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 #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
00141 typedef double RealTypeDFT;
00142 #else
00143 #if defined(USE_FFTWF)
00144
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&);
00186 void operator=(const Self&);
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 }
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