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

itkCurvatureRegistrationFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkCurvatureRegistrationFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-23 16:15:23 $
00007   Version:   $Revision: 1.4 $
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 __itkCurvatureRegistrationFilter_h
00018 #define __itkCurvatureRegistrationFilter_h
00019 
00020 #include "itkPDEDeformableRegistrationFilter.h"
00021 #include "itkMeanSquareRegistrationFunction.h"
00022 
00023 #if defined(USE_FFTWF) || defined(USE_FFTWD)
00024 #include "fftw3.h"
00025 
00026 namespace itk {
00027 
00095 template<class TFixedImage, class TMovingImage, class TDeformationField,
00096   class TImageForceFunction =
00097   MeanSquareRegistrationFunction<TFixedImage,TMovingImage,TDeformationField> >
00098 class ITK_EXPORT CurvatureRegistrationFilter :
00099     public PDEDeformableRegistrationFilter< TFixedImage, TMovingImage,
00100                                             TDeformationField>
00101 {
00102 public:
00104   typedef CurvatureRegistrationFilter             Self;
00105   typedef PDEDeformableRegistrationFilter<
00106     TFixedImage, TMovingImage,TDeformationField>  Superclass;
00107   typedef SmartPointer<Self>                      Pointer;
00108   typedef SmartPointer<const Self>                ConstPointer;
00109 
00111   itkNewMacro(Self);
00112 
00114   itkTypeMacro( CurvatureRegistrationFilter, 
00115                 PDEDeformableRegistrationFilter );
00116 
00118   typedef typename Superclass::TimeStepType  TimeStepType;
00119 
00121   typedef typename Superclass::FixedImageType     FixedImageType;
00122   typedef typename Superclass::FixedImagePointer  FixedImagePointer;
00123   itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension );
00124 
00126   typedef typename Superclass::MovingImageType     MovingImageType;
00127   typedef typename Superclass::MovingImagePointer  MovingImagePointer;
00128 
00130   typedef typename Superclass::DeformationFieldType 
00131                                                    DeformationFieldType;
00132   typedef typename Superclass::DeformationFieldPointer  
00133                                                    DeformationFieldPointer;
00134 
00135   typedef typename TDeformationField::PixelType         DeformationFieldPixelType;
00136   typedef typename DeformationFieldPixelType::ValueType DeformationFieldComponentType;
00137   itkStaticConstMacro(DeformationVectorDimension, unsigned int, DeformationFieldPixelType::Dimension );
00138 
00139   #if defined(USE_FFTWD)
00140   //Prefer to use double precision
00141   typedef double RealTypeDFT;
00142   #else
00143     #if defined(USE_FFTWF)
00144       //Allow to use single precision
00145       #warning "Using single precision for FFT computations!"
00146       typedef double RealTypeDFT;
00147     #endif
00148   #endif
00149 
00150   typedef Image<RealTypeDFT,TDeformationField::ImageDimension> DeformationFieldComponentImageType;
00151   typedef typename DeformationFieldComponentImageType::Pointer DeformationFieldComponentImagePointer;
00152 
00154   typedef typename Superclass::FiniteDifferenceFunctionType
00155   FiniteDifferenceFunctionType;
00156 
00158   typedef TImageForceFunction RegistrationFunctionType;
00159 
00161   void SetConstraintWeight( const float w ) { m_ConstraintWeight = w; }
00162 
00164   void SetTimeStep( const TimeStepType ts ) { m_TimeStep = ts; }
00165 
00171   virtual double GetMetric() const;
00172 
00173 protected:
00174   CurvatureRegistrationFilter();
00175   ~CurvatureRegistrationFilter();
00176   void PrintSelf(std::ostream& os, Indent indent) const;
00177 
00179   virtual void Initialize();
00180 
00182   virtual void ApplyUpdate(TimeStepType dt);
00183 
00184 private:
00185   CurvatureRegistrationFilter(const Self&); //purposely not implemented
00186   void operator=(const Self&); //purposely not implemented
00187 
00188   int m_FixedImageDimensions[ImageDimension];
00189 
00190   RealTypeDFT* m_DeformationFieldComponentImage;
00191   RealTypeDFT* m_DeformationFieldComponentImageDCT;
00192 
00193   float m_ConstraintWeight;
00194 
00195   fftw_plan m_PlanForwardDCT;
00196   fftw_plan m_PlanBackwardDCT;
00197 
00198   TimeStepType m_TimeStep;
00199 
00200   RealTypeDFT* m_DiagonalElements[ImageDimension];
00201 };
00202 
00203 
00204 } // end namespace itk
00205 
00206 #ifndef ITK_MANUAL_INSTANTIATION
00207 #include "itkCurvatureRegistrationFilter.txx"
00208 #endif
00209 
00210 #endif //defined(USE_FFTWF) || defined(USE_FFTWD)
00211 
00212 #endif
00213 

Generated at Wed Nov 5 21:02:45 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000