ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 "itkMutexLock.h"
24 
25 namespace itk
26 {
27 
34 template < typename TDomainPartitioner, typename TImageToImageMetric, typename TMattesMutualInformationMetric >
36  : public ImageToImageMetricv4GetValueAndDerivativeThreader< TDomainPartitioner, TImageToImageMetric >
37 {
38 public:
44 
46 
47  itkNewMacro( Self );
48 
49  typedef typename Superclass::DomainType DomainType;
50  typedef typename Superclass::AssociateType AssociateType;
51 
52  typedef typename Superclass::ImageToImageMetricv4Type ImageToImageMetricv4Type;
53  typedef typename Superclass::VirtualPointType VirtualPointType;
54  typedef typename Superclass::VirtualIndexType VirtualIndexType;
55  typedef typename Superclass::FixedImagePointType FixedImagePointType;
56  typedef typename Superclass::FixedImageIndexType FixedImageIndexType;
57  typedef typename Superclass::FixedImagePixelType FixedImagePixelType;
58  typedef typename Superclass::FixedImageGradientType FixedImageGradientType;
59  typedef typename Superclass::MovingImagePointType MovingImagePointType;
60  typedef typename Superclass::MovingImagePixelType MovingImagePixelType;
61  typedef typename Superclass::MovingImageGradientType MovingImageGradientType;
62  typedef typename Superclass::MeasureType MeasureType;
63  typedef typename Superclass::DerivativeType DerivativeType;
64  typedef typename Superclass::DerivativeValueType DerivativeValueType;
65  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
66 
67  typedef typename ImageToImageMetricv4Type::MovingTransformType MovingTransformType;
68 
69  typedef typename TMattesMutualInformationMetric::PDFValueType PDFValueType;
70  typedef typename TMattesMutualInformationMetric::JointPDFType JointPDFType;
71  typedef typename TMattesMutualInformationMetric::JointPDFRegionType JointPDFRegionType;
72  typedef typename TMattesMutualInformationMetric::JointPDFIndexType JointPDFIndexType;
73  typedef typename TMattesMutualInformationMetric::JointPDFValueType JointPDFValueType;
74  typedef typename TMattesMutualInformationMetric::JointPDFSizeType JointPDFSizeType;
75  typedef typename TMattesMutualInformationMetric::JointPDFDerivativesType JointPDFDerivativesType;
76  typedef typename TMattesMutualInformationMetric::JointPDFDerivativesIndexType JointPDFDerivativesIndexType;
77  typedef typename TMattesMutualInformationMetric::JointPDFDerivativesValueType JointPDFDerivativesValueType;
78  typedef typename TMattesMutualInformationMetric::JointPDFDerivativesRegionType JointPDFDerivativesRegionType;
79  typedef typename TMattesMutualInformationMetric::JointPDFDerivativesSizeType JointPDFDerivativesSizeType;
80 
81  typedef typename TMattesMutualInformationMetric::CubicBSplineFunctionType CubicBSplineFunctionType;
82  typedef typename TMattesMutualInformationMetric::CubicBSplineDerivativeFunctionType CubicBSplineDerivativeFunctionType;
83 
84  typedef typename TMattesMutualInformationMetric::JacobianType JacobianType;
85 
86 protected:
88  m_MattesAssociate(ITK_NULLPTR)
89  {}
90 
91  virtual void BeforeThreadedExecution() ITK_OVERRIDE;
92 
93  virtual void AfterThreadedExecution() ITK_OVERRIDE;
94 
98  virtual bool ProcessPoint(
99  const VirtualIndexType & virtualIndex,
100  const VirtualPointType & virtualPoint,
101  const FixedImagePointType & mappedFixedPoint,
102  const FixedImagePixelType & mappedFixedPixelValue,
103  const FixedImageGradientType & mappedFixedImageGradient,
104  const MovingImagePointType & mappedMovingPoint,
105  const MovingImagePixelType & mappedMovingPixelValue,
106  const MovingImageGradientType & mappedMovingImageGradient,
107  MeasureType & metricValueReturn,
108  DerivativeType & localDerivativeReturn,
109  const ThreadIdType threadId ) const ITK_OVERRIDE;
110 
112  virtual void ComputePDFDerivativesGlobalSupportTransform(const ThreadIdType & threadId,
113  const OffsetValueType & fixedImageParzenWindowIndex,
114  const JacobianType & jacobian,
115  const OffsetValueType & pdfMovingIndex,
116  const MovingImageGradientType & movingGradient,
117  const PDFValueType & cubicBSplineDerivativeValue) const;
118 
121  const JacobianType & jacobian,
122  const MovingImageGradientType & movingGradient,
123  const PDFValueType & cubicBSplineDerivativeValue,
124  DerivativeValueType * localSupportDerivativeResultPtr) const;
125 
126 private:
128  void operator=( const Self & ); // purposely not implemented
129 
132  TMattesMutualInformationMetric * m_MattesAssociate;
133 };
134 
135 } // end namespace itk
136 
137 #ifndef ITK_MANUAL_INSTANTIATION
138 #include "itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.hxx"
139 #endif
140 
141 #endif
signed long OffsetValueType
Definition: itkIntTypes.h:154
virtual void ComputePDFDerivativesGlobalSupportTransform(const ThreadIdType &threadId, const OffsetValueType &fixedImageParzenWindowIndex, const JacobianType &jacobian, const OffsetValueType &pdfMovingIndex, const MovingImageGradientType &movingGradient, const PDFValueType &cubicBSplineDerivativeValue) const
ImageToImageMetricv4GetValueAndDerivativeThreader< TDomainPartitioner, TImageToImageMetric > Superclass
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
virtual bool ProcessPoint(const VirtualIndexType &virtualIndex, const VirtualPointType &virtualPoint, const FixedImagePointType &mappedFixedPoint, const FixedImagePixelType &mappedFixedPixelValue, const FixedImageGradientType &mappedFixedImageGradient, const MovingImagePointType &mappedMovingPoint, const MovingImagePixelType &mappedMovingPixelValue, const MovingImageGradientType &mappedMovingImageGradient, MeasureType &metricValueReturn, DerivativeType &localDerivativeReturn, const ThreadIdType threadId) const override
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
virtual void ComputePDFDerivativesLocalSupportTransform(const JacobianType &jacobian, const MovingImageGradientType &movingGradient, const PDFValueType &cubicBSplineDerivativeValue, DerivativeValueType *localSupportDerivativeResultPtr) const