Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkCompareHistogramImageToImageMetric.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkCompareHistogramImageToImageMetric.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-05-02 05:43:54 $
00007   Version:   $Revision: 1.8 $
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 __itkCompareHistogramImageToImageMetric_h
00018 #define __itkCompareHistogramImageToImageMetric_h
00019 
00020 #include "itkHistogramImageToImageMetric.h"
00021 
00022 namespace itk
00023 {
00052 template <class TFixedImage, class TMovingImage>
00053 class ITK_EXPORT CompareHistogramImageToImageMetric :
00054 public HistogramImageToImageMetric<TFixedImage, TMovingImage>
00055 {
00056 public:
00058   typedef CompareHistogramImageToImageMetric                     Self;
00059   typedef HistogramImageToImageMetric<TFixedImage, TMovingImage> Superclass;
00060   typedef SmartPointer<Self>                                     Pointer;
00061   typedef SmartPointer<const Self>                               ConstPointer;
00062 
00064   itkTypeMacro(CompareHistogramImageToImageMetric,
00065     HistogramImageToImageMetric);
00066 
00068   typedef typename Superclass::RealType                 RealType;
00069   typedef typename Superclass::TransformType            TransformType;
00070   typedef typename Superclass::TransformPointer         TransformPointer;
00071   typedef typename TransformType::ConstPointer          TransformConstPointer;
00072 
00073   typedef typename Superclass::TransformParametersType
00074                                                         TransformParametersType;
00075   typedef typename Superclass::TransformJacobianType    TransformJacobianType;
00076   typedef typename Superclass::GradientPixelType        GradientPixelType;
00077 
00078   typedef typename Superclass::MeasureType              MeasureType;
00079   typedef typename Superclass::DerivativeType           DerivativeType;
00080   typedef typename Superclass::FixedImageType           FixedImageType;
00081   typedef typename Superclass::MovingImageType          MovingImageType;
00082   typedef typename Superclass::FixedImageConstPointer   FixedImageConstPointer;
00083   typedef typename Superclass::MovingImageConstPointer
00084                                                         MovingImageConstPointer;
00085 
00086   typedef typename Superclass::HistogramType            HistogramType;
00087   typedef typename Superclass::HistogramSizeType        HistogramSizeType;
00088   typedef typename HistogramType::MeasurementVectorType
00089                                                         HistogramMeasurementVectorType;
00090 #ifdef ITK_USE_REVIEW_STATISTICS
00091   typedef typename HistogramType::AbsoluteFrequencyType HistogramAbsoluteFrequencyType;
00092 #else
00093   typedef typename HistogramType::FrequencyType         HistogramAbsoluteFrequencyType;
00094 #endif
00095   typedef HistogramAbsoluteFrequencyType                HistogramFrequencyType;
00096 
00097   typedef typename HistogramType::Iterator              HistogramIteratorType;
00098   typedef typename HistogramType::Pointer               HistogramPointerType;
00099 
00100   typedef typename Superclass::InterpolatorType    InterpolatorType;
00101   typedef typename Superclass::InterpolatorPointer InterpolatorPointer;
00102 
00103   typedef typename Superclass::FixedImageRegionType 
00104                                                          FixedImageRegionType;
00105 
00107   itkSetMacro( TrainingHistogram, HistogramPointerType );
00108 
00110   itkGetConstReferenceMacro( TrainingHistogram, HistogramPointerType );
00111 
00113   itkSetConstObjectMacro( TrainingFixedImage, FixedImageType );
00114 
00116   itkGetConstObjectMacro( TrainingFixedImage, FixedImageType );
00117 
00119   itkSetConstObjectMacro( TrainingMovingImage, MovingImageType );
00120 
00122   itkGetConstObjectMacro( TrainingMovingImage, MovingImageType );
00123 
00125   itkSetObjectMacro( TrainingTransform, TransformType );
00126 
00128   itkGetObjectMacro( TrainingTransform, TransformType );
00129 
00131   itkSetObjectMacro( TrainingInterpolator, InterpolatorType );
00132 
00134   itkGetObjectMacro( TrainingInterpolator, InterpolatorType );
00135 
00137   itkSetMacro( TrainingFixedImageRegion, FixedImageRegionType );
00138 
00140   itkGetConstReferenceMacro( TrainingFixedImageRegion, FixedImageRegionType );
00141 
00143   unsigned int GetNumberOfParameters(void) const 
00144   { return this->GetTransform()->GetNumberOfParameters(); }
00145 
00148   void Initialize() throw (ExceptionObject);
00149 
00150 protected:
00153   CompareHistogramImageToImageMetric();
00154   virtual ~CompareHistogramImageToImageMetric(){}
00155   void PrintSelf(std::ostream& os, Indent indent) const;
00157 
00159   void FormTrainingHistogram() throw (ExceptionObject);
00160 
00163   virtual MeasureType EvaluateMeasure(HistogramType& histogram) const = 0;
00164 
00165 private:
00166   // Purposely not implemented.
00167   CompareHistogramImageToImageMetric(Self const&);
00168   void operator=(Self const&); // Purposely not implemented.
00169 
00170   FixedImageConstPointer  m_TrainingFixedImage;
00171   MovingImageConstPointer m_TrainingMovingImage;
00172   TransformPointer        m_TrainingTransform;
00173   InterpolatorPointer     m_TrainingInterpolator;
00174   FixedImageRegionType    m_TrainingFixedImageRegion;
00175   HistogramPointerType    m_TrainingHistogram;
00176 
00177 };
00178 
00179 } // End namespace itk.
00180 
00181 #ifndef ITK_MANUAL_INSTANTIATION
00182 #include "itkCompareHistogramImageToImageMetric.txx"
00183 #endif
00184 
00185 #endif // __itkCompareHistogramImageToImageMetric_h
00186 

Generated at Thu May 28 09:38:08 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000