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

itkImageToImageMetric.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkImageToImageMetric.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:28:32 $ 00007 Version: $Revision: 1.17 $ 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 __itkImageToImageMetric_h 00018 #define __itkImageToImageMetric_h 00019 00020 #include "itkImageBase.h" 00021 #include "itkTransform.h" 00022 #include "itkInterpolateImageFunction.h" 00023 #include "itkSingleValuedCostFunction.h" 00024 #include "itkExceptionObject.h" 00025 #include "itkGradientRecursiveGaussianImageFilter.h" 00026 00027 namespace itk 00028 { 00029 00049 template <class TFixedImage, class TMovingImage> 00050 class ITK_EXPORT ImageToImageMetric : public SingleValuedCostFunction 00051 { 00052 public: 00054 typedef ImageToImageMetric Self; 00055 typedef SingleValuedCostFunction Superclass; 00056 typedef SmartPointer<Self> Pointer; 00057 typedef SmartPointer<const Self> ConstPointer; 00058 00060 typedef Superclass::ParametersValueType CoordinateRepresentationType; 00061 00063 itkTypeMacro(ImageToImageMetric, SingleValuedCostFunction); 00064 00066 typedef TMovingImage MovingImageType; 00067 typedef typename TMovingImage::PixelType MovingImagePixelType; 00068 typedef typename MovingImageType::ConstPointer MovingImageConstPointer; 00069 00071 typedef TFixedImage FixedImageType; 00072 typedef typename FixedImageType::ConstPointer FixedImageConstPointer; 00073 typedef typename FixedImageType::RegionType FixedImageRegionType; 00074 00076 itkStaticConstMacro(MovingImageDimension, unsigned int, 00077 TMovingImage::ImageDimension); 00078 itkStaticConstMacro(FixedImageDimension, unsigned int, 00079 TFixedImage::ImageDimension); 00080 00082 typedef Transform<CoordinateRepresentationType, 00083 itkGetStaticConstMacro(MovingImageDimension), 00084 itkGetStaticConstMacro(FixedImageDimension)> TransformType; 00085 00086 typedef typename TransformType::Pointer TransformPointer; 00087 typedef typename TransformType::InputPointType InputPointType; 00088 typedef typename TransformType::OutputPointType OutputPointType; 00089 typedef typename TransformType::ParametersType TransformParametersType; 00090 typedef typename TransformType::JacobianType TransformJacobianType; 00091 00093 typedef InterpolateImageFunction< 00094 MovingImageType, 00095 CoordinateRepresentationType > InterpolatorType; 00096 00097 00099 typedef typename NumericTraits<MovingImagePixelType>::RealType RealType; 00100 typedef CovariantVector<RealType, 00101 itkGetStaticConstMacro(MovingImageDimension)> GradientPixelType; 00102 typedef Image<GradientPixelType, 00103 itkGetStaticConstMacro(MovingImageDimension)> GradientImageType; 00104 typedef SmartPointer<GradientImageType> GradientImagePointer; 00105 typedef GradientRecursiveGaussianImageFilter< MovingImageType, 00106 GradientImageType > 00107 GradientImageFilterType; 00108 typedef typename GradientImageFilterType::Pointer GradientImageFilterPointer; 00109 00110 00111 typedef typename InterpolatorType::Pointer InterpolatorPointer; 00112 00114 typedef Superclass::MeasureType MeasureType; 00115 00117 typedef Superclass::DerivativeType DerivativeType; 00118 00120 typedef Superclass::ParametersType ParametersType; 00121 00123 itkSetConstObjectMacro( FixedImage, FixedImageType ); 00124 00126 itkGetConstObjectMacro( FixedImage, FixedImageType ); 00127 00129 itkSetConstObjectMacro( MovingImage, MovingImageType ); 00130 00132 itkGetConstObjectMacro( MovingImage, MovingImageType ); 00133 00135 itkSetObjectMacro( Transform, TransformType ); 00136 00138 itkGetObjectMacro( Transform, TransformType ); 00139 00141 itkSetObjectMacro( Interpolator, InterpolatorType ); 00142 00144 itkGetObjectMacro( Interpolator, InterpolatorType ); 00145 00147 itkGetConstMacro( NumberOfPixelsCounted, unsigned long ); 00148 00150 itkSetMacro( FixedImageRegion, FixedImageRegionType ); 00151 00153 itkGetConstMacro( FixedImageRegion, FixedImageRegionType ); 00154 00156 void SetTransformParameters( const ParametersType & parameters ) const; 00157 00159 unsigned int GetNumberOfParameters(void) const 00160 { return m_Transform->GetNumberOfParameters(); } 00161 00164 virtual void Initialize(void) throw ( ExceptionObject ); 00165 00166 protected: 00167 ImageToImageMetric(); 00168 virtual ~ImageToImageMetric() {}; 00169 void PrintSelf(std::ostream& os, Indent indent) const; 00170 00171 mutable unsigned long m_NumberOfPixelsCounted; 00172 00173 FixedImageConstPointer m_FixedImage; 00174 MovingImageConstPointer m_MovingImage; 00175 00176 mutable TransformPointer m_Transform; 00177 InterpolatorPointer m_Interpolator; 00178 00179 bool m_ComputeGradient; 00180 GradientImagePointer m_GradientImage; 00181 00182 private: 00183 ImageToImageMetric(const Self&); //purposely not implemented 00184 void operator=(const Self&); //purposely not implemented 00185 00186 FixedImageRegionType m_FixedImageRegion; 00187 00188 00189 }; 00190 00191 } // end namespace itk 00192 00193 #ifndef ITK_MANUAL_INSTANTIATION 00194 #include "itkImageToImageMetric.txx" 00195 #endif 00196 00197 #endif 00198 00199 00200

Generated at Sat Mar 31 02:22:49 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000