ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkImageToImageMetricv4GetValueAndDerivativeThreader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkImageToImageMetricv4GetValueAndDerivativeThreader_h
00019 #define __itkImageToImageMetricv4GetValueAndDerivativeThreader_h
00020 
00021 #include "itkImageToImageMetricv4GetValueAndDerivativeThreaderBase.h"
00022 #include "itkNumericTraits.h"
00023 #include "itkThreadedImageRegionPartitioner.h"
00024 #include "itkThreadedIndexedContainerPartitioner.h"
00025 
00026 namespace itk
00027 {
00028 
00043 template < class TDomainPartitioner, class TImageToImageMetricv4 >
00044 class ImageToImageMetricv4GetValueAndDerivativeThreader
00045 {};
00046 
00051 template < class TImageToImageMetricv4 >
00052 class ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< TImageToImageMetricv4::VirtualImageDimension >, TImageToImageMetricv4 >
00053   : public ImageToImageMetricv4GetValueAndDerivativeThreaderBase< ThreadedImageRegionPartitioner< TImageToImageMetricv4::VirtualImageDimension >, TImageToImageMetricv4 >
00054 {
00055 public:
00057   typedef ImageToImageMetricv4GetValueAndDerivativeThreader      Self;
00058   typedef ImageToImageMetricv4GetValueAndDerivativeThreaderBase< ThreadedImageRegionPartitioner< TImageToImageMetricv4::VirtualImageDimension >, TImageToImageMetricv4 >
00059                                                                  Superclass;
00060   typedef SmartPointer< Self >                                   Pointer;
00061   typedef SmartPointer< const Self >                             ConstPointer;
00062 
00063   itkTypeMacro( ImageToImageMetricv4GetValueAndDerivativeThreader, ImageToImageMetricv4GetValueAndDerivativeThreaderBase );
00064 
00066   typedef typename Superclass::DomainType    DomainType;
00067   typedef typename Superclass::AssociateType AssociateType;
00068 
00070   typedef TImageToImageMetricv4                        ImageToImageMetricv4Type;
00071   typedef typename Superclass::VirtualImageType        VirtualImageType;
00072   typedef typename Superclass::VirtualIndexType        VirtualIndexType;
00073   typedef typename Superclass::VirtualPointType        VirtualPointType;
00074   typedef typename Superclass::FixedImagePointType     FixedImagePointType;
00075   typedef typename Superclass::FixedImagePixelType     FixedImagePixelType;
00076   typedef typename Superclass::FixedImageGradientType  FixedImageGradientType;
00077   typedef typename Superclass::MovingImagePointType    MovingImagePointType;
00078   typedef typename Superclass::MovingImagePixelType    MovingImagePixelType;
00079   typedef typename Superclass::MovingImageGradientType MovingImageGradientType;
00080 
00081   typedef typename Superclass::FixedTransformType      FixedTransformType;
00082   typedef typename Superclass::FixedOutputPointType    FixedOutputPointType;
00083   typedef typename Superclass::MovingTransformType     MovingTransformType;
00084   typedef typename Superclass::MovingOutputPointType   MovingOutputPointType;
00085 
00086   typedef typename Superclass::MeasureType             MeasureType;
00087   typedef typename Superclass::DerivativeType          DerivativeType;
00088   typedef typename Superclass::DerivativeValueType     DerivativeValueType;
00089   typedef typename Superclass::JacobianType            JacobianType;
00090 
00091   typedef typename Superclass::InternalComputationValueType InternalComputationValueType;
00092   typedef typename Superclass::NumberOfParametersType       NumberOfParametersType;
00093   typedef typename Superclass::ImageDimensionType           ImageDimensionType;
00094 
00095 protected:
00097   ImageToImageMetricv4GetValueAndDerivativeThreader() {}
00098 
00101   virtual void ThreadedExecution( const DomainType & subdomain,
00102                                   const ThreadIdType threadId );
00103 
00104 private:
00105   ImageToImageMetricv4GetValueAndDerivativeThreader( const Self & ); // purposely not implemented
00106   void operator=( const Self & ); // purposely not implemented
00107 };
00108 
00113 template < class TImageToImageMetricv4 >
00114 class ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, TImageToImageMetricv4 >
00115   : public ImageToImageMetricv4GetValueAndDerivativeThreaderBase< ThreadedIndexedContainerPartitioner, TImageToImageMetricv4 >
00116 {
00117 public:
00119   typedef ImageToImageMetricv4GetValueAndDerivativeThreader      Self;
00120   typedef ImageToImageMetricv4GetValueAndDerivativeThreaderBase< ThreadedIndexedContainerPartitioner, TImageToImageMetricv4 >
00121                                                                  Superclass;
00122   typedef SmartPointer< Self >                                   Pointer;
00123   typedef SmartPointer< const Self >                             ConstPointer;
00124 
00125   itkTypeMacro( ImageToImageMetricv4GetValueAndDerivativeThreader, ImageToImageMetricv4GetValueAndDerivativeThreaderBase );
00126 
00128   typedef typename Superclass::DomainType    DomainType;
00129   typedef typename Superclass::AssociateType AssociateType;
00130 
00132   typedef typename Superclass::ImageToImageMetricv4Type ImageToImageMetricv4Type;
00133   typedef typename Superclass::VirtualImageType         VirtualImageType;
00134   typedef typename Superclass::VirtualIndexType         VirtualIndexType;
00135   typedef typename Superclass::VirtualPointType         VirtualPointType;
00136   typedef typename Superclass::FixedImagePointType      FixedImagePointType;
00137   typedef typename Superclass::FixedImagePixelType      FixedImagePixelType;
00138   typedef typename Superclass::FixedImageGradientType   FixedImageGradientType;
00139   typedef typename Superclass::MovingImagePointType     MovingImagePointType;
00140   typedef typename Superclass::MovingImagePixelType     MovingImagePixelType;
00141   typedef typename Superclass::MovingImageGradientType  MovingImageGradientType;
00142 
00143   typedef typename Superclass::FixedTransformType      FixedTransformType;
00144   typedef typename Superclass::FixedOutputPointType    FixedOutputPointType;
00145   typedef typename Superclass::MovingTransformType     MovingTransformType;
00146   typedef typename Superclass::MovingOutputPointType   MovingOutputPointType;
00147 
00148   typedef typename Superclass::MeasureType             MeasureType;
00149   typedef typename Superclass::DerivativeType          DerivativeType;
00150   typedef typename Superclass::DerivativeValueType     DerivativeValueType;
00151   typedef typename Superclass::JacobianType            JacobianType;
00152 
00153   typedef typename Superclass::InternalComputationValueType InternalComputationValueType;
00154   typedef typename Superclass::NumberOfParametersType       NumberOfParametersType;
00155 
00156 protected:
00158   ImageToImageMetricv4GetValueAndDerivativeThreader() {}
00159 
00162   virtual void ThreadedExecution( const DomainType & subdomain,
00163                                   const ThreadIdType threadId );
00164 
00165 private:
00166   ImageToImageMetricv4GetValueAndDerivativeThreader( const Self & ); // purposely not implemented
00167   void operator=( const Self & ); // purposely not implemented
00168 };
00169 
00170 } // end namespace itk
00171 
00172 #ifndef ITK_MANUAL_INSTANTIATION
00173 #include "itkImageToImageMetricv4GetValueAndDerivativeThreader.hxx"
00174 #endif
00175 
00176 #endif
00177