ITK  6.0.0
Insight Toolkit
itkImageToImageMetricv4GetValueAndDerivativeThreader.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 itkImageToImageMetricv4GetValueAndDerivativeThreader_h
19 #define itkImageToImageMetricv4GetValueAndDerivativeThreader_h
20 
22 #include "itkNumericTraits.h"
25 
26 namespace itk
27 {
28 
43 template <typename TDomainPartitioner, typename TImageToImageMetricv4>
45 
50 template <typename TImageToImageMetricv4>
52  ThreadedImageRegionPartitioner<TImageToImageMetricv4::VirtualImageDimension>,
53  TImageToImageMetricv4>
55  ThreadedImageRegionPartitioner<TImageToImageMetricv4::VirtualImageDimension>,
56  TImageToImageMetricv4>
57 {
58 public:
59  ITK_DISALLOW_COPY_AND_MOVE(ImageToImageMetricv4GetValueAndDerivativeThreader);
60 
65  TImageToImageMetricv4>;
68 
69  itkOverrideGetNameOfClassMacro(ImageToImageMetricv4GetValueAndDerivativeThreader);
70 
72  using typename Superclass::DomainType;
73  using typename Superclass::AssociateType;
74 
76  using ImageToImageMetricv4Type = TImageToImageMetricv4;
77  using VirtualImageType = typename Superclass::VirtualImageType;
78  using typename Superclass::VirtualIndexType;
79  using typename Superclass::VirtualPointType;
80  using typename Superclass::FixedImagePointType;
81  using typename Superclass::FixedImagePixelType;
82  using typename Superclass::FixedImageGradientType;
83  using typename Superclass::MovingImagePointType;
84  using typename Superclass::MovingImagePixelType;
85  using typename Superclass::MovingImageGradientType;
86 
87  using typename Superclass::FixedTransformType;
88  using typename Superclass::FixedOutputPointType;
89  using typename Superclass::MovingTransformType;
90  using typename Superclass::MovingOutputPointType;
91 
92  using typename Superclass::MeasureType;
93  using typename Superclass::DerivativeType;
94  using typename Superclass::DerivativeValueType;
95  using typename Superclass::JacobianType;
96 
97  using typename Superclass::InternalComputationValueType;
98  using typename Superclass::NumberOfParametersType;
99  using typename Superclass::ImageDimensionType;
100 
101 protected:
104 
107  void
108  ThreadedExecution(const DomainType & imageSubRegion, const ThreadIdType threadId) override;
109 
115  {
116  return this->m_CachedNumberOfParameters;
117  }
118  inline NumberOfParametersType
120  {
121  return this->m_CachedNumberOfLocalParameters;
122  }
123 };
130 template <typename TImageToImageMetricv4>
131 class ITK_TEMPLATE_EXPORT
133  : public ImageToImageMetricv4GetValueAndDerivativeThreaderBase<ThreadedIndexedContainerPartitioner,
134  TImageToImageMetricv4>
135 {
136 public:
137  ITK_DISALLOW_COPY_AND_MOVE(ImageToImageMetricv4GetValueAndDerivativeThreader);
138 
141  using Superclass =
145 
146  itkOverrideGetNameOfClassMacro(ImageToImageMetricv4GetValueAndDerivativeThreader);
147 
149  using typename Superclass::DomainType;
150  using typename Superclass::AssociateType;
151 
153  using ImageToImageMetricv4Type = typename Superclass::ImageToImageMetricv4Type;
154  using VirtualImageType = typename Superclass::VirtualImageType;
155  using typename Superclass::VirtualIndexType;
156  using typename Superclass::VirtualPointType;
157  using typename Superclass::FixedImagePointType;
158  using typename Superclass::FixedImagePixelType;
159  using typename Superclass::FixedImageGradientType;
160  using typename Superclass::MovingImagePointType;
161  using typename Superclass::MovingImagePixelType;
162  using typename Superclass::MovingImageGradientType;
163 
164  using typename Superclass::FixedTransformType;
165  using typename Superclass::FixedOutputPointType;
166  using typename Superclass::MovingTransformType;
167  using typename Superclass::MovingOutputPointType;
168 
169  using typename Superclass::MeasureType;
170  using typename Superclass::DerivativeType;
171  using typename Superclass::DerivativeValueType;
172  using typename Superclass::JacobianType;
173 
174  using typename Superclass::InternalComputationValueType;
175  using typename Superclass::NumberOfParametersType;
176 
177 protected:
180 
183  void
184  ThreadedExecution(const DomainType & indexSubRange, const ThreadIdType threadId) override;
185 
191  {
192  return this->m_CachedNumberOfParameters;
193  }
194  inline NumberOfParametersType
196  {
197  return this->m_CachedNumberOfLocalParameters;
198  }
199 };
202 } // end namespace itk
203 
204 #ifndef ITK_MANUAL_INSTANTIATION
205 # include "itkImageToImageMetricv4GetValueAndDerivativeThreader.hxx"
206 #endif
207 
208 #endif
itkThreadedIndexedContainerPartitioner.h
itk::ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, TImageToImageMetricv4 >::GetCachedNumberOfLocalParameters
NumberOfParametersType GetCachedNumberOfLocalParameters() const
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreader.h:195
itk::ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< TImageToImageMetricv4::VirtualImageDimension >, TImageToImageMetricv4 >::ImageToImageMetricv4Type
TImageToImageMetricv4 ImageToImageMetricv4Type
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreader.h:76
itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreaderBase.h:46
itk::ImageToImageMetricv4GetValueAndDerivativeThreader
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreader.h:44
itk::ThreadedImageRegionPartitioner
Class for partitioning of an ImageRegion.
Definition: itkThreadedImageRegionPartitioner.h:45
itk::ThreadedIndexedContainerPartitioner
Partitions an indexed container.
Definition: itkThreadedIndexedContainerPartitioner.h:45
itk::SmartPointer< Self >
itkImageToImageMetricv4GetValueAndDerivativeThreaderBase.h
itkThreadedImageRegionPartitioner.h
itk::ThreadIdType
unsigned int ThreadIdType
Definition: itkIntTypes.h:102
itk::ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, TImageToImageMetricv4 >::GetCachedNumberOfParameters
NumberOfParametersType GetCachedNumberOfParameters() const
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreader.h:190
itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< ThreadedImageRegionPartitioner< TImageToImageMetricv4::VirtualImageDimension >, TImageToImageMetricv4 >::NumberOfParametersType
typename ImageToImageMetricv4Type::NumberOfParametersType NumberOfParametersType
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreaderBase.h:89
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, TImageToImageMetricv4 >::VirtualImageType
typename Superclass::VirtualImageType VirtualImageType
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreader.h:154
itk::DomainThreader< ThreadedImageRegionPartitioner< TImageToImageMetricv4::VirtualImageDimension >, TImageToImageMetricv4 >::DomainType
typename DomainPartitionerType::DomainType DomainType
Definition: itkDomainThreader.h:78
itk::ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< TImageToImageMetricv4::VirtualImageDimension >, TImageToImageMetricv4 >::VirtualImageType
typename Superclass::VirtualImageType VirtualImageType
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreader.h:77
itk::ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< TImageToImageMetricv4::VirtualImageDimension >, TImageToImageMetricv4 >::GetCachedNumberOfParameters
NumberOfParametersType GetCachedNumberOfParameters() const
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreader.h:114
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itkNumericTraits.h
itk::ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< TImageToImageMetricv4::VirtualImageDimension >, TImageToImageMetricv4 >::GetCachedNumberOfLocalParameters
NumberOfParametersType GetCachedNumberOfLocalParameters() const
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreader.h:119
itk::ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, TImageToImageMetricv4 >::ImageToImageMetricv4Type
typename Superclass::ImageToImageMetricv4Type ImageToImageMetricv4Type
Definition: itkImageToImageMetricv4GetValueAndDerivativeThreader.h:153