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 
25 namespace itk
26 {
27 
35 template <typename TDomainPartitioner, typename TImageToImageMetric, typename TJointHistogramMetric>
37  : public ImageToImageMetricv4GetValueAndDerivativeThreader<TDomainPartitioner, TImageToImageMetric>
38 {
39 public:
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 
81 protected:
84 
86 
87  void
88  BeforeThreadedExecution() override;
89 
90  void
91  AfterThreadedExecution() override;
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 
107  ComputeFixedImageMarginalPDFDerivative(const MarginalPDFPointType & margPDFpoint, const ThreadIdType threadId) const;
108 
110  ComputeMovingImageMarginalPDFDerivative(const MarginalPDFPointType & margPDFpoint, const ThreadIdType threadId) const;
111 
113  ComputeJointPDFDerivative(const JointPDFPointType & jointPDFpoint,
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 
128 private:
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
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::MarginalPDFType
typename JointHistogramMetricType::MarginalPDFType MarginalPDFType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:76
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointHistogramMIPerThreadStruct::FixedImageMarginalPDFInterpolator
MarginalPDFInterpolatorPointer FixedImageMarginalPDFInterpolator
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:119
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::m_JointHistogramMIPerThreadVariables
std::unique_ptr< AlignedJointHistogramMIPerThreadStruct[]> m_JointHistogramMIPerThreadVariables
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:126
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::MarginalPDFInterpolatorPointer
typename JointHistogramMetricType::MarginalPDFInterpolatorPointer MarginalPDFInterpolatorPointer
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:73
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::MarginalPDFInterpolatorType
typename JointHistogramMetricType::MarginalPDFInterpolatorType MarginalPDFInterpolatorType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:71
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::NumberOfParametersType
typename JointHistogramMetricType::NumberOfParametersType NumberOfParametersType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:74
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointHistogramMIPerThreadStruct
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:116
itk::ImageToImageMetricv4GetValueAndDerivativeThreader
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreader.h:44
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::MarginalPDFPointType
typename MarginalPDFType::PointType MarginalPDFPointType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:77
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointPDFValueType
typename JointHistogramMetricType::JointPDFValueType JointPDFValueType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:79
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itkImageToImageMetricv4GetValueAndDerivativeThreader.h
itk::SmartPointer< Self >
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointHistogramMetricType
TJointHistogramMetric JointHistogramMetricType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:68
itk::ThreadIdType
unsigned int ThreadIdType
Definition: itkIntTypes.h:102
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointPDFPointType
typename JointPDFType::PointType JointPDFPointType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:78
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::InternalComputationValueType
typename JointHistogramMetricType::InternalComputationValueType InternalComputationValueType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:69
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointHistogramMIPerThreadStruct::MovingImageMarginalPDFInterpolator
MarginalPDFInterpolatorPointer MovingImageMarginalPDFInterpolator
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:120
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader
Processes points for JointHistogramMutualInformationImageToImageMetricv4 GetValueAndDerivative().
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:36
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointPDFInterpolatorPointer
typename JointHistogramMetricType::JointPDFInterpolatorPointer JointPDFInterpolatorPointer
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:72
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointHistogramMIPerThreadStruct::JointPDFInterpolator
JointPDFInterpolatorPointer JointPDFInterpolator
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:118
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointPDFType
typename JointHistogramMetricType::JointPDFType JointPDFType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:75
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:86
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointPDFInterpolatorType
typename JointHistogramMetricType::JointPDFInterpolatorType JointPDFInterpolatorType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:70