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

itkMultiResolutionImageRegistrationMethod.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMultiResolutionImageRegistrationMethod.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-23 03:53:36 $
00007   Version:   $Revision: 1.12 $
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 __itkMultiResolutionImageRegistrationMethod_h
00018 #define __itkMultiResolutionImageRegistrationMethod_h
00019 
00020 #include "itkProcessObject.h"
00021 #include "itkImageToImageMetric.h"
00022 #include "itkSingleValuedNonLinearOptimizer.h"
00023 #include "itkMultiResolutionPyramidImageFilter.h"
00024 #include "itkNumericTraits.h"
00025 #include "itkDataObjectDecorator.h"
00026 
00027 namespace itk
00028 {
00029 
00070 template <typename TFixedImage, typename TMovingImage>
00071 class ITK_EXPORT MultiResolutionImageRegistrationMethod : public ProcessObject 
00072 {
00073 public:
00075   typedef MultiResolutionImageRegistrationMethod  Self;
00076   typedef ProcessObject                           Superclass;
00077   typedef SmartPointer<Self>                      Pointer;
00078   typedef SmartPointer<const Self>                ConstPointer;
00079 
00081   itkNewMacro(Self);
00082 
00084   itkTypeMacro(MultiResolutionImageRegistrationMethod, ProcessObject);
00085 
00087   typedef          TFixedImage                     FixedImageType;
00088   typedef typename FixedImageType::ConstPointer    FixedImageConstPointer;
00089   typedef typename FixedImageType::RegionType      FixedImageRegionType;
00090 
00092   typedef          TMovingImage                    MovingImageType;
00093   typedef typename MovingImageType::ConstPointer   MovingImageConstPointer;
00094 
00096   typedef ImageToImageMetric< FixedImageType,
00097                               MovingImageType >    MetricType;
00098   typedef typename MetricType::Pointer             MetricPointer;
00099 
00101   typedef typename MetricType::TransformType       TransformType;
00102   typedef typename TransformType::Pointer          TransformPointer;
00103 
00106   typedef  DataObjectDecorator< TransformType >      TransformOutputType;
00107   typedef typename TransformOutputType::Pointer      TransformOutputPointer;
00108   typedef typename TransformOutputType::ConstPointer TransformOutputConstPointer;
00109 
00111   typedef typename MetricType::InterpolatorType    InterpolatorType;
00112   typedef typename InterpolatorType::Pointer       InterpolatorPointer;
00113 
00115   typedef SingleValuedNonLinearOptimizer           OptimizerType;
00116 
00118   typedef MultiResolutionPyramidImageFilter< FixedImageType,
00119                                              FixedImageType >
00120                                                    FixedImagePyramidType;
00121   typedef typename FixedImagePyramidType::Pointer  FixedImagePyramidPointer;
00122 
00124   typedef typename FixedImagePyramidType::ScheduleType ScheduleType;
00125 
00127   typedef MultiResolutionPyramidImageFilter< MovingImageType,
00128                                              MovingImageType >
00129                                                    MovingImagePyramidType;
00130   typedef typename MovingImagePyramidType::Pointer MovingImagePyramidPointer;
00131 
00134   typedef  typename MetricType::TransformParametersType    ParametersType;
00135 
00137   typedef typename DataObject::Pointer DataObjectPointer;
00138 
00140   void StartRegistration();
00141 
00143   void StopRegistration();
00144 
00146   itkSetConstObjectMacro( FixedImage, FixedImageType );
00147   itkGetConstObjectMacro( FixedImage, FixedImageType ); 
00149 
00151   itkSetConstObjectMacro( MovingImage, MovingImageType );
00152   itkGetConstObjectMacro( MovingImage, MovingImageType );
00154 
00156   itkSetObjectMacro( Optimizer,  OptimizerType );
00157   itkGetObjectMacro( Optimizer,  OptimizerType );
00159 
00161   itkSetObjectMacro( Metric, MetricType );
00162   itkGetObjectMacro( Metric, MetricType );
00164 
00166   itkSetMacro( FixedImageRegion, FixedImageRegionType );
00167   itkGetConstReferenceMacro( FixedImageRegion, FixedImageRegionType );
00169 
00171   itkSetObjectMacro( Transform, TransformType );
00172   itkGetObjectMacro( Transform, TransformType );
00174 
00176   itkSetObjectMacro( Interpolator, InterpolatorType );
00177   itkGetObjectMacro( Interpolator, InterpolatorType );
00179 
00181   itkSetObjectMacro( FixedImagePyramid, FixedImagePyramidType );
00182   itkGetObjectMacro( FixedImagePyramid, FixedImagePyramidType ); 
00184 
00186   itkSetObjectMacro( MovingImagePyramid, MovingImagePyramidType );
00187   itkGetObjectMacro( MovingImagePyramid, MovingImagePyramidType );
00189 
00191   void SetSchedules( const ScheduleType & fixedSchedule,
00192                     const ScheduleType & movingSchedule );
00193   itkGetConstMacro( FixedImagePyramidSchedule, ScheduleType ); 
00194   itkGetConstMacro( MovingImagePyramidSchedule, ScheduleType ); 
00196 
00198   void SetNumberOfLevels( unsigned long numberOfLevels );
00199   itkGetConstMacro( NumberOfLevels, unsigned long );
00201 
00203   itkGetConstMacro( CurrentLevel, unsigned long );
00204 
00206   itkSetMacro( InitialTransformParameters, ParametersType );
00207   itkGetConstReferenceMacro( InitialTransformParameters, ParametersType );
00209 
00213   itkSetMacro( InitialTransformParametersOfNextLevel, ParametersType );
00214   itkGetConstReferenceMacro( InitialTransformParametersOfNextLevel, ParametersType );
00216 
00219   itkGetConstReferenceMacro( LastTransformParameters, ParametersType );  
00220 
00222   const TransformOutputType * GetOutput() const;
00223 
00226   virtual DataObjectPointer MakeOutput(unsigned int idx);
00227 
00230   unsigned long GetMTime() const;  
00231 
00232 protected:
00233   MultiResolutionImageRegistrationMethod();
00234   virtual ~MultiResolutionImageRegistrationMethod() {};
00235   void PrintSelf(std::ostream& os, Indent indent) const;
00236 
00239   void  GenerateData ();
00240 
00245   void Initialize() throw (ExceptionObject);
00246 
00248   void PreparePyramids( void );
00249 
00251   itkSetMacro( CurrentLevel, unsigned long );
00252 
00253 private:
00254   MultiResolutionImageRegistrationMethod(const Self&); //purposely not implemented
00255   void operator=(const Self&); //purposely not implemented
00256   
00257   MetricPointer                    m_Metric;
00258   OptimizerType::Pointer           m_Optimizer;
00259 
00260   MovingImageConstPointer          m_MovingImage;
00261   FixedImageConstPointer           m_FixedImage;
00262 
00263   TransformPointer                 m_Transform;
00264   InterpolatorPointer              m_Interpolator;
00265 
00266   MovingImagePyramidPointer        m_MovingImagePyramid;
00267   FixedImagePyramidPointer         m_FixedImagePyramid;
00268 
00269   ParametersType                   m_InitialTransformParameters;
00270   ParametersType                   m_InitialTransformParametersOfNextLevel;
00271   ParametersType                   m_LastTransformParameters;
00272 
00273   FixedImageRegionType               m_FixedImageRegion;
00274   std::vector<FixedImageRegionType>  m_FixedImageRegionPyramid;
00275 
00276   unsigned long                    m_NumberOfLevels;
00277   unsigned long                    m_CurrentLevel;
00278 
00279   bool                             m_Stop;
00280 
00281   ScheduleType                     m_FixedImagePyramidSchedule;
00282   ScheduleType                     m_MovingImagePyramidSchedule;
00283 
00284   bool                             m_ScheduleSpecified;
00285   bool                             m_NumberOfLevelsSpecified;
00286   
00287 };
00288 
00289 
00290 } // end namespace itk
00291 
00292 
00293 #ifndef ITK_MANUAL_INSTANTIATION
00294 #include "itkMultiResolutionImageRegistrationMethod.txx"
00295 #endif
00296 
00297 #endif
00298 

Generated at Thu May 28 10:53:12 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000