ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkFastSymmetricForcesDemonsRegistrationFunction.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 itkFastSymmetricForcesDemonsRegistrationFunction_h
19#define itkFastSymmetricForcesDemonsRegistrationFunction_h
20
22#include "itkPoint.h"
25#include "itkWarpImageFilter.h"
26#include <mutex>
27
28namespace itk
29{
49template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
51 : public PDEDeformableRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField>
52{
53public:
54 ITK_DISALLOW_COPY_AND_MOVE(FastSymmetricForcesDemonsRegistrationFunction);
55
61
63 itkNewMacro(Self);
64
66 itkOverrideGetNameOfClassMacro(FastSymmetricForcesDemonsRegistrationFunction);
67
69 using typename Superclass::MovingImageType;
70 using typename Superclass::MovingImagePointer;
71
73 using typename Superclass::FixedImageType;
74 using typename Superclass::FixedImagePointer;
75 using IndexType = typename FixedImageType::IndexType;
76 using SizeType = typename FixedImageType::SizeType;
77 using SpacingType = typename FixedImageType::SpacingType;
78
82
84 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
85
87 using typename Superclass::PixelType;
88 using typename Superclass::RadiusType;
89 using typename Superclass::NeighborhoodType;
90 using typename Superclass::FloatOffsetType;
91 using typename Superclass::TimeStepType;
92
94 using CoordinateType = double;
95#ifndef ITK_FUTURE_LEGACY_REMOVE
96 using CoordRepType ITK_FUTURE_DEPRECATED(
97 "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") = CoordinateType;
98#endif
103
107
110
114
117
119 void
121 {
123 m_MovingImageWarper->SetInterpolator(ptr);
124 }
125
127 InterpolatorType *
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 * GlobalData) const override;
159
161 void
163
169 ComputeUpdate(const NeighborhoodType & neighborhood,
170 void * globalData,
171 const FloatOffsetType & offset = FloatOffsetType(0.0)) override;
172
176 virtual double
177 GetMetric() const
178 {
179 return m_Metric;
180 }
181
183 virtual const double &
185 {
186 return m_RMSChange;
187 }
188
193 virtual void
195
196 virtual double
198
199protected:
202 void
203 PrintSelf(std::ostream & os, Indent indent) const override;
204
207
216
217private:
219 double m_Normalizer{};
220
223
226
229
232
235
238
241
245 mutable double m_Metric{};
246 mutable double m_SumOfSquaredDifference{};
248 mutable double m_RMSChange{};
249 mutable double m_SumOfSquaredChange{};
250
252 mutable std::mutex m_MetricCalculationMutex{};
253};
254} // end namespace itk
255
256#ifndef ITK_MANUAL_INSTANTIATION
257# include "itkFastSymmetricForcesDemonsRegistrationFunction.hxx"
258#endif
259
260#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.
InterpolateImageFunction< MovingImageType, CoordinateType > InterpolatorType
LinearInterpolateImageFunction< MovingImageType, CoordinateType > DefaultInterpolatorType
PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField > Superclass
PixelType ComputeUpdate(const NeighborhoodType &neighborhood, void *globalData, const FloatOffsetType &offset=FloatOffsetType(0.0)) override
WarpImageFilter< MovingImageType, MovingImageType, DisplacementFieldType > WarperType
void ReleaseGlobalDataPointer(void *GlobalData) const override
void PrintSelf(std::ostream &os, Indent indent) const override
ConstNeighborhoodIterator< TDisplacementField, DefaultBoundaryConditionType > NeighborhoodType
typename ConstNeighborhoodIterator< TDisplacementField >::RadiusType RadiusType
Control indentation during Print() invocation.
Definition itkIndent.h:51
Base class for all image interpolators.
Point< CoordinateType, Self::ImageDimension > PointType
Linearly interpolate an image at specified positions.
typename DisplacementFieldType::Pointer DisplacementFieldTypePointer
typename FixedImageType::ConstPointer FixedImagePointer
typename MovingImageType::ConstPointer MovingImagePointer
Implements transparent reference counting.
Warps an image using an input displacement field.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:86