ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkImageToImageMetricv4GetValueAndDerivativeThreader.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 itkImageToImageMetricv4GetValueAndDerivativeThreader_h
19 #define itkImageToImageMetricv4GetValueAndDerivativeThreader_h
20 
22 #include "itkNumericTraits.h"
25 
26 namespace itk
27 {
28 
43 template < typename TDomainPartitioner, typename TImageToImageMetricv4 >
45 {};
46 
51 template < typename TImageToImageMetricv4 >
52 class ITK_TEMPLATE_EXPORT ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< TImageToImageMetricv4::VirtualImageDimension >, TImageToImageMetricv4 >
53  : public ImageToImageMetricv4GetValueAndDerivativeThreaderBase< ThreadedImageRegionPartitioner< TImageToImageMetricv4::VirtualImageDimension >, TImageToImageMetricv4 >
54 {
55 public:
56  ITK_DISALLOW_COPY_AND_ASSIGN(ImageToImageMetricv4GetValueAndDerivativeThreader);
57 
60  using Superclass =
64 
66 
68  using DomainType = typename Superclass::DomainType;
69  using AssociateType = typename Superclass::AssociateType;
70 
72  using ImageToImageMetricv4Type = TImageToImageMetricv4;
73  using VirtualImageType = typename Superclass::VirtualImageType;
74  using VirtualIndexType = typename Superclass::VirtualIndexType;
75  using VirtualPointType = typename Superclass::VirtualPointType;
76  using FixedImagePointType = typename Superclass::FixedImagePointType;
77  using FixedImagePixelType = typename Superclass::FixedImagePixelType;
78  using FixedImageGradientType = typename Superclass::FixedImageGradientType;
79  using MovingImagePointType = typename Superclass::MovingImagePointType;
80  using MovingImagePixelType = typename Superclass::MovingImagePixelType;
81  using MovingImageGradientType = typename Superclass::MovingImageGradientType;
82 
83  using FixedTransformType = typename Superclass::FixedTransformType;
84  using FixedOutputPointType = typename Superclass::FixedOutputPointType;
85  using MovingTransformType = typename Superclass::MovingTransformType;
86  using MovingOutputPointType = typename Superclass::MovingOutputPointType;
87 
88  using MeasureType = typename Superclass::MeasureType;
89  using DerivativeType = typename Superclass::DerivativeType;
90  using DerivativeValueType = typename Superclass::DerivativeValueType;
91  using JacobianType = typename Superclass::JacobianType;
92 
93  using InternalComputationValueType = typename Superclass::InternalComputationValueType;
94  using NumberOfParametersType = typename Superclass::NumberOfParametersType;
95  using ImageDimensionType = typename Superclass::ImageDimensionType;
96 
97 protected:
100 
103  void ThreadedExecution( const DomainType & subdomain,
104  const ThreadIdType threadId ) override;
105 
110  {
111  return this->m_CachedNumberOfParameters;
112  }
114  {
115  return this->m_CachedNumberOfLocalParameters;
116  }
117 };
119 
124 template < typename TImageToImageMetricv4 >
126  : public ImageToImageMetricv4GetValueAndDerivativeThreaderBase< ThreadedIndexedContainerPartitioner, TImageToImageMetricv4 >
127 {
128 public:
129  ITK_DISALLOW_COPY_AND_ASSIGN(ImageToImageMetricv4GetValueAndDerivativeThreader);
130 
133  using Superclass =
137 
139 
141  using DomainType = typename Superclass::DomainType;
142  using AssociateType = typename Superclass::AssociateType;
143 
145  using ImageToImageMetricv4Type = typename Superclass::ImageToImageMetricv4Type;
146  using VirtualImageType = typename Superclass::VirtualImageType;
147  using VirtualIndexType = typename Superclass::VirtualIndexType;
148  using VirtualPointType = typename Superclass::VirtualPointType;
149  using FixedImagePointType = typename Superclass::FixedImagePointType;
150  using FixedImagePixelType = typename Superclass::FixedImagePixelType;
151  using FixedImageGradientType = typename Superclass::FixedImageGradientType;
152  using MovingImagePointType = typename Superclass::MovingImagePointType;
153  using MovingImagePixelType = typename Superclass::MovingImagePixelType;
154  using MovingImageGradientType = typename Superclass::MovingImageGradientType;
155 
156  using FixedTransformType = typename Superclass::FixedTransformType;
157  using FixedOutputPointType = typename Superclass::FixedOutputPointType;
158  using MovingTransformType = typename Superclass::MovingTransformType;
159  using MovingOutputPointType = typename Superclass::MovingOutputPointType;
160 
161  using MeasureType = typename Superclass::MeasureType;
162  using DerivativeType = typename Superclass::DerivativeType;
163  using DerivativeValueType = typename Superclass::DerivativeValueType;
164  using JacobianType = typename Superclass::JacobianType;
165 
166  using InternalComputationValueType = typename Superclass::InternalComputationValueType;
167  using NumberOfParametersType = typename Superclass::NumberOfParametersType;
168 
169 protected:
172 
175  void ThreadedExecution( const DomainType & subdomain,
176  const ThreadIdType threadId ) override;
177 
182  {
183  return this->m_CachedNumberOfParameters;
184  }
186  {
187  return this->m_CachedNumberOfLocalParameters;
188  }
189 };
191 
192 } // end namespace itk
193 
194 #ifndef ITK_MANUAL_INSTANTIATION
195 #include "itkImageToImageMetricv4GetValueAndDerivativeThreader.hxx"
196 #endif
197 
198 #endif
Light weight base class for most itk classes.
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
Class for partitioning of an ImageRegion.
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.