14 #ifndef __itkStatisticalShapePointPenalty_h
15 #define __itkStatisticalShapePointPenalty_h
20 #include "itkPointSet.h"
23 #include <itkVariableSizeMatrix.h>
25 #include <vnl/vnl_matrix.h>
26 #include <vnl/vnl_math.h>
27 #include <vnl/vnl_vector.h>
28 #include <vnl/algo/vnl_real_eigensystem.h>
29 #include <vnl/algo/vnl_symmetric_eigensystem.h>
31 #include <vnl/algo/vnl_svd_economy.h>
33 #include <vcl_iostream.h>
52 template<
class TFixedPo
intSet,
class TMovingPo
intSet >
102 void Initialize(
void ) throw ( ExceptionObject );
116 itkSetClampMacro( ShrinkageIntensity,
MeasureType, 0.0, 1.0 );
117 itkGetMacro( ShrinkageIntensity, MeasureType );
119 itkSetMacro( ShrinkageIntensityNeedsUpdate,
bool );
120 itkBooleanMacro( ShrinkageIntensityNeedsUpdate );
123 itkSetClampMacro( BaseVariance, MeasureType,
124 -1.0, NumericTraits< MeasureType >::
max() );
125 itkGetMacro( BaseVariance, MeasureType );
127 itkSetMacro( BaseVarianceNeedsUpdate,
bool );
128 itkBooleanMacro( BaseVarianceNeedsUpdate );
130 itkSetClampMacro( CentroidXVariance, MeasureType,
131 -1.0, NumericTraits< MeasureType >::max() );
132 itkGetMacro( CentroidXVariance, MeasureType );
134 itkSetClampMacro( CentroidYVariance, MeasureType,
135 -1.0, NumericTraits< MeasureType >::max() );
136 itkGetMacro( CentroidYVariance, MeasureType );
138 itkSetClampMacro( CentroidZVariance, MeasureType,
139 -1.0, NumericTraits< MeasureType >::max() );
140 itkGetMacro( CentroidZVariance, MeasureType );
142 itkSetClampMacro( SizeVariance, MeasureType,
143 -1.0, NumericTraits< MeasureType >::max() );
144 itkGetMacro( SizeVariance, MeasureType );
146 itkSetMacro( VariancesNeedsUpdate,
bool );
147 itkBooleanMacro( VariancesNeedsUpdate );
149 itkSetClampMacro( CutOffValue, MeasureType,
150 0.0, NumericTraits< MeasureType >::max() );
151 itkGetMacro( CutOffValue, MeasureType );
153 itkSetClampMacro( CutOffSharpness, MeasureType,
154 NumericTraits< MeasureType >::NonpositiveMin(), NumericTraits< MeasureType >::max() );
155 itkGetMacro( CutOffSharpness, MeasureType );
157 itkSetMacro( ShapeModelCalculation,
int );
158 itkGetConstReferenceMacro( ShapeModelCalculation,
int );
160 itkSetMacro( NormalizedShapeModel,
bool );
161 itkGetConstReferenceMacro( NormalizedShapeModel,
bool );
162 itkBooleanMacro( NormalizedShapeModel );
164 itkSetConstObjectMacro( EigenVectors, vnl_matrix<
double > );
165 itkSetConstObjectMacro( EigenValues, vnl_vector<
double > );
166 itkSetConstObjectMacro( MeanVector, vnl_vector<
double > );
168 itkSetConstObjectMacro( CovarianceMatrix, vnl_matrix<
double > );
173 virtual ~StatisticalShapePointPenalty();
176 void PrintSelf( std::ostream & os, Indent indent ) const;
180 StatisticalShapePointPenalty( const
Self & );
181 void operator=( const Self & );
184 const
unsigned int vertexindex ) const;
187 const
unsigned int vertexindex ) const;
190 const
unsigned int shapeLength ) const;
193 const
unsigned int shapeLength ) const;
195 void UpdateL2( const
unsigned int shapeLength ) const;
206 const
VnlVectorType & eigrot, const
unsigned int shapeLength ) const;
212 const MeasureType &value ) const;
253 #ifndef ITK_MANUAL_INSTANTIATION
254 #include "itkStatisticalShapePointPenalty.hxx"
Superclass::DerivativeType DerivativeType
bool m_BaseVarianceNeedsUpdate
Superclass::PointIterator PointIterator
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
bool m_VariancesNeedsUpdate
Superclass::TransformJacobianType TransformJacobianType
Superclass::InputPointType InputPointType
StatisticalShapePointPenalty Self
const VnlVectorType * m_EigenValues
void CalculateCutOffDerivative(typename DerivativeType::element_type &derivativeElement, const MeasureType &value) const
TransformType::Pointer TransformPointer
Computes the Mahalanobis distance between the transformed shape and a mean shape. A model mean and co...
Superclass::TransformType TransformType
Superclass::MeasureType MeasureType
void UpdateCentroidAndAlignProposalDerivative(const unsigned int shapeLength) const
const VnlMatrixType * m_EigenVectors
VnlVectorType * m_EigenValuesRegularized
void CalculateDerivative(DerivativeType &derivative, const MeasureType &value, const VnlVectorType &differenceVector, const VnlVectorType ¢errotated, const VnlVectorType &eigrot, const unsigned int shapeLength) const
Superclass::OutputPointType OutputPointType
TransformType::ParametersType TransformParametersType
const VnlVectorType * m_MeanVector
FixedPointSetType::PointsContainer::ConstIterator PointIterator
TransformType::OutputPointType OutputPointType
std::vector< VnlVectorType * > ProposalDerivativeType
SmartPointer< Self > Pointer
TransformType::InputPointType InputPointType
Superclass::FixedPointSetType FixedPointSetType
void FillProposalDerivative(const OutputPointType &fixedPoint, const unsigned int vertexindex) const
void CalculateCutOffValue(MeasureType &value) const
void FillProposalVector(const OutputPointType &fixedPoint, const unsigned int vertexindex) const
double m_ShrinkageIntensity
bool m_NormalizedShapeModel
OutputPointType::CoordRepType CoordRepType
void UpdateL2AndNormalizeProposalDerivative(const unsigned int shapeLength) const
MeasureType GetValue(const TransformParametersType ¶meters) const
ProposalDerivativeType * m_ProposalDerivative
void CalculateValue(MeasureType &value, VnlVectorType &differenceVector, VnlVectorType ¢errotated, VnlVectorType &eigrot) const
MovingPointSetType::ConstPointer MovingPointSetConstPointer
TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
void UpdateL2(const unsigned int shapeLength) const
Superclass::MovingPointSetType MovingPointSetType
SingleValuedPointSetToPointSetMetric< TFixedPointSet, TMovingPointSet > Superclass
int m_ShapeModelCalculation
Superclass::MeasureType MeasureType
FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator
double m_CentroidYVariance
void UpdateCentroidAndAlignProposalVector(const unsigned int shapeLength) const
vnl_svd_economy< CoordRepType > PCACovarianceType
VnlMatrixType * m_InverseCovarianceMatrix
FixedPointSetType::ConstPointer FixedPointSetConstPointer
void PrintSelf(std::ostream &os, Indent indent) const
double m_CentroidZVariance
vnl_vector< CoordRepType > VnlVectorType
TFixedPointSet FixedPointSetType
Superclass::TransformPointer TransformPointer
void GetDerivative(const TransformParametersType ¶meters, DerivativeType &Derivative) const
Computes similarity between two point sets.
Superclass::MovingPointSetConstPointer MovingPointSetConstPointer
DerivativeType::ValueType DerivativeValueType
double m_CentroidXVariance
const VnlMatrixType * m_CovarianceMatrix
Superclass::DerivativeType DerivativeType
VnlVectorType m_MeanValues
vnl_matrix< CoordRepType > VnlMatrixType
TMovingPointSet MovingPointSetType
void NormalizeProposalVector(const unsigned int shapeLength) const
Superclass::DerivativeValueType DerivativeValueType
Superclass::TransformParametersType TransformParametersType
Superclass::PointDataIterator PointDataIterator
Superclass::FixedPointSetConstPointer FixedPointSetConstPointer
VnlVectorType m_ProposalVector
bool m_ShrinkageIntensityNeedsUpdate
unsigned int m_ProposalLength
AdvancedTransform< CoordinateRepresentationType, itkGetStaticConstMacro(FixedPointSetDimension), itkGetStaticConstMacro(MovingPointSetDimension) > TransformType
TransformType::JacobianType TransformJacobianType
void GetValueAndDerivative(const TransformParametersType ¶meters, MeasureType &Value, DerivativeType &Derivative) const
SmartPointer< const Self > ConstPointer