18 #ifndef __itkStatisticalShapePointPenalty_h 19 #define __itkStatisticalShapePointPenalty_h 24 #include "itkPointSet.h" 27 #include <itkVariableSizeMatrix.h> 29 #include <vnl/vnl_matrix.h> 30 #include <vnl/vnl_math.h> 31 #include <vnl/vnl_vector.h> 32 #include <vnl/algo/vnl_real_eigensystem.h> 33 #include <vnl/algo/vnl_symmetric_eigensystem.h> 35 #include <vnl/algo/vnl_svd_economy.h> 37 #include <vcl_iostream.h> 56 template<
class TFixedPo
intSet,
class TMovingPo
intSet >
106 void Initialize(
void ) throw ( ExceptionObject );
109 MeasureType
GetValue( const TransformParametersType & parameters ) const;
112 void GetDerivative( const TransformParametersType & parameters,
113 DerivativeType & Derivative ) const;
117 MeasureType & Value, DerivativeType & Derivative ) const;
120 itkSetClampMacro( ShrinkageIntensity, MeasureType, 0.0, 1.0 );
121 itkGetMacro( ShrinkageIntensity, MeasureType );
123 itkSetMacro( ShrinkageIntensityNeedsUpdate,
bool );
124 itkBooleanMacro( ShrinkageIntensityNeedsUpdate );
127 itkSetClampMacro( BaseVariance, MeasureType,
128 -1.0, NumericTraits< MeasureType >::
max() );
129 itkGetMacro( BaseVariance, MeasureType );
131 itkSetMacro( BaseVarianceNeedsUpdate,
bool );
132 itkBooleanMacro( BaseVarianceNeedsUpdate );
134 itkSetClampMacro( CentroidXVariance, MeasureType,
135 -1.0, NumericTraits< MeasureType >::max() );
136 itkGetMacro( CentroidXVariance, MeasureType );
138 itkSetClampMacro( CentroidYVariance, MeasureType,
139 -1.0, NumericTraits< MeasureType >::max() );
140 itkGetMacro( CentroidYVariance, MeasureType );
142 itkSetClampMacro( CentroidZVariance, MeasureType,
143 -1.0, NumericTraits< MeasureType >::max() );
144 itkGetMacro( CentroidZVariance, MeasureType );
146 itkSetClampMacro( SizeVariance, MeasureType,
147 -1.0, NumericTraits< MeasureType >::max() );
148 itkGetMacro( SizeVariance, MeasureType );
150 itkSetMacro( VariancesNeedsUpdate,
bool );
151 itkBooleanMacro( VariancesNeedsUpdate );
153 itkSetClampMacro( CutOffValue, MeasureType,
154 0.0, NumericTraits< MeasureType >::max() );
155 itkGetMacro( CutOffValue, MeasureType );
157 itkSetClampMacro( CutOffSharpness, MeasureType,
158 NumericTraits< MeasureType >::NonpositiveMin(), NumericTraits< MeasureType >::max() );
159 itkGetMacro( CutOffSharpness, MeasureType );
161 itkSetMacro( ShapeModelCalculation,
int );
162 itkGetConstReferenceMacro( ShapeModelCalculation,
int );
164 itkSetMacro( NormalizedShapeModel,
bool );
165 itkGetConstReferenceMacro( NormalizedShapeModel,
bool );
166 itkBooleanMacro( NormalizedShapeModel );
168 itkSetConstObjectMacro( EigenVectors, vnl_matrix<
double > );
169 itkSetConstObjectMacro( EigenValues, vnl_vector<
double > );
170 itkSetConstObjectMacro( MeanVector, vnl_vector<
double > );
172 itkSetConstObjectMacro( CovarianceMatrix, vnl_matrix<
double > );
177 virtual ~StatisticalShapePointPenalty();
180 void PrintSelf(
std::ostream & os, Indent indent ) const;
184 StatisticalShapePointPenalty( const Self & );
185 void operator=( const Self & );
188 const
unsigned int vertexindex ) const;
191 const
unsigned int vertexindex ) const;
194 const
unsigned int shapeLength ) const;
197 const
unsigned int shapeLength ) const;
199 void UpdateL2( const
unsigned int shapeLength ) const;
205 void CalculateValue( MeasureType & value, VnlVectorType & differenceVector,
206 VnlVectorType & centerrotated, VnlVectorType & eigrot ) const;
209 const VnlVectorType & differenceVector, const VnlVectorType & centerrotated,
210 const VnlVectorType & eigrot, const
unsigned int shapeLength ) const;
215 typename DerivativeType::element_type & derivativeElement,
216 const MeasureType &value ) const;
257 #ifndef ITK_MANUAL_INSTANTIATION 258 #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