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

itkImageRegistrationMethod.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkImageRegistrationMethod.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/11/01 21:57:22 $
00007   Version:   $Revision: 1.19 $
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 __itkImageRegistrationMethod_h
00018 #define __itkImageRegistrationMethod_h
00019 
00020 #include "itkProcessObject.h"
00021 #include "itkImage.h"
00022 #include "itkImageToImageMetric.h"
00023 #include "itkSingleValuedNonLinearOptimizer.h"
00024 #include "itkDataObjectDecorator.h"
00025 
00026 namespace itk
00027 {
00028 
00062 template <typename TFixedImage, typename TMovingImage>
00063 class ITK_EXPORT ImageRegistrationMethod : public ProcessObject 
00064 {
00065 public:
00067   typedef ImageRegistrationMethod  Self;
00068   typedef ProcessObject  Superclass;
00069   typedef SmartPointer<Self>   Pointer;
00070   typedef SmartPointer<const Self>  ConstPointer;
00071 
00073   itkNewMacro(Self);
00074 
00076   itkTypeMacro(ImageRegistrationMethod, ProcessObject);
00077 
00079   typedef          TFixedImage                     FixedImageType;
00080   typedef typename FixedImageType::ConstPointer    FixedImageConstPointer;
00081 
00083   typedef          TMovingImage                     MovingImageType;
00084   typedef typename MovingImageType::ConstPointer    MovingImageConstPointer;
00085 
00087   typedef ImageToImageMetric< FixedImageType,
00088                               MovingImageType >       MetricType;
00089   typedef typename MetricType::Pointer                MetricPointer;
00090   typedef typename MetricType::FixedImageRegionType   FixedImageRegionType;
00091 
00093   typedef  typename MetricType::TransformType      TransformType;
00094   typedef  typename TransformType::Pointer         TransformPointer;
00095 
00098   typedef  DataObjectDecorator< TransformType >    TransformOutputType;
00099   typedef typename TransformOutputType::Pointer    TransformOutputPointer;
00100   typedef typename TransformOutputType::ConstPointer    TransformOutputConstPointer;
00101 
00103   typedef  typename MetricType::InterpolatorType   InterpolatorType;
00104   typedef  typename InterpolatorType::Pointer      InterpolatorPointer;
00105 
00107   typedef   SingleValuedNonLinearOptimizer         OptimizerType;
00108 
00111   typedef  typename MetricType::TransformParametersType    ParametersType;
00112 
00114   typedef typename DataObject::Pointer DataObjectPointer;
00115 
00120   void StartRegistration(void);
00121 
00123   void StartOptimization(void);
00124 
00126   void SetFixedImage( const FixedImageType * fixedImage );
00127   itkGetConstObjectMacro( FixedImage, FixedImageType ); 
00129 
00131   void SetMovingImage( const MovingImageType * movingImage );
00132   itkGetConstObjectMacro( MovingImage, MovingImageType );
00134 
00136   itkSetObjectMacro( Optimizer,  OptimizerType );
00137   itkGetObjectMacro( Optimizer,  OptimizerType );
00139 
00141   itkSetObjectMacro( Metric, MetricType );
00142   itkGetObjectMacro( Metric, MetricType );
00144 
00146   itkSetObjectMacro( Transform, TransformType );
00147   itkGetObjectMacro( Transform, TransformType );
00149 
00151   itkSetObjectMacro( Interpolator, InterpolatorType );
00152   itkGetObjectMacro( Interpolator, InterpolatorType );
00154 
00156   virtual void SetInitialTransformParameters( const ParametersType & param );
00157   itkGetConstReferenceMacro( InitialTransformParameters, ParametersType );
00159 
00162   itkGetConstReferenceMacro( LastTransformParameters, ParametersType );
00163 
00171   void SetFixedImageRegion( const  FixedImageRegionType & region ); 
00172 
00177   itkGetConstReferenceMacro( FixedImageRegion, FixedImageRegionType );
00178 
00181   itkGetMacro( FixedImageRegionDefined, bool );
00182 
00187   itkSetMacro( FixedImageRegionDefined, bool );
00188 
00190   virtual void Initialize() throw (ExceptionObject);
00191 
00193   const TransformOutputType * GetOutput() const;
00194 
00197   virtual DataObjectPointer MakeOutput(unsigned int idx);
00198 
00201   unsigned long GetMTime() const;  
00202 
00203 protected:
00204   ImageRegistrationMethod();
00205   virtual ~ImageRegistrationMethod() {};
00206   void PrintSelf(std::ostream& os, Indent indent) const;
00207 
00210   void  GenerateData ();
00211 
00213   itkSetMacro( LastTransformParameters, ParametersType );
00214 
00215 
00216 private:
00217   ImageRegistrationMethod(const Self&); //purposely not implemented
00218   void operator=(const Self&); //purposely not implemented
00219   
00220   MetricPointer                    m_Metric;
00221   OptimizerType::Pointer           m_Optimizer;
00222 
00223   MovingImageConstPointer          m_MovingImage;
00224   FixedImageConstPointer           m_FixedImage;
00225 
00226   TransformPointer                 m_Transform;
00227   InterpolatorPointer              m_Interpolator;
00228 
00229   ParametersType                   m_InitialTransformParameters;
00230   ParametersType                   m_LastTransformParameters;
00231   
00232   bool                             m_FixedImageRegionDefined;
00233   FixedImageRegionType             m_FixedImageRegion;
00234 
00235 };
00236 
00237 
00238 } // end namespace itk
00239 
00240 
00241 #ifndef ITK_MANUAL_INSTANTIATION
00242 #include "itkImageRegistrationMethod.txx"
00243 #endif
00244 
00245 #endif
00246 
00247 
00248 
00249 

Generated at Mon Mar 12 01:07:44 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000