00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkKullbackLeiblerCompareHistogramImageToImageMetric.h,v $ 00005 Language: C++ 00006 Date: $Date: 2006-03-19 04:36:54 $ 00007 Version: $Revision: 1.5 $ 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 __itkKullbackLeiblerCompareHistogramImageToImageMetric_h 00018 #define __itkKullbackLeiblerCompareHistogramImageToImageMetric_h 00019 00020 #include "itkCompareHistogramImageToImageMetric.h" 00021 00022 namespace itk 00023 { 00069 template <class TFixedImage, class TMovingImage> 00070 class ITK_EXPORT KullbackLeiblerCompareHistogramImageToImageMetric : 00071 public CompareHistogramImageToImageMetric<TFixedImage, TMovingImage> 00072 { 00073 public: 00075 typedef KullbackLeiblerCompareHistogramImageToImageMetric Self; 00076 typedef CompareHistogramImageToImageMetric<TFixedImage, TMovingImage> Superclass; 00077 typedef SmartPointer<Self> Pointer; 00078 typedef SmartPointer<const Self> ConstPointer; 00079 00081 itkNewMacro(Self); 00082 00084 itkTypeMacro(KullbackLeiblerCompareHistogramImageToImageMetric, 00085 HistogramImageToImageMetric); 00086 00088 typedef typename Superclass::RealType RealType; 00089 typedef typename Superclass::TransformType TransformType; 00090 typedef typename Superclass::TransformPointer TransformPointer; 00091 typedef typename Superclass::ConstPointer TransformConstPointer; 00092 typedef typename Superclass::TransformParametersType 00093 TransformParametersType; 00094 typedef typename Superclass::TransformJacobianType TransformJacobianType; 00095 typedef typename Superclass::GradientPixelType GradientPixelType; 00096 00097 typedef typename Superclass::MeasureType MeasureType; 00098 typedef typename Superclass::DerivativeType DerivativeType; 00099 typedef typename Superclass::FixedImageType FixedImageType; 00100 typedef typename Superclass::MovingImageType MovingImageType; 00101 typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer; 00102 typedef typename Superclass::MovingImageConstPointer 00103 MovingImageConstPointer; 00104 00105 typedef typename Superclass::HistogramType HistogramType; 00106 typedef typename Superclass::HistogramSizeType HistogramSizeType; 00107 typedef typename Superclass::MeasurementVectorType 00108 HistogramMeasurementVectorType; 00109 00110 typedef typename Superclass::HistogramFrequencyType HistogramFrequencyType; 00111 typedef typename Superclass::HistogramIteratorType HistogramIteratorType; 00112 typedef typename Superclass::HistogramPointerType HistogramPointerType; 00113 typedef typename Superclass::InterpolatorType InterpolatorType; 00114 typedef typename Superclass::InterpolatorPointer InterpolatorPointer; 00115 00117 itkSetMacro( Epsilon, double ); 00118 00120 itkGetConstReferenceMacro( Epsilon, double ); 00121 00123 unsigned int GetNumberOfParameters(void) const 00124 { return this->GetTransform()->GetNumberOfParameters(); } 00125 00129 void Initialize() throw (ExceptionObject); 00130 00131 protected: 00134 KullbackLeiblerCompareHistogramImageToImageMetric(); 00135 virtual ~KullbackLeiblerCompareHistogramImageToImageMetric(){} 00136 void PrintSelf(std::ostream& os, Indent indent) const; 00138 00140 void FormTrainingHistogram() throw (ExceptionObject); 00141 00143 virtual MeasureType EvaluateMeasure(HistogramType& histogram) const; 00144 00145 double m_Epsilon; 00146 00147 private: 00148 // Purposely not implemented. 00149 KullbackLeiblerCompareHistogramImageToImageMetric(Self const&); 00150 void operator=(Self const&); // Purposely not implemented. 00151 }; 00152 00153 } // End namespace itk. 00154 00155 #ifndef ITK_MANUAL_INSTANTIATION 00156 #include "itkKullbackLeiblerCompareHistogramImageToImageMetric.txx" 00157 #endif 00158 00159 #endif // __itkKullbackLeiblerCompareHistogramImageToImageMetric_h 00160