Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __itkMultiInputMultiResolutionImageRegistrationMethodBase_h
00016 #define __itkMultiInputMultiResolutionImageRegistrationMethodBase_h
00017
00018 #include "itkMultiResolutionImageRegistrationMethod2.h"
00019 #include "itkMultiInputImageToImageMetricBase.h"
00020 #include <vector>
00021
00025 #define itkSimpleSetMacro(_name,_type) \
00026 virtual void Set##_name( _type _arg ) \
00027 { \
00028 this->Set##_name ( _arg, 0 ); \
00029 }
00030
00032 #define itkSetNumberOfMacro(_name) \
00033 virtual void SetNumberOf##_name##s(unsigned int _arg) \
00034 { \
00035 if ( this->m_##_name##s.size() != _arg ) \
00036 { \
00037 this->m_##_name##s.resize( _arg ); \
00038 this->Modified(); \
00039 } \
00040 }
00041
00043 #define itkGetNumberOfMacro(_name) \
00044 virtual unsigned int GetNumberOf##_name##s(void) const \
00045 { \
00046 return this->m_##_name##s.size(); \
00047 }
00048
00049
00050 namespace itk
00051 {
00052
00073 template <typename TFixedImage, typename TMovingImage>
00074 class ITK_EXPORT MultiInputMultiResolutionImageRegistrationMethodBase :
00075 public MultiResolutionImageRegistrationMethod2<TFixedImage, TMovingImage>
00076 {
00077 public:
00079 typedef MultiInputMultiResolutionImageRegistrationMethodBase Self;
00080 typedef MultiResolutionImageRegistrationMethod2<
00081 TFixedImage, TMovingImage> Superclass;
00082 typedef SmartPointer<Self> Pointer;
00083 typedef SmartPointer<const Self> ConstPointer;
00084
00086 itkNewMacro( Self );
00087
00089 itkTypeMacro( MultiInputMultiResolutionImageRegistrationMethodBase,
00090 MultiResolutionImageRegistrationMethod2 );
00091
00093 typedef typename Superclass::FixedImageType FixedImageType;
00094 typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
00095 typedef typename Superclass::FixedImageRegionType FixedImageRegionType;
00096 typedef typename Superclass::FixedImageRegionPyramidType FixedImageRegionPyramidType;
00097 typedef typename Superclass::MovingImageType MovingImageType;
00098 typedef typename Superclass::MovingImageConstPointer MovingImageConstPointer;
00099
00100 typedef typename Superclass::MetricType MetricType;
00101 typedef typename Superclass::MetricPointer MetricPointer;
00102 typedef typename Superclass::TransformType TransformType;
00103 typedef typename Superclass::TransformPointer TransformPointer;
00104 typedef typename Superclass::InterpolatorType InterpolatorType;
00105 typedef typename Superclass::InterpolatorPointer InterpolatorPointer;
00106 typedef typename Superclass::OptimizerType OptimizerType;
00107 typedef typename OptimizerType::Pointer OptimizerPointer;
00108 typedef typename Superclass::FixedImagePyramidType FixedImagePyramidType;
00109 typedef typename Superclass::FixedImagePyramidPointer FixedImagePyramidPointer;
00110 typedef typename Superclass::MovingImagePyramidType MovingImagePyramidType;
00111 typedef typename
00112 Superclass::MovingImagePyramidPointer MovingImagePyramidPointer;
00113
00114 typedef typename Superclass::TransformOutputType TransformOutputType;
00115 typedef typename Superclass::TransformOutputPointer TransformOutputPointer;
00116 typedef typename
00117 Superclass::TransformOutputConstPointer TransformOutputConstPointer;
00118
00119 typedef typename Superclass::ParametersType ParametersType;
00120 typedef typename Superclass::DataObjectPointer DataObjectPointer;
00121
00122 typedef std::vector< FixedImageRegionPyramidType > FixedImageRegionPyramidVectorType;
00123
00125 typedef MultiInputImageToImageMetricBase<
00126 FixedImageType, MovingImageType > MultiInputMetricType;
00127 typedef typename MultiInputMetricType::Pointer MultiInputMetricPointer;
00128 typedef typename MultiInputMetricType
00129 ::FixedImageVectorType FixedImageVectorType;
00130 typedef typename MultiInputMetricType
00131 ::FixedImageRegionVectorType FixedImageRegionVectorType;
00132 typedef typename MultiInputMetricType
00133 ::MovingImageVectorType MovingImageVectorType;
00134 typedef typename MultiInputMetricType
00135 ::InterpolatorVectorType InterpolatorVectorType;
00136 typedef typename MultiInputMetricType
00137 ::FixedImageInterpolatorType FixedImageInterpolatorType;
00138 typedef typename MultiInputMetricType
00139 ::FixedImageInterpolatorVectorType FixedImageInterpolatorVectorType;
00140 typedef std::vector<FixedImagePyramidPointer> FixedImagePyramidVectorType;
00141 typedef std::vector<MovingImagePyramidPointer> MovingImagePyramidVectorType;
00142
00151 virtual void SetFixedImage( const FixedImageType * _arg, unsigned int pos );
00152 virtual const FixedImageType * GetFixedImage( unsigned int pos ) const;
00153 virtual const FixedImageType * GetFixedImage( void ) const
00154 { return this->GetFixedImage( 0 ); }
00155 itkSimpleSetMacro( FixedImage, const FixedImageType * );
00156 itkSetNumberOfMacro( FixedImage );
00157 itkGetNumberOfMacro( FixedImage );
00158
00160 virtual void SetFixedImageRegion( FixedImageRegionType _arg, unsigned int pos );
00161 virtual const FixedImageRegionType & GetFixedImageRegion( unsigned int pos ) const;
00162 virtual const FixedImageRegionType & GetFixedImageRegion( void ) const
00163 { return this->GetFixedImageRegion( 0 ); }
00164 itkSimpleSetMacro( FixedImageRegion, const FixedImageRegionType );
00165 itkSetNumberOfMacro( FixedImageRegion );
00166 itkGetNumberOfMacro( FixedImageRegion );
00167
00169 virtual void SetFixedImagePyramid( FixedImagePyramidType * _arg, unsigned int pos );
00170 virtual FixedImagePyramidType * GetFixedImagePyramid( unsigned int pos ) const;
00171 virtual FixedImagePyramidType * GetFixedImagePyramid( void )
00172 { return this->GetFixedImagePyramid( 0 ); }
00173 itkSimpleSetMacro( FixedImagePyramid, FixedImagePyramidType * );
00174 itkSetNumberOfMacro( FixedImagePyramid );
00175 itkGetNumberOfMacro( FixedImagePyramid );
00176
00178 virtual void SetMovingImage( const MovingImageType * _arg, unsigned int pos );
00179 virtual const MovingImageType * GetMovingImage( unsigned int pos ) const;
00180 virtual const MovingImageType * GetMovingImage( void ) const
00181 { return this->GetMovingImage( 0 ); }
00182 itkSimpleSetMacro( MovingImage, const MovingImageType * );
00183 itkSetNumberOfMacro( MovingImage );
00184 itkGetNumberOfMacro( MovingImage );
00185
00187 virtual void SetMovingImagePyramid( MovingImagePyramidType * _arg, unsigned int pos );
00188 virtual MovingImagePyramidType * GetMovingImagePyramid( unsigned int pos ) const;
00189 virtual MovingImagePyramidType * GetMovingImagePyramid( void )
00190 { return this->GetMovingImagePyramid( 0 ); }
00191 itkSimpleSetMacro( MovingImagePyramid, MovingImagePyramidType * );
00192 itkSetNumberOfMacro( MovingImagePyramid );
00193 itkGetNumberOfMacro( MovingImagePyramid );
00194
00196 virtual void SetInterpolator( InterpolatorType * _arg, unsigned int pos );
00197 virtual InterpolatorType * GetInterpolator( unsigned int pos ) const;
00198 virtual InterpolatorType * GetInterpolator( void )
00199 { return this->GetInterpolator( 0 ); }
00200 itkSimpleSetMacro( Interpolator, InterpolatorType * );
00201 itkSetNumberOfMacro( Interpolator );
00202 itkGetNumberOfMacro( Interpolator );
00203
00205 virtual void SetFixedImageInterpolator( FixedImageInterpolatorType * _arg, unsigned int pos );
00206 virtual FixedImageInterpolatorType * GetFixedImageInterpolator( unsigned int pos ) const;
00207 virtual FixedImageInterpolatorType * GetFixedImageInterpolator( void )
00208 { return this->GetFixedImageInterpolator( 0 ); }
00209 itkSimpleSetMacro( FixedImageInterpolator, FixedImageInterpolatorType * );
00210 itkSetNumberOfMacro( FixedImageInterpolator );
00211 itkGetNumberOfMacro( FixedImageInterpolator );
00212
00214 virtual void SetMetric( MetricType * _arg );
00215
00217 itkGetObjectMacro( MultiInputMetric, MultiInputMetricType );
00218
00222 unsigned long GetMTime( void ) const;
00223
00224 protected:
00225
00227 MultiInputMultiResolutionImageRegistrationMethodBase();
00228
00230 virtual ~MultiInputMultiResolutionImageRegistrationMethodBase() {};
00231
00233 void PrintSelf( std::ostream& os, Indent indent ) const;
00234
00238 virtual void GenerateData();
00239
00244 virtual void Initialize() throw (ExceptionObject);
00245
00247 virtual void PreparePyramids( void );
00248
00252 virtual void CheckPyramids( void ) throw (ExceptionObject);
00253
00255 virtual void CheckOnInitialize( void ) throw (ExceptionObject);
00256
00258 FixedImageVectorType m_FixedImages;
00259 MovingImageVectorType m_MovingImages;
00260 FixedImageRegionVectorType m_FixedImageRegions;
00261 FixedImagePyramidVectorType m_FixedImagePyramids;
00262 MovingImagePyramidVectorType m_MovingImagePyramids;
00263 InterpolatorVectorType m_Interpolators;
00264 FixedImageInterpolatorVectorType m_FixedImageInterpolators;
00265
00267 FixedImageRegionPyramidVectorType m_FixedImageRegionPyramids;
00268
00270 FixedImageRegionType m_NullFixedImageRegion;
00271
00272 private:
00273 MultiInputMultiResolutionImageRegistrationMethodBase(const Self&);
00274 void operator=(const Self&);
00275
00276 MultiInputMetricPointer m_MultiInputMetric;
00277
00278 };
00279
00280
00281 }
00282
00283 #undef itkSetNumberOfMacro
00284 #undef itkGetNumberOfMacro
00285 #undef itkSimpleSetMacro
00286
00287 #ifndef ITK_MANUAL_INSTANTIATION
00288 #include "itkMultiInputMultiResolutionImageRegistrationMethodBase.txx"
00289 #endif
00290
00291 #endif // end #ifndef __itkMultiInputMultiResolutionImageRegistrationMethodBase_h
00292