ITK  4.3.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 namespace itk
24 {
25 
32 template < class TDomainPartitioner, class TImageToImageMetric, class TMattesMutualInformationMetric >
34  : public ImageToImageMetricv4GetValueAndDerivativeThreader< TDomainPartitioner, TImageToImageMetric >
35 {
36 public:
42 
44 
45  itkNewMacro( Self );
46 
47  typedef typename Superclass::DomainType DomainType;
48  typedef typename Superclass::AssociateType AssociateType;
49 
50  typedef typename Superclass::ImageToImageMetricv4Type ImageToImageMetricv4Type;
51  typedef typename Superclass::VirtualPointType VirtualPointType;
52  typedef typename Superclass::VirtualIndexType VirtualIndexType;
53  typedef typename Superclass::FixedImagePointType FixedImagePointType;
54  typedef typename Superclass::FixedImageIndexType FixedImageIndexType;
55  typedef typename Superclass::FixedImagePixelType FixedImagePixelType;
56  typedef typename Superclass::FixedImageGradientType FixedImageGradientType;
57  typedef typename Superclass::MovingImagePointType MovingImagePointType;
58  typedef typename Superclass::MovingImagePixelType MovingImagePixelType;
59  typedef typename Superclass::MovingImageGradientType MovingImageGradientType;
60  typedef typename Superclass::MeasureType MeasureType;
61  typedef typename Superclass::DerivativeType DerivativeType;
62  typedef typename Superclass::DerivativeValueType DerivativeValueType;
63  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
64 
65  typedef typename ImageToImageMetricv4Type::MovingTransformType MovingTransformType;
66 
67  typedef typename TMattesMutualInformationMetric::PDFValueType PDFValueType;
68  typedef typename TMattesMutualInformationMetric::JointPDFType JointPDFType;
69  typedef typename TMattesMutualInformationMetric::JointPDFRegionType JointPDFRegionType;
70  typedef typename TMattesMutualInformationMetric::JointPDFIndexType JointPDFIndexType;
71  typedef typename TMattesMutualInformationMetric::JointPDFValueType JointPDFValueType;
72  typedef typename TMattesMutualInformationMetric::JointPDFSizeType JointPDFSizeType;
73  typedef typename TMattesMutualInformationMetric::JointPDFDerivativesType JointPDFDerivativesType;
74  typedef typename TMattesMutualInformationMetric::JointPDFDerivativesIndexType JointPDFDerivativesIndexType;
75  typedef typename TMattesMutualInformationMetric::JointPDFDerivativesValueType JointPDFDerivativesValueType;
76  typedef typename TMattesMutualInformationMetric::JointPDFDerivativesRegionType JointPDFDerivativesRegionType;
77  typedef typename TMattesMutualInformationMetric::JointPDFDerivativesSizeType JointPDFDerivativesSizeType;
78 
79  typedef typename TMattesMutualInformationMetric::CubicBSplineFunctionType CubicBSplineFunctionType;
80  typedef typename TMattesMutualInformationMetric::CubicBSplineDerivativeFunctionType CubicBSplineDerivativeFunctionType;
81 
82  typedef typename TMattesMutualInformationMetric::JacobianType JacobianType;
83 
84 protected:
86 
87  virtual void BeforeThreadedExecution();
88 
89  virtual void AfterThreadedExecution();
90 
94  virtual bool ProcessPoint(
95  const VirtualIndexType & virtualIndex,
96  const VirtualPointType & virtualPoint,
97  const FixedImagePointType & mappedFixedPoint,
98  const FixedImagePixelType & mappedFixedPixelValue,
99  const FixedImageGradientType & mappedFixedImageGradient,
100  const MovingImagePointType & mappedMovingPoint,
101  const MovingImagePixelType & mappedMovingPixelValue,
102  const MovingImageGradientType & mappedMovingImageGradient,
103  MeasureType & metricValueReturn,
104  DerivativeType & localDerivativeReturn,
105  const ThreadIdType threadID ) const;
106 
108  virtual void ComputePDFDerivatives(const ThreadIdType & threadID,
109  const OffsetValueType & fixedImageParzenWindowIndex,
110  const JacobianType & jacobian,
111  const OffsetValueType & pdfMovingIndex,
112  const MovingImageGradientType & movingGradient,
113  const PDFValueType & cubicBSplineDerivativeValue,
114  DerivativeValueType * localSupportDerivativeResultPtr) const;
115 
116 private:
118  void operator=( const Self & ); // purposely not implemented
119 
122  TMattesMutualInformationMetric * m_MattesAssociate;
123 };
124 
125 } // end namespace itk
126 
127 #ifndef ITK_MANUAL_INSTANTIATION
128 #include "itkMattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader.hxx"
129 #endif
130 
131 #endif
132