00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkEuclideanDistanceMetric.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-05-02 05:43:55 $ 00007 Version: $Revision: 1.1 $ 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 __itkEuclideanDistanceMetric_h 00018 #define __itkEuclideanDistanceMetric_h 00019 00020 #include "itkNumericTraits.h" 00021 #include "itkDistanceMetric.h" 00022 #include "itkMeasurementVectorTraits.h" 00023 00024 namespace itk { 00025 namespace Statistics { 00026 00032 template< class TVector > 00033 class ITK_EXPORT EuclideanDistanceMetric : 00034 public DistanceMetric< TVector > 00035 { 00036 public: 00038 typedef EuclideanDistanceMetric Self; 00039 typedef DistanceMetric< TVector > Superclass; 00040 typedef SmartPointer< Self > Pointer; 00041 typedef SmartPointer<const Self> ConstPointer; 00042 00043 typedef typename Superclass::MeasurementVectorType MeasurementVectorType; 00044 typedef typename MeasurementVectorTraitsTypes<MeasurementVectorType>::ValueType ValueType; 00045 typedef typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType; 00046 00047 typedef typename Superclass::OriginType OriginType; 00048 00050 itkTypeMacro(EuclideanDistanceMetric, DistanceMetric); 00051 00053 itkNewMacro(Self); 00054 00056 double Evaluate(const MeasurementVectorType &x) const; 00057 00059 double Evaluate(const MeasurementVectorType &x1, const MeasurementVectorType &x2) const; 00060 00065 double Evaluate(const ValueType &a, const ValueType &b) const; 00066 00067 protected: 00068 EuclideanDistanceMetric() {} 00069 virtual ~EuclideanDistanceMetric() {} 00070 }; // end of class 00071 00072 } // end of namespace Statistics 00073 } // end of namespace itk 00074 00075 #ifndef ITK_MANUAL_INSTANTIATION 00076 #include "itkEuclideanDistanceMetric.txx" 00077 #endif 00078 00079 #endif 00080