Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef __itkMultiResolutionImageRegistrationMethod2_h
00038 #define __itkMultiResolutionImageRegistrationMethod2_h
00039
00040 #include "itkProcessObject.h"
00041 #include "itkAdvancedImageToImageMetric.h"
00042 #include "itkSingleValuedNonLinearOptimizer.h"
00043 #include "itkMultiResolutionPyramidImageFilter.h"
00044 #include "itkNumericTraits.h"
00045 #include "itkDataObjectDecorator.h"
00046
00047 namespace itk
00048 {
00049
00095 template <typename TFixedImage, typename TMovingImage>
00096 class MultiResolutionImageRegistrationMethod2 : public ProcessObject
00097 {
00098 public:
00100 typedef MultiResolutionImageRegistrationMethod2 Self;
00101 typedef ProcessObject Superclass;
00102 typedef SmartPointer<Self> Pointer;
00103 typedef SmartPointer<const Self> ConstPointer;
00104
00106 itkNewMacro( Self );
00107
00109 itkTypeMacro( MultiResolutionImageRegistrationMethod2, ProcessObject );
00110
00112 typedef TFixedImage FixedImageType;
00113 typedef typename FixedImageType::ConstPointer FixedImageConstPointer;
00114 typedef typename FixedImageType::RegionType FixedImageRegionType;
00115 typedef std::vector<FixedImageRegionType> FixedImageRegionPyramidType;
00116
00118 typedef TMovingImage MovingImageType;
00119 typedef typename MovingImageType::ConstPointer MovingImageConstPointer;
00120
00122 typedef AdvancedImageToImageMetric<
00123 FixedImageType, MovingImageType > MetricType;
00124 typedef typename MetricType::Pointer MetricPointer;
00125
00127 typedef typename MetricType::AdvancedTransformType TransformType;
00128 typedef typename TransformType::Pointer TransformPointer;
00129
00133 typedef DataObjectDecorator< TransformType > TransformOutputType;
00134 typedef typename TransformOutputType::Pointer TransformOutputPointer;
00135 typedef typename TransformOutputType::ConstPointer TransformOutputConstPointer;
00136
00138 typedef typename MetricType::InterpolatorType InterpolatorType;
00139 typedef typename InterpolatorType::Pointer InterpolatorPointer;
00140
00142 typedef SingleValuedNonLinearOptimizer OptimizerType;
00143
00145 typedef MultiResolutionPyramidImageFilter<
00146 FixedImageType, FixedImageType > FixedImagePyramidType;
00147 typedef typename FixedImagePyramidType::Pointer FixedImagePyramidPointer;
00148
00150 typedef MultiResolutionPyramidImageFilter<
00151 MovingImageType, MovingImageType > MovingImagePyramidType;
00152 typedef typename MovingImagePyramidType::Pointer MovingImagePyramidPointer;
00153
00157 typedef typename MetricType::TransformParametersType ParametersType;
00158
00160 typedef typename DataObject::Pointer DataObjectPointer;
00161
00163 virtual void StartRegistration( void );
00164
00166 virtual void StopRegistration( void );
00167
00169 itkSetConstObjectMacro( FixedImage, FixedImageType );
00170 itkGetConstObjectMacro( FixedImage, FixedImageType );
00171
00173 itkSetConstObjectMacro( MovingImage, MovingImageType );
00174 itkGetConstObjectMacro( MovingImage, MovingImageType );
00175
00177 itkSetObjectMacro( Optimizer, OptimizerType );
00178 itkGetObjectMacro( Optimizer, OptimizerType );
00179
00181 itkSetObjectMacro( Metric, MetricType );
00182 itkGetObjectMacro( Metric, MetricType );
00183
00185 itkSetMacro( FixedImageRegion, FixedImageRegionType );
00186 itkGetConstReferenceMacro( FixedImageRegion, FixedImageRegionType );
00187
00189 itkSetObjectMacro( Transform, TransformType );
00190 itkGetObjectMacro( Transform, TransformType );
00191
00193 itkSetObjectMacro( Interpolator, InterpolatorType );
00194 itkGetObjectMacro( Interpolator, InterpolatorType );
00195
00197 itkSetObjectMacro( FixedImagePyramid, FixedImagePyramidType );
00198 itkGetObjectMacro( FixedImagePyramid, FixedImagePyramidType );
00199
00201 itkSetObjectMacro( MovingImagePyramid, MovingImagePyramidType );
00202 itkGetObjectMacro( MovingImagePyramid, MovingImagePyramidType );
00203
00205 itkSetClampMacro( NumberOfLevels, unsigned long, 1,
00206 NumericTraits<unsigned long>::max() );
00207 itkGetMacro( NumberOfLevels, unsigned long );
00208
00210 itkGetMacro( CurrentLevel, unsigned long );
00211
00213 itkSetMacro( InitialTransformParameters, ParametersType );
00214 itkGetConstReferenceMacro( InitialTransformParameters, ParametersType );
00215
00220 itkSetMacro( InitialTransformParametersOfNextLevel, ParametersType );
00221 itkGetConstReferenceMacro( InitialTransformParametersOfNextLevel, ParametersType );
00222
00226 itkGetConstReferenceMacro( LastTransformParameters, ParametersType );
00227
00229 const TransformOutputType * GetOutput( void ) const;
00230
00234 virtual DataObjectPointer MakeOutput( unsigned int idx );
00235
00239 unsigned long GetMTime( void ) const;
00240
00241 protected:
00242
00244 MultiResolutionImageRegistrationMethod2();
00245
00247 virtual ~MultiResolutionImageRegistrationMethod2() {};
00248
00250 virtual void PrintSelf(std::ostream& os, Indent indent) const;
00251
00255 virtual void GenerateData( void );
00256
00261 virtual void Initialize() throw (ExceptionObject);
00262
00264 virtual void PreparePyramids( void );
00265
00267 itkSetMacro( CurrentLevel, unsigned long );
00268
00273 ParametersType m_LastTransformParameters;
00274 bool m_Stop;
00275
00276 private:
00277 MultiResolutionImageRegistrationMethod2(const Self&);
00278 void operator=(const Self&);
00279
00281 MetricPointer m_Metric;
00282 OptimizerType::Pointer m_Optimizer;
00283 TransformPointer m_Transform;
00284 InterpolatorPointer m_Interpolator;
00285
00286 ParametersType m_InitialTransformParameters;
00287 ParametersType m_InitialTransformParametersOfNextLevel;
00288
00289 MovingImageConstPointer m_MovingImage;
00290 FixedImageConstPointer m_FixedImage;
00291 MovingImagePyramidPointer m_MovingImagePyramid;
00292 FixedImagePyramidPointer m_FixedImagePyramid;
00293
00294 FixedImageRegionType m_FixedImageRegion;
00295 FixedImageRegionPyramidType m_FixedImageRegionPyramid;
00296
00297 unsigned long m_NumberOfLevels;
00298 unsigned long m_CurrentLevel;
00299
00300 };
00301
00302
00303 }
00304
00305
00306 #ifndef ITK_MANUAL_INSTANTIATION
00307 #include "itkMultiResolutionImageRegistrationMethod2.txx"
00308 #endif
00309
00310 #endif // end #ifndef __itkMultiResolutionImageRegistrationMethod2_h
00311