ITK  4.13.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
itk::Statistics::MahalanobisDistanceMembershipFunction< TVector > Class Template Reference

#include <itkMahalanobisDistanceMembershipFunction.h>

+ Inheritance diagram for itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >:
+ Collaboration diagram for itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >:

Detailed Description

template<typename TVector>
class itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >

MahalanobisDistanceMembershipFunction models class membership using Mahalanobis distance.

MahalanobisDistanceMembershipFunction is a subclass of MembershipFunctionBase that models class membership (or likelihood) using the Mahalanobis distance. The mean and covariance structure of the Mahalanobis distance are established using the methods SetMean() and SetCovariance(). The mean is a vector-type that is the same vector-type as the measurement vector but guaranteed to have a real element type. For instance, if the measurement type is an Vector<int,3>, then the mean is Vector<double,3>. If the measurement type is a VariableLengthVector<float>, then the mean is VariableLengthVector<double>. In contrast to this behavior, the covariance is always a VariableSizeMatrix<double>.

Note that this membership function does not return a probability density function in contrast to the GaussianMembershipFunction.

Note, as is the case in other packages (MATLAB, R), the value returned by this membership function is the squared distance.

If the covariance is singular or nearly singular, the membership function behaves somewhat like (the opposite of) an impulse located at the mean. In this case, we specify the covariance to be a diagonal matrix with large values along the diagonal. This membership function, therefore, will return large but differentiable values everywhere and decay to zero sharply near the mean.

Definition at line 62 of file itkMahalanobisDistanceMembershipFunction.h.

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef VariableSizeMatrix
< double > 
CovarianceMatrixType
 
typedef MeasurementVectorRealType MeanVectorType
 
typedef itk::NumericTraits
< MeasurementVectorType >
::RealType 
MeasurementVectorRealType
 
typedef
Superclass::MeasurementVectorSizeType 
MeasurementVectorSizeType
 
typedef TVector MeasurementVectorType
 
typedef Superclass::Pointer MembershipFunctionPointer
 
typedef SmartPointer< SelfPointer
 
typedef
MahalanobisDistanceMembershipFunction 
Self
 
typedef MembershipFunctionBase
< TVector > 
Superclass
 
- Public Types inherited from itk::Statistics::MembershipFunctionBase< TVector >
typedef SmartPointer< const SelfConstPointer
 
typedef unsigned int MeasurementVectorSizeType
 
typedef TVector MeasurementVectorType
 
typedef SmartPointer< SelfPointer
 
typedef MembershipFunctionBase Self
 
typedef FunctionBase< TVector,
double > 
Superclass
 
- Public Types inherited from itk::FunctionBase< TVector, double >
typedef SmartPointer< const SelfConstPointer
 
typedef TVector InputType
 
typedef double OutputType
 
typedef SmartPointer< SelfPointer
 
typedef FunctionBase Self
 
typedef Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

double Evaluate (const MeasurementVectorType &measurement) const override
 
virtual const
CovarianceMatrixType
GetCovariance () const
 
virtual const MeanVectorTypeGetMean () const
 
virtual LightObject::Pointer InternalClone () const override
 
void SetCovariance (const CovarianceMatrixType &cov)
 
void SetMean (const MeanVectorType &mean)
 
- Public Member Functions inherited from itk::Statistics::MembershipFunctionBase< TVector >
virtual MeasurementVectorSizeType GetMeasurementVectorSize () const
 
virtual void SetMeasurementVectorSize (MeasurementVectorSizeType s)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Protected Member Functions

 MahalanobisDistanceMembershipFunction ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual ~MahalanobisDistanceMembershipFunction () override
 
- Protected Member Functions inherited from itk::Statistics::MembershipFunctionBase< TVector >
 MembershipFunctionBase ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual ~MembershipFunctionBase (void) override
 
- Protected Member Functions inherited from itk::FunctionBase< TVector, double >
 FunctionBase ()
 
 ~FunctionBase () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Attributes

CovarianceMatrixType m_Covariance
 
bool m_CovarianceNonsingular
 
CovarianceMatrixType m_InverseCovariance
 
MeanVectorType m_Mean
 
virtual const char * GetNameOfClass () const
 
virtual ::itk::LightObject::Pointer CreateAnother () const
 
static Pointer New ()
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Member Typedef Documentation

template<typename TVector >
typedef SmartPointer< const Self > itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::ConstPointer

Definition at line 70 of file itkMahalanobisDistanceMembershipFunction.h.

template<typename TVector >
typedef VariableSizeMatrix< double > itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::CovarianceMatrixType

Type of the covariance matrix

Definition at line 92 of file itkMahalanobisDistanceMembershipFunction.h.

Definition at line 89 of file itkMahalanobisDistanceMembershipFunction.h.

Type of the mean vector. RealType on a vector-type is the same vector-type but with a real element type.

Definition at line 88 of file itkMahalanobisDistanceMembershipFunction.h.

template<typename TVector >
typedef Superclass::MeasurementVectorSizeType itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::MeasurementVectorSizeType

Typedef to represent the length of measurement vectors

Definition at line 84 of file itkMahalanobisDistanceMembershipFunction.h.

template<typename TVector >
typedef TVector itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::MeasurementVectorType

Typedef alias for the measurement vectors

Definition at line 81 of file itkMahalanobisDistanceMembershipFunction.h.

SmartPointer class for superclass

Definition at line 74 of file itkMahalanobisDistanceMembershipFunction.h.

template<typename TVector >
typedef SmartPointer< Self > itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::Pointer

Definition at line 69 of file itkMahalanobisDistanceMembershipFunction.h.

Standard class typedefs

Definition at line 67 of file itkMahalanobisDistanceMembershipFunction.h.

template<typename TVector >
typedef MembershipFunctionBase< TVector > itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::Superclass

Definition at line 68 of file itkMahalanobisDistanceMembershipFunction.h.

Constructor & Destructor Documentation

template<typename TVector >
virtual itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::~MahalanobisDistanceMembershipFunction ( )
inlineoverrideprotectedvirtual

Definition at line 125 of file itkMahalanobisDistanceMembershipFunction.h.

Member Function Documentation

template<typename TVector >
virtual::itk::LightObject::Pointer itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::CreateAnother ( ) const
virtual

Strandard macros

Reimplemented from itk::Object.

template<typename TVector >
double itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::Evaluate ( const MeasurementVectorType measurement) const
overridevirtual

Evaluate the Mahalanobis distance of a measurement using the prescribed mean and covariance. Note that the Mahalanobis distance is not a probability density. The square of the distance is returned.

Implements itk::Statistics::MembershipFunctionBase< TVector >.

template<typename TVector >
virtual const CovarianceMatrixType& itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::GetCovariance ( ) const
virtual

Get the covariance matrix. Covariance matrix is a VariableSizeMatrix of doubles.

template<typename TVector >
virtual const MeanVectorType& itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::GetMean ( ) const
virtual

Get the mean of the Mahalanobis distance. Mean is a vector type similar to the measurement type but with a real element type.

template<typename TVector >
virtual const char* itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::GetNameOfClass ( ) const
virtual

Strandard macros

Reimplemented from itk::Statistics::MembershipFunctionBase< TVector >.

template<typename TVector >
virtual LightObject::Pointer itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::InternalClone ( ) const
overridevirtual

Method to clone a membership function, i.e. create a new instance of the same type of membership function and configure its ivars to match.

Reimplemented from itk::LightObject.

template<typename TVector >
static Pointer itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::New ( )
static

Strandard macros

template<typename TVector >
void itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::Object.

template<typename TVector >
void itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::SetCovariance ( const CovarianceMatrixType cov)

Set the covariance matrix. Covariance matrix is a VariableSizeMatrix of doubles. The inverse of the covariance matrix is calculated whenever the covaraince matrix is changed.

template<typename TVector >
void itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::SetMean ( const MeanVectorType mean)

Set the mean used in the Mahalanobis distance. Mean is a vector type similar to the measurement type but with a real element type.

Member Data Documentation

template<typename TVector >
CovarianceMatrixType itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::m_Covariance
private

Definition at line 130 of file itkMahalanobisDistanceMembershipFunction.h.

template<typename TVector >
bool itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::m_CovarianceNonsingular
private

Boolean to cache whether the covarinace is singular or nearly singular

Definition at line 137 of file itkMahalanobisDistanceMembershipFunction.h.

template<typename TVector >
CovarianceMatrixType itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::m_InverseCovariance
private

Definition at line 134 of file itkMahalanobisDistanceMembershipFunction.h.

template<typename TVector >
MeanVectorType itk::Statistics::MahalanobisDistanceMembershipFunction< TVector >::m_Mean
private

Definition at line 129 of file itkMahalanobisDistanceMembershipFunction.h.


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