ITK  5.2.0
Insight Toolkit
itkCorrelationImageToImageMetricv4HelperThreader.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 itkCorrelationImageToImageMetricv4HelperThreader_h
19 #define itkCorrelationImageToImageMetricv4HelperThreader_h
20 
22 
23 namespace itk
24 {
25 
35 template <typename TDomainPartitioner, typename TImageToImageMetric, typename TCorrelationMetric>
37  : public ImageToImageMetricv4GetValueAndDerivativeThreader<TDomainPartitioner, TImageToImageMetric>
38 {
39 public:
40  ITK_DISALLOW_COPY_AND_MOVE(CorrelationImageToImageMetricv4HelperThreader);
41 
47 
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 VirtualIndexType = typename Superclass::VirtualIndexType;
57  using VirtualPointType = typename Superclass::VirtualPointType;
58  using FixedImagePointType = typename Superclass::FixedImagePointType;
59  using FixedImagePixelType = typename Superclass::FixedImagePixelType;
60  using FixedImageGradientType = typename Superclass::FixedImageGradientType;
61  using MovingImagePointType = typename Superclass::MovingImagePointType;
62  using MovingImagePixelType = typename Superclass::MovingImagePixelType;
63  using MovingImageGradientType = typename Superclass::MovingImageGradientType;
64  using MeasureType = typename Superclass::MeasureType;
65  using DerivativeType = typename Superclass::DerivativeType;
66  using DerivativeValueType = typename Superclass::DerivativeValueType;
67 
68  using InternalComputationValueType = typename Superclass::InternalComputationValueType;
69  using NumberOfParametersType = typename Superclass::NumberOfParametersType;
70 
71  using FixedOutputPointType = typename Superclass::FixedOutputPointType;
72  using MovingOutputPointType = typename Superclass::MovingOutputPointType;
73 
74 protected:
77 
79  void
80  BeforeThreadedExecution() override;
81 
89  void
90  AfterThreadedExecution() override;
91 
92 
93  /* Overload: don't need to compute the image gradients and store derivatives
94  *
95  * Method called by the threaders to process the given virtual point. This
96  * in turn calls \c TransformAndEvaluateFixedPoint, \c
97  * TransformAndEvaluateMovingPoint, and \c ProcessPoint.
98  */
99  bool
100  ProcessVirtualPoint(const VirtualIndexType & virtualIndex,
101  const VirtualPointType & virtualPoint,
102  const ThreadIdType threadId) override;
103 
104 
108  bool
110  const VirtualPointType &,
111  const FixedImagePointType &,
112  const FixedImagePixelType &,
113  const FixedImageGradientType &,
114  const MovingImagePointType &,
115  const MovingImagePixelType &,
116  const MovingImageGradientType &,
117  MeasureType &,
118  DerivativeType &,
119  const ThreadIdType) const override
120  {
121  return false;
122  }
123 
124 private:
126  {
129  };
130  itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, CorrelationMetricPerThreadStruct, PaddedCorrelationMetricPerThreadStruct);
131  itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT,
132  PaddedCorrelationMetricPerThreadStruct,
133  AlignedCorrelationMetricPerThreadStruct);
134  /* per thread variables for correlation and its derivatives */
135  mutable AlignedCorrelationMetricPerThreadStruct * m_CorrelationMetricPerThreadVariables;
136 
139  TCorrelationMetric * m_CorrelationAssociate;
140 };
141 
142 } // end namespace itk
143 
144 #ifndef ITK_MANUAL_INSTANTIATION
145 # include "itkCorrelationImageToImageMetricv4HelperThreader.hxx"
146 #endif
147 
148 #endif
itk::CorrelationImageToImageMetricv4HelperThreader::m_CorrelationMetricPerThreadVariables
AlignedCorrelationMetricPerThreadStruct * m_CorrelationMetricPerThreadVariables
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:135
itk::CorrelationImageToImageMetricv4HelperThreader::m_CorrelationAssociate
TCorrelationMetric * m_CorrelationAssociate
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:139
itk::CorrelationImageToImageMetricv4HelperThreader::FixedImageGradientType
typename Superclass::FixedImageGradientType FixedImageGradientType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:60
itk::CorrelationImageToImageMetricv4HelperThreader::AssociateType
typename Superclass::AssociateType AssociateType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:53
itk::CorrelationImageToImageMetricv4HelperThreader::MovingOutputPointType
typename Superclass::MovingOutputPointType MovingOutputPointType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:72
itk::CorrelationImageToImageMetricv4HelperThreader::CorrelationMetricPerThreadStruct
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:125
itk::CorrelationImageToImageMetricv4HelperThreader::ImageToImageMetricv4Type
typename Superclass::ImageToImageMetricv4Type ImageToImageMetricv4Type
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:55
itk::ImageToImageMetricv4GetValueAndDerivativeThreader
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreader.h:44
itk::CorrelationImageToImageMetricv4HelperThreader
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:36
itk::CorrelationImageToImageMetricv4HelperThreader::ProcessPoint
bool ProcessPoint(const VirtualIndexType &, const VirtualPointType &, const FixedImagePointType &, const FixedImagePixelType &, const FixedImageGradientType &, const MovingImagePointType &, const MovingImagePixelType &, const MovingImageGradientType &, MeasureType &, DerivativeType &, const ThreadIdType) const override
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:109
itk::CorrelationImageToImageMetricv4HelperThreader::DerivativeType
typename Superclass::DerivativeType DerivativeType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:65
itk::CorrelationImageToImageMetricv4HelperThreader::MeasureType
typename Superclass::MeasureType MeasureType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:64
itk::CorrelationImageToImageMetricv4HelperThreader::MovingImagePixelType
typename Superclass::MovingImagePixelType MovingImagePixelType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:62
itkImageToImageMetricv4GetValueAndDerivativeThreader.h
itk::SmartPointer< Self >
itk::CorrelationImageToImageMetricv4HelperThreader::MovingImagePointType
typename Superclass::MovingImagePointType MovingImagePointType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:61
itk::ThreadIdType
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
itk::CorrelationImageToImageMetricv4HelperThreader::CorrelationMetricPerThreadStruct::MovSum
InternalComputationValueType MovSum
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:128
itk::CorrelationImageToImageMetricv4HelperThreader::DomainType
typename Superclass::DomainType DomainType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:52
itk::CorrelationImageToImageMetricv4HelperThreader::FixedImagePixelType
typename Superclass::FixedImagePixelType FixedImagePixelType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:59
itk::CorrelationImageToImageMetricv4HelperThreader::FixedOutputPointType
typename Superclass::FixedOutputPointType FixedOutputPointType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:71
itk::CorrelationImageToImageMetricv4HelperThreader::VirtualIndexType
typename Superclass::VirtualIndexType VirtualIndexType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:56
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::CorrelationImageToImageMetricv4HelperThreader::InternalComputationValueType
typename Superclass::InternalComputationValueType InternalComputationValueType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:68
itk::CorrelationImageToImageMetricv4HelperThreader::DerivativeValueType
typename Superclass::DerivativeValueType DerivativeValueType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:66
itk::CorrelationImageToImageMetricv4HelperThreader::FixedImagePointType
typename Superclass::FixedImagePointType FixedImagePointType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:58
itk::CorrelationImageToImageMetricv4HelperThreader::CorrelationMetricPerThreadStruct::FixSum
InternalComputationValueType FixSum
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:127
itk::CorrelationImageToImageMetricv4HelperThreader::MovingImageGradientType
typename Superclass::MovingImageGradientType MovingImageGradientType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:63
itk::CorrelationImageToImageMetricv4HelperThreader::VirtualPointType
typename Superclass::VirtualPointType VirtualPointType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:57
itk::CorrelationImageToImageMetricv4HelperThreader::NumberOfParametersType
typename Superclass::NumberOfParametersType NumberOfParametersType
Definition: itkCorrelationImageToImageMetricv4HelperThreader.h:69