ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkJointHistogramMutualInformationGetValueAndDerivativeThreader.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 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:
44 
46 
47  itkNewMacro( Self );
48 
49  typedef typename Superclass::DomainType DomainType;
50  typedef typename Superclass::AssociateType AssociateType;
51 
52  typedef typename Superclass::VirtualPointType VirtualPointType;
53  typedef typename Superclass::VirtualIndexType VirtualIndexType;
54  typedef typename Superclass::FixedImagePointType FixedImagePointType;
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::JacobianType JacobianType;
64 
65  typedef TJointHistogramMetric JointHistogramMetricType;
66  typedef typename JointHistogramMetricType::InternalComputationValueType InternalComputationValueType;
67  typedef typename JointHistogramMetricType::JointPDFInterpolatorType JointPDFInterpolatorType;
68  typedef typename JointHistogramMetricType::MarginalPDFInterpolatorType MarginalPDFInterpolatorType;
69  typedef typename JointHistogramMetricType::JointPDFInterpolatorPointer JointPDFInterpolatorPointer;
70  typedef typename JointHistogramMetricType::MarginalPDFInterpolatorPointer MarginalPDFInterpolatorPointer;
71  typedef typename JointHistogramMetricType::NumberOfParametersType NumberOfParametersType;
72  typedef typename JointHistogramMetricType::JointPDFType JointPDFType;
73  typedef typename JointHistogramMetricType::MarginalPDFType MarginalPDFType;
74  typedef typename MarginalPDFType::PointType MarginalPDFPointType;
75  typedef typename JointPDFType::PointType JointPDFPointType;
76  typedef typename JointHistogramMetricType::JointPDFValueType JointPDFValueType;
77 
78 protected:
81 
83 
84  virtual void BeforeThreadedExecution() ITK_OVERRIDE;
85 
86  virtual void AfterThreadedExecution() ITK_OVERRIDE;
87 
88  virtual bool ProcessPoint(
89  const VirtualIndexType & virtualIndex,
90  const VirtualPointType & virtualPoint,
91  const FixedImagePointType & mappedFixedPoint,
92  const FixedImagePixelType & mappedFixedPixelValue,
93  const FixedImageGradientType & mappedFixedImageGradient,
94  const MovingImagePointType & mappedMovingPoint,
95  const MovingImagePixelType & mappedMovingPixelValue,
96  const MovingImageGradientType & mappedMovingImageGradient,
97  MeasureType & metricValueReturn,
98  DerivativeType & localDerivativeReturn,
99  const ThreadIdType threadId ) const ITK_OVERRIDE;
100 
102  const MarginalPDFPointType & margPDFpoint,
103  const ThreadIdType threadId ) const;
104 
106  const MarginalPDFPointType & margPDFpoint,
107  const ThreadIdType threadId ) const;
108 
110  const JointPDFPointType & jointPDFpoint,
111  const ThreadIdType threadId,
112  const SizeValueType ind ) const;
114  {
118  };
119  itkPadStruct( ITK_CACHE_LINE_ALIGNMENT, JointHistogramMIPerThreadStruct,
120  PaddedJointHistogramMIPerThreadStruct);
121  itkAlignedTypedef( ITK_CACHE_LINE_ALIGNMENT, PaddedJointHistogramMIPerThreadStruct,
122  AlignedJointHistogramMIPerThreadStruct );
123  AlignedJointHistogramMIPerThreadStruct * m_JointHistogramMIPerThreadVariables;
124 
125 private:
126  JointHistogramMutualInformationGetValueAndDerivativeThreader( const Self & ); // purposely not implemented
127  void operator=( const Self & ); // purposely not implemented
128 
131  TJointHistogramMetric * m_JointAssociate;
132 };
133 
134 } // end namespace itk
135 
136 #endif
137 
138 #ifndef ITK_MANUAL_INSTANTIATION
139 #include "itkJointHistogramMutualInformationGetValueAndDerivativeThreader.hxx"
140 #endif
InternalComputationValueType ComputeJointPDFDerivative(const JointPDFPointType &jointPDFpoint, const ThreadIdType threadId, const SizeValueType ind) const
InternalComputationValueType ComputeMovingImageMarginalPDFDerivative(const MarginalPDFPointType &margPDFpoint, const ThreadIdType threadId) const
unsigned long SizeValueType
Definition: itkIntTypes.h:143
InternalComputationValueType ComputeFixedImageMarginalPDFDerivative(const MarginalPDFPointType &margPDFpoint, const ThreadIdType threadId) const
itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT, PaddedJointHistogramMIPerThreadStruct, AlignedJointHistogramMIPerThreadStruct)
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Processes points for JointHistogramMutualInformationImageToImageMetricv4 GetValueAndDerivative().
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
ImageToImageMetricv4GetValueAndDerivativeThreader< TDomainPartitioner, TImageToImageMetric > Superclass
itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, JointHistogramMIPerThreadStruct, PaddedJointHistogramMIPerThreadStruct)
Templated n-dimensional image class.
Definition: itkImage.h:75
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