go home Home | Main Page | Modules | 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
51template <class TFixedImage, class 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::TransformParametersType;
83 using typename Superclass::TransformJacobianType;
85 using typename Superclass::InterpolatorType;
86 using typename Superclass::InterpolatorPointer;
87 using typename Superclass::RealType;
88 using typename Superclass::GradientPixelType;
89 using typename Superclass::GradientImageType;
90 using typename Superclass::GradientImagePointer;
91 using typename Superclass::FixedImageMaskType;
95 using typename Superclass::MeasureType;
96 using typename Superclass::DerivativeType;
98 using typename Superclass::ParametersType;
101 using typename Superclass::ImageSamplerType;
102 using typename Superclass::ImageSamplerPointer;
110 using typename Superclass::ThreadInfoType;
111
113 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
114
116 itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
117
119 virtual MeasureType
120 GetValueSingleThreaded(const TransformParametersType & parameters) const;
121
122 MeasureType
123 GetValue(const TransformParametersType & parameters) const override;
124
126 void
127 GetDerivative(const TransformParametersType & parameters, DerivativeType & derivative) const override;
128
130 void
131 GetValueAndDerivativeSingleThreaded(const TransformParametersType & parameters,
132 MeasureType & value,
133 DerivativeType & derivative) const;
134
135 void
136 GetValueAndDerivative(const TransformParametersType & parameters,
137 MeasureType & value,
138 DerivativeType & derivative) const override;
139
144 void
145 Initialize() override;
146
154 itkSetMacro(UseNormalization, bool);
155 itkGetConstMacro(UseNormalization, bool);
156
157protected:
160
161 void
162 PrintSelf(std::ostream & os, Indent indent) const override;
163
167 using typename Superclass::FixedImageIndexType;
170 using typename Superclass::FixedImagePointType;
176
179 void
180 UpdateValueAndDerivativeTerms(const RealType fixedImageValue,
181 const RealType movingImageValue,
182 const DerivativeType & imageJacobian,
183 const NonZeroJacobianIndicesType & nzji,
184 MeasureType & measure,
185 DerivativeType & deriv) const;
186
188 void
189 ThreadedGetValue(ThreadIdType threadID) const override;
190
192 void
193 AfterThreadedGetValue(MeasureType & value) const override;
194
196 void
197 ThreadedGetValueAndDerivative(ThreadIdType threadID) const override;
198
200 void
201 AfterThreadedGetValueAndDerivative(MeasureType & value, DerivativeType & derivative) const override;
202
203private:
204 double m_NormalizationFactor{ 1.0 };
205 bool m_UseNormalization{ false };
206};
207
208} // end namespace itk
209
210#ifndef ITK_MANUAL_INSTANTIATION
211# include "itkAdvancedMeanSquaresImageToImageMetric.hxx"
212#endif
213
214#endif // end #ifndef itkAdvancedMeanSquaresImageToImageMetric_h
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
typename TransformType::OutputPointType MovingImagePointType
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
typename MovingImageType::RegionType MovingImageRegionType
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
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
MultiThreaderBase::WorkUnitInfo ThreadInfoType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
typename TransformType::InputPointType FixedImagePointType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
SmartPointer< FixedImageMaskType > FixedImageMaskPointer
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
typename ImageSamplerType::Pointer ImageSamplerPointer
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
typename AdvancedTransformType::NumberOfParametersType NumberOfParametersType
ImageMaskSpatialObject< Self::MovingImageDimension > MovingImageMaskType
Compute Mean square difference between two images, based on AdvancedImageToImageMetric....
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
void ThreadedGetValue(ThreadIdType threadID) const override
void AfterThreadedGetValue(MeasureType &value) const override
void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const override
void AfterThreadedGetValueAndDerivative(MeasureType &value, DerivativeType &derivative) const override
void ThreadedGetValueAndDerivative(ThreadIdType threadID) const override
~AdvancedMeanSquaresImageToImageMetric() override=default
virtual MeasureType GetValueSingleThreaded(const TransformParametersType &parameters) const
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override
ITK_DISALLOW_COPY_AND_MOVE(AdvancedMeanSquaresImageToImageMetric)
void PrintSelf(std::ostream &os, Indent indent) const override
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
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 TransformParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
MeasureType GetValue(const TransformParametersType &parameters) const override
This class is a base class for any image sampler.
Base class for all ITK limiter function objects.


Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo