go home Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedMeanSquaresImageToImageMetric.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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 itkAdvancedMeanSquaresImageToImageMetric_h
19#define itkAdvancedMeanSquaresImageToImageMetric_h
20
22
23namespace itk
24{
25
50
51template <typename TFixedImage, typename TMovingImage>
53 : public AdvancedImageToImageMetric<TFixedImage, TMovingImage>
54{
55public:
57
61 using Pointer = SmartPointer<Self>;
62 using ConstPointer = SmartPointer<const Self>;
63
65 itkNewMacro(Self);
66
69
71 using typename Superclass::CoordinateRepresentationType;
72 using typename Superclass::MovingImageType;
73 using typename Superclass::MovingImagePixelType;
74 using typename Superclass::MovingImageConstPointer;
75 using typename Superclass::FixedImageType;
76 using typename Superclass::FixedImageConstPointer;
77 using typename Superclass::FixedImageRegionType;
78 using typename Superclass::TransformType;
79 using typename Superclass::TransformPointer;
80 using typename Superclass::InputPointType;
81 using typename Superclass::OutputPointType;
82 using typename Superclass::TransformJacobianType;
84 using typename Superclass::InterpolatorType;
85 using typename Superclass::InterpolatorPointer;
86 using typename Superclass::RealType;
87 using typename Superclass::GradientPixelType;
88 using typename Superclass::GradientImageType;
89 using typename Superclass::GradientImagePointer;
90 using typename Superclass::FixedImageMaskType;
94 using typename Superclass::MeasureType;
95 using typename Superclass::DerivativeType;
97 using typename Superclass::ParametersType;
100 using typename Superclass::ImageSamplerType;
101 using typename Superclass::ImageSamplerPointer;
109 using typename Superclass::ThreadInfoType;
110
112 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
113
115 itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
116
118 virtual MeasureType
119 GetValueSingleThreaded(const ParametersType & parameters) const;
120
121 MeasureType
122 GetValue(const ParametersType & parameters) const override;
123
125 void
126 GetDerivative(const ParametersType & parameters, DerivativeType & derivative) const override;
127
129 void
130 GetValueAndDerivativeSingleThreaded(const ParametersType & parameters,
131 MeasureType & value,
132 DerivativeType & derivative) const;
133
134 void
135 GetValueAndDerivative(const ParametersType & parameters,
136 MeasureType & value,
137 DerivativeType & derivative) const override;
138
143 void
144 Initialize() override;
145
153 itkSetMacro(UseNormalization, bool);
154 itkGetConstMacro(UseNormalization, bool);
155
156protected:
159
160 void
161 PrintSelf(std::ostream & os, Indent indent) const override;
162
164
166 using typename Superclass::FixedImageIndexType;
169 using typename Superclass::FixedImagePointType;
175
178 void
179 UpdateValueAndDerivativeTerms(const RealType fixedImageValue,
180 const RealType movingImageValue,
181 const DerivativeType & imageJacobian,
182 const NonZeroJacobianIndicesType & nzji,
183 MeasureType & measure,
184 DerivativeType & deriv) const;
185
187 void
188 ThreadedGetValue(ThreadIdType threadID) const override;
189
191 void
192 AfterThreadedGetValue(MeasureType & value) const override;
193
195 void
196 ThreadedGetValueAndDerivative(ThreadIdType threadID) const override;
197
199 void
200 AfterThreadedGetValueAndDerivative(MeasureType & value, DerivativeType & derivative) const override;
201
202private:
204 bool m_UseNormalization{ false };
205};
206
207} // end namespace itk
208
209#ifndef ITK_MANUAL_INSTANTIATION
210# include "itkAdvancedMeanSquaresImageToImageMetric.hxx"
211#endif
212
213#endif // end #ifndef itkAdvancedMeanSquaresImageToImageMetric_h
typename TransformType::OutputPointType MovingImagePointType
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
typename MovingImageType::RegionType MovingImageRegionType
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
typename FixedImageType::PixelType FixedImagePixelType
typename DerivativeType::ValueType DerivativeValueType
typename FixedImageIndexType::IndexValueType FixedImageIndexValueType
typename MovingImageType::IndexType MovingImageIndexType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
ImageMaskSpatialObject< Self::FixedImageDimension > FixedImageMaskType
typename FixedImageType::IndexType FixedImageIndexType
SmartPointer< MovingImageMaskType > MovingImageMaskPointer
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
ImageSamplerBase< FixedImageType > ImageSamplerType
MultiThreaderBase::WorkUnitInfo ThreadInfoType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
typename TransformType::InputPointType FixedImagePointType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
SmartPointer< FixedImageMaskType > FixedImageMaskPointer
typename ImageSamplerType::Pointer ImageSamplerPointer
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
typename AdvancedTransformType::NumberOfParametersType NumberOfParametersType
ImageMaskSpatialObject< Self::MovingImageDimension > MovingImageMaskType
virtual MeasureType GetValueSingleThreaded(const ParametersType &parameters) const
void ThreadedGetValue(ThreadIdType threadID) const override
itkOverrideGetNameOfClassMacro(AdvancedMeanSquaresImageToImageMetric)
void AfterThreadedGetValue(MeasureType &value) const override
void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const override
MeasureType GetValue(const ParametersType &parameters) const override
void AfterThreadedGetValueAndDerivative(MeasureType &value, DerivativeType &derivative) const override
void ThreadedGetValueAndDerivative(ThreadIdType threadID) const override
~AdvancedMeanSquaresImageToImageMetric() override=default
AdvancedImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType > Superclass
ITK_DISALLOW_COPY_AND_MOVE(AdvancedMeanSquaresImageToImageMetric)
void PrintSelf(std::ostream &os, Indent indent) const override
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
void GetValueAndDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
void UpdateValueAndDerivativeTerms(const RealType fixedImageValue, const RealType movingImageValue, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, MeasureType &measure, DerivativeType &deriv) const
void GetValueAndDerivativeSingleThreaded(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const


Generated on 26-02-2026 for elastix by doxygen 1.16.1 (669aeeefca743c148e2d935b3d3c69535c7491e6) elastix logo