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: 2004-12-21 22:47:26 $
00007   Version:   $Revision: 1.6 $
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   typedef typename HistogramType::FrequencyType         HistogramFrequencyType;
00091   typedef typename HistogramType::Iterator              HistogramIteratorType;
00092   typedef typename HistogramType::Pointer               HistogramPointerType;
00093 
00094   typedef typename Superclass::InterpolatorType InterpolatorType;
00095   typedef typename Superclass::InterpolatorPointer 
00096     InterpolatorPointer;
00097 
00098   typedef typename Superclass::FixedImageRegionType 
00099     FixedImageRegionType;
00100 
00102   itkSetMacro( TrainingHistogram, HistogramPointerType );
00103 
00105   itkGetConstReferenceMacro( TrainingHistogram, HistogramPointerType );
00106 
00108   itkSetConstObjectMacro( TrainingFixedImage, FixedImageType );
00109 
00111   itkGetConstObjectMacro( TrainingFixedImage, FixedImageType );
00112 
00114   itkSetConstObjectMacro( TrainingMovingImage, MovingImageType );
00115 
00117   itkGetConstObjectMacro( TrainingMovingImage, MovingImageType );
00118 
00120   itkSetObjectMacro( TrainingTransform, TransformType );
00121 
00123   itkGetObjectMacro( TrainingTransform, TransformType );
00124 
00126   itkSetObjectMacro( TrainingInterpolator, InterpolatorType );
00127 
00129   itkGetObjectMacro( TrainingInterpolator, InterpolatorType );
00130 
00132   itkSetMacro( TrainingFixedImageRegion, FixedImageRegionType );
00133 
00135   itkGetConstReferenceMacro( TrainingFixedImageRegion, FixedImageRegionType );
00136 
00138   unsigned int GetNumberOfParameters(void) const 
00139   { return this->GetTransform()->GetNumberOfParameters(); }
00140 
00144   void Initialize() throw (ExceptionObject);
00145 
00146 protected:
00149   CompareHistogramImageToImageMetric();
00150   virtual ~CompareHistogramImageToImageMetric(){}
00151   void PrintSelf(std::ostream& os, Indent indent) const;
00153 
00155   void FormTrainingHistogram() throw (ExceptionObject);
00156 
00159   virtual MeasureType EvaluateMeasure(HistogramType& histogram) const = 0;
00160 
00161 private:
00162   // Purposely not implemented.
00163   CompareHistogramImageToImageMetric(Self const&);
00164   void operator=(Self const&); // Purposely not implemented.
00165 
00166   FixedImageConstPointer  m_TrainingFixedImage;
00167   MovingImageConstPointer m_TrainingMovingImage;
00168   TransformPointer        m_TrainingTransform;
00169   InterpolatorPointer     m_TrainingInterpolator;
00170   FixedImageRegionType    m_TrainingFixedImageRegion;
00171   HistogramPointerType    m_TrainingHistogram;
00172 
00173 };
00174 
00175 } // End namespace itk.
00176 
00177 #ifndef ITK_MANUAL_INSTANTIATION
00178 #include "itkCompareHistogramImageToImageMetric.txx"
00179 #endif
00180 
00181 #endif // __itkCompareHistogramImageToImageMetric_h
00182 

Generated at Mon Apr 14 12:01:30 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000