ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkDiffeomorphicDemonsRegistrationFilter.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 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,
80  TDisplacementField >
81 {
82 public:
83  ITK_DISALLOW_COPY_AND_ASSIGN(DiffeomorphicDemonsRegistrationFilter);
84 
90 
92  itkNewMacro(Self);
93 
96 
98  using FixedImageType = typename Superclass::FixedImageType;
99  using FixedImagePointer = typename Superclass::FixedImagePointer;
100 
102  using MovingImageType = typename Superclass::MovingImageType;
103  using MovingImagePointer = typename Superclass::MovingImagePointer;
104 
106  using DisplacementFieldType = typename Superclass::DisplacementFieldType;
107  using DisplacementFieldPointer = typename Superclass::DisplacementFieldPointer;
108 
110  using FiniteDifferenceFunctionType = typename Superclass::FiniteDifferenceFunctionType;
111 
113  using TimeStepType = typename FiniteDifferenceFunctionType::TimeStepType;
114 
119 
120  static constexpr unsigned int ImageDimension = FixedImageType::ImageDimension;
121 
126  virtual double GetMetric() const;
127 
128  const double & GetRMSChange() const override;
129 
130  virtual void SetUseGradientType(GradientType gtype);
131 
132  virtual GradientType GetUseGradientType() const;
133 
137  itkSetMacro(UseFirstOrderExp, bool);
138  itkGetConstMacro(UseFirstOrderExp, bool);
139  itkBooleanMacro(UseFirstOrderExp);
141 
146  virtual void SetIntensityDifferenceThreshold(double);
147 
148  virtual double GetIntensityDifferenceThreshold() const;
149 
152  virtual void SetMaximumUpdateStepLength(double);
153 
154  virtual double GetMaximumUpdateStepLength() const;
155 
156 protected:
158  ~DiffeomorphicDemonsRegistrationFilter() override = default;
159  void PrintSelf(std::ostream & os, Indent indent) const override;
160 
162  void InitializeIteration() override;
163 
166  void AllocateUpdateBuffer() override;
167 
169  void ApplyUpdate(const TimeStepType& dt) override;
170 
171 private:
174  DemonsRegistrationFunctionType * DownCastDifferenceFunctionType();
175 
176  const DemonsRegistrationFunctionType * DownCastDifferenceFunctionType() const;
177 
182 
185 
189 
192 
193  using AdderType = AddImageFilter<
196 
203 
208  bool m_UseFirstOrderExp{false};
209 };
210 } // end namespace itk
211 
212 #ifndef ITK_MANUAL_INSTANTIATION
213 #include "itkDiffeomorphicDemonsRegistrationFilter.hxx"
214 #endif
215 
216 #endif
Pixel-wise addition of two images.
Light weight base class for most itk classes.
typename DemonsRegistrationFunctionType::GradientType GradientType
typename MultiplyByConstantType::Pointer MultiplyByConstantPointer
typename Superclass::DisplacementFieldPointer DisplacementFieldPointer
typename FieldInterpolatorType::OutputType FieldInterpolatorOutputType
Warps an image using an input displacement field.
Computes a diffeomorphic displacement field as the Lie group exponential of a vector field...
typename FieldExponentiatorType::Pointer FieldExponentiatorPointer
Deformably register two images using a diffeomorphic demons algorithm.
Deformably register two images using a PDE algorithm.
typename FieldInterpolatorType::Pointer FieldInterpolatorPointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Pixel-wise multiplication of two images.
typename FiniteDifferenceFunctionType::TimeStepType TimeStepType
typename Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
typename Superclass::DisplacementFieldType DisplacementFieldType
Templated n-dimensional image class.
Definition: itkImage.h:75
Fast implementation of the symmetric demons registration force.