ITK  5.4.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 
26 namespace itk
27 {
52 template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
53 class ITK_TEMPLATE_EXPORT MeanSquareRegistrationFunction
54  : public PDEDeformableRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField>
55 {
56 public:
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 
83  using typename Superclass::DisplacementFieldType;
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
151  InitializeIteration() override;
152 
157  PixelType
158  ComputeUpdate(const NeighborhoodType & neighborhood,
159  void * globalData,
160  const FloatOffsetType & offset = FloatOffsetType(0.0)) override;
161 
162 protected:
164  ~MeanSquareRegistrationFunction() override = default;
165  void
166  PrintSelf(std::ostream & os, Indent indent) const override;
167 
170 
174  {
176  };
177 
178 private:
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
itk::MeanSquareRegistrationFunction::SizeType
typename FixedImageType::SizeType SizeType
Definition: itkMeanSquareRegistrationFunction.h:79
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::MeanSquareRegistrationFunction::DisplacementFieldPixelType
typename DisplacementFieldType::PixelType DisplacementFieldPixelType
Definition: itkMeanSquareRegistrationFunction.h:84
itk::FiniteDifferenceFunction< TDisplacementField >::RadiusType
typename ConstNeighborhoodIterator< TDisplacementField >::RadiusType RadiusType
Definition: itkFiniteDifferenceFunction.h:97
itk::MeanSquareRegistrationFunction::ReleaseGlobalDataPointer
void ReleaseGlobalDataPointer(void *GlobalData) const override
Definition: itkMeanSquareRegistrationFunction.h:144
itk::MeanSquareRegistrationFunction::SpacingType
typename FixedImageType::SpacingType SpacingType
Definition: itkMeanSquareRegistrationFunction.h:80
itk::PDEDeformableRegistrationFunction::MovingImageType
TMovingImage MovingImageType
Definition: itkPDEDeformableRegistrationFunction.h:56
itk::MeanSquareRegistrationFunction::GlobalDataStruct
Definition: itkMeanSquareRegistrationFunction.h:173
itk::PDEDeformableRegistrationFunction::MovingImagePointer
typename MovingImageType::ConstPointer MovingImagePointer
Definition: itkPDEDeformableRegistrationFunction.h:57
itkLinearInterpolateImageFunction.h
itkPoint.h
itk::MeanSquareRegistrationFunction
Definition: itkMeanSquareRegistrationFunction.h:53
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itkPDEDeformableRegistrationFunction.h
itk::CentralDifferenceImageFunction
Calculate the derivative by central differencing.
Definition: itkCentralDifferenceImageFunction.h:76
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::MeanSquareRegistrationFunction::PointType
typename InterpolatorType::PointType PointType
Definition: itkMeanSquareRegistrationFunction.h:101
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::MeanSquareRegistrationFunction::SetMovingImageInterpolator
void SetMovingImageInterpolator(InterpolatorType *ptr)
Definition: itkMeanSquareRegistrationFunction.h:113
itk::MeanSquareRegistrationFunction::GlobalDataStruct::m_FixedImageIterator
FixedImageNeighborhoodIteratorType m_FixedImageIterator
Definition: itkMeanSquareRegistrationFunction.h:175
itk::MeanSquareRegistrationFunction::GradientCalculatorPointer
typename GradientCalculatorType::Pointer GradientCalculatorPointer
Definition: itkMeanSquareRegistrationFunction.h:109
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::LinearInterpolateImageFunction
Linearly interpolate an image at specified positions.
Definition: itkLinearInterpolateImageFunction.h:51
itk::MeanSquareRegistrationFunction::IndexType
typename FixedImageType::IndexType IndexType
Definition: itkMeanSquareRegistrationFunction.h:78
itk::MeanSquareRegistrationFunction::CoordRepType
double CoordRepType
Definition: itkMeanSquareRegistrationFunction.h:98
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkCentralDifferenceImageFunction.h
itk::PDEDeformableRegistrationFunction::FixedImagePointer
typename FixedImageType::ConstPointer FixedImagePointer
Definition: itkPDEDeformableRegistrationFunction.h:61
itk::PDEDeformableRegistrationFunction
Definition: itkPDEDeformableRegistrationFunction.h:41
itk::FiniteDifferenceFunction< TDisplacementField >::PixelType
typename ImageType::PixelType PixelType
Definition: itkFiniteDifferenceFunction.h:83
itk::MeanSquareRegistrationFunction::GetMovingImageInterpolator
InterpolatorType * GetMovingImageInterpolator()
Definition: itkMeanSquareRegistrationFunction.h:120
itk::CovariantVector
A templated class holding a n-Dimensional covariant vector.
Definition: itkCovariantVector.h:70
itk::PDEDeformableRegistrationFunction::DisplacementFieldTypePointer
typename DisplacementFieldType::Pointer DisplacementFieldTypePointer
Definition: itkPDEDeformableRegistrationFunction.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ConstNeighborhoodIterator
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Definition: itkConstNeighborhoodIterator.h:51
itk::PDEDeformableRegistrationFunction::FixedImageType
TFixedImage FixedImageType
Definition: itkPDEDeformableRegistrationFunction.h:60
itk::MeanSquareRegistrationFunction::ComputeGlobalTimeStep
TimeStepType ComputeGlobalTimeStep(void *) const override
Definition: itkMeanSquareRegistrationFunction.h:127
itk::MeanSquareRegistrationFunction::InterpolatorPointer
typename InterpolatorType::Pointer InterpolatorPointer
Definition: itkMeanSquareRegistrationFunction.h:100
itk::PDEDeformableRegistrationFunction::DisplacementFieldType
TDisplacementField DisplacementFieldType
Definition: itkPDEDeformableRegistrationFunction.h:64
itk::MeanSquareRegistrationFunction::GetGlobalDataPointer
void * GetGlobalDataPointer() const override
Definition: itkMeanSquareRegistrationFunction.h:135
itk::InterpolateImageFunction
Base class for all image interpolators.
Definition: itkInterpolateImageFunction.h:45
itk::FiniteDifferenceFunction< TDisplacementField >::TimeStepType
double TimeStepType
Definition: itkFiniteDifferenceFunction.h:90