Skip to content

shapeworks::Sampler

Public Classes

Name
struct CuttingPlaneType
struct SphereType

Public Types

Name
using float PixelType
using itk::Image< PixelType, Dimension > ImageType
using ImageType::PointType PointType
using MeanCurvatureContainer< PixelType, Dimension > MeanCurvatureCacheType
using vnl_matrix_fixed< double, Dimension+1, Dimension+1 > TransformType
using GradientDescentOptimizer OptimizerType
using std::vector< std::vector< std::pair< Eigen::Vector3d, Eigen::Vector3d > > > CuttingPlaneList

Public Functions

Name
Sampler()
Constructor.
virtual ~Sampler()
Destructor.
ParticleSystem * GetParticleSystem()
Returns the particle system.
const ParticleSystem * GetParticleSystem() const
std::shared_ptr< SamplingFunction > GetCurvatureGradientFunction()
std::shared_ptr< OptimizerType > GetOptimizer()
Return a pointer to the optimizer object.
std::shared_ptr< const OptimizerType > GetOptimizer() const
void SetPointsFile(unsigned int i, const std::string & s)
void SetPointsFile(const std::string & s)
void SetInitialPoints(std::vector< std::vector< itk::Point< double > > > initial_points)
Set initial particle positions (e.g. for fixed subjects)
void AddImage(ImageType::Pointer image, double narrow_band, std::string name ="")
void ApplyConstraintsToZeroCrossing()
void AddMesh(std::shared_ptr< shapeworks::Surface > mesh, double geodesic_remesh_percent =100)
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 SetFieldAttributes(const std::vector< std::string > & s)
void SetDomainsPerShape(int n)
void SetCuttingPlane(unsigned int i, const vnl_vector_fixed< double, Dimension > & va, const vnl_vector_fixed< double, Dimension > & vb, const vnl_vector_fixed< double, Dimension > & vc)
void AddFreeFormConstraint(int domain, const FreeFormConstraint & ffc)
void TransformCuttingPlanes(unsigned int i)
void AddSphere(unsigned int i, vnl_vector_fixed< double, Dimension > & c, double r)
void SetAdaptivityMode()
void SetCorrespondenceOn()
void SetCorrespondenceOff()
void SetSamplingOn()
void SetSamplingOff()
bool GetCorrespondenceOn() const
bool GetSamplingOn() const
void SetCorrespondenceMode(shapeworks::CorrespondenceMode mode)
void RegisterGeneralShapeMatrices()
void SetAttributeScales(const std::vector< double > & s)
void SetXYZ(unsigned int i, bool flag)
void SetNormals(int i, bool flag)
void SetAttributesPerDomain(const std::vector< int > s)
LegacyShapeMatrix * GetShapeMatrix()
ShapeMatrix * GetGeneralShapeMatrix()
ShapeGradientMatrix * GetGeneralShapeGradientMatrix()
DualVectorFunction * GetLinkingFunction()
LegacyCorrespondenceFunction * GetEnsembleEntropyFunction()
DisentangledCorrespondenceFunction * GetDisentangledEnsembleEntropyFunction()
LegacyCorrespondenceFunction * GetEnsembleRegressionEntropyFunction()
LegacyCorrespondenceFunction * GetEnsembleMixedEffectsEntropyFunction()
CorrespondenceFunction * GetMeshBasedGeneralEntropyGradientFunction()
const DualVectorFunction * GetLinkingFunction() const
const LegacyCorrespondenceFunction * GetEnsembleEntropyFunction() const
const DisentangledCorrespondenceFunction * GetDisentangledEnsembleEntropyFunction() const
const LegacyCorrespondenceFunction * GetEnsembleRegressionEntropyFunction() const
const LegacyCorrespondenceFunction * GetEnsembleMixedEffectsEntropyFunction() const
const CorrespondenceFunction * GetMeshBasedGeneralEntropyGradientFunction() const
void SetTimeptsPerIndividual(int n)
shapeworks::CorrespondenceMode GetCorrespondenceMode() const
void SetTransformFile(const std::string & s)
void SetTransformFile(const char * s)
void SetPrefixTransformFile(const std::string & s)
void SetPrefixTransformFile(const char * s)
void SetPairwisePotentialType(int pairwise_potential_type)
int GetPairwisePotentialType()
void SetVerbosity(unsigned int val)
unsigned int GetVerbosity()
void SetSharedBoundaryEnabled(bool enabled)
void SetSharedBoundaryWeight(double weight)
void SetSamplingScale(bool enabled)
void SetSamplingAutoScale(bool auto_scale)
void SetSamplingScaleValue(double scale_value)
void SetEarlyStoppingConfig(EarlyStoppingConfig config)
void ReadTransforms()
void ReadPointsFiles()
void AllocateDataCaches()
void AllocateDomainsAndNeighborhoods()
void InitializeOptimizationFunctions()
void initialize_initial_positions()
void Initialize()
void ReInitialize()
void Execute()
CuttingPlaneList ComputeCuttingPlanes()
Eigen::Vector3d ComputePlaneNormal(const vnl_vector< double > & a, const vnl_vector< double > & b, const vnl_vector< double > & c)
std::vector< FreeFormConstraint > GetFFCs()
void SetMeshFFCMode(bool mesh_ffc_mode)

Public Attributes

Name
constexpr unsigned int Dimension

Public Types Documentation

using PixelType

cpp using shapeworks::Sampler::PixelType = float;

using ImageType

cpp using shapeworks::Sampler::ImageType = itk::Image<PixelType, Dimension>;

using PointType

cpp using shapeworks::Sampler::PointType = ImageType::PointType;

using MeanCurvatureCacheType

cpp using shapeworks::Sampler::MeanCurvatureCacheType = MeanCurvatureContainer<PixelType, Dimension>;

using TransformType

cpp using shapeworks::Sampler::TransformType = vnl_matrix_fixed<double, Dimension + 1, Dimension + 1>;

using OptimizerType

cpp using shapeworks::Sampler::OptimizerType = GradientDescentOptimizer;

using CuttingPlaneList

cpp using shapeworks::Sampler::CuttingPlaneList = std::vector<std::vector<std::pair<Eigen::Vector3d, Eigen::Vector3d> >>;

Public Functions Documentation

function Sampler

cpp Sampler()

Constructor.

function ~Sampler

cpp inline virtual ~Sampler()

Destructor.

function GetParticleSystem

cpp inline ParticleSystem * GetParticleSystem()

Returns the particle system.

function GetParticleSystem

cpp inline const ParticleSystem * GetParticleSystem() const

function GetCurvatureGradientFunction

cpp inline std::shared_ptr< SamplingFunction > GetCurvatureGradientFunction()

function GetOptimizer

cpp inline std::shared_ptr< OptimizerType > GetOptimizer()

Return a pointer to the optimizer object.

function GetOptimizer

cpp inline std::shared_ptr< const OptimizerType > GetOptimizer() const

function SetPointsFile

cpp inline void SetPointsFile( unsigned int i, const std::string & s )

Optionally provide a filename for an initial point set.

function SetPointsFile

cpp inline void SetPointsFile( const std::string & s )

function SetInitialPoints

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

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

function AddImage

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

function ApplyConstraintsToZeroCrossing

cpp inline void ApplyConstraintsToZeroCrossing()

function AddMesh

cpp void AddMesh( std::shared_ptr< shapeworks::Surface > mesh, double geodesic_remesh_percent =100 )

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 SetFieldAttributes

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

function SetDomainsPerShape

cpp inline void SetDomainsPerShape( int n )

function SetCuttingPlane

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

Optionally supply a cutting plane that will be set as a particle optimization constraint in the image domains.

function AddFreeFormConstraint

cpp void AddFreeFormConstraint( int domain, const FreeFormConstraint & ffc )

function TransformCuttingPlanes

cpp void TransformCuttingPlanes( unsigned int i )

Transform a cutting plane based on procrustes transformation

function AddSphere

cpp void AddSphere( unsigned int i, vnl_vector_fixed< double, Dimension > & c, double r )

Optionally add spheres that may be used as constraints to the domain.

function SetAdaptivityMode

cpp inline void SetAdaptivityMode()

function SetCorrespondenceOn

cpp inline void SetCorrespondenceOn()

function SetCorrespondenceOff

cpp inline void SetCorrespondenceOff()

function SetSamplingOn

cpp inline void SetSamplingOn()

function SetSamplingOff

cpp inline void SetSamplingOff()

function GetCorrespondenceOn

cpp inline bool GetCorrespondenceOn() const

function GetSamplingOn

cpp inline bool GetSamplingOn() const

function SetCorrespondenceMode

cpp void SetCorrespondenceMode( shapeworks::CorrespondenceMode mode )

This method sets the optimization function for correspondences between surfaces (domains).

function RegisterGeneralShapeMatrices

cpp inline void RegisterGeneralShapeMatrices()

function SetAttributeScales

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

function SetXYZ

cpp inline void SetXYZ( unsigned int i, bool flag )

function SetNormals

cpp inline void SetNormals( int i, bool flag )

function SetAttributesPerDomain

cpp void SetAttributesPerDomain( const std::vector< int > s )

function GetShapeMatrix

cpp inline LegacyShapeMatrix * GetShapeMatrix()

function GetGeneralShapeMatrix

cpp inline ShapeMatrix * GetGeneralShapeMatrix()

function GetGeneralShapeGradientMatrix

cpp inline ShapeGradientMatrix * GetGeneralShapeGradientMatrix()

function GetLinkingFunction

cpp inline DualVectorFunction * GetLinkingFunction()

function GetEnsembleEntropyFunction

cpp inline LegacyCorrespondenceFunction * GetEnsembleEntropyFunction()

function GetDisentangledEnsembleEntropyFunction

cpp inline DisentangledCorrespondenceFunction * GetDisentangledEnsembleEntropyFunction()

function GetEnsembleRegressionEntropyFunction

cpp inline LegacyCorrespondenceFunction * GetEnsembleRegressionEntropyFunction()

function GetEnsembleMixedEffectsEntropyFunction

cpp inline LegacyCorrespondenceFunction * GetEnsembleMixedEffectsEntropyFunction()

function GetMeshBasedGeneralEntropyGradientFunction

cpp inline CorrespondenceFunction * GetMeshBasedGeneralEntropyGradientFunction()

function GetLinkingFunction

cpp inline const DualVectorFunction * GetLinkingFunction() const

function GetEnsembleEntropyFunction

cpp inline const LegacyCorrespondenceFunction * GetEnsembleEntropyFunction() const

function GetDisentangledEnsembleEntropyFunction

cpp inline const DisentangledCorrespondenceFunction * GetDisentangledEnsembleEntropyFunction() const

function GetEnsembleRegressionEntropyFunction

cpp inline const LegacyCorrespondenceFunction * GetEnsembleRegressionEntropyFunction() const

function GetEnsembleMixedEffectsEntropyFunction

cpp inline const LegacyCorrespondenceFunction * GetEnsembleMixedEffectsEntropyFunction() const

function GetMeshBasedGeneralEntropyGradientFunction

cpp inline const CorrespondenceFunction * GetMeshBasedGeneralEntropyGradientFunction() const

function SetTimeptsPerIndividual

cpp inline void SetTimeptsPerIndividual( int n )

function GetCorrespondenceMode

cpp inline shapeworks::CorrespondenceMode GetCorrespondenceMode() const

function SetTransformFile

cpp inline void SetTransformFile( const std::string & s )

function SetTransformFile

cpp inline void SetTransformFile( const char * s )

function SetPrefixTransformFile

cpp inline void SetPrefixTransformFile( const std::string & s )

function SetPrefixTransformFile

cpp inline void SetPrefixTransformFile( const char * s )

function SetPairwisePotentialType

cpp inline void SetPairwisePotentialType( int pairwise_potential_type )

function GetPairwisePotentialType

cpp inline int GetPairwisePotentialType()

function SetVerbosity

cpp inline void SetVerbosity( unsigned int val )

function GetVerbosity

cpp inline unsigned int GetVerbosity()

function SetSharedBoundaryEnabled

cpp inline void SetSharedBoundaryEnabled( bool enabled )

function SetSharedBoundaryWeight

cpp inline void SetSharedBoundaryWeight( double weight )

function SetSamplingScale

cpp inline void SetSamplingScale( bool enabled )

function SetSamplingAutoScale

cpp inline void SetSamplingAutoScale( bool auto_scale )

function SetSamplingScaleValue

cpp inline void SetSamplingScaleValue( double scale_value )

function SetEarlyStoppingConfig

cpp inline void SetEarlyStoppingConfig( EarlyStoppingConfig config )

function ReadTransforms

cpp void ReadTransforms()

function ReadPointsFiles

cpp void ReadPointsFiles()

function AllocateDataCaches

cpp void AllocateDataCaches()

function AllocateDomainsAndNeighborhoods

cpp void AllocateDomainsAndNeighborhoods()

function InitializeOptimizationFunctions

cpp void InitializeOptimizationFunctions()

function initialize_initial_positions

cpp void initialize_initial_positions()

function Initialize

cpp inline void Initialize()

function ReInitialize

cpp void ReInitialize()

function Execute

cpp void Execute()

function ComputeCuttingPlanes

cpp CuttingPlaneList ComputeCuttingPlanes()

function ComputePlaneNormal

cpp Eigen::Vector3d ComputePlaneNormal( const vnl_vector< double > & a, const vnl_vector< double > & b, const vnl_vector< double > & c )

function GetFFCs

cpp inline std::vector< FreeFormConstraint > GetFFCs()

function SetMeshFFCMode

cpp inline void SetMeshFFCMode( bool mesh_ffc_mode )

Public Attributes Documentation

variable Dimension

cpp static constexpr unsigned int Dimension = 3;


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