Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes

cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM > Class Template Reference
[cmtkRegistration Library]

Functional that evaluates a voxel-based similarity measure. More...

#include <cmtkImagePairAffineRegistrationFunctionalTemplate.h>

Inheritance diagram for cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >:
Inheritance graph
[legend]
Collaboration diagram for cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >:
Collaboration graph
[legend]

List of all members.

Classes

struct  EvaluateTaskInfo
 Thread parameter block for incremental gradient computation. More...

Public Types

typedef
ImagePairAffineRegistrationFunctionalTemplate
< VM > 
Self
 This class type.
typedef SmartPointer< SelfSmartPtr
 Smart pointer to this class.
typedef
ImagePairAffineRegistrationFunctional 
Superclass
 Superclass.
typedef Functional::ReturnType ReturnType
 Return type.

Public Member Functions

 ImagePairAffineRegistrationFunctionalTemplate (UniformVolume::SmartPtr &reference, UniformVolume::SmartPtr &floating, const Interpolators::InterpolationEnum interpolation, AffineXform::SmartPtr &affineXform)
 Constructor.
virtual ~ImagePairAffineRegistrationFunctionalTemplate ()
 Destructor.
virtual Self::ReturnType EvaluateAt (CoordinateVector &v)
 Evaluate with new parameter vector.
virtual Self::ReturnType Evaluate ()
 Compute functional value with volume clipping.

Static Public Member Functions

static void EvaluateThread (void *const args, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t)
 Compute functional gradient as a thread.

Public Attributes

size_t m_NumberOfThreads
 Number of threads that this object was created for.
std::vector< VM > m_ThreadMetric
 Metric objects for the separate threads.
MutexLock m_MetricMutex
 Mutex lock for access to global Metric field.
std::vector< typename
Self::EvaluateTaskInfo
m_EvaluateTaskInfo
 Info blocks for parallel threads evaluating functional gradient.

Detailed Description

template<class VM>
class cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >

Functional that evaluates a voxel-based similarity measure.

This class defines the type of functional that is optimized during voxel-based registration. It holds references to reference and floating data and computes similarity as well as its gradient w.r.t. a given transformation.

The metric to be optimized is given by a template parameter, therefore allowing inlined code to be generated for efficient evaluation.

Definition at line 64 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.


Member Typedef Documentation

Return type.

Reimplemented from cmtk::Functional.

Definition at line 79 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.

This class type.

Reimplemented from cmtk::ImagePairAffineRegistrationFunctional.

Definition at line 70 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.

Smart pointer to this class.

Reimplemented from cmtk::ImagePairAffineRegistrationFunctional.

Definition at line 73 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.

Superclass.

Reimplemented from cmtk::ImagePairAffineRegistrationFunctional.

Definition at line 76 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.


Constructor & Destructor Documentation

Constructor.

Init pointers to volume and transformation objects and initialize internal data structures.

Parameters:
referenceThe reference (i.e. static) volume.
floatingThe floating (i.e. transformed) volume.
interpolationID of the interpolator to use for the floating image.
affineXformA transformation template. This object determines the type of transformation to be optimized. Its initial value is not relevant.

Definition at line 90 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.

Destructor.

Definition at line 102 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.


Member Function Documentation

Compute functional value with volume clipping.

This function iterates over all voxels of the reference image that - after applying the current coordinate transformation - are located inside the mode image. This set of voxels is determined on-the-fly by an extension of Liang and Barsky's "Parameterized Line-Clipping" technique.

From the resulting sequence of reference/floating voxel pairs, the selected voxel-based similarity measure (metric) is computed.

Returns:
The computed similarity measure as returned by the "Metric" subobject.
See also:
VolumeClipping

Reimplemented from cmtk::Functional.

Definition at line 42 of file cmtkImagePairAffineRegistrationFunctionalTemplate.txx.

template<class VM>
virtual Self::ReturnType cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::EvaluateAt ( CoordinateVector v ) [inline, virtual]

Evaluate with new parameter vector.

Definition at line 105 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.

template<class VM >
void cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::EvaluateThread ( void *const   args,
const size_t  taskIdx,
const size_t  taskCnt,
const size_t  threadIdx,
const   size_t 
) [static]

Compute functional gradient as a thread.

This function (i.e., each thread) iterates over all parameters of the current warp transformation. Among all active (i.e., not disabled) parameters, it selects the ones that have an index with modulus equal to the threads index when divided by the total number of threads. For these parameters, the thread computes the partial derivative of the functional by finite-difference approximation.

Definition at line 82 of file cmtkImagePairAffineRegistrationFunctionalTemplate.txx.

References cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::EvaluateTaskInfo::AxesHash, cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::EvaluateTaskInfo::StartZ, and cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::EvaluateTaskInfo::thisObject.


Member Data Documentation

Info blocks for parallel threads evaluating functional gradient.

Definition at line 170 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.

Mutex lock for access to global Metric field.

Definition at line 150 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.

Number of threads that this object was created for.

This is the actual maximum number of threads running at any time, but not necessarily the number of parallel tasks to be completed. All duplicated data structures are generated with the multiplicity given by this value. It is determined from Threads when the object is first instanced. It cannot be changed afterwards.

Definition at line 144 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.

template<class VM>
std::vector<VM> cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::m_ThreadMetric

Metric objects for the separate threads.

Definition at line 147 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines