Skip to content

Libs/Analyze/Shape.h

Namespaces

Name
shapeworks
User usage reporting (telemetry)

Classes

Name
class shapeworks::Shape
Representation of a single shape/patient/subject.
class shapeworks::Shape::Point
TODO: replace this wherever it is used.

Source code

```cpp

pragma once

include

include

include

include

// studio

include "MeshGroup.h"

include "MeshManager.h"

include "StudioEnums.h"

include "StudioMesh.h"

// shapeworks

include

include

include

namespace shapeworks {

class Shape; using ShapeHandle = std::shared_ptr; using ShapeList = std::vector; class Surface;

class Shape { public: class Point { public: Point(){}; Point(double _x, double _y, double _z) : x(_x), y(_y), z(_z){}; double x = 0, y = 0, z = 0; };

Shape();

~Shape();

std::string get_display_name();

MeshGroup get_meshes(DisplayMode display_mode, bool wait = false);

void set_annotations(std::vector annotations, bool only_overwrite_blank = true); std::vector get_annotations();

void set_mesh_manager(std::shared_ptr mesh_manager);

void set_subject(std::shared_ptr subject);

bool is_subject();

std::shared_ptr get_subject();

bool is_fixed();

bool is_excluded();

void import_original_file(const std::string& filename);

MeshGroup get_original_meshes(bool wait = false);

MeshGroup get_groomed_meshes(bool wait = false);

MeshGroup get_reconstructed_meshes(bool wait = false);

void set_reconstructed_meshes(MeshGroup meshes);

void reset_groomed_mesh();

bool import_global_point_files(std::vector filenames);

bool import_local_point_files(std::vector filenames);

bool import_landmarks_files(std::vector filenames);

bool store_landmarks();

bool import_constraints(std::vector filenames);

bool store_constraints();

void set_particles(Particles particles);

Particles get_particles();

void set_particle_transform(vtkSmartPointer transform);

void set_groomed_centroids(const std::vector& centroids);

void set_alignment_type(int alignment);

Eigen::VectorXd get_global_correspondence_points();

std::vector get_particles_for_display();

Eigen::VectorXd get_local_correspondence_points();

void clear_reconstructed_mesh();

int get_id();

void set_id(int id);

void update_annotations();

std::vector get_original_filenames(); std::vector get_original_filenames_with_path();

std::string get_original_filename(); std::string get_original_filename_with_path();

std::string get_groomed_filename(); std::string get_groomed_filename_with_path(int domain);

std::string get_global_point_filename(); std::string get_global_point_filename_with_path();

std::string get_local_point_filename(); std::string get_local_point_filename_with_path();

void set_transform(vtkSmartPointer transform); vtkSmartPointer get_transform(int domain = 0); vtkSmartPointer get_inverse_transform(int domain = 0);

bool has_alignment();

vtkSmartPointer get_original_transform(int domain = 0);

void set_reconstruction_transforms(std::vector> transforms); vtkSmartPointer get_reconstruction_transform(int domain);

vtkSmartPointer get_groomed_transform(int domain = 0);

std::vector get_groomed_centroids();

vtkSmartPointer get_procrustes_transform(int domain = 0); std::vector> get_procrustes_transforms();

vtkSmartPointer get_alignment(int domain = 0);

void load_feature(DisplayMode display_mode, std::string feature);

std::shared_ptr get_image_volume(std::string image_volume_name);

std::shared_ptr get_segmentation(); std::string get_segmentation_filename() { return segmentation_filename_; }

Eigen::VectorXd get_point_features(std::string feature);

void set_point_features(std::string feature, Eigen::VectorXd values);

void load_feature_from_scalar_file(std::string filename, std::string feature_name);

void set_override_feature(std::string feature); std::string get_override_feature();

Eigen::MatrixXd& landmarks();

std::vector& constraints();

Constraints& get_constraints(int domain_id);

bool has_constraints();

bool has_planes();

std::vector> get_groomed_mesh_wrappers();

void recompute_original_surface();

void ensure_segmentation();

private: void generate_meshes(std::vector filenames, MeshGroup& mesh_list, bool save_transform, bool wait = false);

static bool import_point_file(std::string filename, Eigen::VectorXd& points);

void apply_feature_to_points(std::string feature, ImageType::Pointer image); void load_feature_from_mesh(std::string feature, MeshHandle mesh);

int id_;

MeshGroup original_meshes_; MeshGroup groomed_meshes_; MeshGroup reconstructed_meshes_; std::vector> groomed_mesh_wrappers_;

std::string override_feature_;

std::vector global_point_filenames_; std::vector local_point_filenames_;

std::map point_features_; Particles particles_;

std::shared_ptr subject_;

vtkSmartPointer transform_ = vtkSmartPointer::New();

std::vector> reconstruction_transforms_;

std::vector corner_annotations_;

std::shared_ptr mesh_manager_;

Eigen::MatrixXd landmarks_;

std::shared_ptr image_volume_; std::string image_volume_filename_;

std::shared_ptr segmentation_; std::string segmentation_filename_;

std::vector constraints_; // one set for each domain int alignment_type_; }; } // namespace shapeworks ```


Updated on 2026-03-31 at 16:02:11 +0000