ITK  5.2.0
Insight Toolkit
itkDiffeomorphicDemonsRegistrationFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 itkDiffeomorphicDemonsRegistrationFilter_h
19 #define itkDiffeomorphicDemonsRegistrationFilter_h
20 
23 
24 #include "itkMultiplyImageFilter.h"
26 
27 namespace itk
28 {
77 template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
78 class ITK_TEMPLATE_EXPORT DiffeomorphicDemonsRegistrationFilter
79  : public PDEDeformableRegistrationFilter<TFixedImage, TMovingImage, TDisplacementField>
80 {
81 public:
82  ITK_DISALLOW_COPY_AND_MOVE(DiffeomorphicDemonsRegistrationFilter);
83 
89 
91  itkNewMacro(Self);
92 
95 
97  using FixedImageType = typename Superclass::FixedImageType;
98  using FixedImagePointer = typename Superclass::FixedImagePointer;
99 
101  using MovingImageType = typename Superclass::MovingImageType;
102  using MovingImagePointer = typename Superclass::MovingImagePointer;
103 
105  using DisplacementFieldType = typename Superclass::DisplacementFieldType;
106  using DisplacementFieldPointer = typename Superclass::DisplacementFieldPointer;
107 
109  using FiniteDifferenceFunctionType = typename Superclass::FiniteDifferenceFunctionType;
110 
112  using TimeStepType = typename FiniteDifferenceFunctionType::TimeStepType;
113 
118 
119  static constexpr unsigned int ImageDimension = FixedImageType::ImageDimension;
120 
125  virtual double
126  GetMetric() const;
127 
128  const double &
129  GetRMSChange() const override;
130 
131  virtual void
132  SetUseGradientType(GradientType gtype);
133 
134  virtual GradientType
135  GetUseGradientType() const;
136 
140  itkSetMacro(UseFirstOrderExp, bool);
141  itkGetConstMacro(UseFirstOrderExp, bool);
142  itkBooleanMacro(UseFirstOrderExp);
144 
149  virtual void
150  SetIntensityDifferenceThreshold(double);
151 
152  virtual double
153  GetIntensityDifferenceThreshold() const;
154 
157  virtual void
158  SetMaximumUpdateStepLength(double);
159 
160  virtual double
161  GetMaximumUpdateStepLength() const;
162 
163 protected:
165  ~DiffeomorphicDemonsRegistrationFilter() override = default;
166  void
167  PrintSelf(std::ostream & os, Indent indent) const override;
168 
170  void
171  InitializeIteration() override;
172 
175  void
176  AllocateUpdateBuffer() override;
177 
179  void
180  ApplyUpdate(const TimeStepType & dt) override;
181 
182 private:
186  DownCastDifferenceFunctionType();
187 
189  DownCastDifferenceFunctionType() const;
190 
192  using MultiplyByConstantType =
194 
196 
198 
199  using FieldInterpolatorType =
201 
203 
210 
215  bool m_UseFirstOrderExp{ false };
216 };
217 } // end namespace itk
218 
219 #ifndef ITK_MANUAL_INSTANTIATION
220 # include "itkDiffeomorphicDemonsRegistrationFilter.hxx"
221 #endif
222 
223 #endif
itk::DiffeomorphicDemonsRegistrationFilter::FixedImagePointer
typename Superclass::FixedImagePointer FixedImagePointer
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:98
itk::DiffeomorphicDemonsRegistrationFilter::DisplacementFieldPointer
typename Superclass::DisplacementFieldPointer DisplacementFieldPointer
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:106
itkExponentialDisplacementFieldImageFilter.h
itk::DiffeomorphicDemonsRegistrationFilter::TimeStepType
typename FiniteDifferenceFunctionType::TimeStepType TimeStepType
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:112
itk::DiffeomorphicDemonsRegistrationFilter::MovingImageType
typename Superclass::MovingImageType MovingImageType
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:101
itkESMDemonsRegistrationFunction.h
itk::DiffeomorphicDemonsRegistrationFilter::FixedImageType
typename Superclass::FixedImageType FixedImageType
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:97
itk::DiffeomorphicDemonsRegistrationFilter::FieldExponentiatorPointer
typename FieldExponentiatorType::Pointer FieldExponentiatorPointer
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:205
itk::DiffeomorphicDemonsRegistrationFilter::VectorWarperPointer
typename VectorWarperType::Pointer VectorWarperPointer
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:206
itk::DiffeomorphicDemonsRegistrationFilter::m_Exponentiator
FieldExponentiatorPointer m_Exponentiator
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:212
itk::DiffeomorphicDemonsRegistrationFilter::FieldInterpolatorPointer
typename FieldInterpolatorType::Pointer FieldInterpolatorPointer
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:207
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::DiffeomorphicDemonsRegistrationFilter
Deformably register two images using a diffeomorphic demons algorithm.
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:78
itk::DiffeomorphicDemonsRegistrationFilter::DisplacementFieldType
typename Superclass::DisplacementFieldType DisplacementFieldType
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:105
itk::DiffeomorphicDemonsRegistrationFilter::m_Warper
VectorWarperPointer m_Warper
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:213
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itkMultiplyImageFilter.h
itk::ESMDemonsRegistrationFunction
Fast implementation of the symmetric demons registration force.
Definition: itkESMDemonsRegistrationFunction.h:84
itk::DiffeomorphicDemonsRegistrationFilter::GradientType
typename DemonsRegistrationFunctionType::GradientEnum GradientType
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:117
itk::VectorLinearInterpolateNearestNeighborExtrapolateImageFunction
Linearly interpolate or NN extrapolate a vector image at specified positions.
Definition: itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunction.h:54
itk::DiffeomorphicDemonsRegistrationFilter::AdderPointer
typename AdderType::Pointer AdderPointer
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:209
itk::DiffeomorphicDemonsRegistrationFilter::MultiplyByConstantPointer
typename MultiplyByConstantType::Pointer MultiplyByConstantPointer
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:204
itk::DiffeomorphicDemonsRegistrationFilter::MovingImagePointer
typename Superclass::MovingImagePointer MovingImagePointer
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:102
itk::ExponentialDisplacementFieldImageFilter
Computes a diffeomorphic displacement field as the Lie group exponential of a vector field.
Definition: itkExponentialDisplacementFieldImageFilter.h:62
itk::WarpVectorImageFilter
Warps an image using an input displacement field.
Definition: itkWarpVectorImageFilter.h:89
itk::ESMDemonsRegistrationFunctionEnums::Gradient
Gradient
Definition: itkESMDemonsRegistrationFunction.h:40
itk::DiffeomorphicDemonsRegistrationFilter::FiniteDifferenceFunctionType
typename Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:109
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::AddImageFilter
Pixel-wise addition of two images.
Definition: itkAddImageFilter.h:80
itk::VectorLinearInterpolateNearestNeighborExtrapolateImageFunction::OutputType
typename Superclass::OutputType OutputType
Definition: itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunction.h:94
itkPDEDeformableRegistrationFilter.h
itk::MultiplyImageFilter
Pixel-wise multiplication of two images.
Definition: itkMultiplyImageFilter.h:43
itk::DiffeomorphicDemonsRegistrationFilter::m_Adder
AdderPointer m_Adder
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:214
itk::PDEDeformableRegistrationFilter
Deformably register two images using a PDE algorithm.
Definition: itkPDEDeformableRegistrationFilter.h:73
itk::DiffeomorphicDemonsRegistrationFilter::m_Multiplier
MultiplyByConstantPointer m_Multiplier
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:211
itk::DiffeomorphicDemonsRegistrationFilter::FieldInterpolatorOutputType
typename FieldInterpolatorType::OutputType FieldInterpolatorOutputType
Definition: itkDiffeomorphicDemonsRegistrationFilter.h:208