Skip to content

shapeworks::Optimize

More...

#include <Optimize.h>

Inherited by shapeworks::QOptimize

Public Types

Name
using itk::Image< float, 3 > ImageType
using itk::ParticleVectorFunction< 3 >::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 projectFile)
void SetProject(std::shared_ptr< Project > project)
Set the Projects.
void SetIterationCallbackFunction(const std::function< void(void)> & f)
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 SetProcessingMode(int mode)
Set processing mode (TODO: details)
void SetAdaptivityMode(int adaptivity_mode)
Set adaptivity mode (TODO: details)
void SetMeshFFCMode(int mesh_ffc_mode)
Set Mesh FFC Mode false/0 = mesh clipping mode, true/1 = mesh augmented lagrangian mode.
void SetAdaptivityStrength(double adaptivity_strength)
Set adaptivity strength (TODO: details)
void SetPairwisePotentialType(int pairwise_potential_type)
Set pairwise potential type (TODO: details)
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 SetInitializationCriterion(double init_criterion)
Set the init criterion (TODO: details)
void SetOptimizationCriterion(double opt_criterion)
Set the optimization criterion (TODO: details)
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 SetCotanSigmaFactor(double cotan_sigma_factor)
Set the cotan sigma factor (TODO: details)
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 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 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)
int GetNumShapes()
Get number of shapes.
void SetMeshFiles(const std::vector< std::string > & mesh_files)
Set the mesh files (TODO: details)
void SetAttributeScales(const std::vector< double > & scales)
Set attribute scales (TODO: details)
void SetFeaFiles(const std::vector< std::string > & files)
Set FEA files (TODO: details)
void SetFeaGradFiles(const std::vector< std::string > & files)
Set FEA grad files (TODO: details)
void SetFidsFiles(const std::vector< std::string > & files)
Set FIDS files (TODO: details)
void SetParticleFlags(std::vector< int > flags)
Set Particle Flags (TODO: details)
void SetDomainFlags(std::vector< int > flags)
Set Domain Flags (TODO: details)
void SetSharedBoundaryEnabled(bool enabled)
Shared boundary settings.
void SetSharedBoundaryWeight(double weight)
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.
void SetGeodesicsCacheSizeMultiplier(size_t n)
shapeworks::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

Protected Functions

Name
virtual void SetIterationCallback()
Set the iteration callback. Derived classes should override to set their own callback.
void RunProcrustes()
Run an iteration of procrustes.
void OptimizeStart()
void OptimizerStop()
void ReadTransformFile()
void ReadPrefixTransformFile(const std::string & s)
void InitializeSampler()
double GetMinNeighborhoodRadius()
void AddSinglePoint()
void Initialize()
void AddAdaptivity()
void RunOptimize()
void SetInitialCorrespondenceMode()
virtual void IterateCallback(itk::Object * , const itk::EventObject & )
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 WriteCuttingPlanePoints(int iter =-1)
void WriteParameters(std::string output_dir ="")
void ReportBadParticles()
void 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
ParticleProcrustesRegistration::Pointer m_procrustes
itk::ParticleGoodBadAssessment< float, 3 >::Pointer 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
int m_saturation_counter
bool m_disable_procrustes
bool m_use_cutting_planes
bool m_optimizing
bool m_use_regression
bool m_use_mixed_effects
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
int m_processing_mode
int m_adaptivity_mode
double m_adaptivity_strength
int m_pairwise_potential_type
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
double m_initialization_criterion
double m_optimization_criterion
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
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
unsigned int m_mode
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
std::mt19937 m_rand
std::function< void(void)> m_iter_callback
bool show_visualizer
shapeworks::OptimizationVisualizer visualizer
std::shared_ptr< Project > project_

Detailed Description

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

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

using VectorType

using shapeworks::Optimize::VectorType =  itk::ParticleVectorFunction<3>::VectorType;

using MatrixType

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

Public Functions Documentation

function Optimize

Optimize()

Constructor.

function ~Optimize

virtual ~Optimize()

Destructor.

function Run

bool Run()

Run the optimization.

function LoadParameterFile

bool LoadParameterFile(
    std::string filename
)

Load a parameter file.

function SetUpOptimize

bool SetUpOptimize(
    ProjectHandle projectFile
)

function SetProject

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

Set the Projects.

function SetIterationCallbackFunction

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

function AbortOptimization

void AbortOptimization()

Abort optimization.

function GetAborted

bool GetAborted()

Return if the optimization was aborted.

function GetLocalPoints

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

Return the local points.

Reimplemented by: shapeworks::QOptimize::GetLocalPoints

function GetGlobalPoints

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

Return the global points.

Reimplemented by: shapeworks::QOptimize::GetGlobalPoints

function SetCutPlanes

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

Set cutting planes.

function SetVerbosity

void SetVerbosity(
    int verbosity_level
)

Set the verbosity level (0-5)

function SetDomainsPerShape

void SetDomainsPerShape(
    int domains_per_shape
)

Set the number of domains per shape.

function GetDomainsPerShape

int GetDomainsPerShape()

Return the number of domains per shape.

function SetDomainType

void SetDomainType(
    shapeworks::DomainType type
)

function GetDomainType

shapeworks::DomainType GetDomainType()

function SetNumberOfParticles

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

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

function GetNumberOfParticles

std::vector< int > GetNumberOfParticles()

Return the numbers of particles per domain.

function SetTransformFile

void SetTransformFile(
    std::string filename
)

Set the transform file.

function GetTransformFile

std::string GetTransformFile()

Get the transform file.

function SetPrefixTransformFile

void SetPrefixTransformFile(
    std::string prefix_transform_file
)

Set the prefix transform file (TODO: details)

function GetPrefixTransformFile

std::string GetPrefixTransformFile()

Get the prefix transform file.

function SetOutputDir

void SetOutputDir(
    std::string output_dir
)

Set the output directory.

function SetOutputTransformFile

void SetOutputTransformFile(
    std::string output_transform_file
)

Set the output transform file.

function SetOutputIndividualTransformFiles

void SetOutputIndividualTransformFiles(
    bool value
)

Set whether individual transforms should be written.

function SetUseMeshBasedAttributes

void SetUseMeshBasedAttributes(
    bool use_mesh_based_attributes
)

Set if mesh based attributes should be used.

function GetUseMeshBasedAttributes

bool GetUseMeshBasedAttributes()

Get if mesh based attributes are being used.

function SetUseXYZ

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

Set if XYZ is used, one value per domain.

function SetUseNormals

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

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

function SetAttributesPerDomain

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

Set the attributes per domain.

function GetAttributesPerDomain

std::vector< int > GetAttributesPerDomain()

Get attributes per domain.

function SetDistributionDomainID

void SetDistributionDomainID(
    int distribution_domain_id
)

Set the distribution domain ID (TODO: details)

function GetDistributionDomainID

int GetDistributionDomainID()

Get the distribution domain ID.

function SetOutputCuttingPlaneFile

void SetOutputCuttingPlaneFile(
    std::string output_cutting_plane_file
)

Set the output cutting plane file.

function SetUseCuttingPlanes

void SetUseCuttingPlanes(
    bool use_cutting_planes
)

Set if using cutting planes.

function SetCuttingPlane

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 SetProcessingMode

void SetProcessingMode(
    int mode
)

Set processing mode (TODO: details)

function SetAdaptivityMode

void SetAdaptivityMode(
    int adaptivity_mode
)

Set adaptivity mode (TODO: details)

function SetMeshFFCMode

inline void SetMeshFFCMode(
    int mesh_ffc_mode
)

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

function SetAdaptivityStrength

void SetAdaptivityStrength(
    double adaptivity_strength
)

Set adaptivity strength (TODO: details)

function SetPairwisePotentialType

void SetPairwisePotentialType(
    int pairwise_potential_type
)

Set pairwise potential type (TODO: details)

function SetTimePtsPerSubject

void SetTimePtsPerSubject(
    int time_pts_per_subject
)

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

function GetTimePtsPerSubject

int GetTimePtsPerSubject()

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

function SetOptimizationIterations

void SetOptimizationIterations(
    int optimization_iterations
)

Set the number of optimization iterations.

function SetOptimizationIterationsCompleted

void SetOptimizationIterationsCompleted(
    int optimization_iterations_completed
)

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

function SetIterationsPerSplit

void SetIterationsPerSplit(
    int iterations_per_split
)

Set the number of iterations per split.

function SetInitializationCriterion

void SetInitializationCriterion(
    double init_criterion
)

Set the init criterion (TODO: details)

function SetOptimizationCriterion

void SetOptimizationCriterion(
    double opt_criterion
)

Set the optimization criterion (TODO: details)

function SetUseShapeStatisticsInInit

void SetUseShapeStatisticsInInit(
    bool use_shape_statistics_in_init
)

Set if shape statistics should be used in initialization.

function SetProcrustesInterval

void SetProcrustesInterval(
    int procrustes_interval
)

Set the interval for running procrustes (0 to disable)

function SetProcrustesScaling

void SetProcrustesScaling(
    bool procrustes_scaling
)

Set if procrustes scaling should be used.

function SetProcrustesRotationTranslation

void SetProcrustesRotationTranslation(
    bool procrustes_rotation_translation
)

Set if procrustes rotation/translation should be used.

function SetRelativeWeighting

void SetRelativeWeighting(
    double relative_weighting
)

Set the relative weighting (TODO: details)

function SetInitialRelativeWeighting

void SetInitialRelativeWeighting(
    double initial_relative_weighting
)

Set the initial relative weigting (TODO: details)

function SetStartingRegularization

void SetStartingRegularization(
    double starting_regularization
)

Set the starting regularization (TODO: details)

function SetEndingRegularization

void SetEndingRegularization(
    double ending_regularization
)

Set the ending regularization (TODO: details)

function SetRecomputeRegularizationInterval

void SetRecomputeRegularizationInterval(
    int recompute_regularization_interval
)

Set the interval for recomputing regularization (TODO: details)

function SetSaveInitSplits

void SetSaveInitSplits(
    bool save_init_splits
)

Set if initialization splits should be saved or not.

function SetCheckpointingInterval

void SetCheckpointingInterval(
    int checkpointing_interval
)

Set the checkpointing interval.

function SetKeepCheckpoints

void SetKeepCheckpoints(
    int keep_checkpoints
)

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

function SetCotanSigmaFactor

void SetCotanSigmaFactor(
    double cotan_sigma_factor
)

Set the cotan sigma factor (TODO: details)

function SetUseRegression

void SetUseRegression(
    bool use_regression
)

Set if regression should be used (TODO: details)

function SetUseMixedEffects

void SetUseMixedEffects(
    bool use_mixed_effects
)

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

function SetNormalAngle

void SetNormalAngle(
    double normal_angle
)

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

function SetPerformGoodBad

void SetPerformGoodBad(
    bool perform_good_bad
)

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

function SetLogEnergy

void SetLogEnergy(
    bool log_energy
)

Set the log energy (TODO: details)

function AddImage

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

Set the shape input images.

function AddMesh

void AddMesh(
    vtkSmartPointer< vtkPolyData > poly_data
)

function AddContour

void AddContour(
    vtkSmartPointer< vtkPolyData > poly_data
)

function SetFilenames

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

Set the shape filenames (TODO: details)

function SetPointFiles

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

Set starting point files (TODO: details)

function GetNumShapes

int GetNumShapes()

Get number of shapes.

function SetMeshFiles

void SetMeshFiles(
    const std::vector< std::string > & mesh_files
)

Set the mesh files (TODO: details)

function SetAttributeScales

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

Set attribute scales (TODO: details)

function SetFeaFiles

void SetFeaFiles(
    const std::vector< std::string > & files
)

Set FEA files (TODO: details)

function SetFeaGradFiles

void SetFeaGradFiles(
    const std::vector< std::string > & files
)

Set FEA grad files (TODO: details)

function SetFidsFiles

void SetFidsFiles(
    const std::vector< std::string > & files
)

Set FIDS files (TODO: details)

function SetParticleFlags

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

Set Particle Flags (TODO: details)

function SetDomainFlags

void SetDomainFlags(
    std::vector< int > flags
)

Set Domain Flags (TODO: details)

function SetSharedBoundaryEnabled

void SetSharedBoundaryEnabled(
    bool enabled
)

Shared boundary settings.

function SetSharedBoundaryWeight

void SetSharedBoundaryWeight(
    double weight
)

function GetDomainFlags

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

function SetFileOutputEnabled

void SetFileOutputEnabled(
    bool enabled
)

Set if file output is enabled.

function GetUseXYZ

std::vector< bool > GetUseXYZ()

Return if XYZ is used, per shape.

function GetUseNormals

std::vector< bool > GetUseNormals()

Return if Normals are used, per shape.

function SetNarrowBand

void SetNarrowBand(
    double v
)

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

function GetNarrowBand

double GetNarrowBand()

Return the narrow band to be used.

function SetUseShapeStatisticsAfter

void SetUseShapeStatisticsAfter(
    int num_particles
)

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

function GetUseShapeStatisticsAfter

int GetUseShapeStatisticsAfter()

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

function PrintParamInfo

void PrintParamInfo()

Print parameter info to stdout.

function GetSampler

inline std::shared_ptr< Sampler > GetSampler()

Return the Sampler.

function GetParticleSystem

MatrixContainer GetParticleSystem()

Return the particle system as a matrix.

function SetPythonFile

void SetPythonFile(
    std::string filename
)

Set the python file to run at startup.

function SetGeodesicsEnabled

void SetGeodesicsEnabled(
    bool is_enabled
)

Set whether or not geodesics are enabled.

function SetGeodesicsCacheSizeMultiplier

void SetGeodesicsCacheSizeMultiplier(
    size_t n
)

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

function GetVisualizer

shapeworks::OptimizationVisualizer & GetVisualizer()

function SetShowVisualizer

void SetShowVisualizer(
    bool show
)

function GetShowVisualizer

bool GetShowVisualizer()

function GetMeshFFCMode

inline bool GetMeshFFCMode()

function TransformPoint

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

transform a point if necessary

Protected Functions Documentation

function SetIterationCallback

virtual void SetIterationCallback()

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

Reimplemented by: shapeworks::QOptimize::SetIterationCallback

function RunProcrustes

void RunProcrustes()

Run an iteration of procrustes.

function OptimizeStart

void OptimizeStart()

function OptimizerStop

void OptimizerStop()

function ReadTransformFile

void ReadTransformFile()

function ReadPrefixTransformFile

void ReadPrefixTransformFile(
    const std::string & s
)

function InitializeSampler

void InitializeSampler()

function GetMinNeighborhoodRadius

double GetMinNeighborhoodRadius()

function AddSinglePoint

void AddSinglePoint()

function Initialize

void Initialize()

function AddAdaptivity

void AddAdaptivity()

function RunOptimize

void RunOptimize()

function SetInitialCorrespondenceMode

void SetInitialCorrespondenceMode()

function IterateCallback

virtual void IterateCallback(
    itk::Object * ,
    const itk::EventObject & 
)

Reimplemented by: shapeworks::QOptimize::IterateCallback

function ComputeEnergyAfterIteration

void ComputeEnergyAfterIteration()

function SetCotanSigma

void SetCotanSigma()

function WriteTransformFile

void WriteTransformFile(
    int iter =-1
) const

function WriteTransformFile

void WriteTransformFile(
    std::string iter_prefix
) const

function WriteTransformFiles

void WriteTransformFiles(
    int iter =-1
) const

function WriteTransformFiles

void WriteTransformFiles(
    std::string iter_prefix
) const

function WritePointFiles

void WritePointFiles(
    int iter =-1
)

function WritePointFiles

void WritePointFiles(
    std::string iter_prefix
)

function WritePointFilesWithFeatures

void WritePointFilesWithFeatures(
    int iter =-1
)

function WritePointFilesWithFeatures

void WritePointFilesWithFeatures(
    std::string iter_prefix
)

function WriteEnergyFiles

void WriteEnergyFiles()

function WriteCuttingPlanePoints

void WriteCuttingPlanePoints(
    int iter =-1
)

function WriteParameters

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

function ReportBadParticles

void ReportBadParticles()

function SetParameters

void SetParameters()

function WriteModes

void WriteModes()

function PrintStartMessage

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

function PrintDoneMessage

void PrintDoneMessage(
    unsigned int vlevel =0
) const

function UpdateExportablePoints

virtual void UpdateExportablePoints()

Reimplemented by: shapeworks::QOptimize::UpdateExportablePoints

function GetProcrustesTransforms

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

Reimplemented by: shapeworks::QOptimize::GetProcrustesTransforms

function UpdateProject

void UpdateProject()

function GetCheckpointDir

std::string GetCheckpointDir()

Protected Attributes Documentation

variable m_sampler

std::shared_ptr< Sampler > m_sampler;

variable m_procrustes

ParticleProcrustesRegistration::Pointer m_procrustes;

variable m_good_bad

itk::ParticleGoodBadAssessment< float, 3 >::Pointer m_good_bad;

variable m_verbosity_level

unsigned int m_verbosity_level = 0;

variable m_local_points

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

variable m_global_points

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

variable m_checkpoint_counter

int m_checkpoint_counter = 0;

variable m_procrustes_counter

int m_procrustes_counter = 0;

variable m_saturation_counter

int m_saturation_counter = 0;

variable m_disable_procrustes

bool m_disable_procrustes = true;

variable m_use_cutting_planes

bool m_use_cutting_planes = false;

variable m_optimizing

bool m_optimizing = false;

variable m_use_regression

bool m_use_regression = false;

variable m_use_mixed_effects

bool m_use_mixed_effects = false;

variable m_domains_per_shape

unsigned int m_domains_per_shape = 1;

variable m_domain_type

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

variable m_number_of_particles

std::vector< int > m_number_of_particles;

variable m_transform_file

std::string m_transform_file;

variable m_prefix_transform_file

std::string m_prefix_transform_file;

variable m_output_dir

std::string m_output_dir;

variable m_output_transform_file

std::string m_output_transform_file;

variable m_output_transform_files

bool m_output_transform_files = false;

variable m_mesh_based_attributes

bool m_mesh_based_attributes = false;

variable m_use_xyz

std::vector< bool > m_use_xyz;

variable m_use_normals

std::vector< bool > m_use_normals;

variable m_attributes_per_domain

std::vector< int > m_attributes_per_domain;

variable m_distribution_domain_id

int m_distribution_domain_id = -1;

variable m_output_cutting_plane_file

std::string m_output_cutting_plane_file;

variable m_processing_mode

int m_processing_mode = 3;

variable m_adaptivity_mode

int m_adaptivity_mode = 0;

variable m_adaptivity_strength

double m_adaptivity_strength = 0.0;

variable m_pairwise_potential_type

int m_pairwise_potential_type = 0;

variable m_mesh_ffc_mode

bool m_mesh_ffc_mode = 0;

variable m_timepts_per_subject

unsigned int m_timepts_per_subject = 1;

variable m_optimization_iterations

int m_optimization_iterations = 2000;

variable m_optimization_iterations_completed

int m_optimization_iterations_completed = 0;

variable m_iterations_per_split

int m_iterations_per_split = 1000;

variable m_initialization_criterion

double m_initialization_criterion = 1e-6;

variable m_optimization_criterion

double m_optimization_criterion = 1e-6;

variable m_use_shape_statistics_in_init

bool m_use_shape_statistics_in_init = false;

variable m_procrustes_interval

unsigned int m_procrustes_interval = 3;

variable m_procrustes_scaling

bool m_procrustes_scaling = true;

variable m_procrustes_rotation_translation

bool m_procrustes_rotation_translation = true;

variable m_relative_weighting

double m_relative_weighting = 1.0;

variable m_initial_relative_weighting

double m_initial_relative_weighting = 0.05;

variable m_starting_regularization

double m_starting_regularization = 1000;

variable m_ending_regularization

double m_ending_regularization = 1.0;

variable m_recompute_regularization_interval

int m_recompute_regularization_interval = 1;

variable m_save_init_splits

bool m_save_init_splits = false;

variable m_checkpointing_interval

unsigned int m_checkpointing_interval = 50;

variable m_keep_checkpoints

int m_keep_checkpoints = 0;

variable m_cotan_sigma_factor

double m_cotan_sigma_factor = 5.0;

variable m_particle_flags

std::vector< int > m_particle_flags;

variable m_domain_flags

std::vector< int > m_domain_flags;

variable m_narrow_band

double m_narrow_band = 0.0;

variable m_narrow_band_set

bool m_narrow_band_set = false;

variable m_fixed_domains_present

bool m_fixed_domains_present = false;

variable m_use_shape_statistics_after

int m_use_shape_statistics_after = -1;

variable m_python_filename

std::string m_python_filename;

variable m_geodesics_enabled

bool m_geodesics_enabled = false;

variable m_geodesic_cache_size_multiplier

size_t m_geodesic_cache_size_multiplier = 0;

variable m_mode

unsigned int m_mode = 0;

variable m_spacing

double m_spacing = 0;

variable m_filenames

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

variable m_num_shapes

int m_num_shapes = 0;

variable m_energy_a

std::vector< double > m_energy_a;

variable m_energy_b

std::vector< double > m_energy_b;

variable m_total_energy

std::vector< double > m_total_energy;

variable m_log_energy

bool m_log_energy = false;

variable m_str_energy

std::string m_str_energy;

variable m_bad_ids

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

variable m_normal_angle

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

variable m_perform_good_bad

bool m_perform_good_bad = false;

variable m_cutting_planes_per_input

std::vector< int > m_cutting_planes_per_input;

variable m_spheres_per_input

std::vector< int > m_spheres_per_input;

variable m_file_output_enabled

bool m_file_output_enabled = true;

variable m_aborted

bool m_aborted = false;

variable m_cut_planes

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

variable m_total_iterations

int m_total_iterations = 0;

variable m_iteration_count

int m_iteration_count = 0;

variable m_split_number

int m_split_number {0};

variable m_rand

std::mt19937 m_rand {42};

variable m_iter_callback

std::function< void(void)> m_iter_callback;

variable show_visualizer

bool show_visualizer = false;

variable visualizer

shapeworks::OptimizationVisualizer visualizer;

variable project_

std::shared_ptr< Project > project_;

Updated on 2022-07-23 at 16:40:06 -0600