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 > );
172 itkSetConstObjectMacro( CovarianceMatrix, vnl_matrix< double > );
180 void PrintSelf( std::ostream & os, Indent indent )
const;
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
void operator=(const Self &)
Superclass::InputPointType InputPointType
MeasureType GetValue(const TransformParametersType ¶meters) const
void CalculateCutOffValue(MeasureType &value) const
StatisticalShapePointPenalty Self
const VnlVectorType * m_EigenValues
TransformType::Pointer TransformPointer
virtual ~StatisticalShapePointPenalty()
Computes the Mahalanobis distance between the transformed shape and a mean shape. A model mean and co...
Superclass::TransformType TransformType
Superclass::MeasureType MeasureType
const VnlMatrixType * m_EigenVectors
VnlVectorType * m_EigenValuesRegularized
Superclass::OutputPointType OutputPointType
TransformType::ParametersType TransformParametersType
void UpdateL2(const unsigned int shapeLength) const
const VnlVectorType * m_MeanVector
FixedPointSetType::PointsContainer::ConstIterator PointIterator
TransformType::OutputPointType OutputPointType
std::vector< VnlVectorType *> ProposalDerivativeType
SmartPointer< Self > Pointer
TransformType::InputPointType InputPointType
void NormalizeProposalVector(const unsigned int shapeLength) const
void UpdateCentroidAndAlignProposalVector(const unsigned int shapeLength) const
Superclass::FixedPointSetType FixedPointSetType
double m_ShrinkageIntensity
void CalculateDerivative(DerivativeType &derivative, const MeasureType &value, const VnlVectorType &differenceVector, const VnlVectorType ¢errotated, const VnlVectorType &eigrot, const unsigned int shapeLength) const
bool m_NormalizedShapeModel
OutputPointType::CoordRepType CoordRepType
void FillProposalVector(const OutputPointType &fixedPoint, const unsigned int vertexindex) const
ProposalDerivativeType * m_ProposalDerivative
MovingPointSetType::ConstPointer MovingPointSetConstPointer
void FillProposalDerivative(const OutputPointType &fixedPoint, const unsigned int vertexindex) const
void UpdateCentroidAndAlignProposalDerivative(const unsigned int shapeLength) const
TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
void GetValueAndDerivative(const TransformParametersType ¶meters, MeasureType &Value, DerivativeType &Derivative) const
Superclass::MovingPointSetType MovingPointSetType
SingleValuedPointSetToPointSetMetric< TFixedPointSet, TMovingPointSet > Superclass
int m_ShapeModelCalculation
Superclass::MeasureType MeasureType
FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator
double m_CentroidYVariance
vnl_svd_economy< CoordRepType > PCACovarianceType
void PrintSelf(std::ostream &os, Indent indent) const
VnlMatrixType * m_InverseCovarianceMatrix
FixedPointSetType::ConstPointer FixedPointSetConstPointer
double m_CentroidZVariance
vnl_vector< CoordRepType > VnlVectorType
TFixedPointSet FixedPointSetType
Superclass::TransformPointer TransformPointer
Computes similarity between two point sets.
Superclass::MovingPointSetConstPointer MovingPointSetConstPointer
void CalculateCutOffDerivative(typename DerivativeType::element_type &derivativeElement, const MeasureType &value) const
DerivativeType::ValueType DerivativeValueType
double m_CentroidXVariance
const VnlMatrixType * m_CovarianceMatrix
void GetDerivative(const TransformParametersType ¶meters, DerivativeType &Derivative) const
Superclass::DerivativeType DerivativeType
VnlVectorType m_MeanValues
vnl_matrix< CoordRepType > VnlMatrixType
StatisticalShapePointPenalty()
TMovingPointSet MovingPointSetType
Superclass::DerivativeValueType DerivativeValueType
void UpdateL2AndNormalizeProposalDerivative(const unsigned int shapeLength) const
Superclass::TransformParametersType TransformParametersType
Superclass::PointDataIterator PointDataIterator
Superclass::FixedPointSetConstPointer FixedPointSetConstPointer
VnlVectorType m_ProposalVector
bool m_ShrinkageIntensityNeedsUpdate
unsigned int m_ProposalLength
void CalculateValue(MeasureType &value, VnlVectorType &differenceVector, VnlVectorType ¢errotated, VnlVectorType &eigrot) const
AdvancedTransform< CoordinateRepresentationType, itkGetStaticConstMacro(FixedPointSetDimension), itkGetStaticConstMacro(MovingPointSetDimension) > TransformType
TransformType::JacobianType TransformJacobianType
SmartPointer< const Self > ConstPointer