ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
itk::Statistics::DistanceMetric< TVector > Class Template Referenceabstract

#include <itkDistanceMetric.h>

Detailed Description

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

this class declares common interfaces for distance functions.

As a function derived from FunctionBase, users use Evaluate method to get result.

To use this function users should first set the origin by calling SetOrigin() function, then call Evaluate() method with a point to get the distance between the origin point and the evaluation point.

See also
EuclideanSquareDistanceMetric
EuclideanDistanceMetric
ManhattanDistanceMetric

Definition at line 48 of file itkDistanceMetric.h.

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

Public Types

using ConstPointer = SmartPointer< const Self >
 
using MeasurementVectorSizeType = unsigned int
 
using MeasurementVectorType = TVector
 
using OriginType = Array< double >
 
using Pointer = SmartPointer< Self >
 
using Self = DistanceMetric
 
using Superclass = FunctionBase< TVector, double >
 
- Public Types inherited from itk::FunctionBase< TVector, double >
using ConstPointer = SmartPointer< const Self >
 
using InputType = TVector
 
using OutputType = double
 
using Pointer = SmartPointer< Self >
 
using Self = FunctionBase
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

double Evaluate (const MeasurementVectorType &x) const override=0
 
virtual double Evaluate (const MeasurementVectorType &x1, const MeasurementVectorType &x2) const =0
 
virtual MeasurementVectorSizeType GetMeasurementVectorSize () const
 
const char * GetNameOfClass () const override
 
virtual const OriginTypeGetOrigin () const
 
void SetOrigin (const OriginType &x)
 
virtual void SetMeasurementVectorSize (MeasurementVectorSizeType s)
 
- Public Member Functions inherited from itk::FunctionBase< TVector, double >
const char * GetNameOfClass () const override
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *cmd) const
 
unsigned long AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const
 
LightObject::Pointer CreateAnother () const override
 
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
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag) const
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
void Print (std::ostream &os, Indent indent=0) const
 

Protected Member Functions

 DistanceMetric ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~DistanceMetric () override=default
 
- Protected Member Functions inherited from itk::FunctionBase< TVector, double >
 FunctionBase ()=default
 
 ~FunctionBase () override=default
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
 ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Attributes

MeasurementVectorSizeType m_MeasurementVectorSize {}
 
OriginType m_Origin {}
 

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 val)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

Member Typedef Documentation

◆ ConstPointer

template<typename TVector>
using itk::Statistics::DistanceMetric< TVector >::ConstPointer = SmartPointer<const Self>

Definition at line 55 of file itkDistanceMetric.h.

◆ MeasurementVectorSizeType

template<typename TVector>
using itk::Statistics::DistanceMetric< TVector >::MeasurementVectorSizeType = unsigned int

declare Measurement vector component type Type used to represent the number of components oft he MeasurementVectorType

Definition at line 64 of file itkDistanceMetric.h.

◆ MeasurementVectorType

template<typename TVector>
using itk::Statistics::DistanceMetric< TVector >::MeasurementVectorType = TVector

declare the MeasurementVector type

Definition at line 58 of file itkDistanceMetric.h.

◆ OriginType

template<typename TVector>
using itk::Statistics::DistanceMetric< TVector >::OriginType = Array<double>

Definition at line 69 of file itkDistanceMetric.h.

◆ Pointer

template<typename TVector>
using itk::Statistics::DistanceMetric< TVector >::Pointer = SmartPointer<Self>

Definition at line 54 of file itkDistanceMetric.h.

◆ Self

template<typename TVector>
using itk::Statistics::DistanceMetric< TVector >::Self = DistanceMetric

Standard type alias

Definition at line 52 of file itkDistanceMetric.h.

◆ Superclass

template<typename TVector>
using itk::Statistics::DistanceMetric< TVector >::Superclass = FunctionBase<TVector, double>

Definition at line 53 of file itkDistanceMetric.h.

Constructor & Destructor Documentation

◆ DistanceMetric()

template<typename TVector>
itk::Statistics::DistanceMetric< TVector >::DistanceMetric ( )
protected

◆ ~DistanceMetric()

template<typename TVector>
itk::Statistics::DistanceMetric< TVector >::~DistanceMetric ( )
overrideprotecteddefault

Member Function Documentation

◆ Evaluate() [1/2]

template<typename TVector>
double itk::Statistics::DistanceMetric< TVector >::Evaluate ( const MeasurementVectorType x) const
overridepure virtual

◆ Evaluate() [2/2]

template<typename TVector>
virtual double itk::Statistics::DistanceMetric< TVector >::Evaluate ( const MeasurementVectorType x1,
const MeasurementVectorType x2 
) const
pure virtual

Gets the distance between x1 and x2. This method is used by KdTreeKMeans estimators. When the estimator is refactored, this method should be removed. Distance between two measurement vectors can be computed by setting one of them as an origin of the distance and using the Evaluate method with a single argument

Implemented in itk::Statistics::MahalanobisDistanceMetric< TVector >, itk::Statistics::ManhattanDistanceMetric< TVector >, itk::Statistics::EuclideanDistanceMetric< TVector >, itk::Statistics::EuclideanDistanceMetric< Array< double > >, and itk::Statistics::EuclideanSquareDistanceMetric< TVector >.

◆ GetMeasurementVectorSize()

template<typename TVector>
virtual MeasurementVectorSizeType itk::Statistics::DistanceMetric< TVector >::GetMeasurementVectorSize ( ) const
virtual

Get method for the length of the measurement vector

◆ GetNameOfClass()

template<typename TVector>
const char* itk::Statistics::DistanceMetric< TVector >::GetNameOfClass ( ) const
overridevirtual

◆ GetOrigin()

template<typename TVector>
virtual const OriginType& itk::Statistics::DistanceMetric< TVector >::GetOrigin ( ) const
virtual

◆ PrintSelf()

template<typename TVector>
void itk::Statistics::DistanceMetric< 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.

Reimplemented in itk::Statistics::MahalanobisDistanceMetric< TVector >.

◆ SetMeasurementVectorSize()

template<typename TVector>
virtual void itk::Statistics::DistanceMetric< TVector >::SetMeasurementVectorSize ( MeasurementVectorSizeType  s)
inlinevirtual

Set method for the length of the measurement vector

Reimplemented in itk::Statistics::MahalanobisDistanceMetric< TVector >.

Definition at line 97 of file itkDistanceMetric.h.

◆ SetOrigin()

template<typename TVector>
void itk::Statistics::DistanceMetric< TVector >::SetOrigin ( const OriginType x)

Sets the origin point that will be used for the single point version Evaluate() function. This function is necessary part of implementing the Evaluate() interface. The argument of SetOrigin() must be of type DistanceMetric::OriginType, which in most cases will be different from the TVector type. This is necessary because often times the origin would be a mean, or a vector representative of a collection of vectors.

Member Data Documentation

◆ m_MeasurementVectorSize

template<typename TVector>
MeasurementVectorSizeType itk::Statistics::DistanceMetric< TVector >::m_MeasurementVectorSize {}
private

Number of components in the MeasurementVectorType

Definition at line 142 of file itkDistanceMetric.h.

◆ m_Origin

template<typename TVector>
OriginType itk::Statistics::DistanceMetric< TVector >::m_Origin {}
private

Definition at line 139 of file itkDistanceMetric.h.


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