ITK  5.2.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  * 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 itkJointHistogramMutualInformationGetValueAndDerivativeThreader_h
19 #define itkJointHistogramMutualInformationGetValueAndDerivativeThreader_h
20 
22 
23 namespace itk
24 {
25 
33 template <typename TDomainPartitioner, typename TImageToImageMetric, typename TJointHistogramMetric>
35  : public ImageToImageMetricv4GetValueAndDerivativeThreader<TDomainPartitioner, TImageToImageMetric>
36 {
37 public:
39 
45 
48 
49  itkNewMacro(Self);
50 
51  using DomainType = typename Superclass::DomainType;
52  using AssociateType = typename Superclass::AssociateType;
53 
54  using VirtualPointType = typename Superclass::VirtualPointType;
55  using VirtualIndexType = typename Superclass::VirtualIndexType;
56  using FixedImagePointType = typename Superclass::FixedImagePointType;
57  using FixedImagePixelType = typename Superclass::FixedImagePixelType;
58  using FixedImageGradientType = typename Superclass::FixedImageGradientType;
59  using MovingImagePointType = typename Superclass::MovingImagePointType;
60  using MovingImagePixelType = typename Superclass::MovingImagePixelType;
61  using MovingImageGradientType = typename Superclass::MovingImageGradientType;
62  using MeasureType = typename Superclass::MeasureType;
63  using DerivativeType = typename Superclass::DerivativeType;
64  using DerivativeValueType = typename Superclass::DerivativeValueType;
65  using JacobianType = typename Superclass::JacobianType;
66 
67  using JointHistogramMetricType = TJointHistogramMetric;
68  using InternalComputationValueType = typename JointHistogramMetricType::InternalComputationValueType;
69  using JointPDFInterpolatorType = typename JointHistogramMetricType::JointPDFInterpolatorType;
70  using MarginalPDFInterpolatorType = typename JointHistogramMetricType::MarginalPDFInterpolatorType;
71  using JointPDFInterpolatorPointer = typename JointHistogramMetricType::JointPDFInterpolatorPointer;
72  using MarginalPDFInterpolatorPointer = typename JointHistogramMetricType::MarginalPDFInterpolatorPointer;
73  using NumberOfParametersType = typename JointHistogramMetricType::NumberOfParametersType;
74  using JointPDFType = typename JointHistogramMetricType::JointPDFType;
75  using MarginalPDFType = typename JointHistogramMetricType::MarginalPDFType;
78  using JointPDFValueType = typename JointHistogramMetricType::JointPDFValueType;
79 
80 protected:
83 
85 
86  void
87  BeforeThreadedExecution() override;
88 
89  void
90  AfterThreadedExecution() override;
91 
92  bool
93  ProcessPoint(const VirtualIndexType & virtualIndex,
94  const VirtualPointType & virtualPoint,
95  const FixedImagePointType & mappedFixedPoint,
96  const FixedImagePixelType & fixedImageValue,
97  const FixedImageGradientType & mappedFixedImageGradient,
98  const MovingImagePointType & mappedMovingPoint,
99  const MovingImagePixelType & movingImageValue,
100  const MovingImageGradientType & movingImageGradient,
101  MeasureType & metricValueReturn,
102  DerivativeType & localDerivativeReturn,
103  const ThreadIdType threadId) const override;
104 
106  ComputeFixedImageMarginalPDFDerivative(const MarginalPDFPointType & margPDFpoint, const ThreadIdType threadId) const;
107 
109  ComputeMovingImageMarginalPDFDerivative(const MarginalPDFPointType & margPDFpoint, const ThreadIdType threadId) const;
110 
112  ComputeJointPDFDerivative(const JointPDFPointType & jointPDFpoint,
113  const ThreadIdType threadId,
114  const SizeValueType ind) const;
116  {
120  };
121  itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, JointHistogramMIPerThreadStruct, PaddedJointHistogramMIPerThreadStruct);
122  itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT,
123  PaddedJointHistogramMIPerThreadStruct,
124  AlignedJointHistogramMIPerThreadStruct);
125  AlignedJointHistogramMIPerThreadStruct * m_JointHistogramMIPerThreadVariables;
126 
127 private:
130  TJointHistogramMetric * m_JointAssociate;
131 };
132 
133 } // end namespace itk
134 
135 #endif
136 
137 #ifndef ITK_MANUAL_INSTANTIATION
138 #include "itkJointHistogramMutualInformationGetValueAndDerivativeThreader.hxx"
139 #endif
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::MeasureType
typename Superclass::MeasureType MeasureType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:62
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::MarginalPDFType
typename JointHistogramMetricType::MarginalPDFType MarginalPDFType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:75
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointHistogramMIPerThreadStruct::FixedImageMarginalPDFInterpolator
MarginalPDFInterpolatorPointer FixedImageMarginalPDFInterpolator
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:118
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::MarginalPDFInterpolatorPointer
typename JointHistogramMetricType::MarginalPDFInterpolatorPointer MarginalPDFInterpolatorPointer
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:72
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::MarginalPDFInterpolatorType
typename JointHistogramMetricType::MarginalPDFInterpolatorType MarginalPDFInterpolatorType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:70
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::NumberOfParametersType
typename JointHistogramMetricType::NumberOfParametersType NumberOfParametersType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:73
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointHistogramMIPerThreadStruct
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:115
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::VirtualPointType
typename Superclass::VirtualPointType VirtualPointType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:54
itk::ImageToImageMetricv4GetValueAndDerivativeThreader
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreader.h:44
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::DerivativeType
typename Superclass::DerivativeType DerivativeType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:63
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::MarginalPDFPointType
typename MarginalPDFType::PointType MarginalPDFPointType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:76
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::FixedImagePixelType
typename Superclass::FixedImagePixelType FixedImagePixelType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:57
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointPDFValueType
typename JointHistogramMetricType::JointPDFValueType JointPDFValueType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:78
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itkImageToImageMetricv4GetValueAndDerivativeThreader.h
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::FixedImagePointType
typename Superclass::FixedImagePointType FixedImagePointType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:56
itk::SmartPointer< Self >
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointHistogramMetricType
TJointHistogramMetric JointHistogramMetricType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:67
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::DomainType
typename Superclass::DomainType DomainType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:51
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::AssociateType
typename Superclass::AssociateType AssociateType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:52
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::MovingImagePointType
typename Superclass::MovingImagePointType MovingImagePointType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:59
itk::ThreadIdType
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointPDFPointType
typename JointPDFType::PointType JointPDFPointType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:77
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::m_JointHistogramMIPerThreadVariables
AlignedJointHistogramMIPerThreadStruct * m_JointHistogramMIPerThreadVariables
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:125
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::VirtualIndexType
typename Superclass::VirtualIndexType VirtualIndexType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:55
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JacobianType
typename Superclass::JacobianType JacobianType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:65
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::MovingImageGradientType
typename Superclass::MovingImageGradientType MovingImageGradientType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:61
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::m_JointAssociate
TJointHistogramMetric * m_JointAssociate
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:130
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::MovingImagePixelType
typename Superclass::MovingImagePixelType MovingImagePixelType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:60
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::DerivativeValueType
typename Superclass::DerivativeValueType DerivativeValueType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:64
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::InternalComputationValueType
typename JointHistogramMetricType::InternalComputationValueType InternalComputationValueType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:68
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointHistogramMIPerThreadStruct::MovingImageMarginalPDFInterpolator
MarginalPDFInterpolatorPointer MovingImageMarginalPDFInterpolator
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:119
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader
Processes points for JointHistogramMutualInformationImageToImageMetricv4 GetValueAndDerivative().
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:34
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointPDFInterpolatorPointer
typename JointHistogramMetricType::JointPDFInterpolatorPointer JointPDFInterpolatorPointer
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:71
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointHistogramMIPerThreadStruct::JointPDFInterpolator
JointPDFInterpolatorPointer JointPDFInterpolator
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:117
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::FixedImageGradientType
typename Superclass::FixedImageGradientType FixedImageGradientType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:58
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointPDFType
typename JointHistogramMetricType::JointPDFType JointPDFType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:74
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::JointHistogramMutualInformationGetValueAndDerivativeThreader::JointPDFInterpolatorType
typename JointHistogramMetricType::JointPDFInterpolatorType JointPDFInterpolatorType
Definition: itkJointHistogramMutualInformationGetValueAndDerivativeThreader.h:69