ITK  6.0.0
Insight Toolkit
itkMeanSquareRegistrationFunction.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 itkMeanSquareRegistrationFunction_h
19#define itkMeanSquareRegistrationFunction_h
20
22#include "itkPoint.h"
25
26namespace itk
27{
52template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
53class ITK_TEMPLATE_EXPORT MeanSquareRegistrationFunction
54 : public PDEDeformableRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField>
55{
56public:
57 ITK_DISALLOW_COPY_AND_MOVE(MeanSquareRegistrationFunction);
58
64
66 itkNewMacro(Self);
67
69 itkOverrideGetNameOfClassMacro(MeanSquareRegistrationFunction);
70
72 using typename Superclass::MovingImageType;
73 using typename Superclass::MovingImagePointer;
74
76 using typename Superclass::FixedImageType;
77 using typename Superclass::FixedImagePointer;
80 using SpacingType = typename FixedImageType::SpacingType;
81
84 using DisplacementFieldPixelType = typename DisplacementFieldType::PixelType;
86
88 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
89
91 using typename Superclass::PixelType;
92 using typename Superclass::RadiusType;
93 using typename Superclass::NeighborhoodType;
94 using typename Superclass::FloatOffsetType;
95 using typename Superclass::TimeStepType;
96
98 using CoordinateType = double;
99#ifndef ITK_FUTURE_LEGACY_REMOVE
100 using CoordRepType ITK_FUTURE_DEPRECATED(
101 "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") = CoordinateType;
102#endif
107
110
114
116 void
118 {
119 m_MovingImageInterpolator = ptr;
120 }
121
123 InterpolatorType *
125 {
126 return m_MovingImageInterpolator;
127 }
128
130 TimeStepType
131 ComputeGlobalTimeStep(void * itkNotUsed(GlobalData)) const override
132 {
133 return m_TimeStep;
134 }
135
138 void *
139 GetGlobalDataPointer() const override
140 {
141 auto * global = new GlobalDataStruct();
142
143 return global;
144 }
145
147 void
148 ReleaseGlobalDataPointer(void * GlobalData) const override
149 {
150 delete (GlobalDataStruct *)GlobalData;
151 }
152
154 void
156
162 ComputeUpdate(const NeighborhoodType & neighborhood,
163 void * globalData,
164 const FloatOffsetType & offset = FloatOffsetType(0.0)) override;
165
166protected:
169 void
170 PrintSelf(std::ostream & os, Indent indent) const override;
171
174
178 {
180 };
181
182private:
184 SpacingType m_FixedImageSpacing{};
185
187 GradientCalculatorPointer m_FixedImageGradientCalculator{};
188
190 InterpolatorPointer m_MovingImageInterpolator{};
191
193 TimeStepType m_TimeStep{};
194
196 double m_DenominatorThreshold{};
197
199 double m_IntensityDifferenceThreshold{};
200};
201} // end namespace itk
202
203#ifndef ITK_MANUAL_INSTANTIATION
204# include "itkMeanSquareRegistrationFunction.hxx"
205#endif
206
207#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.
typename InterpolatorType::Pointer InterpolatorPointer
void ReleaseGlobalDataPointer(void *GlobalData) const override
typename FixedImageType::IndexType IndexType
~MeanSquareRegistrationFunction() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
TimeStepType ComputeGlobalTimeStep(void *) const override
typename FixedImageType::SpacingType SpacingType
typename DisplacementFieldType::PixelType DisplacementFieldPixelType
typename GradientCalculatorType::Pointer GradientCalculatorPointer
PixelType ComputeUpdate(const NeighborhoodType &neighborhood, void *globalData, const FloatOffsetType &offset=FloatOffsetType(0.0)) override
typename InterpolatorType::PointType PointType
typename DisplacementFieldType::Pointer DisplacementFieldTypePointer
typename FixedImageType::ConstPointer FixedImagePointer
typename MovingImageType::ConstPointer MovingImagePointer
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....