00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkEuclideanDistance.h,v $ 00005 Language: C++ 00006 Date: $Date: 2002/09/11 19:57:14 $ 00007 Version: $Revision: 1.2 $ 00008 00009 Copyright (c) 2002 Insight 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 "itkFixedArray.h" 00022 #include "itkDistanceMetric.h" 00023 00024 namespace itk{ 00025 namespace Statistics{ 00026 00027 template< class TVector > 00028 class ITK_EXPORT EuclideanDistance : 00029 public DistanceMetric< TVector > 00030 { 00031 public: 00033 typedef EuclideanDistance Self; 00034 typedef DistanceMetric< TVector > Superclass; 00035 typedef SmartPointer< Self > Pointer ; 00036 00037 itkStaticConstMacro(VectorLength, unsigned int, TVector::Length); 00038 00040 itkTypeMacro(EuclideanDistance, DistanceMetric); 00041 00043 itkNewMacro(Self) ; 00044 00045 typedef typename TVector::ValueType ValueType ; 00046 00047 double Evaluate(const TVector &x) const ; 00048 double Evaluate(const TVector &x1, const TVector &x2) const ; 00049 double Evaluate(const ValueType &a, const ValueType &b) const ; 00050 00051 protected: 00052 EuclideanDistance() {} 00053 virtual ~EuclideanDistance() {} 00054 } ; // end of class 00055 00056 } // end of namespace Statistics 00057 } // end of namespace itk 00058 00059 #ifndef ITK_MANUAL_INSTANTIATION 00060 #include "itkEuclideanDistance.txx" 00061 #endif 00062 00063 #endif 00064 00065 00066 00067 00068 00069 00070