ITK  6.0.0
Insight Toolkit
itkMeanSquaresImageToImageMetric.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 itkMeanSquaresImageToImageMetric_h
19#define itkMeanSquaresImageToImageMetric_h
20
22#include "itkPoint.h"
23#include "itkIndex.h"
24
25#include <memory> // For unique_ptr.
26
27
28namespace itk
29{
30
40template <typename TFixedImage, typename TMovingImage>
41class ITK_TEMPLATE_EXPORT MeanSquaresImageToImageMetric : public ImageToImageMetric<TFixedImage, TMovingImage>
42{
43public:
44 ITK_DISALLOW_COPY_AND_MOVE(MeanSquaresImageToImageMetric);
45
51
53 itkNewMacro(Self);
54
56 itkOverrideGetNameOfClassMacro(MeanSquaresImageToImageMetric);
57
59 using typename Superclass::TransformType;
60 using typename Superclass::TransformPointer;
61 using typename Superclass::TransformJacobianType;
62 using typename Superclass::InterpolatorType;
63 using typename Superclass::MeasureType;
64 using typename Superclass::DerivativeType;
65 using typename Superclass::ParametersType;
66 using typename Superclass::FixedImageType;
67 using typename Superclass::MovingImageType;
68 using typename Superclass::MovingImagePointType;
69 using typename Superclass::FixedImageConstPointer;
70 using typename Superclass::MovingImageConstPointer;
71 using typename Superclass::CoordinateRepresentationType;
72 using typename Superclass::FixedImageSampleContainer;
73 using typename Superclass::ImageDerivativesType;
74 using typename Superclass::WeightsValueType;
75 using typename Superclass::IndexValueType;
76
77 // Needed for evaluation of Jacobian.
78 using typename Superclass::FixedImagePointType;
79
81 static constexpr unsigned int MovingImageDimension = MovingImageType::ImageDimension;
82
90 void
91 Initialize() override;
92
95 GetValue(const ParametersType & parameters) const override;
96
98 void
99 GetDerivative(const ParametersType & parameters, DerivativeType & derivative) const override;
100
102 void
104 MeasureType & value,
105 DerivativeType & derivative) const override;
106
107protected:
109 ~MeanSquaresImageToImageMetric() override = default;
110 void
111 PrintSelf(std::ostream & os, Indent indent) const override;
112
113private:
114 bool
116 SizeValueType fixedImageSample,
117 const MovingImagePointType & mappedPoint,
118 double movingImageValue) const override;
119
120 bool
122 SizeValueType fixedImageSample,
123 const MovingImagePointType & mappedPoint,
124 double movingImageValue,
125 const ImageDerivativesType & movingImageGradientValue) const override;
126
128 {
132 };
133
134 itkAlignedTypedef(64, PerThreadS, AlignedPerThreadType);
135 std::unique_ptr<AlignedPerThreadType[]> m_PerThread;
136};
137} // end namespace itk
138
139#ifndef ITK_MANUAL_INSTANTIATION
140# include "itkMeanSquaresImageToImageMetric.hxx"
141#endif
142
143#endif
Array class with size defined at construction time.
Definition: itkArray.h:48
A templated class holding a n-Dimensional covariant vector.
Computes similarity between regions of two images.
typename TransformType::OutputPointType MovingImagePointType
typename TransformType::JacobianType TransformJacobianType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
~MeanSquaresImageToImageMetric() override=default
std::unique_ptr< AlignedPerThreadType[]> m_PerThread
MeasureType GetValue(const ParametersType &parameters) const override
bool GetValueThreadProcessSample(ThreadIdType threadId, SizeValueType fixedImageSample, const MovingImagePointType &mappedPoint, double movingImageValue) const override
void GetValueAndDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override
void PrintSelf(std::ostream &os, Indent indent) const override
void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const override
itkAlignedTypedef(64, PerThreadS, AlignedPerThreadType)
bool GetValueAndDerivativeThreadProcessSample(ThreadIdType threadId, SizeValueType fixedImageSample, const MovingImagePointType &mappedPoint, double movingImageValue, const ImageDerivativesType &movingImageGradientValue) const override
Superclass::ParametersType ParametersType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType
Definition: itkIntTypes.h:102
long IndexValueType
Definition: itkIntTypes.h:93
unsigned long SizeValueType
Definition: itkIntTypes.h:86