Skip to content

Commit 5f4fb53

Browse files
authored
Merge branch 'master' into dependabot/pip/requests-2.33.0
2 parents 8ffc2a3 + 2d6c287 commit 5f4fb53

58 files changed

Lines changed: 766 additions & 267 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-mac-arm64.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@ jobs:
9595
shell: bash -l {0}
9696
run: conda activate shapeworks && source ./devenv.sh ./build/bin && cd build && ctest -VV
9797

98+
- name: Print crash reports
99+
if: failure()
100+
run: |
101+
echo "=== Crash Reports ==="
102+
for f in ~/Library/Logs/DiagnosticReports/*.crash ~/Library/Logs/DiagnosticReports/*.ips; do
103+
if [ -f "$f" ]; then
104+
echo "--- $f ---"
105+
cat "$f"
106+
echo ""
107+
fi
108+
done
109+
98110
- uses: actions/upload-artifact@v4
99111
with:
100112
name: artifact-${{github.sha}}-mac-arm64

.github/workflows/build-mac.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@ jobs:
9595
shell: bash -l {0}
9696
run: conda activate shapeworks && source ./devenv.sh ./build/bin && cd build && ctest -VV
9797

98+
- name: Print crash reports
99+
if: failure()
100+
run: |
101+
echo "=== Crash Reports ==="
102+
for f in ~/Library/Logs/DiagnosticReports/*.crash ~/Library/Logs/DiagnosticReports/*.ips; do
103+
if [ -f "$f" ]; then
104+
echo "--- $f ---"
105+
cat "$f"
106+
echo ""
107+
fi
108+
done
109+
98110
- uses: actions/upload-artifact@v4
99111
with:
100112
name: artifact-${{github.sha}}-mac

Applications/shapeworks/Command.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "Command.h"
2+
#include <Profiling.h>
23
#include <sstream>
34

45
namespace shapeworks {
@@ -22,6 +23,7 @@ std::vector<std::string> Command::parse_args(const std::vector<std::string> &arg
2223
///////////////////////////////////////////////////////////////////////////////
2324
int Command::run(SharedCommandData &sharedData)
2425
{
26+
TIME_SCOPE(QString::fromStdString(name()));
2527
const optparse::Values &options = parser.get_parsed_options();
2628

2729
return this->execute(options, sharedData) ? EXIT_SUCCESS : EXIT_FAILURE;

Libs/Alignment/Procrustes3D.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "Procrustes3D.h"
22

3+
#include <Profiling.h>
34
#include <vnl/algo/vnl_svd.h>
45

56
#include <iostream>
@@ -44,6 +45,7 @@ void Procrustes3D::RemoveTranslation(SimilarityTransformListType& transforms, Sh
4445

4546
//---------------------------------------------------------------------------
4647
void Procrustes3D::AlignShapes(SimilarityTransformListType& transforms, ShapeListType& shapes) {
48+
TIME_SCOPE("Procrustes3D::AlignShapes");
4749
const RealType SOS_EPSILON = 1.0e-8;
4850

4951
PointType center;

Libs/Analyze/Analyze.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <Groom/GroomParameters.h>
44
#include <Logging.h>
5+
#include <Profiling.h>
56
#include <MeshWarper.h>
67
#include <Particles/ParticleNormalEvaluation.h>
78
#include <StringUtils.h>
@@ -167,6 +168,7 @@ Analyze::Analyze(ProjectHandle project) : project_(project), mesh_manager_(new M
167168

168169
//---------------------------------------------------------------------------
169170
void Analyze::run_offline_analysis(std::string outfile, float range, float steps) {
171+
TIME_SCOPE("Analyze::run_offline_analysis");
170172
SW_LOG("ShapeWorks Offline Analysis");
171173
if (!project_->get_particles_present()) {
172174
throw std::runtime_error("Project has not been optimized, please run optimize first");
@@ -478,6 +480,7 @@ bool Analyze::update_shapes() {
478480

479481
//---------------------------------------------------------------------------
480482
bool Analyze::compute_stats() {
483+
TIME_SCOPE("Analyze::compute_stats");
481484
if (stats_ready_) {
482485
return true;
483486
}

Libs/Analyze/Reconstruction.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "itkNrrdImageIOFactory.h"
2424
#include "itkMetaImageIOFactory.h"
2525
#include "Reconstruction.h"
26+
#include <Profiling.h>
2627

2728
#include <vtkLoopSubdivisionFilter.h>
2829
#include <vtkButterflySubdivisionFilter.h>
@@ -67,6 +68,7 @@ vtkSmartPointer<vtkPolyData> Reconstruction<TTransformType,TInterpolatorType, TC
6768
std::vector< PointArrayType > local_pts,
6869
std::vector< PointArrayType > global_pts,
6970
std::vector<std::string> distance_transform) {
71+
TIME_SCOPE("Reconstruction::getDenseMean");
7072
if (!this->denseDone_ || !local_pts.empty() ||
7173
!distance_transform.empty() || !global_pts.empty()) {
7274
this->denseDone_ = false;
@@ -439,6 +441,7 @@ void Reconstruction<TTransformType,TInterpolatorType, TCoordRep, PixelType, Imag
439441
std::vector< PointArrayType > local_pts,
440442
std::vector< PointArrayType > global_pts,
441443
std::vector<std::string> distance_transform) {
444+
TIME_SCOPE("Reconstruction::computeDenseMean");
442445
try {
443446
//turn the sets of global points to one sparse global mean.
444447
float init[] = { 0.f,0.f,0.f };

Libs/Application/Job/Job.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <Job/Job.h>
2+
#include <Profiling.h>
23
namespace shapeworks {
34

45
//---------------------------------------------------------------------------
@@ -19,6 +20,12 @@ QString Job::get_abort_message() {
1920
return name() + " aborted. Duration: " + duration + " seconds";
2021
}
2122

23+
//---------------------------------------------------------------------------
24+
void Job::execute() {
25+
TIME_SCOPE(name());
26+
run();
27+
}
28+
2229
//---------------------------------------------------------------------------
2330
void Job::start_timer() { this->timer_.start(); }
2431

Libs/Application/Job/Job.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ class Job : public QObject {
1515
//! run the job
1616
virtual void run() = 0;
1717

18+
//! execute the job with profiling instrumentation
19+
void execute();
20+
1821
//! get the name of the job
1922
virtual QString name() = 0;
2023

Libs/Application/Job/PythonWorker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void PythonWorker::start_job(QSharedPointer<Job> job) {
104104
}
105105
Q_EMIT job->progress(0);
106106
current_job_ = job;
107-
current_job_->run();
107+
current_job_->execute();
108108
current_job_->set_complete(true);
109109
if (!job->get_quiet_mode()) {
110110
SW_LOG(current_job_->get_completion_message().toStdString());

Libs/Groom/Groom.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <GroomParameters.h>
33
#include <Image/Image.h>
44
#include <Logging.h>
5+
#include <Profiling.h>
56
#include <Mesh/Mesh.h>
67
#include <Mesh/MeshUtils.h>
78
#include <Optimize/Constraints/Constraints.h>
@@ -32,6 +33,7 @@ Groom::Groom(ProjectHandle project) : project_{project} {}
3233

3334
//---------------------------------------------------------------------------
3435
bool Groom::run() {
36+
TIME_SCOPE("Groom::run");
3537
ShapeWorksUtils::setup_threads();
3638

3739
used_names_.clear();
@@ -124,6 +126,7 @@ bool Groom::run() {
124126

125127
//---------------------------------------------------------------------------
126128
bool Groom::image_pipeline(std::shared_ptr<Subject> subject, size_t domain) {
129+
TIME_SCOPE("Groom::image_pipeline");
127130
// grab parameters
128131
auto params = GroomParameters(project_, project_->get_domain_names()[domain]);
129132

@@ -321,6 +324,7 @@ bool Groom::run_image_pipeline(Image& image, GroomParameters params) {
321324

322325
//---------------------------------------------------------------------------
323326
bool Groom::mesh_pipeline(std::shared_ptr<Subject> subject, size_t domain) {
327+
TIME_SCOPE("Groom::mesh_pipeline");
324328
// grab parameters
325329
auto params = GroomParameters(project_, project_->get_domain_names()[domain]);
326330

@@ -381,8 +385,10 @@ bool Groom::mesh_pipeline(std::shared_ptr<Subject> subject, size_t domain) {
381385

382386
//---------------------------------------------------------------------------
383387
bool Groom::run_mesh_pipeline(Mesh& mesh, GroomParameters params, const std::string& filename) {
384-
// Repair mesh: triangulate, extract largest component, clean, fix non-manifold, remove zero-area triangles
385-
mesh = Mesh(MeshUtils::repair_mesh(mesh.getVTKMesh()));
388+
// Repair mesh: triangulate, clean, fix non-manifold, remove zero-area triangles
389+
// Skip extract-largest-component for shared boundary domains to avoid removing fragments at the cut surface
390+
bool extract_largest = !params.is_shared_boundary_domain();
391+
mesh = Mesh(MeshUtils::repair_mesh(mesh.getVTKMesh(), extract_largest));
386392

387393
if (params.get_fill_mesh_holes_tool()) {
388394
mesh.fillHoles();
@@ -557,6 +563,7 @@ bool Groom::get_aborted() { return abort_; }
557563

558564
//---------------------------------------------------------------------------
559565
bool Groom::run_alignment() {
566+
TIME_SCOPE("Groom::run_alignment");
560567
size_t num_domains = project_->get_number_of_domains_per_subject();
561568
SW_DEBUG("Running alignment, number of domains = {}", num_domains);
562569
auto subjects = project_->get_subjects();

0 commit comments

Comments
 (0)