go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkMultiMetricMultiResolutionImageRegistrationMethod.h
Go to the documentation of this file.
00001 /*======================================================================
00002 
00003   This file is part of the elastix software.
00004 
00005   Copyright (c) University Medical Center Utrecht. All rights reserved.
00006   See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00007   details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE. See the above copyright notices for more information.
00012 
00013 ======================================================================*/
00014 
00015 #ifndef __itkMultiMetricMultiResolutionImageRegistrationMethod_h
00016 #define __itkMultiMetricMultiResolutionImageRegistrationMethod_h
00017 
00018 #include "itkMultiResolutionImageRegistrationMethod2.h"
00019 #include "itkCombinationImageToImageMetric.h"
00020 #include <vector>
00021 
00024 #define itkSimpleSetMacro(_name,_type) \
00025   virtual void Set##_name( _type _arg ) \
00026   { \
00027     this->Set##_name ( _arg, 0 ); \
00028   }
00029 
00031 #define itkSetNumberOfMacro(_name) \
00032   virtual void SetNumberOf##_name##s(unsigned int _arg) \
00033   { \
00034     if ( this->m_##_name##s.size() != _arg ) \
00035     { \
00036       this->m_##_name##s.resize( _arg ); \
00037       this->Modified(); \
00038     } \
00039   }
00040 
00042 #define itkGetNumberOfMacro(_name) \
00043   virtual unsigned int GetNumberOf##_name##s(void) const \
00044   { \
00045     return this->m_##_name##s.size(); \
00046   }
00047 
00048 
00049 namespace itk
00050 {
00051 
00080 template <typename TFixedImage, typename TMovingImage>
00081 class ITK_EXPORT MultiMetricMultiResolutionImageRegistrationMethod :
00082   public MultiResolutionImageRegistrationMethod2<TFixedImage, TMovingImage>
00083 {
00084 public:
00086   typedef MultiMetricMultiResolutionImageRegistrationMethod  Self;
00087   typedef MultiResolutionImageRegistrationMethod2<
00088     TFixedImage, TMovingImage>                               Superclass;
00089   typedef SmartPointer<Self>                                 Pointer;
00090   typedef SmartPointer<const Self>                           ConstPointer;
00091 
00093   itkNewMacro( Self );
00094 
00096   itkTypeMacro( MultiMetricMultiResolutionImageRegistrationMethod,
00097     MultiResolutionImageRegistrationMethod2 );
00098 
00100   typedef typename Superclass::FixedImageType           FixedImageType;
00101   typedef typename Superclass::FixedImageConstPointer   FixedImageConstPointer;
00102   typedef typename Superclass::FixedImageRegionType     FixedImageRegionType;
00103   typedef typename Superclass::MovingImageType          MovingImageType;
00104   typedef typename Superclass::MovingImageConstPointer  MovingImageConstPointer;
00105 
00106   typedef typename Superclass::MetricType               MetricType;
00107   typedef typename Superclass::MetricPointer            MetricPointer;
00108   typedef typename Superclass::TransformType            TransformType;
00109   typedef typename Superclass::TransformPointer         TransformPointer;
00110   typedef typename Superclass::InterpolatorType         InterpolatorType;
00111   typedef typename Superclass::InterpolatorPointer      InterpolatorPointer;
00112   typedef typename Superclass::OptimizerType            OptimizerType;
00113   typedef typename OptimizerType::Pointer               OptimizerPointer;
00114   typedef typename Superclass::FixedImagePyramidType    FixedImagePyramidType;
00115   typedef typename Superclass::FixedImagePyramidPointer FixedImagePyramidPointer;
00116   typedef typename Superclass::MovingImagePyramidType   MovingImagePyramidType;
00117   typedef typename
00118     Superclass::MovingImagePyramidPointer               MovingImagePyramidPointer;
00119 
00120   typedef typename Superclass::TransformOutputType      TransformOutputType;
00121   typedef typename Superclass::TransformOutputPointer   TransformOutputPointer;
00122   typedef typename
00123     Superclass::TransformOutputConstPointer             TransformOutputConstPointer;
00124 
00125   typedef typename Superclass::ParametersType           ParametersType;
00126   typedef typename Superclass::DataObjectPointer        DataObjectPointer;
00127 
00129   typedef CombinationImageToImageMetric<
00130     FixedImageType, MovingImageType >                   CombinationMetricType;
00131   typedef typename CombinationMetricType::Pointer       CombinationMetricPointer;
00132 
00137   virtual void StopMultiMetricRegistration( void )
00138   {
00139     this->m_Stop = true;
00140   }
00141 
00148   virtual void SetMetric( MetricType * _arg );
00149 
00154   virtual CombinationMetricType * GetCombinationMetric( void ) const
00155   {
00156     return this->m_CombinationMetric.GetPointer();
00157   }
00158 
00167   virtual void SetFixedImage( const FixedImageType * _arg, unsigned int pos );
00168   virtual const FixedImageType * GetFixedImage( unsigned int pos ) const;
00169   virtual const FixedImageType * GetFixedImage( void ) const
00170   {
00171     return this->GetFixedImage(0);
00172   }
00173   itkSimpleSetMacro( FixedImage, const FixedImageType * );
00174   itkSetNumberOfMacro( FixedImage );
00175   itkGetNumberOfMacro( FixedImage );
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 SetFixedImageRegion( FixedImageRegionType _arg, unsigned int pos );
00188   virtual const FixedImageRegionType & GetFixedImageRegion( unsigned int pos ) const;
00189   virtual const FixedImageRegionType & GetFixedImageRegion( void ) const
00190   { return this->GetFixedImageRegion(0); }
00191   itkSimpleSetMacro( FixedImageRegion, const FixedImageRegionType );
00192   itkSetNumberOfMacro( FixedImageRegion );
00193   itkGetNumberOfMacro( FixedImageRegion );
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 SetFixedImagePyramid( FixedImagePyramidType * _arg, unsigned int pos );
00206   virtual FixedImagePyramidType * GetFixedImagePyramid( unsigned int pos ) const;
00207   virtual FixedImagePyramidType * GetFixedImagePyramid( void )
00208   { return this->GetFixedImagePyramid(0); }
00209   itkSimpleSetMacro( FixedImagePyramid, FixedImagePyramidType * );
00210   itkSetNumberOfMacro( FixedImagePyramid );
00211   itkGetNumberOfMacro( FixedImagePyramid );
00212 
00214   virtual void SetMovingImagePyramid( MovingImagePyramidType * _arg, unsigned int pos );
00215   virtual MovingImagePyramidType * GetMovingImagePyramid( unsigned int pos ) const;
00216   virtual MovingImagePyramidType * GetMovingImagePyramid( void )
00217   { return this->GetMovingImagePyramid(0); }
00218   itkSimpleSetMacro( MovingImagePyramid, MovingImagePyramidType * );
00219   itkSetNumberOfMacro( MovingImagePyramid );
00220   itkGetNumberOfMacro( MovingImagePyramid );
00221 
00225   unsigned long GetMTime( void ) const;
00226 
00231   virtual const ParametersType & GetLastTransformParameters( void ) const
00232   {
00233     return this->m_LastTransformParameters;
00234   }
00235 
00236 protected:
00237   MultiMetricMultiResolutionImageRegistrationMethod();
00238   virtual ~MultiMetricMultiResolutionImageRegistrationMethod() {};
00239   void PrintSelf( std::ostream& os, Indent indent ) const;
00240 
00241   typedef std::vector<FixedImageRegionType>  FixedImageRegionPyramidType;
00242 
00246   virtual void GenerateData( void );
00247 
00252   virtual void Initialize( void ) throw (ExceptionObject);
00253 
00258   virtual void PrepareAllPyramids( void );
00259 
00263   virtual void CheckPyramids( void ) throw (ExceptionObject);
00264 
00268   virtual void CheckOnInitialize( void ) throw (ExceptionObject);
00269 
00271   bool m_Stop;
00272   ParametersType m_LastTransformParameters;
00273 
00275   CombinationMetricPointer m_CombinationMetric;
00276 
00278   std::vector<FixedImageConstPointer>       m_FixedImages;
00279   std::vector<MovingImageConstPointer>      m_MovingImages;
00280   std::vector<FixedImageRegionType>         m_FixedImageRegions;
00281   std::vector<FixedImagePyramidPointer>     m_FixedImagePyramids;
00282   std::vector<MovingImagePyramidPointer>    m_MovingImagePyramids;
00283   std::vector<InterpolatorPointer>          m_Interpolators;
00284 
00286   std::vector<FixedImageRegionPyramidType>  m_FixedImageRegionPyramids;
00287 
00289   FixedImageRegionType m_NullFixedImageRegion;
00290 
00291 private:
00292   MultiMetricMultiResolutionImageRegistrationMethod(const Self&); //purposely not implemented
00293   void operator=(const Self&); //purposely not implemented
00294 
00295 }; // end class
00296 
00297 
00298 } // end namespace itk
00299 
00300 #undef itkSetNumberOfMacro
00301 #undef itkGetNumberOfMacro
00302 #undef itkSimpleSetMacro
00303 
00304 #ifndef ITK_MANUAL_INSTANTIATION
00305 #include "itkMultiMetricMultiResolutionImageRegistrationMethod.txx"
00306 #endif
00307 
00308 #endif
00309 


Generated on 24-10-2011 for elastix by doxygen 1.7.4 elastix logo