18 #ifndef itkMahalanobisDistanceMetric_h 19 #define itkMahalanobisDistanceMetric_h 21 #include "vnl/vnl_vector.h" 22 #include "vnl/vnl_vector_ref.h" 23 #include "vnl/vnl_transpose.h" 24 #include "vnl/vnl_matrix.h" 25 #include "vnl/algo/vnl_matrix_inverse.h" 26 #include "vnl/algo/vnl_determinant.h" 45 template<
typename TVector >
77 void SetMean(const MeanVectorType & mean);
80 const MeanVectorType &
GetMean() const;
89 itkGetConstReferenceMacro(Covariance, CovarianceMatrixType);
96 itkGetConstReferenceMacro(InverseCovariance, CovarianceMatrixType);
101 double Evaluate(const MeasurementVectorType & measurement) const ITK_OVERRIDE;
104 double Evaluate(const MeasurementVectorType & x1, const MeasurementVectorType & x2) const ITK_OVERRIDE;
107 itkSetMacro(Epsilon,
double);
108 itkGetConstMacro(Epsilon,
double);
111 itkSetMacro(DoubleMax,
double);
112 itkGetConstMacro(DoubleMax,
double);
116 virtual ~MahalanobisDistanceMetric(
void) {}
135 #ifndef ITK_MANUAL_INSTANTIATION 136 #include "itkMahalanobisDistanceMetric.hxx" MahalanobisDistanceMetric Self
Superclass::MeasurementVectorType MeasurementVectorType
SmartPointer< Self > Pointer
SmartPointer< const Self > ConstPointer
Superclass::OriginType MeanVectorType
double Evaluate(const MeasurementVectorType &measurement) const override
DistanceMetric< TVector > Superclass
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
Array< double > OriginType
void SetCovariance(const CovarianceMatrixType &cov)
TVector MeasurementVectorType
this class declares common interfaces for distance functions.
void PrintSelf(std::ostream &os, Indent indent) const override
const MeanVectorType & GetMean() const
CovarianceMatrixType m_InverseCovariance
CovarianceMatrixType m_Covariance
void CalculateInverseCovariance()
virtual void SetMeasurementVectorSize(MeasurementVectorSizeType) override
void SetInverseCovariance(const CovarianceMatrixType &invcov)
void SetMean(const MeanVectorType &mean)
Control indentation during Print() invocation.
Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
MahalanobisDistanceMetric class computes a Mahalanobis distance given a mean and covariance.
vnl_matrix< double > CovarianceMatrixType
unsigned int MeasurementVectorSizeType