ITK  6.0.0
Insight Toolkit
itkSymmetricForcesDemonsRegistrationFunction.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 * https://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 itkSymmetricForcesDemonsRegistrationFunction_h
19#define itkSymmetricForcesDemonsRegistrationFunction_h
20
22#include "itkPoint.h"
25#include <mutex>
26
27namespace itk
28{
61template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
63 : public PDEDeformableRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField>
64{
65public:
66 ITK_DISALLOW_COPY_AND_MOVE(SymmetricForcesDemonsRegistrationFunction);
67
73
75 itkNewMacro(Self);
76
78 itkOverrideGetNameOfClassMacro(SymmetricForcesDemonsRegistrationFunction);
79
81 using typename Superclass::MovingImageType;
82 using typename Superclass::MovingImagePointer;
83
85 using typename Superclass::FixedImageType;
86 using typename Superclass::FixedImagePointer;
89 using SpacingType = typename FixedImageType::SpacingType;
90
92 using typename Superclass::DisplacementFieldType;
93 using typename Superclass::DisplacementFieldTypePointer;
94
96 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
97
99 using typename Superclass::PixelType;
100 using typename Superclass::RadiusType;
101 using typename Superclass::NeighborhoodType;
102 using typename Superclass::FloatOffsetType;
103 using typename Superclass::TimeStepType;
104
106 using CoordRepType = double;
111
114
118
120 void
122 {
123 m_MovingImageInterpolator = ptr;
124 }
125
127 InterpolatorType *
129 {
130 return m_MovingImageInterpolator;
131 }
132
134 TimeStepType
135 ComputeGlobalTimeStep(void * itkNotUsed(GlobalData)) const override
136 {
137 return m_TimeStep;
138 }
139
142 void *
143 GetGlobalDataPointer() const override
144 {
145 auto * global = new GlobalDataStruct();
146
147 global->m_SumOfSquaredDifference = 0.0;
148 global->m_NumberOfPixelsProcessed = 0L;
149 global->m_SumOfSquaredChange = 0;
150 return global;
151 }
152
157 void
158 ReleaseGlobalDataPointer(void * gd) const override;
159
161 void
163
169 ComputeUpdate(const NeighborhoodType & it, void * gd, const FloatOffsetType & offset = FloatOffsetType(0.0)) override;
170
174 virtual double
175 GetMetric() const
176 {
177 return m_Metric;
178 }
179
181 virtual const double &
183 {
184 return m_RMSChange;
185 }
186
191 virtual void
193
194 virtual double
196
197protected:
200 void
201 PrintSelf(std::ostream & os, Indent indent) const override;
202
205
209 {
213 };
214
215private:
217 SpacingType m_FixedImageSpacing{};
218 PointType m_FixedImageOrigin{};
219 double m_Normalizer{};
220
222 GradientCalculatorPointer m_FixedImageGradientCalculator{};
223
225 InterpolatorPointer m_MovingImageInterpolator{};
226
228 TimeStepType m_TimeStep{};
229
231 double m_DenominatorThreshold{};
232
234 double m_IntensityDifferenceThreshold{};
235
239 mutable double m_Metric{};
240 mutable double m_SumOfSquaredDifference{};
241 mutable SizeValueType m_NumberOfPixelsProcessed{};
242 mutable double m_RMSChange{};
243 mutable double m_SumOfSquaredChange{};
244
246 mutable std::mutex m_MetricCalculationMutex{};
247};
248} // end namespace itk
249
250#ifndef ITK_MANUAL_INSTANTIATION
251# include "itkSymmetricForcesDemonsRegistrationFunction.hxx"
252#endif
253
254#endif
Calculate the derivative by central differencing.
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
A templated class holding a n-Dimensional covariant vector.
typename ConstNeighborhoodIterator< TDisplacementField >::RadiusType RadiusType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Base class for all image interpolators.
Light weight base class for most itk classes.
Linearly interpolate an image at specified positions.
~SymmetricForcesDemonsRegistrationFunction() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
PixelType ComputeUpdate(const NeighborhoodType &it, void *gd, const FloatOffsetType &offset=FloatOffsetType(0.0)) override
void ReleaseGlobalDataPointer(void *gd) const override
virtual double GetIntensityDifferenceThreshold() const
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:63
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition: itkIntTypes.h:86