ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkKullbackLeiblerCompareHistogramImageToImageMetric.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkKullbackLeiblerCompareHistogramImageToImageMetric_h
00019 #define __itkKullbackLeiblerCompareHistogramImageToImageMetric_h
00020 
00021 #include "itkCompareHistogramImageToImageMetric.h"
00022 
00023 namespace itk
00024 {
00071 template< class TFixedImage, class TMovingImage >
00072 class ITK_EXPORT KullbackLeiblerCompareHistogramImageToImageMetric:
00073   public CompareHistogramImageToImageMetric< TFixedImage, TMovingImage >
00074 {
00075 public:
00077   typedef KullbackLeiblerCompareHistogramImageToImageMetric Self;
00078   typedef CompareHistogramImageToImageMetric< TFixedImage, TMovingImage >
00079   Superclass;
00080   typedef SmartPointer< Self >       Pointer;
00081   typedef SmartPointer< const Self > ConstPointer;
00082 
00084   itkNewMacro(Self);
00085 
00087   itkTypeMacro(KullbackLeiblerCompareHistogramImageToImageMetric,
00088                HistogramImageToImageMetric);
00089 
00091   typedef typename Superclass::RealType                RealType;
00092   typedef typename Superclass::TransformType           TransformType;
00093   typedef typename Superclass::TransformPointer        TransformPointer;
00094   typedef typename Superclass::ConstPointer            TransformConstPointer;
00095   typedef typename Superclass::TransformParametersType TransformParametersType;
00096   typedef typename Superclass::TransformJacobianType   TransformJacobianType;
00097   typedef typename Superclass::GradientPixelType       GradientPixelType;
00098 
00099   typedef typename Superclass::MeasureType            MeasureType;
00100   typedef typename Superclass::DerivativeType         DerivativeType;
00101   typedef typename Superclass::FixedImageType         FixedImageType;
00102   typedef typename Superclass::MovingImageType        MovingImageType;
00103   typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
00104   typedef typename Superclass::MovingImageConstPointer
00105   MovingImageConstPointer;
00106 
00107   typedef typename Superclass::HistogramType     HistogramType;
00108   typedef typename Superclass::HistogramSizeType HistogramSizeType;
00109   typedef typename Superclass::MeasurementVectorType
00110   HistogramMeasurementVectorType;
00111 
00112   typedef typename Superclass::HistogramFrequencyType HistogramFrequencyType;
00113   typedef typename Superclass::HistogramIteratorType  HistogramIteratorType;
00114   typedef typename Superclass::HistogramPointerType   HistogramPointerType;
00115   typedef typename Superclass::InterpolatorType       InterpolatorType;
00116   typedef typename Superclass::InterpolatorPointer    InterpolatorPointer;
00117 
00119   itkSetMacro(Epsilon, double);
00120 
00122   itkGetConstReferenceMacro(Epsilon, double);
00123 
00125   unsigned int GetNumberOfParameters(void) const
00126   { return this->GetTransform()->GetNumberOfParameters(); }
00127 
00131   void Initialize()
00132   throw ( ExceptionObject );
00133 
00134 protected:
00137   KullbackLeiblerCompareHistogramImageToImageMetric();
00138   virtual ~KullbackLeiblerCompareHistogramImageToImageMetric(){}
00139   void PrintSelf(std::ostream & os, Indent indent) const;
00141 
00143   void FormTrainingHistogram()
00144   throw ( ExceptionObject );
00145 
00147   virtual MeasureType EvaluateMeasure(HistogramType & histogram) const;
00148 
00149   double m_Epsilon;
00150 private:
00151   // Purposely not implemented.
00152   KullbackLeiblerCompareHistogramImageToImageMetric(Self const &);
00153   void operator=(Self const &); // Purposely not implemented.
00154 };
00155 } // End namespace itk.
00156 
00157 #ifndef ITK_MANUAL_INSTANTIATION
00158 #include "itkKullbackLeiblerCompareHistogramImageToImageMetric.hxx"
00159 #endif
00160 
00161 #endif // __itkKullbackLeiblerCompareHistogramImageToImageMetric_h
00162