ITK  4.8.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 > >
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 
124  itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension);
125 
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 
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  CurvatureRegistrationFilter(const Self &); //purposely not implemented
187  void operator=(const Self &); //purposely not implemented
188 
190 
193 
195 
196  fftw_plan m_PlanForwardDCT;
197  fftw_plan m_PlanBackwardDCT;
198 
200 
202 };
203 } // end namespace itk
204 
205 #ifndef ITK_MANUAL_INSTANTIATION
206 #include "itkCurvatureRegistrationFilter.hxx"
207 #endif
208 
209 #endif //defined(ITK_USE_FFTWF) || defined(ITK_USE_FFTWD)
210 
211 #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
unsigned int m_FixedImageDimensions[ImageDimension]
Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
Deformably register two images using the fast curvature algorithm.
Superclass::MovingImagePointer MovingImagePointer
DisplacementFieldPixelType::ValueType DisplacementFieldComponentType
virtual void ApplyUpdate(const TimeStepType &dt)
Deformably register two images using a PDE algorithm.
Superclass::DisplacementFieldType DisplacementFieldType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
RealTypeDFT * m_DiagonalElements[ImageDimension]
void PrintSelf(std::ostream &os, Indent indent) const override
virtual double GetMetric() const
static const unsigned int DeformationVectorDimension
Templated n-dimensional image class.
Definition: itkImage.h:75
Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
Superclass::DisplacementFieldPointer DisplacementFieldPointer