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

itkPDEDeformableRegistrationFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkPDEDeformableRegistrationFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/09/29 14:20:40 $
00007   Version:   $Revision: 1.23 $
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 _itkPDEDeformableRegistrationFilter_h_
00018 #define _itkPDEDeformableRegistrationFilter_h_
00019 
00020 #include "itkDenseFiniteDifferenceImageFilter.h"
00021 #include "itkPDEDeformableRegistrationFunction.h"
00022 
00023 namespace itk {
00024 
00070 template<class TFixedImage, class TMovingImage, class TDeformationField>
00071 class ITK_EXPORT PDEDeformableRegistrationFilter : 
00072     public DenseFiniteDifferenceImageFilter<TDeformationField,TDeformationField>
00073 {
00074 public:
00075 
00077   typedef PDEDeformableRegistrationFilter    Self;
00078   typedef DenseFiniteDifferenceImageFilter<
00079     TDeformationField,TDeformationField>    Superclass;
00080   typedef SmartPointer<Self> Pointer;
00081   typedef SmartPointer<const Self> ConstPointer;
00082 
00084   itkNewMacro(Self);
00085 
00087   itkTypeMacro( PDEDeformableRegistrationFilter, 
00088                 DenseFiniteDifferenceImageFilter );
00089 
00091   typedef TFixedImage   FixedImageType;
00092   typedef typename FixedImageType::Pointer  FixedImagePointer;
00093   typedef typename FixedImageType::ConstPointer  FixedImageConstPointer;
00094 
00096   typedef TMovingImage    MovingImageType;
00097   typedef typename MovingImageType::Pointer  MovingImagePointer;
00098   typedef typename MovingImageType::ConstPointer  MovingImageConstPointer;
00099 
00101   typedef TDeformationField    DeformationFieldType;
00102   typedef typename DeformationFieldType::Pointer  DeformationFieldPointer;
00103 
00105   typedef typename Superclass::OutputImageType    OutputImageType;
00106 
00108   typedef typename Superclass::FiniteDifferenceFunctionType
00109   FiniteDifferenceFunctionType;
00110 
00112   typedef PDEDeformableRegistrationFunction<FixedImageType,MovingImageType,
00113                                             DeformationFieldType>  PDEDeformableRegistrationFunctionType;
00114 
00116   itkStaticConstMacro(ImageDimension, unsigned int,
00117                       Superclass::ImageDimension);
00118 
00120   void SetFixedImage( const FixedImageType * ptr );
00121 
00123   const FixedImageType * GetFixedImage(void) const;
00124 
00126   void SetMovingImage( const MovingImageType * ptr );
00127 
00129   const MovingImageType * GetMovingImage(void) const;
00130 
00132   void SetInitialDeformationField( DeformationFieldType * ptr )
00133   { this->SetInput( ptr ); }
00134 
00136   DeformationFieldType * GetDeformationField()
00137   { return this->GetOutput(); }
00138 
00144   virtual std::vector<SmartPointer<DataObject> >::size_type GetNumberOfValidRequiredInputs() const;
00145 
00151   itkSetMacro( SmoothDeformationField, bool );
00152   itkGetMacro( SmoothDeformationField, bool );
00153   itkBooleanMacro( SmoothDeformationField );
00155 
00159   itkSetVectorMacro( StandardDeviations, double, ImageDimension );
00160   virtual void SetStandardDeviations( double value );
00162 
00165   const double * GetStandardDeviations(void) 
00166     { return (double *) m_StandardDeviations; }
00167 
00173   itkSetMacro( SmoothUpdateField, bool );
00174   itkGetMacro( SmoothUpdateField, bool );
00175   itkBooleanMacro( SmoothUpdateField );
00177 
00180   itkSetVectorMacro( UpdateFieldStandardDeviations, double, ImageDimension );
00181   virtual void SetUpdateFieldStandardDeviations( double value );
00183 
00186   const double * GetUpdateFieldStandardDeviations(void) 
00187     { return (double *) m_UpdateFieldStandardDeviations; }
00188 
00189   
00190 
00192   virtual void StopRegistration()
00193     { m_StopRegistrationFlag = true; }
00194 
00197   itkSetMacro( MaximumError, double );
00198   itkGetMacro( MaximumError, double );
00200 
00203   itkSetMacro( MaximumKernelWidth, unsigned int );
00204   itkGetMacro( MaximumKernelWidth, unsigned int );
00206 
00207 
00208 protected:
00209   PDEDeformableRegistrationFilter();
00210   ~PDEDeformableRegistrationFilter() {}
00211   void PrintSelf(std::ostream& os, Indent indent) const;
00212 
00215   virtual bool Halt()
00216     {
00217 
00218     if ( m_StopRegistrationFlag )
00219       {
00220       return true;
00221       }
00222 
00223     return this->Superclass::Halt();
00224     }
00225 
00228   virtual void CopyInputToOutput();
00229 
00232   virtual void InitializeIteration();
00233 
00237   virtual void SmoothDeformationField();
00238 
00242   virtual void SmoothUpdateField();
00243 
00246   virtual void PostProcessOutput();
00247 
00249   virtual void Initialize();
00250 
00255   virtual void GenerateOutputInformation();
00256 
00263   virtual void GenerateInputRequestedRegion();
00264 
00265 private:
00266   PDEDeformableRegistrationFilter(const Self&); //purposely not implemented
00267   void operator=(const Self&); //purposely not implemented
00268   
00270   double                   m_StandardDeviations[ImageDimension];
00271   double                   m_UpdateFieldStandardDeviations[ImageDimension];
00272 
00274   bool m_SmoothDeformationField;
00275   bool m_SmoothUpdateField;
00276 
00277   
00280   DeformationFieldPointer   m_TempField;
00281 
00282 private:
00284   double                    m_MaximumError;
00285 
00287   unsigned int              m_MaximumKernelWidth;
00288 
00290   bool                      m_StopRegistrationFlag;
00291 
00292 };
00293 
00294 
00295 } // end namespace itk
00296 
00297 #ifndef ITK_MANUAL_INSTANTIATION
00298 #include "itkPDEDeformableRegistrationFilter.txx"
00299 #endif
00300 
00301 #endif
00302 

Generated at Wed Nov 5 23:28:06 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000