Shapeworks Studio
2.1
Shape analysis software suite
|
This the most basic of all PSM model optimization filters. This filter assembles all of the necessary components to perform an entropy-based correspondence optimization for constructing a point-based shape model of shape surfaces. More...
#include <itkPSMEntropyModelFilter.h>
Classes | |
struct | CuttingPlaneType |
Public Types | |
typedef PSMEntropyModelFilter | Self |
typedef InPlaceImageFilter< TImage, TImage > | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const Self > | ConstPointer |
typedef PSMParticleSystem< Dimension > | ParticleSystemType |
typedef TShapeMatrix | ShapeMatrixType |
typedef ShapeMatrixType::Pointer | ShapeMatrixPointerType |
typedef TImage | ImageType |
typedef ImageType::PointType | PointType |
typedef PSMGradientDescentOptimizer< typename ImageType::PixelType, Dimension > | OptimizerType |
Public Member Functions | |
itkStaticConstMacro (Dimension, unsigned int, TImage::ImageDimension) | |
itkNewMacro (Self) | |
itkTypeMacro (PSMEntropyModelFilter, InPlaceImageFilter) | |
void | SetInput (const std::string &s, itk::DataObject *o) |
void | SetInput (const TImage *image) |
void | SetInput (unsigned int index, const TImage *image) |
void | SetNumberOfScales (unsigned int n) |
itkGetMacro (NumberOfScales, unsigned int) | |
itkSetMacro (CurrentScale, unsigned int) | |
itkGetMacro (CurrentScale, unsigned int) | |
void | SetInputCorrespondencePoints (unsigned int index, const std::vector< PointType > &corr) |
itkGetObjectMacro (ParticleSystem, ParticleSystemType) | |
itkGetConstObjectMacro (ParticleSystem, ParticleSystemType) | |
PSMParticleEntropyFunction< typename ImageType::PixelType, Dimension > * | GetParticleEntropyFunction () |
PSMShapeEntropyFunction< Dimension > * | ShapeEntropyFunction () |
itkGetObjectMacro (Optimizer, OptimizerType) | |
itkGetConstObjectMacro (Optimizer, OptimizerType) | |
void | SetMaximumNumberOfIterations (const std::vector< unsigned int > &n) |
void | SetMaximumNumberOfIterations (unsigned int n, unsigned int i=0) |
unsigned int | GetMaximumNumberOfIterations (unsigned int i=0) const |
unsigned int | GetNumberOfElapsedIterations () const |
itkGetMacro (Initialized, bool) | |
itkGetMacro (Initializing, bool) | |
itkSetMacro (Initializing, bool) | |
void | SetShapeEntropyWeighting (double w) |
double | GetShapeEntropyWeighting () const |
const std::vector< double > & | GetShapePCAVariances () const |
void | SetRegularizationInitial (const std::vector< double > &v) |
void | SetRegularizationInitial (double t, unsigned int i=0) |
double | GetRegularizationInitial (unsigned int i=0) const |
void | SetRegularizationFinal (const std::vector< double > &v) |
void | SetRegularizationFinal (double t, unsigned int i=0) |
double | GetRegularizationFinal (unsigned int i=0) const |
void | SetRegularizationDecaySpan (const std::vector< double > &v) |
void | SetRegularizationDecaySpan (double t, unsigned int i=0) |
double | GetRegularizationDecaySpan (unsigned int i=0) const |
void | SetRegularizationConstant (double r) |
void | SetMinimumVariance (double r) |
double | GetRegularizationConstant () const |
double | GetMinimumVariance () const |
void | SetTolerance (const std::vector< double > &v) |
void | SetTolerance (double t, unsigned int i=0) |
double | GetTolerance (unsigned int i=0) const |
itkGetMacro (ShapeMatrix, ShapeMatrixPointerType) | |
const ShapeMatrixType * | GetShapeMatrix () const |
bool | CreateSingleCorrespondence () |
void | SetDomainName (const std::string &s, unsigned int i) |
unsigned int | GetDomainIndexByName (const std::string &name) |
void | AddCuttingPlane (const vnl_vector_fixed< double, 3 > &x, const vnl_vector_fixed< double, 3 > &y, const vnl_vector_fixed< double, 3 > &z, unsigned int domain) |
void | AddCuttingPlane (const vnl_vector_fixed< double, 3 > &x, const vnl_vector_fixed< double, 3 > &y, const vnl_vector_fixed< double, 3 > &z, const std::string &s) |
Protected Member Functions | |
void | PrintSelf (std::ostream &os, Indent indent) const |
void | GenerateData () |
virtual void | AllocateDataCaches () |
virtual void | AllocateWorkingImages () |
virtual void | AllocateDomainsAndNeighborhoods () |
void | InitializeCorrespondences () |
itkSetMacro (Initialized, bool) | |
void | OptimizerIterateCallback (Object *, const EventObject &) |
PSMImplicitSurfaceDomain< typename ImageType::PixelType, Dimension >::Pointer & | GetDomainByName (const std::string &name) |
PSMImplicitSurfaceDomain< typename ImageType::PixelType, Dimension >::Pointer & | GetDomain (unsigned int i) |
This the most basic of all PSM model optimization filters. This filter assembles all of the necessary components to perform an entropy-based correspondence optimization for constructing a point-based shape model of shape surfaces.
This class combines a PSMShapeEntropyFunction with a PSMParticleEntropyFunction within a PSMTwoCostFunction to produce an optimization of particle positions with respect to both their positional entropy on shape surfaces and their entropy within a higher-dimensional shape space (the entropy of the distributions of shapes). The relative weighting of these two terms may be adjusted using the SetShapeEntropyWeighting method, which increases or decreases the influence of the entropy of the shape model on the optimization. The default value for ShapeEntropyWeighting is 1.0.
NEED CITATION HERE
HOW DO YOU USE THIS FILTER? First you need to specify the input images. Input images are in the form of distance transforms that contain an implicit surface representation at the zero level set within the image. The zero level set is the surface on which the particles are constrained during the optimization. You will specify multiple input images, one for each shape in your shape cohort. To specify the inputs, use the method SetInput(i,image *), where i is the number of the input and image * is an itk::Image::Pointer to the distance transform image.
This filter can be run in "initialization mode", which causes all data structures to allocate and initialize, but does not run the actual optimization. To run in initialization mode, set the Initializing flag to true.
Definition at line 78 of file itkPSMEntropyModelFilter.h.
typedef TImage itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::ImageType |
Type of the input/output image.
Definition at line 105 of file itkPSMEntropyModelFilter.h.
typedef PSMGradientDescentOptimizer<typename ImageType::PixelType, Dimension> itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::OptimizerType |
Type of the optimizer
Definition at line 111 of file itkPSMEntropyModelFilter.h.
typedef PSMParticleSystem<Dimension> itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::ParticleSystemType |
Type of the particle system
Definition at line 92 of file itkPSMEntropyModelFilter.h.
typedef ImageType::PointType itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::PointType |
Expose the point type
Definition at line 108 of file itkPSMEntropyModelFilter.h.
typedef PSMEntropyModelFilter itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::Self |
Standard class typedefs.
Definition at line 83 of file itkPSMEntropyModelFilter.h.
typedef TShapeMatrix itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::ShapeMatrixType |
The type of the Shape Matrix, which defines optimization behavior.
Definition at line 95 of file itkPSMEntropyModelFilter.h.
void itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::AddCuttingPlane | ( | const vnl_vector_fixed< double, 3 > & | x, |
const vnl_vector_fixed< double, 3 > & | y, | ||
const vnl_vector_fixed< double, 3 > & | z, | ||
unsigned int | domain | ||
) |
Adds cutting plane information for given domain i. Currently, only one cutting plane per domain is supported.
Definition at line 136 of file itkPSMEntropyModelFilter.hxx.
|
protectedvirtual |
This method sets up temporary data structures needed for the optimization. It is called during the first run of GenerateData.
Definition at line 80 of file itkPSMEntropyModelFilter.hxx.
|
protectedvirtual |
This method allocates data structures necessary to keep track of image domains and image neighborhoods. It is called during the first run of GenerateData.
Definition at line 107 of file itkPSMEntropyModelFilter.hxx.
|
protectedvirtual |
This method allocates working images needed during the optimization. It is called during the first run of GenerateData.
Definition at line 95 of file itkPSMEntropyModelFilter.hxx.
bool itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::CreateSingleCorrespondence | ( | ) |
Creates a single correspondence point to each domain that is placed at the surface position closest to the upper-left-hand corner of each of the input images.
Definition at line 347 of file itkPSMEntropyModelFilter.hxx.
|
protected |
This method does the work of the optimization.
Definition at line 220 of file itkPSMEntropyModelFilter.hxx.
|
inlineprotected |
Returns a pointer to the ith domain in the domain list.
Definition at line 613 of file itkPSMEntropyModelFilter.h.
|
inlineprotected |
Returns a pointer to the domain that is referenced by the given name
Definition at line 605 of file itkPSMEntropyModelFilter.h.
unsigned int itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::GetDomainIndexByName | ( | const std::string & | name | ) |
Returns the index associated with the given name. Throws an exception if the given name is not found in the domain name list.
Definition at line 168 of file itkPSMEntropyModelFilter.hxx.
|
inline |
Return the number of elapsed iterations of the solver. Note that this number is reset to zero with each call to GenerateData.
Definition at line 274 of file itkPSMEntropyModelFilter.h.
|
inline |
Returns a pointer to the ParticleEntropyFunction. This is the cost function that will maximize positional entropy of particle distributions on shape surfaces. This is the cost function term that ensures good shape representations.
Definition at line 220 of file itkPSMEntropyModelFilter.h.
|
inline |
Returns a vector of the variances associated with the PCA decomposition of the shape space. There will be only number_of_samples - 1 total valid PCA modes. This method simply calls the method of the same name in PSMShapeEntropyFunction. It is included here for convenience.
Definition at line 342 of file itkPSMEntropyModelFilter.h.
|
protected |
This method copies the correspondence point lists provided by SetInputCorrespondencePoints into the initialized particle system. It is called during the first run of GenerateData.
Definition at line 188 of file itkPSMEntropyModelFilter.hxx.
itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::itkGetMacro | ( | Initialized | , |
bool | |||
) |
The Initialized flag indicates whether GenerateData has previously been called and all the necessary temporary data structures have been allocated.
itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::itkGetMacro | ( | Initializing | , |
bool | |||
) |
Get/Set the Initializing flag. When set to true, this flag will prevent GenerateData from starting the optimization. When m_Initializing is true, GenerateData will allocated all data structures and set necessary parameters, but return before running the optimization.
itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::itkGetMacro | ( | ShapeMatrix | , |
ShapeMatrixPointerType | |||
) |
Returns shape matrix. Each column of the shape matrix is a different point-based representation of a shape in the cohort. There are several types of shape matrices, which may be defined differently for subclasses of the PSMEntropyModelFilter class.
itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::itkGetObjectMacro | ( | ParticleSystem | , |
ParticleSystemType | |||
) |
Returns the particle system used in the shape model computation.
itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::itkGetObjectMacro | ( | Optimizer | , |
OptimizerType | |||
) |
Return a pointer to the optimizer object.
itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::itkNewMacro | ( | Self | ) |
Method for creation through the object factory.
|
protected |
The Initialized flag indicates whether GenerateData has previously been called and all the necessary temporary data structures have been allocated.
itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::itkStaticConstMacro | ( | Dimension | , |
unsigned | int, | ||
TImage::ImageDimension | |||
) |
Dimensionality of the domain of the particle system.
itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::itkTypeMacro | ( | PSMEntropyModelFilter< TImage, TShapeMatrix > | , |
InPlaceImageFilter | |||
) |
Run-time type information (and related methods).
|
protected |
A callback method that will be called after each iteration of the Solver.
Definition at line 328 of file itkPSMEntropyModelFilter.hxx.
void itk::PSMEntropyModelFilter< TImage, TShapeMatrix >::SetDomainName | ( | const std::string & | s, |
unsigned int | i | ||
) |
Sets the name of the ith domain. This functionality is only for convenience, but required if you want to lookup a domain index by its name.
Definition at line 156 of file itkPSMEntropyModelFilter.hxx.
|
inline |
Override parent classes to expand input list on new inputs. This filter requires multiple input images. Each input to this filter represents a shape sample. Note that there may be hundreds of inputs to this filter!
Definition at line 132 of file itkPSMEntropyModelFilter.h.
|
inline |
This is a placeholder for a more formalized implementation of a point-based shape model. Set the Nth list of correspondences for the input model. These are the initial correspondence point positions for the Nth input surface (see SetInput).
Definition at line 202 of file itkPSMEntropyModelFilter.h.
|
inline |
Set / Get the maximum number of iterations that the solver is allowed to execute. If set to 0, this parameter is ignored and the solver will iterate until any other convergence criteria are met. A maximum number of iterations must be specified for each scale (second, optional parameter if NumberOfScales > 1).
Definition at line 243 of file itkPSMEntropyModelFilter.h.
|
inline |
The number of scales for the optimization. Starting with the input correspondence points for Scale 0, the algorithm will run a full optimization with the parameters given for that scale (RegularizationInitial, RegularizationFinal, etc.). After optimization at each scale, the particle system size will be doubled by splitting each particle and optimization will proceed at the next scale. If no correspondence points are supplied on the inputs, then the system at Scale 0 will be initialized with a single correspondence point, placed at the surface position closest to the upper-left-hand corner of each of the input images.
If NumberOfScales = 1, then the filter will simply optimize the positions of the input correspondence points. Note that you must supply parameters separately for each scale of the optimization.
Definition at line 166 of file itkPSMEntropyModelFilter.h.
|
inline |
Directly set the regularization. This bypasses all other methods, but will only be valid until the current scale is optimized.
Definition at line 461 of file itkPSMEntropyModelFilter.h.
|
inline |
A regularization constant is added to the diagonal elements of the covariance matrix of the particle positions in shape space during the optimization. It is called "minimum variance" in the PSMShapeEntropyFunction class because it enforces a minimum variance in each of the eigen-modes of the shape space during the optimization. Higher MinimumVariance produces larger gradients, thus allowing shapes to move larger distances in shape space during optimization of positions with this function. Higher MinimumVariance values minimize the effects of smaller modes of variation in the covariance matrix. Conversely, smaller MinimumVariance values increase the significance of the smaller modes of variation on the gradient calculation. The parameters RegularizationInitial, RegularizationFinal, and RegularizationDecaySpan define an "annealing" type optimization, where the minimum variance starts at RegularizationInitial and exponentially decreases over RegularizationDecaySpan to the RegularizationFinal value. If the RegularizationDecaySpan is set to 0, then only RegularizationConstant is used as the MinimumVariance parameter and is held fixed during the optimization.
Definition at line 367 of file itkPSMEntropyModelFilter.h.
|
inline |
This method sets/gets the relative weighting of terms in the two-term cost function used for the optimization. This parameter adjusts the weighting of the shape representation term with respect to the strength of the entropy minimization in shape space. Higher values will favor a more compact representation in shape space and produce less regular samplings of shape surfaces. Default value is an equal weighting between the two terms (1.0).
Definition at line 299 of file itkPSMEntropyModelFilter.h.
|
inline |
Set the tolerance for the optimization, below which the optimization will be considered to have converged. Tolerance is specified as a distance in the implicit surface images. The solver will converge when no pixel has moved more than the specified tolerance in a given iteration. An optional argument specifies the scale to which you want this tolerance applied (see SetNumberOfScales). If NumberOfScales > 1, then you MUST supply a value for each scale.
Definition at line 486 of file itkPSMEntropyModelFilter.h.
|
inline |
Returns a pointer to the ShapeEntropyFunction. This is the cost function that will minimize the entropy of the shape vectors in high-dimensional shape space. This is the cost function term that establishes correspondence across shapes.
Definition at line 229 of file itkPSMEntropyModelFilter.h.