00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkEuclideanDistance.h,v $ 00005 Language: C++ 00006 Date: $Date: 2005-07-26 15:54:55 $ 00007 Version: $Revision: 1.10 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkEuclideanDistance_h 00018 #define __itkEuclideanDistance_h 00019 00020 #include "itkNumericTraits.h" 00021 #include "itkDistanceMetric.h" 00022 #include "itkMeasurementVectorTraits.h" 00023 00024 namespace itk{ 00025 namespace Statistics{ 00026 00051 template< class TVector > 00052 class ITK_EXPORT EuclideanDistance : 00053 public DistanceMetric< TVector > 00054 { 00055 public: 00057 typedef EuclideanDistance Self; 00058 typedef DistanceMetric< TVector > Superclass; 00059 typedef SmartPointer< Self > Pointer ; 00060 typedef SmartPointer<const Self> ConstPointer; 00061 typedef typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType; 00062 00064 itkTypeMacro(EuclideanDistance, DistanceMetric); 00065 00067 itkNewMacro(Self) ; 00068 00070 typedef typename TVector::ValueType ValueType ; 00071 00073 double Evaluate(const TVector &x) const ; 00074 00076 double Evaluate(const TVector &x1, const TVector &x2) const ; 00077 00080 double Evaluate(const ValueType &a, const ValueType &b) const ; 00081 00084 bool IsWithinRange(const TVector &x, const double radius) const ; 00085 00086 protected: 00087 EuclideanDistance() {} 00088 virtual ~EuclideanDistance() {} 00089 } ; // end of class 00090 00091 } // end of namespace Statistics 00092 } // end of namespace itk 00093 00094 #ifndef ITK_MANUAL_INSTANTIATION 00095 #include "itkEuclideanDistance.txx" 00096 #endif 00097 00098 #endif 00099 00100 00101 00102 00103 00104 00105 00106