ITK  5.4.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 
25 namespace itk
26 {
27 
34 template <typename TDomainPartitioner, typename TImageToImageMetric, typename TMattesMutualInformationMetric>
36  : public ImageToImageMetricv4GetValueAndDerivativeThreader<TDomainPartitioner, TImageToImageMetric>
37 {
38 public:
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 
89 protected:
91  : m_MattesAssociate(nullptr)
92  {}
93 
94  void
95  BeforeThreadedExecution() override;
96 
97  void
98  AfterThreadedExecution() override;
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
118  ComputePDFDerivativesLocalSupportTransform(const JacobianType & jacobian,
119  const MovingImageGradientType & movingImageGradient,
120  const PDFValueType & cubicBSplineDerivativeValue,
121  DerivativeValueType * localSupportDerivativeResultPtr) const;
122 
123 private:
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
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::MovingTransformType
typename ImageToImageMetricv4Type::MovingTransformType MovingTransformType
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:69
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::JacobianType
typename TMattesMutualInformationMetric::JacobianType JacobianType
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:87
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::JointPDFDerivativesRegionType
typename TMattesMutualInformationMetric::JointPDFDerivativesRegionType JointPDFDerivativesRegionType
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:80
itk::ImageToImageMetricv4GetValueAndDerivativeThreader
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreader.h:44
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::PDFValueType
typename TMattesMutualInformationMetric::PDFValueType PDFValueType
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:71
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::JointPDFType
typename TMattesMutualInformationMetric::JointPDFType JointPDFType
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:72
itkImageToImageMetricv4GetValueAndDerivativeThreader.h
itk::SmartPointer< Self >
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader
Processes points for MattesMutualInformationImageToImageMetricv4 GetValueAndDerivative.
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:35
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::JointPDFDerivativesIndexType
typename TMattesMutualInformationMetric::JointPDFDerivativesIndexType JointPDFDerivativesIndexType
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:78
itk::ThreadIdType
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::CubicBSplineFunctionType
typename TMattesMutualInformationMetric::CubicBSplineFunctionType CubicBSplineFunctionType
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:83
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::CubicBSplineDerivativeFunctionType
typename TMattesMutualInformationMetric::CubicBSplineDerivativeFunctionType CubicBSplineDerivativeFunctionType
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:85
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::JointPDFIndexType
typename TMattesMutualInformationMetric::JointPDFIndexType JointPDFIndexType
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:74
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::JointPDFSizeType
typename TMattesMutualInformationMetric::JointPDFSizeType JointPDFSizeType
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:76
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::ImageToImageMetricv4Type
typename Superclass::ImageToImageMetricv4Type ImageToImageMetricv4Type
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:54
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::JointPDFValueType
typename TMattesMutualInformationMetric::JointPDFValueType JointPDFValueType
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:75
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:77
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::JointPDFDerivativesValueType
typename TMattesMutualInformationMetric::JointPDFDerivativesValueType JointPDFDerivativesValueType
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:79
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::JointPDFRegionType
typename TMattesMutualInformationMetric::JointPDFRegionType JointPDFRegionType
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:73
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader
MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader()
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:90
itk::MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::JointPDFDerivativesSizeType
typename TMattesMutualInformationMetric::JointPDFDerivativesSizeType JointPDFDerivativesSizeType
Definition: itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h:81