itkCompareHistogramImageToImageMetric.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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 InterpolatorPointer;
00096
00097 typedef typename Superclass::FixedImageRegionType
00098 FixedImageRegionType;
00099
00101 itkSetMacro( TrainingHistogram, HistogramPointerType );
00102
00104 itkGetConstReferenceMacro( TrainingHistogram, HistogramPointerType );
00105
00107 itkSetConstObjectMacro( TrainingFixedImage, FixedImageType );
00108
00110 itkGetConstObjectMacro( TrainingFixedImage, FixedImageType );
00111
00113 itkSetConstObjectMacro( TrainingMovingImage, MovingImageType );
00114
00116 itkGetConstObjectMacro( TrainingMovingImage, MovingImageType );
00117
00119 itkSetObjectMacro( TrainingTransform, TransformType );
00120
00122 itkGetObjectMacro( TrainingTransform, TransformType );
00123
00125 itkSetObjectMacro( TrainingInterpolator, InterpolatorType );
00126
00128 itkGetObjectMacro( TrainingInterpolator, InterpolatorType );
00129
00131 itkSetMacro( TrainingFixedImageRegion, FixedImageRegionType );
00132
00134 itkGetConstReferenceMacro( TrainingFixedImageRegion, FixedImageRegionType );
00135
00137 unsigned int GetNumberOfParameters(void) const
00138 { return this->GetTransform()->GetNumberOfParameters(); }
00139
00142 void Initialize() throw (ExceptionObject);
00143
00144 protected:
00147 CompareHistogramImageToImageMetric();
00148 virtual ~CompareHistogramImageToImageMetric(){}
00149 void PrintSelf(std::ostream& os, Indent indent) const;
00151
00153 void FormTrainingHistogram() throw (ExceptionObject);
00154
00157 virtual MeasureType EvaluateMeasure(HistogramType& histogram) const = 0;
00158
00159 private:
00160
00161 CompareHistogramImageToImageMetric(Self const&);
00162 void operator=(Self const&);
00163
00164 FixedImageConstPointer m_TrainingFixedImage;
00165 MovingImageConstPointer m_TrainingMovingImage;
00166 TransformPointer m_TrainingTransform;
00167 InterpolatorPointer m_TrainingInterpolator;
00168 FixedImageRegionType m_TrainingFixedImageRegion;
00169 HistogramPointerType m_TrainingHistogram;
00170
00171 };
00172
00173 }
00174
00175 #ifndef ITK_MANUAL_INSTANTIATION
00176 #include "itkCompareHistogramImageToImageMetric.txx"
00177 #endif
00178
00179 #endif // __itkCompareHistogramImageToImageMetric_h
00180