ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkCurvatureRegistrationFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkCurvatureRegistrationFilter_h
19 #define itkCurvatureRegistrationFilter_h
20 
23 
24 #if defined( ITK_USE_FFTWF ) || defined( ITK_USE_FFTWD )
25 #include "fftw3.h"
26 
27 namespace itk
28 {
97 template< typename TFixedImage, typename TMovingImage, typename TDisplacementField,
98  typename TImageForceFunction =
99  MeanSquareRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField > >
100 class ITK_TEMPLATE_EXPORT CurvatureRegistrationFilter:
101  public PDEDeformableRegistrationFilter< TFixedImage, TMovingImage,
102  TDisplacementField >
103 {
104 public:
110 
112  itkNewMacro(Self);
113 
115  itkTypeMacro(CurvatureRegistrationFilter,
117 
119  typedef typename Superclass::TimeStepType TimeStepType;
120 
122  typedef typename Superclass::FixedImageType FixedImageType;
123  typedef typename Superclass::FixedImagePointer FixedImagePointer;
124  itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension);
125 
127  typedef typename Superclass::MovingImageType MovingImageType;
128  typedef typename Superclass::MovingImagePointer MovingImagePointer;
129 
131  typedef typename Superclass::DisplacementFieldType
133  typedef typename Superclass::DisplacementFieldPointer
135 
136  typedef typename TDisplacementField::PixelType DisplacementFieldPixelType;
137  typedef typename DisplacementFieldPixelType::ValueType DisplacementFieldComponentType;
138  itkStaticConstMacro(DeformationVectorDimension, unsigned int, DisplacementFieldPixelType::Dimension);
139 
140  #if defined( ITK_USE_FFTWD )
141  //Prefer to use double precision
142  typedef double RealTypeDFT;
143  #else
144  #if defined( ITK_USE_FFTWF )
145  //Allow to use single precision
146  #warning "Using single precision for FFT computations!"
147  typedef double RealTypeDFT;
148  #endif
149  #endif
150 
153 
155  typedef typename Superclass::FiniteDifferenceFunctionType
157 
159  typedef TImageForceFunction RegistrationFunctionType;
160 
162  void SetConstraintWeight(const float w) { m_ConstraintWeight = w; }
163 
165  void SetTimeStep(const TimeStepType ts) { m_TimeStep = ts; }
166 
172  virtual double GetMetric() const;
173 
174 protected:
177  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
178 
180  virtual void Initialize();
181 
183  virtual void ApplyUpdate(const TimeStepType& dt);
184 
185 private:
186  ITK_DISALLOW_COPY_AND_ASSIGN(CurvatureRegistrationFilter);
187 
188  unsigned int m_FixedImageDimensions[ImageDimension];
189 
192 
194 
195  fftw_plan m_PlanForwardDCT;
196  fftw_plan m_PlanBackwardDCT;
197 
199 
200  RealTypeDFT *m_DiagonalElements[ImageDimension];
201 };
202 } // end namespace itk
203 
204 #ifndef ITK_MANUAL_INSTANTIATION
205 #include "itkCurvatureRegistrationFilter.hxx"
206 #endif
207 
208 #endif //defined(ITK_USE_FFTWF) || defined(ITK_USE_FFTWD)
209 
210 #endif
Image< RealTypeDFT, TDisplacementField::ImageDimension > DisplacementFieldComponentImageType
Superclass::FixedImagePointer FixedImagePointer
Light weight base class for most itk classes.
PDEDeformableRegistrationFilter< TFixedImage, TMovingImage, TDisplacementField > Superclass
TDisplacementField::PixelType DisplacementFieldPixelType
DisplacementFieldComponentImageType::Pointer DisplacementFieldComponentImagePointer
Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
Deformably register two images using the fast curvature algorithm.
Superclass::MovingImagePointer MovingImagePointer
DisplacementFieldPixelType::ValueType DisplacementFieldComponentType
Deformably register two images using a PDE algorithm.
Superclass::DisplacementFieldType DisplacementFieldType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Templated n-dimensional image class.
Definition: itkImage.h:75
Superclass::DisplacementFieldPointer DisplacementFieldPointer