ITK  6.0.0
Insight Toolkit
itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.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 itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader_h
19#define itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader_h
20
22
23#include <mutex>
24
25namespace itk
26{
27
34template <typename TDomainPartitioner, typename TImageToImageMetric, typename TMattesMutualInformationMetric>
36 : public ImageToImageMetricv4GetValueAndDerivativeThreader<TDomainPartitioner, TImageToImageMetric>
37{
38public:
40
46
48
49 itkNewMacro(Self);
50
51 using typename Superclass::DomainType;
52 using typename Superclass::AssociateType;
53
54 using ImageToImageMetricv4Type = typename Superclass::ImageToImageMetricv4Type;
55 using typename Superclass::VirtualPointType;
56 using typename Superclass::VirtualIndexType;
57 using typename Superclass::FixedImagePointType;
58 using typename Superclass::FixedImageIndexType;
59 using typename Superclass::FixedImagePixelType;
60 using typename Superclass::FixedImageGradientType;
61 using typename Superclass::MovingImagePointType;
62 using typename Superclass::MovingImagePixelType;
63 using typename Superclass::MovingImageGradientType;
64 using typename Superclass::MeasureType;
65 using typename Superclass::DerivativeType;
66 using typename Superclass::DerivativeValueType;
67 using typename Superclass::NumberOfParametersType;
68
69 using MovingTransformType = typename ImageToImageMetricv4Type::MovingTransformType;
70
71 using PDFValueType = typename TMattesMutualInformationMetric::PDFValueType;
72 using JointPDFType = typename TMattesMutualInformationMetric::JointPDFType;
73 using JointPDFRegionType = typename TMattesMutualInformationMetric::JointPDFRegionType;
74 using JointPDFIndexType = typename TMattesMutualInformationMetric::JointPDFIndexType;
75 using JointPDFValueType = typename TMattesMutualInformationMetric::JointPDFValueType;
76 using JointPDFSizeType = typename TMattesMutualInformationMetric::JointPDFSizeType;
77 using JointPDFDerivativesType = typename TMattesMutualInformationMetric::JointPDFDerivativesType;
78 using JointPDFDerivativesIndexType = typename TMattesMutualInformationMetric::JointPDFDerivativesIndexType;
79 using JointPDFDerivativesValueType = typename TMattesMutualInformationMetric::JointPDFDerivativesValueType;
80 using JointPDFDerivativesRegionType = typename TMattesMutualInformationMetric::JointPDFDerivativesRegionType;
81 using JointPDFDerivativesSizeType = typename TMattesMutualInformationMetric::JointPDFDerivativesSizeType;
82
83 using CubicBSplineFunctionType = typename TMattesMutualInformationMetric::CubicBSplineFunctionType;
85 typename TMattesMutualInformationMetric::CubicBSplineDerivativeFunctionType;
86
87 using JacobianType = typename TMattesMutualInformationMetric::JacobianType;
88
89protected:
91 : m_MattesAssociate(nullptr)
92 {}
93
94 void
96
97 void
99
103 bool
104 ProcessPoint(const VirtualIndexType & virtualIndex,
105 const VirtualPointType & virtualPoint,
106 const FixedImagePointType & mappedFixedPoint,
107 const FixedImagePixelType & fixedImageValue,
108 const FixedImageGradientType & mappedFixedImageGradient,
109 const MovingImagePointType & mappedMovingPoint,
110 const MovingImagePixelType & movingImageValue,
111 const MovingImageGradientType & movingImageGradient,
112 MeasureType & metricValueReturn,
113 DerivativeType & localDerivativeReturn,
114 const ThreadIdType threadId) const override;
115
117 virtual void
119 const MovingImageGradientType & movingImageGradient,
120 const PDFValueType & cubicBSplineDerivativeValue,
121 DerivativeValueType * localSupportDerivativeResultPtr) const;
122
123private:
126 TMattesMutualInformationMetric * m_MattesAssociate{};
127};
128
129} // end namespace itk
130
131#ifndef ITK_MANUAL_INSTANTIATION
132# include "itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.hxx"
133#endif
134
135#endif
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
bool ProcessPoint(const VirtualIndexType &virtualIndex, const VirtualPointType &virtualPoint, const FixedImagePointType &mappedFixedPoint, const FixedImagePixelType &fixedImageValue, const FixedImageGradientType &mappedFixedImageGradient, const MovingImagePointType &mappedMovingPoint, const MovingImagePixelType &movingImageValue, const MovingImageGradientType &movingImageGradient, MeasureType &metricValueReturn, DerivativeType &localDerivativeReturn, const ThreadIdType threadId) const override
virtual void ComputePDFDerivativesLocalSupportTransform(const JacobianType &jacobian, const MovingImageGradientType &movingImageGradient, const PDFValueType &cubicBSplineDerivativeValue, DerivativeValueType *localSupportDerivativeResultPtr) const
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType
Definition: itkIntTypes.h:102