ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLevelSetMotionRegistrationFunction.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 itkLevelSetMotionRegistrationFunction_h
19#define itkLevelSetMotionRegistrationFunction_h
20
22#include "itkPoint.h"
23#include "itkCovariantVector.h"
26#include <mutex>
27
28namespace itk
29{
63template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
64class ITK_TEMPLATE_EXPORT LevelSetMotionRegistrationFunction
65 : public PDEDeformableRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField>
66{
67public:
68 ITK_DISALLOW_COPY_AND_MOVE(LevelSetMotionRegistrationFunction);
69
73
76
78 itkNewMacro(Self);
79
81 itkOverrideGetNameOfClassMacro(LevelSetMotionRegistrationFunction);
82
84 using typename Superclass::MovingImageType;
85 using typename Superclass::MovingImagePointer;
86 using MovingSpacingType = typename MovingImageType::SpacingType;
87
89 using typename Superclass::FixedImageType;
90 using typename Superclass::FixedImagePointer;
91 using IndexType = typename FixedImageType::IndexType;
92 using SizeType = typename FixedImageType::SizeType;
93 using SpacingType = typename FixedImageType::SpacingType;
94
98
100 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
101
103 using typename Superclass::PixelType;
104 using typename Superclass::RadiusType;
105 using typename Superclass::NeighborhoodType;
106 using typename Superclass::FloatOffsetType;
107 using typename Superclass::TimeStepType;
108
110 using CoordinateType = double;
111#ifndef ITK_FUTURE_LEGACY_REMOVE
112 using CoordRepType ITK_FUTURE_DEPRECATED(
113 "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") = CoordinateType;
114#endif
119
123
127
129 void
134
136 InterpolatorType *
141
146 TimeStepType
147 ComputeGlobalTimeStep(void * GlobalData) const override;
148
151 void *
152 GetGlobalDataPointer() const override
153 {
154 auto * global = new GlobalDataStruct();
155
156 global->m_SumOfSquaredDifference = 0.0;
157 global->m_NumberOfPixelsProcessed = 0L;
158 global->m_SumOfSquaredChange = 0;
159 global->m_MaxL1Norm = NumericTraits<double>::NonpositiveMin();
160 return global;
161 }
162
167 void
168 ReleaseGlobalDataPointer(void * gd) const override;
169
171 void
173
179 ComputeUpdate(const NeighborhoodType & it, void * gd, const FloatOffsetType & offset = FloatOffsetType(0.0)) override;
180
184 virtual double
185 GetMetric() const
186 {
187 return m_Metric;
188 }
189
191 virtual double
193 {
194 return m_RMSChange;
195 }
196
203 virtual void
204 SetAlpha(double);
205
206 virtual double
207 GetAlpha() const;
208
213 virtual void
215
216 virtual double
218
221 virtual void
223
224 virtual double
226
229 virtual void
231
232 virtual double
234
238 void
240
241 bool
243
244protected:
247 void
248 PrintSelf(std::ostream & os, Indent indent) const override;
249
252
262
263private:
267
270
274
277 double m_Alpha{};
278
281
284
287
291 mutable double m_Metric{};
292 mutable double m_SumOfSquaredDifference{};
294 mutable double m_RMSChange{};
295 mutable double m_SumOfSquaredChange{};
296
298 mutable std::mutex m_MetricCalculationMutex{};
299
300 bool m_UseImageSpacing{ true };
301};
302} // end namespace itk
303
304#ifndef ITK_MANUAL_INSTANTIATION
305# include "itkLevelSetMotionRegistrationFunction.hxx"
306#endif
307
308#endif
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
A templated class holding a n-Dimensional covariant vector.
ConstNeighborhoodIterator< TImageType, DefaultBoundaryConditionType > NeighborhoodType
static constexpr unsigned int ImageDimension
Vector< float, Self::ImageDimension > FloatOffsetType
typename ImageType::PixelType PixelType
typename ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
Control indentation during Print() invocation.
Definition itkIndent.h:51
Base class for all image interpolators.
Point< CoordinateType, Self::ImageDimension > PointType
PixelType ComputeUpdate(const NeighborhoodType &it, void *gd, const FloatOffsetType &offset=FloatOffsetType(0.0)) override
void PrintSelf(std::ostream &os, Indent indent) const override
PDEDeformableRegistrationFunction< FixedImageType, MovingImageType, DisplacementFieldType > Superclass
void ReleaseGlobalDataPointer(void *gd) const override
virtual double GetGradientMagnitudeThreshold() const
virtual double GetGradientSmoothingStandardDeviations() const
virtual void SetIntensityDifferenceThreshold(double)
virtual void SetGradientSmoothingStandardDeviations(double)
virtual void SetGradientMagnitudeThreshold(double)
virtual double GetIntensityDifferenceThreshold() const
~LevelSetMotionRegistrationFunction() override=default
TimeStepType ComputeGlobalTimeStep(void *GlobalData) const override
Linearly interpolate an image at specified positions.
static constexpr T NonpositiveMin()
Implements transparent reference counting.
Computes the smoothing of an image by convolution with the Gaussian kernels implemented as IIR filter...
A templated class holding a n-Dimensional vector.
Definition itkVector.h:63
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:86