itkImageRegistrationMethod.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 __itkImageRegistrationMethod_h
00018 #define __itkImageRegistrationMethod_h
00019
00020 #include "itkProcessObject.h"
00021 #include "itkImage.h"
00022 #include "itkImageToImageMetric.h"
00023 #include "itkSingleValuedNonLinearOptimizer.h"
00024 #include "itkDataObjectDecorator.h"
00025
00026 namespace itk
00027 {
00028
00062 template <typename TFixedImage, typename TMovingImage>
00063 class ITK_EXPORT ImageRegistrationMethod : public ProcessObject
00064 {
00065 public:
00067 typedef ImageRegistrationMethod Self;
00068 typedef ProcessObject Superclass;
00069 typedef SmartPointer<Self> Pointer;
00070 typedef SmartPointer<const Self> ConstPointer;
00071
00073 itkNewMacro(Self);
00074
00076 itkTypeMacro(ImageRegistrationMethod, ProcessObject);
00077
00079 typedef TFixedImage FixedImageType;
00080 typedef typename FixedImageType::ConstPointer FixedImageConstPointer;
00081
00083 typedef TMovingImage MovingImageType;
00084 typedef typename MovingImageType::ConstPointer MovingImageConstPointer;
00085
00087 typedef ImageToImageMetric< FixedImageType,
00088 MovingImageType > MetricType;
00089 typedef typename MetricType::Pointer MetricPointer;
00090 typedef typename MetricType::FixedImageRegionType FixedImageRegionType;
00091
00093 typedef typename MetricType::TransformType TransformType;
00094 typedef typename TransformType::Pointer TransformPointer;
00095
00098 typedef DataObjectDecorator< TransformType > TransformOutputType;
00099 typedef typename TransformOutputType::Pointer TransformOutputPointer;
00100 typedef typename TransformOutputType::ConstPointer TransformOutputConstPointer;
00101
00103 typedef typename MetricType::InterpolatorType InterpolatorType;
00104 typedef typename InterpolatorType::Pointer InterpolatorPointer;
00105
00107 typedef SingleValuedNonLinearOptimizer OptimizerType;
00108
00111 typedef typename MetricType::TransformParametersType ParametersType;
00112
00114 typedef typename DataObject::Pointer DataObjectPointer;
00115
00120 void StartRegistration(void);
00121
00127 void StartOptimization(void);
00128
00130 void SetFixedImage( const FixedImageType * fixedImage );
00131 itkGetConstObjectMacro( FixedImage, FixedImageType );
00133
00135 void SetMovingImage( const MovingImageType * movingImage );
00136 itkGetConstObjectMacro( MovingImage, MovingImageType );
00138
00140 itkSetObjectMacro( Optimizer, OptimizerType );
00141 itkGetObjectMacro( Optimizer, OptimizerType );
00143
00145 itkSetObjectMacro( Metric, MetricType );
00146 itkGetObjectMacro( Metric, MetricType );
00148
00150 itkSetObjectMacro( Transform, TransformType );
00151 itkGetObjectMacro( Transform, TransformType );
00153
00155 itkSetObjectMacro( Interpolator, InterpolatorType );
00156 itkGetObjectMacro( Interpolator, InterpolatorType );
00158
00160 virtual void SetInitialTransformParameters( const ParametersType & param );
00161 itkGetConstReferenceMacro( InitialTransformParameters, ParametersType );
00163
00166 itkGetConstReferenceMacro( LastTransformParameters, ParametersType );
00167
00175 void SetFixedImageRegion( const FixedImageRegionType & region );
00176
00181 itkGetConstReferenceMacro( FixedImageRegion, FixedImageRegionType );
00182
00185 itkGetMacro( FixedImageRegionDefined, bool );
00186
00191 itkSetMacro( FixedImageRegionDefined, bool );
00192
00194 virtual void Initialize() throw (ExceptionObject);
00195
00197 const TransformOutputType * GetOutput() const;
00198
00201 virtual DataObjectPointer MakeOutput(unsigned int idx);
00202
00205 unsigned long GetMTime() const;
00206
00207 protected:
00208 ImageRegistrationMethod();
00209 virtual ~ImageRegistrationMethod() {};
00210 void PrintSelf(std::ostream& os, Indent indent) const;
00211
00214 void GenerateData ();
00215
00217 itkSetMacro( LastTransformParameters, ParametersType );
00218
00219
00220 private:
00221 ImageRegistrationMethod(const Self&);
00222 void operator=(const Self&);
00223
00224 MetricPointer m_Metric;
00225 OptimizerType::Pointer m_Optimizer;
00226
00227 MovingImageConstPointer m_MovingImage;
00228 FixedImageConstPointer m_FixedImage;
00229
00230 TransformPointer m_Transform;
00231 InterpolatorPointer m_Interpolator;
00232
00233 ParametersType m_InitialTransformParameters;
00234 ParametersType m_LastTransformParameters;
00235
00236 bool m_FixedImageRegionDefined;
00237 FixedImageRegionType m_FixedImageRegion;
00238
00239 };
00240
00241
00242 }
00243
00244
00245 #ifndef ITK_MANUAL_INSTANTIATION
00246 #include "itkImageRegistrationMethod.txx"
00247 #endif
00248
00249 #endif
00250