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: 2003/09/10 14:28:35 $
00007   Version:   $Revision: 1.8 $
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 
00026 namespace itk
00027 {
00028 
00065 template <typename TFixedImage, typename TMovingImage>
00066 class ITK_EXPORT MultiResolutionImageRegistrationMethod : public ProcessObject 
00067 {
00068 public:
00070   typedef MultiResolutionImageRegistrationMethod  Self;
00071   typedef ProcessObject  Superclass;
00072   typedef SmartPointer<Self>   Pointer;
00073   typedef SmartPointer<const Self>  ConstPointer;
00074 
00076   itkNewMacro(Self);
00077 
00079   itkTypeMacro(MultiResolutionImageRegistrationMethod, ProcessObject);
00080 
00082   typedef          TFixedImage                     FixedImageType;
00083   typedef typename FixedImageType::ConstPointer    FixedImageConstPointer;
00084   typedef typename FixedImageType::RegionType      FixedImageRegionType;
00085 
00087   typedef          TMovingImage                    MovingImageType;
00088   typedef typename MovingImageType::ConstPointer   MovingImageConstPointer;
00089 
00091   typedef ImageToImageMetric< FixedImageType,
00092                               MovingImageType >    MetricType;
00093   typedef typename MetricType::Pointer             MetricPointer;
00094 
00096   typedef typename MetricType::TransformType       TransformType;
00097   typedef typename TransformType::Pointer          TransformPointer;
00098 
00100   typedef typename MetricType::InterpolatorType    InterpolatorType;
00101   typedef typename InterpolatorType::Pointer       InterpolatorPointer;
00102 
00104   typedef SingleValuedNonLinearOptimizer           OptimizerType;
00105 
00107   typedef MultiResolutionPyramidImageFilter< FixedImageType,
00108                                              FixedImageType >
00109   FixedImagePyramidType;
00110   typedef typename FixedImagePyramidType::Pointer  FixedImagePyramidPointer;
00111 
00113   typedef MultiResolutionPyramidImageFilter< MovingImageType,
00114                                              MovingImageType >
00115   MovingImagePyramidType;
00116   typedef typename MovingImagePyramidType::Pointer MovingImagePyramidPointer;
00117 
00120   typedef  typename MetricType::TransformParametersType    ParametersType;
00121 
00123   void StartRegistration();
00124 
00126   void StopRegistration();
00127 
00129   itkSetConstObjectMacro( FixedImage, FixedImageType );
00130   itkGetConstObjectMacro( FixedImage, FixedImageType ); 
00132 
00134   itkSetConstObjectMacro( MovingImage, MovingImageType );
00135   itkGetConstObjectMacro( MovingImage, MovingImageType );
00137 
00139   itkSetObjectMacro( Optimizer,  OptimizerType );
00140   itkGetObjectMacro( Optimizer,  OptimizerType );
00142 
00144   itkSetObjectMacro( Metric, MetricType );
00145   itkGetObjectMacro( Metric, MetricType );
00147 
00149   itkSetMacro( FixedImageRegion, FixedImageRegionType );
00150   itkGetConstReferenceMacro( FixedImageRegion, FixedImageRegionType );
00152 
00154   itkSetObjectMacro( Transform, TransformType );
00155   itkGetObjectMacro( Transform, TransformType );
00157 
00159   itkSetObjectMacro( Interpolator, InterpolatorType );
00160   itkGetObjectMacro( Interpolator, InterpolatorType );
00162 
00164   itkSetObjectMacro( FixedImagePyramid, FixedImagePyramidType );
00165   itkGetObjectMacro( FixedImagePyramid, FixedImagePyramidType ); 
00167 
00169   itkSetObjectMacro( MovingImagePyramid, MovingImagePyramidType );
00170   itkGetObjectMacro( MovingImagePyramid, MovingImagePyramidType );
00172 
00174   itkSetClampMacro( NumberOfLevels, unsigned long, 1,
00175                     NumericTraits<unsigned long>::max() );
00176   itkGetMacro( NumberOfLevels, unsigned long );
00178 
00180   itkGetMacro( CurrentLevel, unsigned long );
00181 
00183   itkSetMacro( InitialTransformParameters, ParametersType );
00184   itkGetConstReferenceMacro( InitialTransformParameters, ParametersType );
00186 
00190   itkSetMacro( InitialTransformParametersOfNextLevel, ParametersType );
00191   itkGetConstReferenceMacro( InitialTransformParametersOfNextLevel, ParametersType );
00193 
00196   itkGetConstReferenceMacro( LastTransformParameters, ParametersType );  
00197 
00198 protected:
00199   MultiResolutionImageRegistrationMethod();
00200   virtual ~MultiResolutionImageRegistrationMethod() {};
00201   void PrintSelf(std::ostream& os, Indent indent) const;
00202 
00207   void Initialize() throw (ExceptionObject);
00208 
00210   void PreparePyramids( void );
00211 
00213   itkSetMacro( CurrentLevel, unsigned long );
00214 
00215 private:
00216   MultiResolutionImageRegistrationMethod(const Self&); //purposely not implemented
00217   void operator=(const Self&); //purposely not implemented
00218   
00219   MetricPointer                    m_Metric;
00220   OptimizerType::Pointer           m_Optimizer;
00221 
00222   MovingImageConstPointer          m_MovingImage;
00223   FixedImageConstPointer           m_FixedImage;
00224 
00225   TransformPointer                 m_Transform;
00226   InterpolatorPointer              m_Interpolator;
00227 
00228   MovingImagePyramidPointer        m_MovingImagePyramid;
00229   FixedImagePyramidPointer         m_FixedImagePyramid;
00230 
00231   ParametersType                   m_InitialTransformParameters;
00232   ParametersType                   m_InitialTransformParametersOfNextLevel;
00233   ParametersType                   m_LastTransformParameters;
00234 
00235   FixedImageRegionType               m_FixedImageRegion;
00236   std::vector<FixedImageRegionType>  m_FixedImageRegionPyramid;
00237 
00238   unsigned long                    m_NumberOfLevels;
00239   unsigned long                    m_CurrentLevel;
00240 
00241   bool                             m_Stop;
00242   
00243 };
00244 
00245 
00246 } // end namespace itk
00247 
00248 
00249 #ifndef ITK_MANUAL_INSTANTIATION
00250 #include "itkMultiResolutionImageRegistrationMethod.txx"
00251 #endif
00252 
00253 #endif
00254 
00255 
00256 
00257 

Generated at Fri Sep 8 03:44:33 2006 for ITK by doxygen 1.4.7 written by Dimitri van Heesch, © 1997-2000