ITK  4.1.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 > Class Template Reference

#include <itkImageToImageMetricv4GetValueAndDerivativeThreaderBase.h>

+ Inheritance diagram for itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >:
+ Collaboration diagram for itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >:

List of all members.

Public Types

typedef Superclass::AssociateType AssociateType
typedef SmartPointer< const SelfConstPointer
typedef
ImageToImageMetricv4Type::DerivativeType 
DerivativeType
typedef
ImageToImageMetricv4Type::DerivativeValueType 
DerivativeValueType
typedef Superclass::DomainType DomainType
typedef
ImageToImageMetricv4Type::FixedImageGradientType 
FixedImageGradientType
typedef
ImageToImageMetricv4Type::FixedImageIndexType 
FixedImageIndexType
typedef
ImageToImageMetricv4Type::FixedImagePixelType 
FixedImagePixelType
typedef
ImageToImageMetricv4Type::FixedImagePointType 
FixedImagePointType
typedef
FixedTransformType::OutputPointType 
FixedOutputPointType
typedef
ImageToImageMetricv4Type::FixedTransformType 
FixedTransformType
typedef TImageToImageMetricv4 ImageToImageMetricv4Type
typedef
ImageToImageMetricv4Type::InternalComputationValueType 
InternalComputationValueType
typedef
ImageToImageMetricv4Type::JacobianType 
JacobianType
typedef
ImageToImageMetricv4Type::MeasureType 
MeasureType
typedef
ImageToImageMetricv4Type::MovingImageGradientType 
MovingImageGradientType
typedef
ImageToImageMetricv4Type::MovingImagePixelType 
MovingImagePixelType
typedef
ImageToImageMetricv4Type::MovingImagePointType 
MovingImagePointType
typedef
MovingTransformType::OutputPointType 
MovingOutputPointType
typedef
ImageToImageMetricv4Type::MovingTransformType 
MovingTransformType
typedef
ImageToImageMetricv4Type::NumberOfParametersType 
NumberOfParametersType
typedef SmartPointer< SelfPointer
typedef
ImageToImageMetricv4GetValueAndDerivativeThreaderBase 
Self
typedef DomainThreader
< TDomainPartitioner,
TImageToImageMetricv4 > 
Superclass
typedef
ImageToImageMetricv4Type::VirtualImageType 
VirtualImageType
typedef
ImageToImageMetricv4Type::VirtualIndexType 
VirtualIndexType
typedef
ImageToImageMetricv4Type::VirtualPointType 
VirtualPointType

Public Member Functions

virtual const char * GetNameOfClass () const

Protected Member Functions

virtual void AfterThreadedExecution ()
virtual void BeforeThreadedExecution ()
 ImageToImageMetricv4GetValueAndDerivativeThreaderBase ()
virtual bool ProcessPoint (const VirtualIndexType &virtualIndex, const VirtualPointType &virtualPoint, const FixedImagePointType &mappedFixedPoint, const FixedImagePixelType &mappedFixedPixelValue, const FixedImageGradientType &mappedFixedImageGradient, const MovingImagePointType &mappedMovingPoint, const MovingImagePixelType &mappedMovingPixelValue, const MovingImageGradientType &mappedMovingImageGradient, MeasureType &metricValueReturn, DerivativeType &localDerivativeReturn, const ThreadIdType threadID) const =0
virtual bool ProcessVirtualPoint (const VirtualIndexType &virtualIndex, const VirtualPointType &virtualPoint, const ThreadIdType threadId)
virtual void StorePointDerivativeResult (const VirtualIndexType &virtualIndex, const ThreadIdType threadID)

Protected Attributes

std::vector< DerivativeTypem_DerivativesPerThread
std::vector< DerivativeTypem_LocalDerivativesPerThread
std::vector
< InternalComputationValueType
m_MeasurePerThread
std::vector< JacobianTypem_MovingTransformJacobianPerThread
std::vector< SizeValueTypem_NumberOfValidPointsPerThread

Private Member Functions

 ImageToImageMetricv4GetValueAndDerivativeThreaderBase (const Self &)
void operator= (const Self &)

Detailed Description

template<class TDomainPartitioner, class TImageToImageMetricv4>
class itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >

Provides threading for ImageToImageMetricv4::GetValueAndDerivative.

Template Parameters:
TDomainPartitionertype of the Domain, ThreadedImageRegionPartitioner or ThreadedIndexedContainerPartitioner
TImageToImageMetricv4type of the ImageToImageMetricv4

This class provides a BeforeThreadedExecution, and AfterThreadedExecution.

The ThreadedExecution in ImageToImageMetricv4GetValueAndDerivativeThreader calls ProcessVirtualPoint on every point in the virtual image domain. ProcessVirtualPoint calls ProcessPoint on each point.

Definition at line 43 of file itkImageToImageMetricv4GetValueAndDerivativeThreaderBase.h.


Member Typedef Documentation

template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef Superclass::AssociateType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::AssociateType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef SmartPointer< const Self > itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::ConstPointer
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::DerivativeType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::DerivativeType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::DerivativeValueType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::DerivativeValueType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef Superclass::DomainType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::DomainType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::FixedImageGradientType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::FixedImageGradientType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::FixedImageIndexType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::FixedImageIndexType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::FixedImagePixelType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::FixedImagePixelType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::FixedImagePointType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::FixedImagePointType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef FixedTransformType::OutputPointType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::FixedOutputPointType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::FixedTransformType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::FixedTransformType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef TImageToImageMetricv4 itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::ImageToImageMetricv4Type
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::InternalComputationValueType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::InternalComputationValueType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::JacobianType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::JacobianType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::MeasureType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::MeasureType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::MovingImageGradientType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::MovingImageGradientType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::MovingImagePixelType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::MovingImagePixelType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::MovingImagePointType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::MovingImagePointType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef MovingTransformType::OutputPointType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::MovingOutputPointType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::MovingTransformType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::MovingTransformType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::NumberOfParametersType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::NumberOfParametersType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef SmartPointer< Self > itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::Pointer
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4GetValueAndDerivativeThreaderBase itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::Self
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef DomainThreader< TDomainPartitioner, TImageToImageMetricv4 > itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::Superclass
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::VirtualImageType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::VirtualImageType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::VirtualIndexType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::VirtualIndexType
template<class TDomainPartitioner, class TImageToImageMetricv4>
typedef ImageToImageMetricv4Type::VirtualPointType itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::VirtualPointType

Constructor & Destructor Documentation

template<class TDomainPartitioner, class TImageToImageMetricv4>
itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::ImageToImageMetricv4GetValueAndDerivativeThreaderBase ( ) [protected]

Constructor.

template<class TDomainPartitioner, class TImageToImageMetricv4>
itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::ImageToImageMetricv4GetValueAndDerivativeThreaderBase ( const Self ) [private]

Member Function Documentation

template<class TDomainPartitioner, class TImageToImageMetricv4>
virtual void itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::AfterThreadedExecution ( ) [protected, virtual]

Collects the results from each thread and sums them. Results are stored in the enclosing class m_Value and m_DerivativeResult. Behavior depends on m_AverageValueAndDerivativeByNumberOfValuePoints, m_NumberOfValidPoints, to average the value sum, and to average derivative sums for global transforms only (i.e. transforms without local support).

Reimplemented from itk::DomainThreader< TDomainPartitioner, TImageToImageMetricv4 >.

template<class TDomainPartitioner, class TImageToImageMetricv4>
virtual void itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::BeforeThreadedExecution ( ) [protected, virtual]

Resize and initialize per thread objects.

Reimplemented from itk::DomainThreader< TDomainPartitioner, TImageToImageMetricv4 >.

template<class TDomainPartitioner, class TImageToImageMetricv4>
virtual const char* itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::GetNameOfClass ( ) const [virtual]
template<class TDomainPartitioner, class TImageToImageMetricv4>
void itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::operator= ( const Self ) [private]
template<class TDomainPartitioner, class TImageToImageMetricv4>
virtual bool itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::ProcessPoint ( const VirtualIndexType virtualIndex,
const VirtualPointType virtualPoint,
const FixedImagePointType mappedFixedPoint,
const FixedImagePixelType mappedFixedPixelValue,
const FixedImageGradientType mappedFixedImageGradient,
const MovingImagePointType mappedMovingPoint,
const MovingImagePixelType mappedMovingPixelValue,
const MovingImageGradientType mappedMovingImageGradient,
MeasureType metricValueReturn,
DerivativeType localDerivativeReturn,
const ThreadIdType  threadID 
) const [protected, pure virtual]

Method to calculate the metric value and derivative given a point, value and image derivative for both fixed and moving spaces. The provided values have been calculated from virtualPoint, which is provided in case it's needed.

Parameters:
virtualIndex
virtualPointis the point within the virtual domain from which the passed parameters have been calculated.
mappedFixedPointis a valid point within the moving image space that has passed bounds checking, and lies within any mask that may be assigned.
mappedFixedPixelValueholds the pixel value at the mapped fixed point.
mappedFixedImageGradientholds the image gradient at the fixed point, but only when m_GradientSource is set to calculate fixed image gradients (either when it's set to calculate only fixed gradients, or both fixed and moving). Otherwise, the value is meaningless and should be ignored.
mappedMovingPoint
mappedMovingPixelValue
mappedMovingImageGradientThese three parameters hold the point, pixel value and image gradient for the moving image space, as described above for the fixed image space. Results must be returned by derived classes in:
metricValueReturn
localDerivativeReturn
threadIDmay be used as needed, for example to access any per-thread data cached during pre-processing by the derived class.
Warning:
This is called from the threader, and thus must be thread-safe.
template<class TDomainPartitioner, class TImageToImageMetricv4>
virtual bool itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::ProcessVirtualPoint ( const VirtualIndexType virtualIndex,
const VirtualPointType virtualPoint,
const ThreadIdType  threadId 
) [protected, virtual]

Method called by the threaders to process the given virtual point. This in turn calls TransformAndEvaluateFixedPoint, TransformAndEvaluateMovingPoint, and ProcessPoint. And adds entries to m_MeasurePerThread and m_LocalDerivativesPerThread, m_NumberOfValidPointsPerThread.

template<class TDomainPartitioner, class TImageToImageMetricv4>
virtual void itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::StorePointDerivativeResult ( const VirtualIndexType virtualIndex,
const ThreadIdType  threadID 
) [protected, virtual]

Store derivative result from a single point calculation.

Warning:
If this method is overridden or otherwise not used in a derived class, be sure to *accumulate* results.

Member Data Documentation

template<class TDomainPartitioner, class TImageToImageMetricv4>
std::vector< DerivativeType > itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::m_DerivativesPerThread [mutable, protected]
template<class TDomainPartitioner, class TImageToImageMetricv4>
std::vector< DerivativeType > itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::m_LocalDerivativesPerThread [mutable, protected]
template<class TDomainPartitioner, class TImageToImageMetricv4>
std::vector< InternalComputationValueType > itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::m_MeasurePerThread [mutable, protected]

Intermediary threaded metric value storage.

Definition at line 158 of file itkImageToImageMetricv4GetValueAndDerivativeThreaderBase.h.

template<class TDomainPartitioner, class TImageToImageMetricv4>
std::vector< JacobianType > itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::m_MovingTransformJacobianPerThread [mutable, protected]

Pre-allocated transform jacobian objects, for use as needed by dervied classes for efficiency.

Definition at line 165 of file itkImageToImageMetricv4GetValueAndDerivativeThreaderBase.h.

template<class TDomainPartitioner, class TImageToImageMetricv4>
std::vector< SizeValueType > itk::ImageToImageMetricv4GetValueAndDerivativeThreaderBase< TDomainPartitioner, TImageToImageMetricv4 >::m_NumberOfValidPointsPerThread [mutable, protected]

The documentation for this class was generated from the following file: