Skip to content

Commit 30d9233

Browse files
authored
Merge pull request #2206 from SCIInstitute/release_v6.5
Release v6.5
2 parents 077c588 + 7591466 commit 30d9233

35 files changed

+764
-380
lines changed

.github/workflows/build-linux-debug.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ jobs:
2424
build:
2525

2626
runs-on: ubuntu-latest
27-
container: akenmorris/ubuntu-build-box-sw65
27+
container: akenmorris/ubuntu-build-box-focal-sw65
2828

2929
steps:
3030

3131
- name: Install SSH Key
32-
uses: shimataro/ssh-key-action@v2
32+
uses: shimataro/ssh-key-action@v2.7.0
3333
with:
3434
key: ${{ secrets.SSH_PRIVATE_KEY }}
3535
known_hosts: ${{ secrets.KNOWN_HOSTS }}

.github/workflows/build-linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ jobs:
2525
build:
2626

2727
runs-on: ubuntu-latest
28-
container: akenmorris/ubuntu-build-box-sw65
28+
container: akenmorris/ubuntu-build-box-focal-sw65
2929

3030
steps:
3131

3232
- name: Install SSH Key
33-
uses: shimataro/ssh-key-action@v2
33+
uses: shimataro/ssh-key-action@v2.7.0
3434
with:
3535
key: ${{ secrets.SSH_PRIVATE_KEY }}
3636
known_hosts: ${{ secrets.KNOWN_HOSTS }}

.github/workflows/copy_artifact.sh

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@ if [[ "$PLATFORM" == "windows" ]]; then
1414
# install rsync on for windows/msys2 (the one from chocolatey doesn't work)
1515
# (adapted from https://github.com/GuillaumeFalourd/setup-rsync)
1616
echo "Installing rsync for Windows/msys2"
17-
curl.exe --output rsync-3.2.3-2-x86_64.pkg.tar.zst --url https://repo.msys2.org/msys/x86_64/rsync-3.2.3-1-x86_64.pkg.tar.zst
18-
zstd -d rsync-3.2.3-2-x86_64.pkg.tar.zst
19-
tar -xvf rsync-3.2.3-2-x86_64.pkg.tar
20-
mv usr/bin/rsync.exe "C:\Program Files\Git\usr\bin\\"
21-
curl.exe --output libzstd-1.5.2-1-x86_64.pkg.tar.zst https://repo.msys2.org/msys/x86_64/libzstd-1.5.2-1-x86_64.pkg.tar.zst
22-
zstd -d libzstd-1.5.2-1-x86_64.pkg.tar.zst
23-
tar -xvf libzstd-1.5.2-1-x86_64.pkg.tar
24-
mv usr/bin/msys-zstd-1.dll "C:\Program Files\Git\usr\bin\\"
25-
curl.exe --output libxxhash-0.8.0-1-x86_64.pkg.tar.zst https://repo.msys2.org/msys/x86_64/libxxhash-0.8.0-1-x86_64.pkg.tar.zst
26-
zstd -d libxxhash-0.8.0-1-x86_64.pkg.tar.zst
27-
tar -xvf libxxhash-0.8.0-1-x86_64.pkg.tar
28-
mv usr/bin/msys-xxhash-0.8.0.dll "C:\Program Files\Git\usr\bin\\"
17+
18+
# These were the original URLs, but they keep changing and it's time consuming to keep up
19+
# So I have just combined them in this windows_rsync.tar.gz that I'm hosting myself
20+
21+
# https://repo.msys2.org/msys/x86_64/rsync-3.2.3-1-x86_64.pkg.tar.zst
22+
# https://repo.msys2.org/msys/x86_64/libzstd-1.5.2-1-x86_64.pkg.tar.zst
23+
# https://repo.msys2.org/msys/x86_64/libxxhash-0.8.1-1-x86_64.pkg.tar.zst
24+
curl.exe --output windows_rsync.tar.gz http://www.sci.utah.edu/~amorris/windows_rsync.tar.gz
25+
26+
mv usr/bin/* "C:\Program Files\Git\usr\bin\\"
2927
echo "rsync installed on windows runner"
3028
fi
3129

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.20)
66
SET(SHAPEWORKS_MAJOR_VERSION 6 CACHE INTERNAL "Major version number" FORCE)
77
SET(SHAPEWORKS_MINOR_VERSION 5 CACHE INTERNAL "Minor version number" FORCE)
88
SET(SHAPEWORKS_PATCH_VERSION 0 CACHE INTERNAL "Patch version number" FORCE)
9-
SET(SHAPEWORKS_VERSION_STRING "6.5.0-dev")
9+
SET(SHAPEWORKS_VERSION_STRING "6.5.0-RC3")
1010
SET(SHAPEWORKS_VERSION "${SHAPEWORKS_MAJOR_VERSION}.${SHAPEWORKS_MINOR_VERSION}.${SHAPEWORKS_PATCH_VERSION}")
1111

1212
# First, check that files were checked out properly using git-lfs

Libs/Analyze/Shape.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,15 @@ bool Shape::import_global_point_files(std::vector<std::string> filenames) {
148148
global_point_filenames_.clear();
149149
for (int i = 0; i < filenames.size(); i++) {
150150
Eigen::VectorXd points;
151-
if (filenames[i] != "") {
152-
if (!Shape::import_point_file(filenames[i], points)) {
151+
auto filename = filenames[i];
152+
// replace \ with /
153+
filename = StringUtils::replace_string(filename, "\\", "/");
154+
if (filename != "") {
155+
if (!Shape::import_point_file(filename, points)) {
153156
throw std::invalid_argument("Unable to import point file: " + filenames[i]);
154157
}
155158
}
156-
global_point_filenames_.push_back(filenames[i]);
159+
global_point_filenames_.push_back(filename);
157160
particles_.set_world_particles(i, points);
158161
}
159162
subject_->set_world_particle_filenames(global_point_filenames_);
@@ -165,12 +168,15 @@ bool Shape::import_local_point_files(std::vector<std::string> filenames) {
165168
local_point_filenames_.clear();
166169
for (int i = 0; i < filenames.size(); i++) {
167170
Eigen::VectorXd points;
168-
if (filenames[i] != "") {
169-
if (!Shape::import_point_file(filenames[i], points)) {
171+
auto filename = filenames[i];
172+
// replace \ with /
173+
filename = StringUtils::replace_string(filename, "\\", "/");
174+
if (filename != "") {
175+
if (!Shape::import_point_file(filename, points)) {
170176
throw std::invalid_argument("Unable to import point file: " + filenames[i]);
171177
}
172178
}
173-
local_point_filenames_.push_back(filenames[i]);
179+
local_point_filenames_.push_back(filename);
174180
particles_.set_local_particles(i, points);
175181
}
176182
subject_->set_local_particle_filenames(local_point_filenames_);

Libs/Mesh/Mesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ Mesh& Mesh::fixElement() {
488488
FEMesh* meshFE = import.Load(this->poly_data_);
489489

490490
if (meshFE == nullptr) {
491-
throw std::invalid_argument("Unable to read file");
491+
throw std::runtime_error("Unable to read mesh file");
492492
}
493493

494494
FEFixMesh fix;

Libs/Mesh/MeshWarper.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,13 @@ bool MeshWarper::generate_warp() {
441441
// prep points
442442
this->vertices_ = this->reference_particles_;
443443

444+
if (reference_mesh_->GetNumberOfPoints() == 0) {
445+
SW_ERROR("Unable to warp mesh, no points in surface mesh");
446+
update_progress(1.0);
447+
warp_available_ = false;
448+
return false;
449+
}
450+
444451
this->add_particle_vertices(this->vertices_);
445452

446453
if (this->landmarks_points_.size() > 0) {

Libs/Particles/ParticleFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Eigen::VectorXd read_particles(std::string filename) {
6363

6464
std::ifstream in(filename);
6565
if (!in.good()) {
66-
throw std::runtime_error("Unable to read file: " + filename);
66+
throw std::runtime_error("Unable to read particle file: " + filename);
6767
}
6868
Eigen::VectorXd points;
6969

Libs/Project/Project.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ void Project::set_project_path(const std::string& new_pathname) {
9494

9595
auto fixup = [&](StringList paths) {
9696
StringList new_paths;
97-
for (const auto& path : paths) {
97+
for (auto path : paths) {
9898
if (fs::exists(path)) {
99+
// replace \ with / in path
100+
path = StringUtils::replace_string(path, "\\", "/");
99101
auto canonical = fs::canonical(path, old_path);
100102
new_paths.push_back(fs::relative(canonical, new_path).string());
101103
} else {
@@ -116,7 +118,10 @@ void Project::set_project_path(const std::string& new_pathname) {
116118
auto features = subject->get_feature_filenames();
117119
project::types::StringMap new_features;
118120
for (auto const& x : features) {
119-
auto canonical = fs::canonical(x.second, old_path);
121+
auto path = x.second;
122+
// replace \ with / in path
123+
path = StringUtils::replace_string(path, "\\", "/");
124+
auto canonical = fs::canonical(path, old_path);
120125
new_features[x.first] = fs::relative(canonical, new_path).string();
121126
}
122127
subject->set_feature_filenames(new_features);

Python/DeepSSMUtilsPackage/DeepSSMUtils/eval_utils.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def get_mesh_from_DT(DT_list, mesh_dir):
4949
if not os.path.exists(mesh_dir):
5050
os.makedirs(mesh_dir)
5151
mesh_files = []
52-
xml_filename = mesh_dir + "temp.xml"
5352
for input_file in DT_list:
5453
print(' ' + get_prefix(input_file))
5554
output_vtk = mesh_dir + "original_" + get_prefix(input_file) + ".vtk"
@@ -59,12 +58,22 @@ def get_mesh_from_DT(DT_list, mesh_dir):
5958
return sorted(mesh_files)
6059

6160

61+
def get_mesh(filename, iso_value=0):
62+
if filename.endswith('.nrrd'):
63+
image = sw.Image(filename)
64+
return image.toMesh(iso_value)
65+
else:
66+
return sw.Mesh(filename)
67+
68+
6269
def get_mesh_from_particles(particle_list, mesh_dir, template_particles, template_mesh, planes=None):
6370
if not os.path.exists(mesh_dir):
6471
os.makedirs(mesh_dir)
6572

6673
warp = sw.MeshWarper()
67-
sw_mesh = sw.Mesh(template_mesh)
74+
75+
# Create mesh from file (mesh or segmentation)
76+
sw_mesh = get_mesh(template_mesh)
6877
sw_particles = np.loadtxt(template_particles)
6978
warp.generateWarp(sw_mesh, sw_particles)
7079

@@ -135,7 +144,7 @@ def get_mesh_distances(pred_particle_files, mesh_list, template_particles, templ
135144
mean_distances.append(-1)
136145
continue
137146
print(f"Computing distance between {mesh_list[index]} and {pred_mesh_list[index]}")
138-
orig_mesh = sw.Mesh(mesh_list[index])
147+
orig_mesh = get_mesh(mesh_list[index], iso_value=0.5)
139148
if planes is not None:
140149
orig_mesh.clip(planes[index][0], planes[index][1], planes[index][2])
141150
pred_mesh = sw.Mesh(pred_mesh_list[index])

0 commit comments

Comments
 (0)