ITK  4.9.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 >
79  public PDEDeformableRegistrationFilter< TFixedImage, TMovingImage,
80  TDisplacementField >
81 {
82 public:
88 
90  itkNewMacro(Self);
91 
94 
98 
102 
106 #ifdef ITKV3_COMPATIBILITY
107  typedef typename Superclass::DeformationFieldType DeformationFieldType;
108  typedef typename Superclass::DeformationFieldPointer DeformationFieldPointer;
109 #endif
110 
113 
115  typedef typename FiniteDifferenceFunctionType::TimeStepType TimeStepType;
116 
121 
122  itkStaticConstMacro(
123  ImageDimension, unsigned int, FixedImageType::ImageDimension);
124 
129  virtual double GetMetric() const;
130 
131  virtual const double & GetRMSChange() const ITK_OVERRIDE;
132 
133  virtual void SetUseGradientType(GradientType gtype);
134 
135  virtual GradientType GetUseGradientType() const;
136 
140  itkSetMacro(UseFirstOrderExp, bool);
141  itkGetConstMacro(UseFirstOrderExp, bool);
142  itkBooleanMacro(UseFirstOrderExp);
144 
149  virtual void SetIntensityDifferenceThreshold(double);
150 
151  virtual double GetIntensityDifferenceThreshold() const;
152 
155  virtual void SetMaximumUpdateStepLength(double);
156 
157  virtual double GetMaximumUpdateStepLength() const;
158 
159 protected:
161  ~DiffeomorphicDemonsRegistrationFilter() {}
162  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
163 
165  virtual void InitializeIteration() ITK_OVERRIDE;
166 
169  virtual void AllocateUpdateBuffer() ITK_OVERRIDE;
170 
172  virtual void ApplyUpdate(const TimeStepType& dt) ITK_OVERRIDE;
173 
174 private:
175  DiffeomorphicDemonsRegistrationFilter(const Self &) ITK_DELETE_FUNCTION;
176  void operator=(const Self &) ITK_DELETE_FUNCTION;
177 
181 
182  const DemonsRegistrationFunctionType * DownCastDifferenceFunctionType() const;
183 
187  DisplacementFieldType > MultiplyByConstantType;
188 
190  DisplacementFieldType, DisplacementFieldType > FieldExponentiatorType;
191 
193  DisplacementFieldType,
194  DisplacementFieldType, DisplacementFieldType > VectorWarperType;
195 
197  DisplacementFieldType, double > FieldInterpolatorType;
198 
200  DisplacementFieldType,
201  DisplacementFieldType, DisplacementFieldType > AdderType;
202 
203  typedef typename MultiplyByConstantType::Pointer MultiplyByConstantPointer;
204  typedef typename FieldExponentiatorType::Pointer FieldExponentiatorPointer;
205  typedef typename VectorWarperType::Pointer VectorWarperPointer;
206  typedef typename FieldInterpolatorType::Pointer FieldInterpolatorPointer;
207  typedef typename FieldInterpolatorType::OutputType FieldInterpolatorOutputType;
208  typedef typename AdderType::Pointer AdderPointer;
209 
210  MultiplyByConstantPointer m_Multiplier;
211  FieldExponentiatorPointer m_Exponentiator;
212  VectorWarperPointer m_Warper;
213  AdderPointer m_Adder;
215 };
216 } // end namespace itk
217 
218 #ifndef ITK_MANUAL_INSTANTIATION
219 #include "itkDiffeomorphicDemonsRegistrationFilter.hxx"
220 #endif
221 
222 #endif
DemonsRegistrationFunctionType::GradientType GradientType
Pixel-wise addition of two images.
Light weight base class for most itk classes.
virtual GradientType GetUseGradientType() const
virtual const double & GetRMSChange() const override
DemonsRegistrationFunctionType * DownCastDifferenceFunctionType()
virtual void ApplyUpdate(const TimeStepType &dt) override
virtual void SetIntensityDifferenceThreshold(double)
virtual double GetMaximumUpdateStepLength() const
Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
virtual void AllocateUpdateBuffer() override
virtual void SetUseGradientType(GradientType gtype)
Warps an image using an input displacement field.
Computes a diffeomorphic displacement field as the Lie group exponential of a vector field...
Deformably register two images using a diffeomorphic demons algorithm.
Deformably register two images using a PDE algorithm.
PDEDeformableRegistrationFilter< TFixedImage, TMovingImage, TDisplacementField > Superclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void InitializeIteration() override
Pixel-wise multiplication of two images.
ESMDemonsRegistrationFunction< FixedImageType, MovingImageType, DisplacementFieldType > DemonsRegistrationFunctionType
virtual void SetMaximumUpdateStepLength(double)
Templated n-dimensional image class.
Definition: itkImage.h:75
Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
typedef(Concept::MultiplyOperator< PixelType, double >) OutputTimesDoubleCheck
Fast implementation of the symmetric demons registration force.
virtual double GetIntensityDifferenceThreshold() const