00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _itkCurvatureRegistrationFilter_h_
00018 #define _itkCurvatureRegistrationFilter_h_
00019
00020 #include "itkPDEDeformableRegistrationFilter.h"
00021 #include "itkMeanSquareRegistrationFunction.h"
00022
00023 #ifdef USE_FFTW
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 typedef double RealTypeDFT;
00140
00141 typedef Image<RealTypeDFT,TDeformationField::ImageDimension> DeformationFieldComponentImageType;
00142 typedef typename DeformationFieldComponentImageType::Pointer DeformationFieldComponentImagePointer;
00143
00145 typedef typename Superclass::FiniteDifferenceFunctionType
00146 FiniteDifferenceFunctionType;
00147
00149 typedef TImageForceFunction RegistrationFunctionType;
00150
00152 void SetConstraintWeight( const float w ) { m_ConstraintWeight = w; }
00153
00155 void SetTimeStep( const TimeStepType ts ) { m_TimeStep = ts; }
00156
00162 virtual double GetMetric() const;
00163
00164 protected:
00165 CurvatureRegistrationFilter();
00166 ~CurvatureRegistrationFilter();
00167 void PrintSelf(std::ostream& os, Indent indent) const;
00168
00170 virtual void Initialize();
00171
00173 virtual void ApplyUpdate(TimeStepType dt);
00174
00175 private:
00176 CurvatureRegistrationFilter(const Self&);
00177 void operator=(const Self&);
00178
00179 int m_FixedImageDimensions[ImageDimension];
00180
00181 RealTypeDFT* m_DeformationFieldComponentImage;
00182 RealTypeDFT* m_DeformationFieldComponentImageDCT;
00183
00184 float m_ConstraintWeight;
00185
00186 fftw_plan m_PlanForwardDCT;
00187 fftw_plan m_PlanBackwardDCT;
00188
00189 TimeStepType m_TimeStep;
00190
00191 RealTypeDFT* m_DiagonalElements[ImageDimension];
00192 };
00193
00194
00195 }
00196
00197 #ifndef ITK_MANUAL_INSTANTIATION
00198 #include "itkCurvatureRegistrationFilter.txx"
00199 #endif
00200
00201 #endif // #ifdef USE_FFTW
00202
00203 #endif