go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkParzenWindowMutualInformationImageToImageMetric.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 itkParzenWindowMutualInformationImageToImageMetric_h
19#define itkParzenWindowMutualInformationImageToImageMetric_h
20
22
23#include "itkArray2D.h"
24
25namespace itk
26{
27
74template <class TFixedImage, class TMovingImage>
76 : public ParzenWindowHistogramImageToImageMetric<TFixedImage, TMovingImage>
77{
78public:
80
84 using Pointer = SmartPointer<Self>;
85 using ConstPointer = SmartPointer<const Self>;
86
88 itkNewMacro(Self);
89
92
94 using typename Superclass::CoordinateRepresentationType;
95 using typename Superclass::MovingImageType;
96 using typename Superclass::MovingImagePixelType;
97 using typename Superclass::MovingImageConstPointer;
98 using typename Superclass::FixedImageType;
99 using typename Superclass::FixedImageConstPointer;
100 using typename Superclass::FixedImageRegionType;
101 using typename Superclass::TransformType;
102 using typename Superclass::TransformPointer;
103 using typename Superclass::InputPointType;
104 using typename Superclass::OutputPointType;
105 using typename Superclass::TransformParametersType;
106 using typename Superclass::TransformJacobianType;
108 using typename Superclass::InterpolatorType;
109 using typename Superclass::InterpolatorPointer;
110 using typename Superclass::RealType;
111 using typename Superclass::GradientPixelType;
112 using typename Superclass::GradientImageType;
113 using typename Superclass::GradientImagePointer;
114 using typename Superclass::GradientImageFilterType;
115 using typename Superclass::GradientImageFilterPointer;
116 using typename Superclass::FixedImageMaskType;
117 using typename Superclass::FixedImageMaskPointer;
118 using typename Superclass::MovingImageMaskType;
119 using typename Superclass::MovingImageMaskPointer;
120 using typename Superclass::MeasureType;
121 using typename Superclass::DerivativeType;
122 using typename Superclass::DerivativeValueType;
123 using typename Superclass::ParametersType;
124 using typename Superclass::FixedImagePixelType;
126 using typename Superclass::ImageSamplerType;
127 using typename Superclass::ImageSamplerPointer;
135 using typename Superclass::ThreaderType;
136 using typename Superclass::ThreadInfoType;
137
139 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
140
142 itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
143
145 MeasureType
146 GetValue(const ParametersType & parameters) const override;
147
149 itkGetConstMacro(UseJacobianPreconditioning, bool);
150 itkSetMacro(UseJacobianPreconditioning, bool);
151
152protected:
155
158
162 using typename Superclass::FixedImageIndexType;
165 using typename Superclass::FixedImagePointType;
171 using typename Superclass::PDFValueType;
173 using typename Superclass::MarginalPDFType;
174 using typename Superclass::JointPDFType;
177 using typename Superclass::JointPDFIndexType;
178 using typename Superclass::JointPDFRegionType;
179 using typename Superclass::JointPDFSizeType;
184 using typename Superclass::KernelFunctionType;
186
194 void
195 GetValueAndAnalyticDerivative(const ParametersType & parameters,
196 MeasureType & value,
197 DerivativeType & derivative) const override;
198
208 virtual void
209 GetValueAndAnalyticDerivativeLowMemory(const ParametersType & parameters,
210 MeasureType & value,
211 DerivativeType & derivative) const;
212
218 void
219 GetValueAndFiniteDifferenceDerivative(const ParametersType & parameters,
220 MeasureType & value,
221 DerivativeType & derivative) const override;
222
224 virtual void
225 ComputeJacobianPreconditioner(const TransformJacobianType & jac,
226 const NonZeroJacobianIndicesType & nzji,
227 DerivativeType & preconditioner,
228 DerivativeType & divisor) const;
229
231 void
233
236 {
238 };
240
242 void
244
246 void
247 AfterThreadedComputeDerivativeLowMemory(DerivativeType & derivative) const;
248
250 static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
252
254 void
256
257private:
260 using PRatioArrayType = Array2D<PRatioType>;
262
265
267 void
268 ComputeDerivativeLowMemorySingleThreaded(DerivativeType & derivative) const;
269
270 void
271 ComputeDerivativeLowMemory(DerivativeType & derivative) const;
272
274 void
275 UpdateDerivativeLowMemory(const RealType & fixedImageValue,
276 const RealType & movingImageValue,
277 const DerivativeType & imageJacobian,
278 const NonZeroJacobianIndicesType & nzji,
279 DerivativeType & derivative) const;
280
282 void
283 ComputeValueAndPRatioArray(double & MI) const;
284};
285
286} // end namespace itk
287
288#ifndef ITK_MANUAL_INSTANTIATION
289# include "itkParzenWindowMutualInformationImageToImageMetric.hxx"
290#endif
291
292#endif // end #ifndef itkParzenWindowMutualInformationImageToImageMetric_h
typename AdvancedTransformType::NumberOfParametersType NumberOfParametersType
This class is a base class for any image sampler.
Kernel used for density estimation and nonparameteric regression.
Base class for all ITK limiter function objects.
A base class for image metrics based on a joint histogram computed using Parzen Windowing.
typename TransformType::OutputPointType MovingImagePointType
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
typename MovingImageType::RegionType MovingImageRegionType
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
GradientImageFilter< MovingImageType, RealType, RealType > CentralDifferenceGradientFilterType
typename FixedImageIndexType::IndexValueType FixedImageIndexValueType
typename MovingImageType::IndexType MovingImageIndexType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
typename TransformType::InputPointType FixedImagePointType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
Computes the mutual information between two images to be registered using the method of Mattes et al.
virtual void ComputeJacobianPreconditioner(const TransformJacobianType &jac, const NonZeroJacobianIndicesType &nzji, DerivativeType &preconditioner, DerivativeType &divisor) const
void ComputeDerivativeLowMemorySingleThreaded(DerivativeType &derivative) const
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
void GetValueAndAnalyticDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
ITK_DISALLOW_COPY_AND_MOVE(ParzenWindowMutualInformationImageToImageMetric)
void ThreadedComputeDerivativeLowMemory(ThreadIdType threadId)
void GetValueAndFiniteDifferenceDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override
void ComputeDerivativeLowMemory(DerivativeType &derivative) const
MeasureType GetValue(const ParametersType &parameters) const override
void UpdateDerivativeLowMemory(const RealType &fixedImageValue, const RealType &movingImageValue, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, DerivativeType &derivative) const
ParzenWindowMutualInformationMultiThreaderParameterType m_ParzenWindowMutualInformationThreaderParameters
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
virtual void GetValueAndAnalyticDerivativeLowMemory(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ComputeDerivativeLowMemoryThreaderCallback(void *arg)
void AfterThreadedComputeDerivativeLowMemory(DerivativeType &derivative) const


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo