ITK  5.2.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  * http://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 
70 
74 
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 PixelType = typename Superclass::PixelType;
95  using TimeStepType = 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 
155  PixelType
156  ComputeUpdate(const NeighborhoodType & neighborhood,
157  void * globalData,
158  const FloatOffsetType & offset = FloatOffsetType(0.0)) override;
159 
160 protected:
162  ~MeanSquareRegistrationFunction() override = default;
163  void
164  PrintSelf(std::ostream & os, Indent indent) const override;
165 
168 
172  {
174  };
175 
176 private:
179 
182 
185 
188 
191 
194 };
195 } // end namespace itk
196 
197 #ifndef ITK_MANUAL_INSTANTIATION
198 # include "itkMeanSquareRegistrationFunction.hxx"
199 #endif
200 
201 #endif
itk::MeanSquareRegistrationFunction::SizeType
typename FixedImageType::SizeType SizeType
Definition: itkMeanSquareRegistrationFunction.h:79
itk::MeanSquareRegistrationFunction::DisplacementFieldType
typename Superclass::DisplacementFieldType DisplacementFieldType
Definition: itkMeanSquareRegistrationFunction.h:83
itk::MeanSquareRegistrationFunction::NeighborhoodType
typename Superclass::NeighborhoodType NeighborhoodType
Definition: itkMeanSquareRegistrationFunction.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::m_DenominatorThreshold
double m_DenominatorThreshold
Definition: itkMeanSquareRegistrationFunction.h:190
itk::MeanSquareRegistrationFunction::GlobalDataStruct
Definition: itkMeanSquareRegistrationFunction.h:171
itk::PDEDeformableRegistrationFunction::MovingImagePointer
typename MovingImageType::ConstPointer MovingImagePointer
Definition: itkPDEDeformableRegistrationFunction.h:57
itkLinearInterpolateImageFunction.h
itk::MeanSquareRegistrationFunction::RadiusType
typename Superclass::RadiusType RadiusType
Definition: itkMeanSquareRegistrationFunction.h:92
itk::MeanSquareRegistrationFunction::m_TimeStep
TimeStepType m_TimeStep
Definition: itkMeanSquareRegistrationFunction.h:187
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::m_IntensityDifferenceThreshold
double m_IntensityDifferenceThreshold
Definition: itkMeanSquareRegistrationFunction.h:193
itk::MeanSquareRegistrationFunction::MovingImageType
typename Superclass::MovingImageType MovingImageType
Definition: itkMeanSquareRegistrationFunction.h:72
itk::MeanSquareRegistrationFunction::SetMovingImageInterpolator
void SetMovingImageInterpolator(InterpolatorType *ptr)
Definition: itkMeanSquareRegistrationFunction.h:113
itk::MeanSquareRegistrationFunction::GlobalDataStruct::m_FixedImageIterator
FixedImageNeighborhoodIteratorType m_FixedImageIterator
Definition: itkMeanSquareRegistrationFunction.h:173
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:50
itk::MeanSquareRegistrationFunction::FixedImagePointer
typename Superclass::FixedImagePointer FixedImagePointer
Definition: itkMeanSquareRegistrationFunction.h:77
itk::MeanSquareRegistrationFunction::IndexType
typename FixedImageType::IndexType IndexType
Definition: itkMeanSquareRegistrationFunction.h:78
itk::MeanSquareRegistrationFunction::CoordRepType
double CoordRepType
Definition: itkMeanSquareRegistrationFunction.h:98
itk::MeanSquareRegistrationFunction::FixedImageType
typename Superclass::FixedImageType FixedImageType
Definition: itkMeanSquareRegistrationFunction.h:76
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::MeanSquareRegistrationFunction::PixelType
typename Superclass::PixelType PixelType
Definition: itkMeanSquareRegistrationFunction.h:91
itkCentralDifferenceImageFunction.h
itk::PDEDeformableRegistrationFunction::FixedImagePointer
typename FixedImageType::ConstPointer FixedImagePointer
Definition: itkPDEDeformableRegistrationFunction.h:61
itk::MeanSquareRegistrationFunction::MovingImagePointer
typename Superclass::MovingImagePointer MovingImagePointer
Definition: itkMeanSquareRegistrationFunction.h:73
itk::MeanSquareRegistrationFunction::FloatOffsetType
typename Superclass::FloatOffsetType FloatOffsetType
Definition: itkMeanSquareRegistrationFunction.h:94
itk::MeanSquareRegistrationFunction::m_FixedImageGradientCalculator
GradientCalculatorPointer m_FixedImageGradientCalculator
Definition: itkMeanSquareRegistrationFunction.h:181
itk::PDEDeformableRegistrationFunction
Definition: itkPDEDeformableRegistrationFunction.h:41
itk::FiniteDifferenceFunction< TDisplacementField >::PixelType
typename ImageType::PixelType PixelType
Definition: itkFiniteDifferenceFunction.h:83
itk::MeanSquareRegistrationFunction::m_MovingImageInterpolator
InterpolatorPointer m_MovingImageInterpolator
Definition: itkMeanSquareRegistrationFunction.h:184
itk::MeanSquareRegistrationFunction::DisplacementFieldTypePointer
typename Superclass::DisplacementFieldTypePointer DisplacementFieldTypePointer
Definition: itkMeanSquareRegistrationFunction.h:85
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::MeanSquareRegistrationFunction::TimeStepType
typename Superclass::TimeStepType TimeStepType
Definition: itkMeanSquareRegistrationFunction.h:95
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::m_FixedImageSpacing
SpacingType m_FixedImageSpacing
Definition: itkMeanSquareRegistrationFunction.h:178
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