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: 2003/12/29 19:41:07 $
00007   Version:   $Revision: 1.2 $
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   itkNewMacro(Self);
00065 
00067   itkTypeMacro(CompareHistogramImageToImageMetric,
00068     HistogramImageToImageMetric);
00069 
00071   typedef typename Superclass::RealType                 RealType;
00072   typedef typename Superclass::TransformType            TransformType;
00073   typedef typename Superclass::TransformPointer         TransformPointer;
00074   typedef typename TransformType::ConstPointer          TransformConstPointer;
00075 
00076   typedef typename Superclass::TransformParametersType
00077     TransformParametersType;
00078   typedef typename Superclass::TransformJacobianType    TransformJacobianType;
00079   typedef typename Superclass::GradientPixelType        GradientPixelType;
00080 
00081   typedef typename Superclass::MeasureType              MeasureType;
00082   typedef typename Superclass::DerivativeType           DerivativeType;
00083   typedef typename Superclass::FixedImageType           FixedImageType;
00084   typedef typename Superclass::MovingImageType          MovingImageType;
00085   typedef typename Superclass::FixedImageConstPointer   FixedImageConstPointer;
00086   typedef typename Superclass::MovingImageConstPointer
00087     MovingImageConstPointer;
00088 
00089   typedef typename Superclass::HistogramType            HistogramType;
00090   typedef typename Superclass::HistogramSizeType        HistogramSizeType;
00091   typedef typename HistogramType::MeasurementVectorType
00092     HistogramMeasurementVectorType;
00093   typedef typename HistogramType::FrequencyType         HistogramFrequencyType;
00094   typedef typename HistogramType::Iterator              HistogramIteratorType;
00095   typedef typename HistogramType::Pointer               HistogramPointerType;
00096 
00097   typedef typename Superclass::InterpolatorType InterpolatorType;
00098   typedef typename Superclass::InterpolatorPointer 
00099     InterpolatorPointer;
00100 
00101   typedef typename Superclass::FixedImageRegionType 
00102     FixedImageRegionType;
00103 
00105   itkSetMacro( TrainingHistogram, HistogramPointerType );
00106 
00108   itkGetConstMacro( TrainingHistogram, HistogramPointerType );
00109 
00111   itkSetConstObjectMacro( TrainingFixedImage, FixedImageType );
00112 
00114   itkGetConstObjectMacro( TrainingFixedImage, FixedImageType );
00115 
00117   itkSetConstObjectMacro( TrainingMovingImage, MovingImageType );
00118 
00120   itkGetConstObjectMacro( TrainingMovingImage, MovingImageType );
00121 
00123   itkSetObjectMacro( TrainingTransform, TransformType );
00124 
00126   itkGetObjectMacro( TrainingTransform, TransformType );
00127 
00129   itkSetObjectMacro( TrainingInterpolator, InterpolatorType );
00130 
00132   itkGetObjectMacro( TrainingInterpolator, InterpolatorType );
00133 
00135   itkSetMacro( TrainingFixedImageRegion, FixedImageRegionType );
00136 
00138   itkGetConstMacro( TrainingFixedImageRegion, FixedImageRegionType );
00139 
00141   unsigned int GetNumberOfParameters(void) const 
00142   { return m_Transform->GetNumberOfParameters(); }
00143  
00146   void Initialize() throw (ExceptionObject);
00147 
00148 protected:
00151   CompareHistogramImageToImageMetric();
00152   virtual ~CompareHistogramImageToImageMetric(){}
00153   void PrintSelf(std::ostream& os, Indent indent) const;
00154 
00156   void FormTrainingHistogram() throw (ExceptionObject);
00157 
00160   virtual MeasureType EvaluateMeasure(HistogramType& histogram) const = 0;
00161 
00162   FixedImageConstPointer  m_TrainingFixedImage;
00163   MovingImageConstPointer m_TrainingMovingImage;
00164   TransformPointer        m_TrainingTransform;
00165   InterpolatorPointer     m_TrainingInterpolator;
00166   FixedImageRegionType    m_TrainingFixedImageRegion;
00167   HistogramPointerType    m_TrainingHistogram;
00168 
00169 private:
00170   // Purposely not implemented.
00171   CompareHistogramImageToImageMetric(Self const&);
00172   void operator=(Self const&); // Purposely not implemented.
00173 };
00174 
00175 } // End namespace itk.
00176 
00177 #ifndef ITK_MANUAL_INSTANTIATION
00178 #include "itkCompareHistogramImageToImageMetric.txx"
00179 #endif
00180 
00181 #endif // __itkCompareHistogramImageToImageMetric_h

Generated at Sun Jan 25 13:19:30 2004 for ITK by doxygen 1.3.3 written by Dimitri van Heesch, © 1997-2000