00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkDistanceMetric.h,v $ 00005 Language: C++ 00006 Date: $Date: 2005-11-21 02:40:48 $ 00007 Version: $Revision: 1.12 $ 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 __itkDistanceMetric_h 00018 #define __itkDistanceMetric_h 00019 00020 #include "itkMembershipFunctionBase.h" 00021 #include "itkArray.h" 00022 00023 namespace itk{ 00024 namespace Statistics{ 00025 00056 template< class TVector > 00057 class ITK_EXPORT DistanceMetric : public MembershipFunctionBase< TVector > 00058 { 00059 public: 00061 typedef DistanceMetric Self; 00062 typedef MembershipFunctionBase< TVector > Superclass; 00063 typedef typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType; 00064 00066 itkTypeMacro(DistanceMetric, MembershipFunctionBase); 00067 00068 typedef Array< double > OriginType ; 00069 00071 virtual void SetMeasurementVectorSize( const MeasurementVectorSizeType ); 00072 00076 void SetOrigin(const OriginType& x) ; 00077 itkGetConstReferenceMacro(Origin, OriginType) ; 00079 00082 virtual double Evaluate(const TVector &x) const = 0 ; 00083 00085 virtual double Evaluate(const TVector &x1, const TVector &x2) const = 0 ; 00086 00087 protected: 00088 DistanceMetric(); 00089 virtual ~DistanceMetric() {} 00090 void PrintSelf(std::ostream& os, Indent indent) const; 00091 00092 OriginType m_Origin ; 00093 } ; // end of class 00094 00095 } // end of namespace Statistics 00096 } // end of namespace itk 00097 00098 #ifndef ITK_MANUAL_INSTANTIATION 00099 #include "itkDistanceMetric.txx" 00100 #endif 00101 00102 #endif 00103 00104 00105 00106 00107 00108 00109 00110