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{
46template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
48 : public PDEDeformableRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField>
49{
50public:
51 ITK_DISALLOW_COPY_AND_MOVE(FastSymmetricForcesDemonsRegistrationFunction);
52
58
60 itkNewMacro(Self);
61
63 itkOverrideGetNameOfClassMacro(FastSymmetricForcesDemonsRegistrationFunction);
64
66 using typename Superclass::MovingImageType;
67 using typename Superclass::MovingImagePointer;
68
70 using typename Superclass::FixedImageType;
71 using typename Superclass::FixedImagePointer;
72 using IndexType = typename FixedImageType::IndexType;
73 using SizeType = typename FixedImageType::SizeType;
74 using SpacingType = typename FixedImageType::SpacingType;
75
79
81 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
82
84 using typename Superclass::PixelType;
85 using typename Superclass::RadiusType;
86 using typename Superclass::NeighborhoodType;
87 using typename Superclass::FloatOffsetType;
88 using typename Superclass::TimeStepType;
89
91 using CoordinateType = double;
92#ifndef ITK_FUTURE_LEGACY_REMOVE
93 using CoordRepType ITK_FUTURE_DEPRECATED(
94 "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") = CoordinateType;
95#endif
100
104
107
111
114
116 void
118 {
120 m_MovingImageWarper->SetInterpolator(ptr);
121 }
122
123
125 InterpolatorType *
130
132 TimeStepType
133 ComputeGlobalTimeStep(void * itkNotUsed(GlobalData)) const override
134 {
135 return m_TimeStep;
136 }
137
140 void *
141 GetGlobalDataPointer() const override
142 {
143 auto * global = new GlobalDataStruct();
144
145 global->m_SumOfSquaredDifference = 0.0;
146 global->m_NumberOfPixelsProcessed = 0L;
147 global->m_SumOfSquaredChange = 0;
148 return global;
149 }
150
155 void
156 ReleaseGlobalDataPointer(void * GlobalData) const override;
157
159 void
161
167 ComputeUpdate(const NeighborhoodType & neighborhood,
168 void * globalData,
169 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
214
215private:
217 double m_Normalizer{};
218
221
224
227
230
233
236
239
243 mutable double m_Metric{};
244 mutable double m_SumOfSquaredDifference{};
246 mutable double m_RMSChange{};
247 mutable double m_SumOfSquaredChange{};
248
250 mutable std::mutex m_MetricCalculationMutex{};
251};
252} // end namespace itk
253
254#ifndef ITK_MANUAL_INSTANTIATION
255# include "itkFastSymmetricForcesDemonsRegistrationFunction.hxx"
256#endif
257
258#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:50
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