Skip to content

shapeworks::Optimize

More...

#include <Optimize.h>

Inherited by shapeworks::QOptimize

Public Types

Name
using itk::Image< float, 3 > ImageType
using VectorFunction::VectorType VectorType
using Eigen::MatrixXd MatrixType

Public Functions

Name
Optimize()
Constructor.
virtual ~Optimize()
Destructor.
bool Run()
Run the optimization.
bool LoadParameterFile(std::string filename)
Load a parameter file.
bool SetUpOptimize(ProjectHandle project)
Set up this Optimize object using a ShapeWorks project.
void SetProject(std::shared_ptr< Project > project)
Set the Project object.
void SetIterationCallbackFunction(const std::function< void(void)> & f)
Set an iteration callback function to be called after each iteration.
void AbortOptimization()
Abort optimization.
bool GetAborted()
Return if the optimization was aborted.
virtual std::vector< std::vector< itk::Point< double > > > GetLocalPoints()
Return the local points.
virtual std::vector< std::vector< itk::Point< double > > > GetGlobalPoints()
Return the global points.
void SetCutPlanes(std::vector< std::array< itk::Point< double >, 3 > > cut_planes)
Set cutting planes.
void SetVerbosity(int verbosity_level)
Set the verbosity level (0-5)
void SetDomainsPerShape(int domains_per_shape)
Set the number of domains per shape.
int GetDomainsPerShape()
Return the number of domains per shape.
void SetDomainType(shapeworks::DomainType type)
shapeworks::DomainType GetDomainType()
void SetNumberOfParticles(std::vector< int > number_of_particles)
Set the numbers of particles (vector of numbers, one for each domain)
std::vector< int > GetNumberOfParticles()
Return the numbers of particles per domain.
void SetTransformFile(std::string filename)
Set the transform file.
std::string GetTransformFile()
Get the transform file.
void SetPrefixTransformFile(std::string prefix_transform_file)
Set the prefix transform file (TODO: details)
std::string GetPrefixTransformFile()
Get the prefix transform file.
void SetOutputDir(std::string output_dir)
Set the output directory.
void SetOutputTransformFile(std::string output_transform_file)
Set the output transform file.
void SetOutputIndividualTransformFiles(bool value)
Set whether individual transforms should be written.
void SetUseMeshBasedAttributes(bool use_mesh_based_attributes)
Set if mesh based attributes should be used.
bool GetUseMeshBasedAttributes()
Get if mesh based attributes are being used.
void SetUseXYZ(std::vector< bool > use_xyz)
Set if XYZ is used, one value per domain.
void SetUseNormals(std::vector< bool > use_normals)
Set if Normals are being used, one value per domain.
void SetAttributesPerDomain(std::vector< int > attributes_per_domain)
Set the attributes per domain.
std::vector< int > GetAttributesPerDomain()
Get attributes per domain.
void SetDistributionDomainID(int distribution_domain_id)
Set the distribution domain ID (TODO: details)
int GetDistributionDomainID()
Get the distribution domain ID.
void SetOutputCuttingPlaneFile(std::string output_cutting_plane_file)
Set the output cutting plane file.
void SetUseCuttingPlanes(bool use_cutting_planes)
Set if using cutting planes.
void SetCuttingPlane(unsigned int i, const vnl_vector_fixed< double, 3 > & va, const vnl_vector_fixed< double, 3 > & vb, const vnl_vector_fixed< double, 3 > & vc)
Set a given cutting plane for a shape.
void SetMeshFFCMode(int mesh_ffc_mode)
Set Mesh FFC Mode false/0 = mesh clipping mode, true/1 = mesh augmented lagrangian mode.
void SetTimePtsPerSubject(int time_pts_per_subject)
Set the number of time points per subject (TODO: details)
int GetTimePtsPerSubject()
Get the number of time points per subject (TODO: details)
void SetOptimizationIterations(int optimization_iterations)
Set the number of optimization iterations.
void SetOptimizationIterationsCompleted(int optimization_iterations_completed)
Set the number of optimization iterations already completed (TODO: details)
void SetIterationsPerSplit(int iterations_per_split)
Set the number of iterations per split.
void SetUseShapeStatisticsInInit(bool use_shape_statistics_in_init)
Set if shape statistics should be used in initialization.
void SetProcrustesInterval(int procrustes_interval)
Set the interval for running procrustes (0 to disable)
void SetProcrustesScaling(bool procrustes_scaling)
Set if procrustes scaling should be used.
void SetProcrustesRotationTranslation(bool procrustes_rotation_translation)
Set if procrustes rotation/translation should be used.
void SetRelativeWeighting(double relative_weighting)
Set the relative weighting (TODO: details)
void SetInitialRelativeWeighting(double initial_relative_weighting)
Set the initial relative weigting (TODO: details)
void SetStartingRegularization(double starting_regularization)
Set the starting regularization (TODO: details)
void SetEndingRegularization(double ending_regularization)
Set the ending regularization (TODO: details)
void SetRecomputeRegularizationInterval(int recompute_regularization_interval)
Set the interval for recomputing regularization (TODO: details)
void SetSaveInitSplits(bool save_init_splits)
Set if initialization splits should be saved or not.
void SetCheckpointingInterval(int checkpointing_interval)
Set the checkpointing interval.
void SetKeepCheckpoints(int keep_checkpoints)
Set if checkpoints should be kept (0=disable, 1=enable)
void SetUseRegression(bool use_regression)
Set if regression should be used (TODO: details)
void SetUseMixedEffects(bool use_mixed_effects)
Set if mixed effects should be used (TODO: details)
void SetUseDisentangledSpatiotemporalSSM(bool use_disentangled_ssm_4d)
Set if optimization should be done using disentangled spatiotemporal SSM method.
bool GetUseDisentangledSpatiotemporalSSM()
Returns true if optimization is to be done using disentangled spatiotemporal SSM method.
void SetNormalAngle(double normal_angle)
For good/bad analysis, set the normal angle to use (TODO: details)
void SetPerformGoodBad(bool perform_good_bad)
Set if good/bad analysis should be done (TODO: details)
void SetLogEnergy(bool log_energy)
Set the log energy (TODO: details)
void AddImage(ImageType::Pointer image, std::string name ="")
Set the shape input images.
void AddMesh(vtkSmartPointer< vtkPolyData > poly_data)
void AddMesh(std::shared_ptr< Surface > surface, std::shared_ptr< Surface > geodesics_surface, std::shared_ptr< Mesh > sw_mesh, double surface_area)
void AddContour(vtkSmartPointer< vtkPolyData > poly_data)
void SetFilenames(const std::vector< std::string > & filenames)
Set the shape filenames (TODO: details)
void SetPointFiles(const std::vector< std::string > & point_files)
Set starting point files (TODO: details)
void SetInitialPoints(std::vector< std::vector< itk::Point< double > > > initial_points)
Set initial particle positions (e.g. for fixed subjects)
int GetNumShapes()
Get number of shapes.
void SetAttributeScales(const std::vector< double > & scales)
Set attribute scales (TODO: details)
void SetFieldAttributes(const std::vector< std::string > & field_attributes)
Set the field attributes.
void SetParticleFlags(std::vector< int > flags)
Set Particle Flags (TODO: details)
void SetFixedDomains(std::vector< int > flags)
Set Domain Flags (TODO: details)
void SetProcustesTransforms(std::map< int, vnl_matrix_fixed< double, 4, 4 > > transforms)
Set Procrustes transforms to load for specific domains (applied after initialization)
void SetSharedBoundaryEnabled(bool enabled)
Shared boundary settings.
void SetSharedBoundaryWeight(double weight)
void SetSamplingScale(bool enabled)
Sampling scale settings.
bool GetSamplingScale()
void SetSamplingAutoScale(bool auto_scale)
bool GetSamplingAutoScale()
void SetSamplingScaleValue(double scale_value)
double GetSamplingScaleValue()
void SetEarlyStoppingConfig(EarlyStoppingConfig config)
Early Stopping params.
const std::vector< int > & GetDomainFlags()
void SetFileOutputEnabled(bool enabled)
Set if file output is enabled.
std::vector< bool > GetUseXYZ()
Return if XYZ is used, per shape.
std::vector< bool > GetUseNormals()
Return if Normals are used, per shape.
void SetNarrowBand(double v)
Set the narrow band used to be +/- the given value as a multiple of the spacing.
double GetNarrowBand()
Return the narrow band to be used.
void SetUseShapeStatisticsAfter(int num_particles)
Set the number of particles when correspondence based multiscale takes over.
int GetUseShapeStatisticsAfter()
Return the number of particles when correspondence based multiscale takes over.
void PrintParamInfo()
Print parameter info to stdout.
std::shared_ptr< Sampler > GetSampler()
Return the Sampler.
MatrixContainer GetParticleSystem()
Return the particle system as a matrix.
void SetPythonFile(std::string filename)
Set the python file to run at startup.
void SetGeodesicsEnabled(bool is_enabled)
Set whether or not geodesics are enabled.
bool GetGeodesicsEnabled() const
void SetGeodesicsCacheSizeMultiplier(size_t n)
void SetGeodesicsRemeshPercent(double percent)
Set the remeshing percent for the mesh used for computing geodesics (0-100)
OptimizationVisualizer & GetVisualizer()
void SetShowVisualizer(bool show)
bool GetShowVisualizer()
bool GetMeshFFCMode()
vnl_vector_fixed< double, 3 > TransformPoint(int domain, vnl_vector_fixed< double, 3 > input)
transform a point if necessary
void UpdateProgress()
void set_particle_format(std::string format)

Protected Functions

Name
virtual void SetIterationCallback()
Set the iteration callback. Derived classes should override to set their own callback.
void ComputeTotalIterations()
void OptimizerStop()
void ReadTransformFile()
void ReadPrefixTransformFile(const std::string & s)
void InitializeSampler()
double GetMinNeighborhoodRadius()
void AddSinglePoint()
void Initialize()
void RunOptimize()
void ComputeEnergyAfterIteration()
void SetCotanSigma()
void WriteTransformFile(int iter =-1) const
void WriteTransformFile(std::string iter_prefix) const
void WriteTransformFiles(int iter =-1) const
void WriteTransformFiles(std::string iter_prefix) const
void WritePointFiles(int iter =-1)
void WritePointFiles(std::string iter_prefix)
void WritePointFilesWithFeatures(int iter =-1)
void WritePointFilesWithFeatures(std::string iter_prefix)
void WriteEnergyFiles()
void WriteSplitFiles(std::string name)
void WriteCuttingPlanePoints(int iter =-1)
void WriteParameters(std::string output_dir ="")
void ReportBadParticles()
int SetParameters()
void WriteModes()
void PrintStartMessage(std::string str, unsigned int vlevel =0) const
void PrintDoneMessage(unsigned int vlevel =0) const
virtual void UpdateExportablePoints()
virtual std::vector< std::vector< std::vector< double > > > GetProcrustesTransforms()
void UpdateProject()
std::string GetCheckpointDir()

Protected Attributes

Name
std::shared_ptr< Sampler > m_sampler
ProcrustesRegistration::Pointer m_procrustes
std::shared_ptr< ParticleGoodBadAssessment > m_good_bad
unsigned int m_verbosity_level
std::vector< std::vector< itk::Point< double > > > m_local_points
std::vector< std::vector< itk::Point< double > > > m_global_points
int m_checkpoint_counter
int m_procrustes_counter
bool m_use_cutting_planes
bool m_optimizing
bool m_use_regression
bool m_use_mixed_effects
bool m_use_disentangled_ssm
unsigned int m_domains_per_shape
shapeworks::DomainType m_domain_type
std::vector< int > m_number_of_particles
std::string m_transform_file
std::string m_prefix_transform_file
std::string m_output_dir
std::string m_output_transform_file
bool m_output_transform_files
bool m_mesh_based_attributes
std::vector< bool > m_use_xyz
std::vector< bool > m_use_normals
std::vector< int > m_attributes_per_domain
int m_distribution_domain_id
std::string m_output_cutting_plane_file
bool m_mesh_ffc_mode
unsigned int m_timepts_per_subject
int m_optimization_iterations
int m_optimization_iterations_completed
int m_iterations_per_split
bool m_use_shape_statistics_in_init
unsigned int m_procrustes_interval
bool m_procrustes_scaling
bool m_procrustes_rotation_translation
double m_relative_weighting
double m_initial_relative_weighting
double m_starting_regularization
double m_ending_regularization
int m_recompute_regularization_interval
bool m_save_init_splits
unsigned int m_checkpointing_interval
int m_keep_checkpoints
double m_cotan_sigma_factor
std::vector< int > m_particle_flags
std::vector< int > m_domain_flags
std::map< int, vnl_matrix_fixed< double, 4, 4 > > m_procrustes_transforms
double m_narrow_band
bool m_narrow_band_set
bool m_fixed_domains_present
int m_use_shape_statistics_after
std::string m_python_filename
bool m_geodesics_enabled
size_t m_geodesic_cache_size_multiplier
double m_geodesic_remesh_percent
bool m_sampling_scale
bool m_sampling_auto_scale
double m_sampling_scale_value
double m_spacing
std::vector< std::string > m_filenames
int m_num_shapes
std::vector< double > m_energy_a
std::vector< double > m_energy_b
std::vector< double > m_total_energy
bool m_log_energy
std::string m_str_energy
std::vector< std::vector< int > > m_bad_ids
double m_normal_angle
bool m_perform_good_bad
std::vector< int > m_cutting_planes_per_input
std::vector< int > m_spheres_per_input
bool m_file_output_enabled
bool m_aborted
std::vector< std::array< itk::Point< double >, 3 > > m_cut_planes
int m_total_iterations
int m_iteration_count
int m_split_number
int current_particle_iterations_
int total_particle_iterations_
std::function< void(void)> iteration_callback_
bool show_visualizer_
shapeworks::OptimizationVisualizer visualizer_
std::string particle_format_
std::shared_ptr< Project > project_
std::chrono::system_clock::time_point m_start_time
std::chrono::system_clock::time_point m_last_update_time
std::chrono::system_clock::time_point m_last_remaining_update_time
std::string m_remaining_time_message

Detailed Description

cpp class shapeworks::Optimize;

Par: Overview of Optimize

This class is the top-level API for the optimization library

The Optimize class controls all aspect of the particle system library provides a top-level public API for running optimization

Public Types Documentation

using ImageType

cpp using shapeworks::Optimize::ImageType = itk::Image<float, 3>;

using VectorType

cpp using shapeworks::Optimize::VectorType = VectorFunction::VectorType;

using MatrixType

cpp using shapeworks::Optimize::MatrixType = Eigen::MatrixXd;

Public Functions Documentation

function Optimize

cpp Optimize()

Constructor.

function ~Optimize

cpp virtual ~Optimize()

Destructor.

function Run

cpp bool Run()

Run the optimization.

function LoadParameterFile

cpp bool LoadParameterFile( std::string filename )

Load a parameter file.

function SetUpOptimize

cpp bool SetUpOptimize( ProjectHandle project )

Set up this Optimize object using a ShapeWorks project.

function SetProject

cpp void SetProject( std::shared_ptr< Project > project )

Set the Project object.

function SetIterationCallbackFunction

cpp inline void SetIterationCallbackFunction( const std::function< void(void)> & f )

Set an iteration callback function to be called after each iteration.

function AbortOptimization

cpp void AbortOptimization()

Abort optimization.

function GetAborted

cpp bool GetAborted()

Return if the optimization was aborted.

function GetLocalPoints

cpp virtual std::vector< std::vector< itk::Point< double > > > GetLocalPoints()

Return the local points.

Reimplemented by: shapeworks::QOptimize::GetLocalPoints

function GetGlobalPoints

cpp virtual std::vector< std::vector< itk::Point< double > > > GetGlobalPoints()

Return the global points.

Reimplemented by: shapeworks::QOptimize::GetGlobalPoints

function SetCutPlanes

cpp void SetCutPlanes( std::vector< std::array< itk::Point< double >, 3 > > cut_planes )

Set cutting planes.

function SetVerbosity

cpp void SetVerbosity( int verbosity_level )

Set the verbosity level (0-5)

function SetDomainsPerShape

cpp void SetDomainsPerShape( int domains_per_shape )

Set the number of domains per shape.

function GetDomainsPerShape

cpp int GetDomainsPerShape()

Return the number of domains per shape.

function SetDomainType

cpp void SetDomainType( shapeworks::DomainType type )

function GetDomainType

cpp shapeworks::DomainType GetDomainType()

function SetNumberOfParticles

cpp void SetNumberOfParticles( std::vector< int > number_of_particles )

Set the numbers of particles (vector of numbers, one for each domain)

function GetNumberOfParticles

cpp std::vector< int > GetNumberOfParticles()

Return the numbers of particles per domain.

function SetTransformFile

cpp void SetTransformFile( std::string filename )

Set the transform file.

function GetTransformFile

cpp std::string GetTransformFile()

Get the transform file.

function SetPrefixTransformFile

cpp void SetPrefixTransformFile( std::string prefix_transform_file )

Set the prefix transform file (TODO: details)

function GetPrefixTransformFile

cpp std::string GetPrefixTransformFile()

Get the prefix transform file.

function SetOutputDir

cpp void SetOutputDir( std::string output_dir )

Set the output directory.

function SetOutputTransformFile

cpp void SetOutputTransformFile( std::string output_transform_file )

Set the output transform file.

function SetOutputIndividualTransformFiles

cpp void SetOutputIndividualTransformFiles( bool value )

Set whether individual transforms should be written.

function SetUseMeshBasedAttributes

cpp void SetUseMeshBasedAttributes( bool use_mesh_based_attributes )

Set if mesh based attributes should be used.

function GetUseMeshBasedAttributes

cpp bool GetUseMeshBasedAttributes()

Get if mesh based attributes are being used.

function SetUseXYZ

cpp void SetUseXYZ( std::vector< bool > use_xyz )

Set if XYZ is used, one value per domain.

function SetUseNormals

cpp void SetUseNormals( std::vector< bool > use_normals )

Set if Normals are being used, one value per domain.

function SetAttributesPerDomain

cpp void SetAttributesPerDomain( std::vector< int > attributes_per_domain )

Set the attributes per domain.

function GetAttributesPerDomain

cpp std::vector< int > GetAttributesPerDomain()

Get attributes per domain.

function SetDistributionDomainID

cpp void SetDistributionDomainID( int distribution_domain_id )

Set the distribution domain ID (TODO: details)

function GetDistributionDomainID

cpp int GetDistributionDomainID()

Get the distribution domain ID.

function SetOutputCuttingPlaneFile

cpp void SetOutputCuttingPlaneFile( std::string output_cutting_plane_file )

Set the output cutting plane file.

function SetUseCuttingPlanes

cpp void SetUseCuttingPlanes( bool use_cutting_planes )

Set if using cutting planes.

function SetCuttingPlane

cpp void SetCuttingPlane( unsigned int i, const vnl_vector_fixed< double, 3 > & va, const vnl_vector_fixed< double, 3 > & vb, const vnl_vector_fixed< double, 3 > & vc )

Set a given cutting plane for a shape.

function SetMeshFFCMode

cpp inline void SetMeshFFCMode( int mesh_ffc_mode )

Set Mesh FFC Mode false/0 = mesh clipping mode, true/1 = mesh augmented lagrangian mode.

function SetTimePtsPerSubject

cpp void SetTimePtsPerSubject( int time_pts_per_subject )

Set the number of time points per subject (TODO: details)

function GetTimePtsPerSubject

cpp int GetTimePtsPerSubject()

Get the number of time points per subject (TODO: details)

function SetOptimizationIterations

cpp void SetOptimizationIterations( int optimization_iterations )

Set the number of optimization iterations.

function SetOptimizationIterationsCompleted

cpp void SetOptimizationIterationsCompleted( int optimization_iterations_completed )

Set the number of optimization iterations already completed (TODO: details)

function SetIterationsPerSplit

cpp void SetIterationsPerSplit( int iterations_per_split )

Set the number of iterations per split.

function SetUseShapeStatisticsInInit

cpp void SetUseShapeStatisticsInInit( bool use_shape_statistics_in_init )

Set if shape statistics should be used in initialization.

function SetProcrustesInterval

cpp void SetProcrustesInterval( int procrustes_interval )

Set the interval for running procrustes (0 to disable)

function SetProcrustesScaling

cpp void SetProcrustesScaling( bool procrustes_scaling )

Set if procrustes scaling should be used.

function SetProcrustesRotationTranslation

cpp void SetProcrustesRotationTranslation( bool procrustes_rotation_translation )

Set if procrustes rotation/translation should be used.

function SetRelativeWeighting

cpp void SetRelativeWeighting( double relative_weighting )

Set the relative weighting (TODO: details)

function SetInitialRelativeWeighting

cpp void SetInitialRelativeWeighting( double initial_relative_weighting )

Set the initial relative weigting (TODO: details)

function SetStartingRegularization

cpp void SetStartingRegularization( double starting_regularization )

Set the starting regularization (TODO: details)

function SetEndingRegularization

cpp void SetEndingRegularization( double ending_regularization )

Set the ending regularization (TODO: details)

function SetRecomputeRegularizationInterval

cpp void SetRecomputeRegularizationInterval( int recompute_regularization_interval )

Set the interval for recomputing regularization (TODO: details)

function SetSaveInitSplits

cpp void SetSaveInitSplits( bool save_init_splits )

Set if initialization splits should be saved or not.

function SetCheckpointingInterval

cpp void SetCheckpointingInterval( int checkpointing_interval )

Set the checkpointing interval.

function SetKeepCheckpoints

cpp void SetKeepCheckpoints( int keep_checkpoints )

Set if checkpoints should be kept (0=disable, 1=enable)

function SetUseRegression

cpp void SetUseRegression( bool use_regression )

Set if regression should be used (TODO: details)

function SetUseMixedEffects

cpp void SetUseMixedEffects( bool use_mixed_effects )

Set if mixed effects should be used (TODO: details)

function SetUseDisentangledSpatiotemporalSSM

cpp void SetUseDisentangledSpatiotemporalSSM( bool use_disentangled_ssm_4d )

Set if optimization should be done using disentangled spatiotemporal SSM method.

function GetUseDisentangledSpatiotemporalSSM

cpp bool GetUseDisentangledSpatiotemporalSSM()

Returns true if optimization is to be done using disentangled spatiotemporal SSM method.

function SetNormalAngle

cpp void SetNormalAngle( double normal_angle )

For good/bad analysis, set the normal angle to use (TODO: details)

function SetPerformGoodBad

cpp void SetPerformGoodBad( bool perform_good_bad )

Set if good/bad analysis should be done (TODO: details)

function SetLogEnergy

cpp void SetLogEnergy( bool log_energy )

Set the log energy (TODO: details)

function AddImage

cpp void AddImage( ImageType::Pointer image, std::string name ="" )

Set the shape input images.

function AddMesh

cpp void AddMesh( vtkSmartPointer< vtkPolyData > poly_data )

function AddMesh

cpp void AddMesh( std::shared_ptr< Surface > surface, std::shared_ptr< Surface > geodesics_surface, std::shared_ptr< Mesh > sw_mesh, double surface_area )

function AddContour

cpp void AddContour( vtkSmartPointer< vtkPolyData > poly_data )

function SetFilenames

cpp void SetFilenames( const std::vector< std::string > & filenames )

Set the shape filenames (TODO: details)

function SetPointFiles

cpp void SetPointFiles( const std::vector< std::string > & point_files )

Set starting point files (TODO: details)

function SetInitialPoints

cpp void SetInitialPoints( std::vector< std::vector< itk::Point< double > > > initial_points )

Set initial particle positions (e.g. for fixed subjects)

function GetNumShapes

cpp int GetNumShapes()

Get number of shapes.

function SetAttributeScales

cpp void SetAttributeScales( const std::vector< double > & scales )

Set attribute scales (TODO: details)

function SetFieldAttributes

cpp void SetFieldAttributes( const std::vector< std::string > & field_attributes )

Set the field attributes.

function SetParticleFlags

cpp void SetParticleFlags( std::vector< int > flags )

Set Particle Flags (TODO: details)

function SetFixedDomains

cpp void SetFixedDomains( std::vector< int > flags )

Set Domain Flags (TODO: details)

function SetProcustesTransforms

cpp void SetProcustesTransforms( std::map< int, vnl_matrix_fixed< double, 4, 4 > > transforms )

Set Procrustes transforms to load for specific domains (applied after initialization)

function SetSharedBoundaryEnabled

cpp void SetSharedBoundaryEnabled( bool enabled )

Shared boundary settings.

function SetSharedBoundaryWeight

cpp void SetSharedBoundaryWeight( double weight )

function SetSamplingScale

cpp void SetSamplingScale( bool enabled )

Sampling scale settings.

function GetSamplingScale

cpp bool GetSamplingScale()

function SetSamplingAutoScale

cpp void SetSamplingAutoScale( bool auto_scale )

function GetSamplingAutoScale

cpp bool GetSamplingAutoScale()

function SetSamplingScaleValue

cpp void SetSamplingScaleValue( double scale_value )

function GetSamplingScaleValue

cpp double GetSamplingScaleValue()

function SetEarlyStoppingConfig

cpp void SetEarlyStoppingConfig( EarlyStoppingConfig config )

Early Stopping params.

function GetDomainFlags

cpp const std::vector< int > & GetDomainFlags()

function SetFileOutputEnabled

cpp void SetFileOutputEnabled( bool enabled )

Set if file output is enabled.

function GetUseXYZ

cpp std::vector< bool > GetUseXYZ()

Return if XYZ is used, per shape.

function GetUseNormals

cpp std::vector< bool > GetUseNormals()

Return if Normals are used, per shape.

function SetNarrowBand

cpp void SetNarrowBand( double v )

Set the narrow band used to be +/- the given value as a multiple of the spacing.

function GetNarrowBand

cpp double GetNarrowBand()

Return the narrow band to be used.

function SetUseShapeStatisticsAfter

cpp void SetUseShapeStatisticsAfter( int num_particles )

Set the number of particles when correspondence based multiscale takes over.

function GetUseShapeStatisticsAfter

cpp int GetUseShapeStatisticsAfter()

Return the number of particles when correspondence based multiscale takes over.

function PrintParamInfo

cpp void PrintParamInfo()

Print parameter info to stdout.

function GetSampler

cpp inline std::shared_ptr< Sampler > GetSampler()

Return the Sampler.

function GetParticleSystem

cpp MatrixContainer GetParticleSystem()

Return the particle system as a matrix.

function SetPythonFile

cpp void SetPythonFile( std::string filename )

Set the python file to run at startup.

function SetGeodesicsEnabled

cpp void SetGeodesicsEnabled( bool is_enabled )

Set whether or not geodesics are enabled.

function GetGeodesicsEnabled

cpp inline bool GetGeodesicsEnabled() const

function SetGeodesicsCacheSizeMultiplier

cpp void SetGeodesicsCacheSizeMultiplier( size_t n )

Set cache size multiplier for geodesics. The total number of cache entries will be n * number_of_triangles

function SetGeodesicsRemeshPercent

cpp void SetGeodesicsRemeshPercent( double percent )

Set the remeshing percent for the mesh used for computing geodesics (0-100)

function GetVisualizer

cpp OptimizationVisualizer & GetVisualizer()

function SetShowVisualizer

cpp void SetShowVisualizer( bool show )

function GetShowVisualizer

cpp bool GetShowVisualizer()

function GetMeshFFCMode

cpp inline bool GetMeshFFCMode()

function TransformPoint

cpp vnl_vector_fixed< double, 3 > TransformPoint( int domain, vnl_vector_fixed< double, 3 > input )

transform a point if necessary

function UpdateProgress

cpp void UpdateProgress()

function set_particle_format

cpp inline void set_particle_format( std::string format )

Protected Functions Documentation

function SetIterationCallback

cpp virtual void SetIterationCallback()

Set the iteration callback. Derived classes should override to set their own callback.

Reimplemented by: shapeworks::QOptimize::SetIterationCallback

function ComputeTotalIterations

cpp void ComputeTotalIterations()

function OptimizerStop

cpp void OptimizerStop()

function ReadTransformFile

cpp void ReadTransformFile()

function ReadPrefixTransformFile

cpp void ReadPrefixTransformFile( const std::string & s )

function InitializeSampler

cpp void InitializeSampler()

function GetMinNeighborhoodRadius

cpp double GetMinNeighborhoodRadius()

function AddSinglePoint

cpp void AddSinglePoint()

function Initialize

cpp void Initialize()

function RunOptimize

cpp void RunOptimize()

function ComputeEnergyAfterIteration

cpp void ComputeEnergyAfterIteration()

function SetCotanSigma

cpp void SetCotanSigma()

function WriteTransformFile

cpp void WriteTransformFile( int iter =-1 ) const

function WriteTransformFile

cpp void WriteTransformFile( std::string iter_prefix ) const

function WriteTransformFiles

cpp void WriteTransformFiles( int iter =-1 ) const

function WriteTransformFiles

cpp void WriteTransformFiles( std::string iter_prefix ) const

function WritePointFiles

cpp void WritePointFiles( int iter =-1 )

function WritePointFiles

cpp void WritePointFiles( std::string iter_prefix )

function WritePointFilesWithFeatures

cpp void WritePointFilesWithFeatures( int iter =-1 )

function WritePointFilesWithFeatures

cpp void WritePointFilesWithFeatures( std::string iter_prefix )

function WriteEnergyFiles

cpp void WriteEnergyFiles()

function WriteSplitFiles

cpp void WriteSplitFiles( std::string name )

function WriteCuttingPlanePoints

cpp void WriteCuttingPlanePoints( int iter =-1 )

function WriteParameters

cpp void WriteParameters( std::string output_dir ="" )

function ReportBadParticles

cpp void ReportBadParticles()

function SetParameters

cpp int SetParameters()

function WriteModes

cpp void WriteModes()

function PrintStartMessage

cpp void PrintStartMessage( std::string str, unsigned int vlevel =0 ) const

function PrintDoneMessage

cpp void PrintDoneMessage( unsigned int vlevel =0 ) const

function UpdateExportablePoints

cpp virtual void UpdateExportablePoints()

Reimplemented by: shapeworks::QOptimize::UpdateExportablePoints

function GetProcrustesTransforms

cpp virtual std::vector< std::vector< std::vector< double > > > GetProcrustesTransforms()

Reimplemented by: shapeworks::QOptimize::GetProcrustesTransforms

function UpdateProject

cpp void UpdateProject()

function GetCheckpointDir

cpp std::string GetCheckpointDir()

Protected Attributes Documentation

variable m_sampler

cpp std::shared_ptr< Sampler > m_sampler;

variable m_procrustes

cpp ProcrustesRegistration::Pointer m_procrustes;

variable m_good_bad

cpp std::shared_ptr< ParticleGoodBadAssessment > m_good_bad;

variable m_verbosity_level

cpp unsigned int m_verbosity_level = 0;

variable m_local_points

cpp std::vector< std::vector< itk::Point< double > > > m_local_points;

variable m_global_points

cpp std::vector< std::vector< itk::Point< double > > > m_global_points;

variable m_checkpoint_counter

cpp int m_checkpoint_counter = 0;

variable m_procrustes_counter

cpp int m_procrustes_counter = 0;

variable m_use_cutting_planes

cpp bool m_use_cutting_planes = false;

variable m_optimizing

cpp bool m_optimizing = false;

variable m_use_regression

cpp bool m_use_regression = false;

variable m_use_mixed_effects

cpp bool m_use_mixed_effects = false;

variable m_use_disentangled_ssm

cpp bool m_use_disentangled_ssm = false;

variable m_domains_per_shape

cpp unsigned int m_domains_per_shape = 1;

variable m_domain_type

cpp shapeworks::DomainType m_domain_type = shapeworks::DomainType::Image;

variable m_number_of_particles

cpp std::vector< int > m_number_of_particles;

variable m_transform_file

cpp std::string m_transform_file;

variable m_prefix_transform_file

cpp std::string m_prefix_transform_file;

variable m_output_dir

cpp std::string m_output_dir;

variable m_output_transform_file

cpp std::string m_output_transform_file;

variable m_output_transform_files

cpp bool m_output_transform_files = false;

variable m_mesh_based_attributes

cpp bool m_mesh_based_attributes = false;

variable m_use_xyz

cpp std::vector< bool > m_use_xyz;

variable m_use_normals

cpp std::vector< bool > m_use_normals;

variable m_attributes_per_domain

cpp std::vector< int > m_attributes_per_domain;

variable m_distribution_domain_id

cpp int m_distribution_domain_id = -1;

variable m_output_cutting_plane_file

cpp std::string m_output_cutting_plane_file;

variable m_mesh_ffc_mode

cpp bool m_mesh_ffc_mode = 0;

variable m_timepts_per_subject

cpp unsigned int m_timepts_per_subject = 1;

variable m_optimization_iterations

cpp int m_optimization_iterations = 2000;

variable m_optimization_iterations_completed

cpp int m_optimization_iterations_completed = 0;

variable m_iterations_per_split

cpp int m_iterations_per_split = 1000;

variable m_use_shape_statistics_in_init

cpp bool m_use_shape_statistics_in_init = false;

variable m_procrustes_interval

cpp unsigned int m_procrustes_interval = 3;

variable m_procrustes_scaling

cpp bool m_procrustes_scaling = true;

variable m_procrustes_rotation_translation

cpp bool m_procrustes_rotation_translation = true;

variable m_relative_weighting

cpp double m_relative_weighting = 1.0;

variable m_initial_relative_weighting

cpp double m_initial_relative_weighting = 0.05;

variable m_starting_regularization

cpp double m_starting_regularization = 1000;

variable m_ending_regularization

cpp double m_ending_regularization = 1.0;

variable m_recompute_regularization_interval

cpp int m_recompute_regularization_interval = 1;

variable m_save_init_splits

cpp bool m_save_init_splits = false;

variable m_checkpointing_interval

cpp unsigned int m_checkpointing_interval = 50;

variable m_keep_checkpoints

cpp int m_keep_checkpoints = 0;

variable m_cotan_sigma_factor

cpp double m_cotan_sigma_factor = 5.0;

variable m_particle_flags

cpp std::vector< int > m_particle_flags;

variable m_domain_flags

cpp std::vector< int > m_domain_flags;

variable m_procrustes_transforms

cpp std::map< int, vnl_matrix_fixed< double, 4, 4 > > m_procrustes_transforms;

variable m_narrow_band

cpp double m_narrow_band = 0.0;

variable m_narrow_band_set

cpp bool m_narrow_band_set = false;

variable m_fixed_domains_present

cpp bool m_fixed_domains_present = false;

variable m_use_shape_statistics_after

cpp int m_use_shape_statistics_after = -1;

variable m_python_filename

cpp std::string m_python_filename;

variable m_geodesics_enabled

cpp bool m_geodesics_enabled = false;

variable m_geodesic_cache_size_multiplier

cpp size_t m_geodesic_cache_size_multiplier = 0;

variable m_geodesic_remesh_percent

cpp double m_geodesic_remesh_percent = 100.0;

variable m_sampling_scale

cpp bool m_sampling_scale = true;

variable m_sampling_auto_scale

cpp bool m_sampling_auto_scale = true;

variable m_sampling_scale_value

cpp double m_sampling_scale_value = 1.0;

variable m_spacing

cpp double m_spacing = 0;

variable m_filenames

cpp std::vector< std::string > m_filenames;

variable m_num_shapes

cpp int m_num_shapes = 0;

variable m_energy_a

cpp std::vector< double > m_energy_a;

variable m_energy_b

cpp std::vector< double > m_energy_b;

variable m_total_energy

cpp std::vector< double > m_total_energy;

variable m_log_energy

cpp bool m_log_energy = false;

variable m_str_energy

cpp std::string m_str_energy;

variable m_bad_ids

cpp std::vector< std::vector< int > > m_bad_ids;

variable m_normal_angle

cpp double m_normal_angle = itk::Math::pi / 2.0;

variable m_perform_good_bad

cpp bool m_perform_good_bad = false;

variable m_cutting_planes_per_input

cpp std::vector< int > m_cutting_planes_per_input;

variable m_spheres_per_input

cpp std::vector< int > m_spheres_per_input;

variable m_file_output_enabled

cpp bool m_file_output_enabled = true;

variable m_aborted

cpp bool m_aborted = false;

variable m_cut_planes

cpp std::vector< std::array< itk::Point< double >, 3 > > m_cut_planes;

variable m_total_iterations

cpp int m_total_iterations = 0;

variable m_iteration_count

cpp int m_iteration_count = 0;

variable m_split_number

cpp int m_split_number = 0;

variable current_particle_iterations_

cpp int current_particle_iterations_ = 0;

variable total_particle_iterations_

cpp int total_particle_iterations_ = 0;

variable iteration_callback_

cpp std::function< void(void)> iteration_callback_;

variable show_visualizer_

cpp bool show_visualizer_ = false;

variable visualizer_

cpp shapeworks::OptimizationVisualizer visualizer_;

variable particle_format_

cpp std::string particle_format_ = "particles";

variable project_

cpp std::shared_ptr< Project > project_;

variable m_start_time

cpp std::chrono::system_clock::time_point m_start_time;

variable m_last_update_time

cpp std::chrono::system_clock::time_point m_last_update_time;

variable m_last_remaining_update_time

cpp std::chrono::system_clock::time_point m_last_remaining_update_time;

variable m_remaining_time_message

cpp std::string m_remaining_time_message;


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