00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkEuclideanDistance_h
00018 #define __itkEuclideanDistance_h
00019
00020 #include "itkNumericTraits.h"
00021 #include "itkFixedArray.h"
00022 #include "itkDistanceMetric.h"
00023
00024 namespace itk{
00025 namespace Statistics{
00026
00037 template< class TVector >
00038 class ITK_EXPORT EuclideanDistance :
00039 public DistanceMetric< TVector >
00040 {
00041 public:
00043 typedef EuclideanDistance Self;
00044 typedef DistanceMetric< TVector > Superclass;
00045 typedef SmartPointer< Self > Pointer ;
00046 typedef SmartPointer<const Self> ConstPointer;
00047
00049 itkStaticConstMacro(VectorLength, unsigned int, TVector::Length);
00050
00052 itkTypeMacro(EuclideanDistance, DistanceMetric);
00053
00055 itkNewMacro(Self) ;
00056
00058 typedef typename TVector::ValueType ValueType ;
00059
00061 double Evaluate(const TVector &x) const ;
00062
00064 double Evaluate(const TVector &x1, const TVector &x2) const ;
00065
00068 double Evaluate(const ValueType &a, const ValueType &b) const ;
00069
00072 bool IsWithinRange(const TVector &x, const double radius) const ;
00073
00074 protected:
00075 EuclideanDistance() {}
00076 virtual ~EuclideanDistance() {}
00077 virtual void PrintSelf(std::ostream& os, Indent indent) const
00078 { Superclass::PrintSelf(os, indent) ; }
00079
00080 } ;
00081
00082 }
00083 }
00084
00085 #ifndef ITK_MANUAL_INSTANTIATION
00086 #include "itkEuclideanDistance.txx"
00087 #endif
00088
00089 #endif
00090
00091
00092
00093
00094
00095
00096