Shapeworks Studio  2.1
Shape analysis software suite
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
itk::PSMCostFunction< VDimension > Class Template Referenceabstract

#include <itkPSMCostFunction.h>

+ Inheritance diagram for itk::PSMCostFunction< VDimension >:
+ Collaboration diagram for itk::PSMCostFunction< VDimension >:

Public Types

typedef PSMCostFunction Self
 
typedef SmartPointer< SelfPointer
 
typedef SmartPointer< const SelfConstPointer
 
typedef LightObject Superclass
 
typedef PSMParticleSystem< VDimension > ParticleSystemType
 
typedef vnl_vector_fixed< double, VDimension > VectorType
 

Public Member Functions

 itkTypeMacro (PSMCostFunction, LightObject)
 
 itkStaticConstMacro (Dimension, unsigned int, VDimension)
 
virtual VectorType Evaluate (unsigned int, unsigned int, const ParticleSystemType *, double &maxtimestep) const =0
 
virtual VectorType Evaluate (unsigned int, unsigned int, const ParticleSystemType *, double &maxtimestep, double &energy) const =0
 
virtual double Energy (unsigned int, unsigned int, const ParticleSystemType *) const =0
 
virtual void ResetBuffers ()
 
virtual void AfterIteration ()
 
virtual void BeforeIteration ()
 
virtual void BeforeEvaluate (unsigned int, unsigned int, const ParticleSystemType *)
 
virtual void SetParticleSystem (ParticleSystemType *p)
 
virtual ParticleSystemTypeGetParticleSystem () const
 
virtual void SetDomainNumber (unsigned int i)
 
virtual int GetDomainNumber () const
 

Protected Member Functions

void operator= (const PSMCostFunction &)
 
 PSMCostFunction (const PSMCostFunction &)
 

Protected Attributes

ParticleSystemTypem_ParticleSystem
 
unsigned int m_DomainNumber
 

Detailed Description

template<unsigned int VDimension>
class itk::PSMCostFunction< VDimension >

This class defines the base API for functions in the PSM optimization framework. These are functions that take a particle system, a particle system domain, and a location index as arguments and return a vector-valued result. Subclasses of these functions are used as metrics in optimizations of the positions of particles in a particle system (PSMParticleSystem).

A unique feature of these function objects is that they implement several methods specific to the PSM optimizer framework, including a BeforeIteration and AfterIteration method, which may be used to apply constraints to gradients, such as constraining particles to lie on surfaces.

Author
Josh Cates

Definition at line 52 of file itkPSMCostFunction.h.

Member Typedef Documentation

template<unsigned int VDimension>
typedef PSMParticleSystem<VDimension> itk::PSMCostFunction< VDimension >::ParticleSystemType

Type of particle system.

Definition at line 63 of file itkPSMCostFunction.h.

template<unsigned int VDimension>
typedef PSMCostFunction itk::PSMCostFunction< VDimension >::Self

Standard class typedefs.

Definition at line 56 of file itkPSMCostFunction.h.

template<unsigned int VDimension>
typedef vnl_vector_fixed<double, VDimension> itk::PSMCostFunction< VDimension >::VectorType

Type of vectors.

Definition at line 66 of file itkPSMCostFunction.h.

Member Function Documentation

template<unsigned int VDimension>
virtual void itk::PSMCostFunction< VDimension >::AfterIteration ( )
inlinevirtual

This method is called by a solver after each iteration. Subclasses may or may not implement this method.

Reimplemented in itk::PSMShapeEntropyFunction< VDimension >, itk::PSMShapeEntropyFunction< Dimension >, itk::PSMTwoCostFunction< VDimension >, itk::PSMTwoCostFunction< Dimension >, itk::TestCostFunction< VDimension >, and itk::TestTwoCostFunction< VDimension >.

Definition at line 91 of file itkPSMCostFunction.h.

91 { }
template<unsigned int VDimension>
virtual void itk::PSMCostFunction< VDimension >::BeforeEvaluate ( unsigned int  ,
unsigned int  ,
const ParticleSystemType  
)
inlinevirtual

This method may be called to set up the state of the function object before a call to Evaluate. It is necessary in order to initialize certain constants and variables that may be used for calculating the Energy as well as the Gradients. Typically this is only necessary for the adaptive gradient descent algorithm.

Reimplemented in itk::PSMTwoCostFunction< VDimension >, and itk::PSMTwoCostFunction< Dimension >.

Definition at line 102 of file itkPSMCostFunction.h.

102 {}
template<unsigned int VDimension>
virtual void itk::PSMCostFunction< VDimension >::BeforeIteration ( )
inlinevirtual

This method is called by a solver before each iteration. Subclasses may or may not implement this method.

Reimplemented in itk::PSMShapeEntropyFunction< VDimension >, itk::PSMShapeEntropyFunction< Dimension >, itk::PSMTwoCostFunction< VDimension >, itk::PSMTwoCostFunction< Dimension >, itk::TestCostFunction< VDimension >, and itk::TestTwoCostFunction< VDimension >.

Definition at line 95 of file itkPSMCostFunction.h.

95 {}
template<unsigned int VDimension>
virtual VectorType itk::PSMCostFunction< VDimension >::Evaluate ( unsigned  int,
unsigned  int,
const ParticleSystemType ,
double &  maxtimestep 
) const
pure virtual

Evaluate returns the vector-valued result of the function. The first argument is a pointer to the particle system. The second argument is the index of the domain within that particle system. The third argument is the index of the particle location within the given domain.

Implemented in itk::PSMParticleEntropyFunction< TGradientNumericType, VDimension >, itk::PSMParticleEntropyFunction< typename TImage::PixelType, Dimension >, itk::PSMParticleEntropyFunction< typename ImageType::PixelType, Dimension >, itk::PSMShapeEntropyFunction< VDimension >, itk::PSMShapeEntropyFunction< Dimension >, itk::PSMTwoCostFunction< VDimension >, itk::PSMTwoCostFunction< Dimension >, itk::TestCostFunction< VDimension >, and itk::TestTwoCostFunction< VDimension >.

template<unsigned int VDimension>
itk::PSMCostFunction< VDimension >::itkStaticConstMacro ( Dimension  ,
unsigned  int,
VDimension   
)

Method for object allocation through the factory. Dimensionality of the domain of the particle system.

template<unsigned int VDimension>
virtual void itk::PSMCostFunction< VDimension >::ResetBuffers ( )
inlinevirtual
template<unsigned int VDimension>
virtual void itk::PSMCostFunction< VDimension >::SetParticleSystem ( ParticleSystemType p)
inlinevirtual

Some subclasses may require a pointer to the particle system and its domain number. These methods set/get those values.

Reimplemented in itk::PSMTwoCostFunction< VDimension >, and itk::PSMTwoCostFunction< Dimension >.

Definition at line 106 of file itkPSMCostFunction.h.

107  { m_ParticleSystem = p; }

The documentation for this class was generated from the following file: