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