ITK  4.9.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 ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< TImageToImageMetricv4::VirtualImageDimension >, TImageToImageMetricv4 >
53  : public ImageToImageMetricv4GetValueAndDerivativeThreaderBase< ThreadedImageRegionPartitioner< TImageToImageMetricv4::VirtualImageDimension >, TImageToImageMetricv4 >
54 {
55 public:
62 
64 
66  typedef typename Superclass::DomainType DomainType;
67  typedef typename Superclass::AssociateType AssociateType;
68 
70  typedef TImageToImageMetricv4 ImageToImageMetricv4Type;
71  typedef typename Superclass::VirtualImageType VirtualImageType;
72  typedef typename Superclass::VirtualIndexType VirtualIndexType;
73  typedef typename Superclass::VirtualPointType VirtualPointType;
74  typedef typename Superclass::FixedImagePointType FixedImagePointType;
75  typedef typename Superclass::FixedImagePixelType FixedImagePixelType;
76  typedef typename Superclass::FixedImageGradientType FixedImageGradientType;
77  typedef typename Superclass::MovingImagePointType MovingImagePointType;
78  typedef typename Superclass::MovingImagePixelType MovingImagePixelType;
79  typedef typename Superclass::MovingImageGradientType MovingImageGradientType;
80 
81  typedef typename Superclass::FixedTransformType FixedTransformType;
82  typedef typename Superclass::FixedOutputPointType FixedOutputPointType;
83  typedef typename Superclass::MovingTransformType MovingTransformType;
84  typedef typename Superclass::MovingOutputPointType MovingOutputPointType;
85 
86  typedef typename Superclass::MeasureType MeasureType;
87  typedef typename Superclass::DerivativeType DerivativeType;
88  typedef typename Superclass::DerivativeValueType DerivativeValueType;
89  typedef typename Superclass::JacobianType JacobianType;
90 
91  typedef typename Superclass::InternalComputationValueType InternalComputationValueType;
92  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
93  typedef typename Superclass::ImageDimensionType ImageDimensionType;
94 
95 protected:
98 
101  virtual void ThreadedExecution( const DomainType & subdomain,
102  const ThreadIdType threadId ) ITK_OVERRIDE;
103 
108  {
109  return this->m_CachedNumberOfParameters;
110  }
112  {
113  return this->m_CachedNumberOfLocalParameters;
114  }
116 
117 private:
118  ImageToImageMetricv4GetValueAndDerivativeThreader( const Self & ) ITK_DELETE_FUNCTION;
119  void operator=( const Self & ) ITK_DELETE_FUNCTION;
120 };
121 
126 template < typename TImageToImageMetricv4 >
128  : public ImageToImageMetricv4GetValueAndDerivativeThreaderBase< ThreadedIndexedContainerPartitioner, TImageToImageMetricv4 >
129 {
130 public:
137 
139 
141  typedef typename Superclass::DomainType DomainType;
142  typedef typename Superclass::AssociateType AssociateType;
143 
145  typedef typename Superclass::ImageToImageMetricv4Type ImageToImageMetricv4Type;
146  typedef typename Superclass::VirtualImageType VirtualImageType;
147  typedef typename Superclass::VirtualIndexType VirtualIndexType;
148  typedef typename Superclass::VirtualPointType VirtualPointType;
149  typedef typename Superclass::FixedImagePointType FixedImagePointType;
150  typedef typename Superclass::FixedImagePixelType FixedImagePixelType;
151  typedef typename Superclass::FixedImageGradientType FixedImageGradientType;
152  typedef typename Superclass::MovingImagePointType MovingImagePointType;
153  typedef typename Superclass::MovingImagePixelType MovingImagePixelType;
154  typedef typename Superclass::MovingImageGradientType MovingImageGradientType;
155 
156  typedef typename Superclass::FixedTransformType FixedTransformType;
157  typedef typename Superclass::FixedOutputPointType FixedOutputPointType;
158  typedef typename Superclass::MovingTransformType MovingTransformType;
159  typedef typename Superclass::MovingOutputPointType MovingOutputPointType;
160 
161  typedef typename Superclass::MeasureType MeasureType;
162  typedef typename Superclass::DerivativeType DerivativeType;
163  typedef typename Superclass::DerivativeValueType DerivativeValueType;
164  typedef typename Superclass::JacobianType JacobianType;
165 
166  typedef typename Superclass::InternalComputationValueType InternalComputationValueType;
167  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
168 
169 protected:
172 
175  virtual void ThreadedExecution( const DomainType & subdomain,
176  const ThreadIdType threadId ) ITK_OVERRIDE;
177 
181  inline NumberOfParametersType GetCachedNumberOfParameters() const
182  {
183  return this->m_CachedNumberOfParameters;
184  }
185  inline NumberOfParametersType GetCachedNumberOfLocalParameters() const
186  {
187  return this->m_CachedNumberOfLocalParameters;
188  }
190 
191 private:
192  ImageToImageMetricv4GetValueAndDerivativeThreader( const Self & ) ITK_DELETE_FUNCTION;
193  void operator=( const Self & ) ITK_DELETE_FUNCTION;
194 };
195 
196 } // end namespace itk
197 
198 #ifndef ITK_MANUAL_INSTANTIATION
199 #include "itkImageToImageMetricv4GetValueAndDerivativeThreader.hxx"
200 #endif
201 
202 #endif
ImageToImageMetricv4GetValueAndDerivativeThreaderBase< ThreadedIndexedContainerPartitioner, TImageToImageMetricv4 > Superclass
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
Class for partitioning of an ImageRegion.
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Provides threading for ImageToImageMetricv4::GetValueAndDerivative.
ImageToImageMetricv4GetValueAndDerivativeThreaderBase< ThreadedImageRegionPartitioner< TImageToImageMetricv4::VirtualImageDimension >, TImageToImageMetricv4 > Superclass