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 CoordRepType = double;
103
106
110
112 void
114 {
115 m_MovingImageInterpolator = ptr;
116 }
117
119 InterpolatorType *
121 {
122 return m_MovingImageInterpolator;
123 }
124
126 TimeStepType
127 ComputeGlobalTimeStep(void * itkNotUsed(GlobalData)) const override
128 {
129 return m_TimeStep;
130 }
131
134 void *
135 GetGlobalDataPointer() const override
136 {
137 auto * global = new GlobalDataStruct();
138
139 return global;
140 }
141
143 void
144 ReleaseGlobalDataPointer(void * GlobalData) const override
145 {
146 delete (GlobalDataStruct *)GlobalData;
147 }
148
150 void
152
158 ComputeUpdate(const NeighborhoodType & neighborhood,
159 void * globalData,
160 const FloatOffsetType & offset = FloatOffsetType(0.0)) override;
161
162protected:
165 void
166 PrintSelf(std::ostream & os, Indent indent) const override;
167
170
174 {
176 };
177
178private:
180 SpacingType m_FixedImageSpacing{};
181
183 GradientCalculatorPointer m_FixedImageGradientCalculator{};
184
186 InterpolatorPointer m_MovingImageInterpolator{};
187
189 TimeStepType m_TimeStep{};
190
192 double m_DenominatorThreshold{};
193
195 double m_IntensityDifferenceThreshold{};
196};
197} // end namespace itk
198
199#ifndef ITK_MANUAL_INSTANTIATION
200# include "itkMeanSquareRegistrationFunction.hxx"
201#endif
202
203#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....