ITK  6.0.0
Insight Toolkit
itkJointHistogramMutualInformationGetValueAndDerivativeThreader.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 itkJointHistogramMutualInformationGetValueAndDerivativeThreader_h
19#define itkJointHistogramMutualInformationGetValueAndDerivativeThreader_h
20
22
23#include <memory> // For unique_ptr.
24
25namespace itk
26{
27
35template <typename TDomainPartitioner, typename TImageToImageMetric, typename TJointHistogramMetric>
37 : public ImageToImageMetricv4GetValueAndDerivativeThreader<TDomainPartitioner, TImageToImageMetric>
38{
39public:
41
47
49
50 itkNewMacro(Self);
51
52 using typename Superclass::DomainType;
53 using typename Superclass::AssociateType;
54
55 using typename Superclass::VirtualPointType;
56 using typename Superclass::VirtualIndexType;
57 using typename Superclass::FixedImagePointType;
58 using typename Superclass::FixedImagePixelType;
59 using typename Superclass::FixedImageGradientType;
60 using typename Superclass::MovingImagePointType;
61 using typename Superclass::MovingImagePixelType;
62 using typename Superclass::MovingImageGradientType;
63 using typename Superclass::MeasureType;
64 using typename Superclass::DerivativeType;
65 using typename Superclass::DerivativeValueType;
66 using typename Superclass::JacobianType;
67
68 using JointHistogramMetricType = TJointHistogramMetric;
69 using InternalComputationValueType = typename JointHistogramMetricType::InternalComputationValueType;
70 using JointPDFInterpolatorType = typename JointHistogramMetricType::JointPDFInterpolatorType;
71 using MarginalPDFInterpolatorType = typename JointHistogramMetricType::MarginalPDFInterpolatorType;
72 using JointPDFInterpolatorPointer = typename JointHistogramMetricType::JointPDFInterpolatorPointer;
73 using MarginalPDFInterpolatorPointer = typename JointHistogramMetricType::MarginalPDFInterpolatorPointer;
74 using NumberOfParametersType = typename JointHistogramMetricType::NumberOfParametersType;
75 using JointPDFType = typename JointHistogramMetricType::JointPDFType;
76 using MarginalPDFType = typename JointHistogramMetricType::MarginalPDFType;
79 using JointPDFValueType = typename JointHistogramMetricType::JointPDFValueType;
80
81protected:
84
86
87 void
89
90 void
92
93 bool
94 ProcessPoint(const VirtualIndexType & virtualIndex,
95 const VirtualPointType & virtualPoint,
96 const FixedImagePointType & mappedFixedPoint,
97 const FixedImagePixelType & fixedImageValue,
98 const FixedImageGradientType & mappedFixedImageGradient,
99 const MovingImagePointType & mappedMovingPoint,
100 const MovingImagePixelType & movingImageValue,
101 const MovingImageGradientType & movingImageGradient,
102 MeasureType & metricValueReturn,
103 DerivativeType & localDerivativeReturn,
104 const ThreadIdType threadId) const override;
105
108
111
114 const ThreadIdType threadId,
115 const SizeValueType ind) const;
117 {
121 };
122 itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, JointHistogramMIPerThreadStruct, PaddedJointHistogramMIPerThreadStruct);
123 itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT,
124 PaddedJointHistogramMIPerThreadStruct,
125 AlignedJointHistogramMIPerThreadStruct);
126 std::unique_ptr<AlignedJointHistogramMIPerThreadStruct[]> m_JointHistogramMIPerThreadVariables;
127
128private:
131 TJointHistogramMetric * m_JointAssociate{};
132};
133
134} // end namespace itk
135
136#ifndef ITK_MANUAL_INSTANTIATION
137# include "itkJointHistogramMutualInformationGetValueAndDerivativeThreader.hxx"
138#endif
139
140#endif
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
Templated n-dimensional image class.
Definition: itkImage.h:89
Processes points for JointHistogramMutualInformationImageToImageMetricv4 GetValueAndDerivative().
InternalComputationValueType ComputeFixedImageMarginalPDFDerivative(const MarginalPDFPointType &margPDFpoint, const ThreadIdType threadId) const
itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, JointHistogramMIPerThreadStruct, PaddedJointHistogramMIPerThreadStruct)
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
InternalComputationValueType ComputeMovingImageMarginalPDFDerivative(const MarginalPDFPointType &margPDFpoint, const ThreadIdType threadId) const
InternalComputationValueType ComputeJointPDFDerivative(const JointPDFPointType &jointPDFpoint, const ThreadIdType threadId, const SizeValueType ind) const
itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT, PaddedJointHistogramMIPerThreadStruct, AlignedJointHistogramMIPerThreadStruct)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType
Definition: itkIntTypes.h:102
unsigned long SizeValueType
Definition: itkIntTypes.h:86