00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkEuclideanDistance.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-03-04 15:23:46 $ 00007 Version: $Revision: 1.11 $ 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 00062 typedef typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType; 00063 00065 itkTypeMacro(EuclideanDistance, DistanceMetric); 00066 00068 itkNewMacro(Self); 00069 00071 typedef typename TVector::ValueType ValueType; 00072 00074 double Evaluate(const TVector &x) const; 00075 00077 double Evaluate(const TVector &x1, const TVector &x2) const; 00078 00081 double Evaluate(const ValueType &a, const ValueType &b) const; 00082 00085 bool IsWithinRange(const TVector &x, const double radius) const; 00086 00087 protected: 00088 EuclideanDistance() {} 00089 virtual ~EuclideanDistance() {} 00090 }; // end of class 00091 00092 } // end of namespace Statistics 00093 } // end of namespace itk 00094 00095 #ifndef ITK_MANUAL_INSTANTIATION 00096 #include "itkEuclideanDistance.txx" 00097 #endif 00098 00099 #endif 00100