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

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

Parallel elastic registration functional. More...

#include <cmtkImagePairNonrigidRegistrationFunctionalTemplate.h>

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

List of all members.

Classes

class  EvaluateCompleteTaskInfo
 Thread parameter block for complete functional evaluation. More...
class  EvaluateGradientTaskInfo
 Thread parameter block for incremental gradient computation. More...

Public Types

typedef
ImagePairNonrigidRegistrationFunctionalTemplate
< VM > 
Self
 This class.
typedef SmartPointer< SelfSmartPtr
 Smart pointer to this class.
typedef
ImagePairNonrigidRegistrationFunctional 
Superclass
 Superclass.

Public Member Functions

 ImagePairNonrigidRegistrationFunctionalTemplate (UniformVolume::SmartPtr &reference, UniformVolume::SmartPtr &floating, const Interpolators::InterpolationEnum interpolation)
 Constructor.
virtual ~ImagePairNonrigidRegistrationFunctionalTemplate ()
 Destructor.
virtual void SetForceOutside (const bool flag=true, const Types::DataItem value=0)
 Set flag and value for forcing values outside the floating image.
virtual void SetWarpXform (SplineWarpXform::SmartPtr &warp)
 Set warp transformation.
virtual void MatchRefFltIntensities ()
 Match intensities of reference and floating images.
Self::ReturnType Evaluate ()
 Evaluate functional for the complete image data.
Self::ReturnType EvaluateIncremental (const SplineWarpXform &warp, VM &localMetric, const DataGrid::RegionType &voi, Vector3D *const vectorCache)
 Evaluate functional after change of a single parameter.
virtual Self::ReturnType EvaluateWithGradient (CoordinateVector &v, CoordinateVector &g, const typename Self::ParameterType step=1)
 Compute functional value and gradient.
virtual Self::ReturnType EvaluateAt (CoordinateVector &v)
 Evaluate functional.

Protected Attributes

SmartPointer< VM > m_IncrementalMetric
 Metric object for incremental computation.

Private Member Functions

void UpdateWarpFixedParameters ()
 Update set of active and passive parameters.

Static Private Member Functions

static void EvaluateGradientThread (void *arg, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t)
 Compute functional gradient as a thread.
static void EvaluateCompleteThread (void *arg, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t)
 Multi-threaded implementation of complete metric evaluation.

Private Attributes

std::vector< VM > m_TaskMetric
 Metric object for threadwise computation.
std::vector< typename
Self::EvaluateGradientTaskInfo
m_InfoTaskGradient
 Info blocks for parallel threads evaluating functional gradient.
std::vector< typename
Self::EvaluateCompleteTaskInfo > 
m_InfoTaskComplete
 Info blocks for parallel threads evaluating complete functional.
bool WarpNeedsFixUpdate
 Warp's fixed parameters need to be updated.
JointHistogram< unsigned int >
::SmartPtr 
m_ConsistencyHistogram
 Histogram used for consistency computation.

Detailed Description

template<class VM>
class cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >

Parallel elastic registration functional.

This class provides multi-threaded implementations for the most time-consuming tasks performed by ImagePairNonrigidRegistrationFunctional and its derived classes. Inherit from general image pair registration functional.

Definition at line 60 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.


Member Typedef Documentation

Smart pointer to this class.

Reimplemented from cmtk::ImagePairNonrigidRegistrationFunctional.

Definition at line 78 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 84 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.

Destructor.

Free all per-thread data structures.

Definition at line 97 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.


Member Function Documentation

template<class VM>
Self::ReturnType cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::Evaluate (  ) [inline, virtual]

Evaluate functional for the complete image data.

This function builds the pre-computed deformed floating image that is later used for rapid gradient computation.

Reimplemented from cmtk::Functional.

Definition at line 122 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.

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

Evaluate functional.

Definition at line 241 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.

template<class VM>
static void cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::EvaluateCompleteThread ( void *  arg,
const size_t  taskIdx,
const size_t  taskCnt,
const size_t  threadIdx,
const   size_t 
) [inline, static, private]

Multi-threaded implementation of complete metric evaluation.

Definition at line 363 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.

References cmtk::SplineWarpXform::GetTransformedGridRow().

template<class VM>
static void cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::EvaluateGradientThread ( void *  arg,
const size_t  taskIdx,
const size_t  taskCnt,
const size_t  threadIdx,
const   size_t 
) [inline, static, private]

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 297 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.

References cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::EvaluateGradientTaskInfo::BaseValue, cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::EvaluateGradientTaskInfo::Gradient, cmtk::Xform::m_Parameters, cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::EvaluateGradientTaskInfo::Parameters, cmtk::Xform::SetParamVector(), cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::EvaluateGradientTaskInfo::Step, and cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::EvaluateGradientTaskInfo::thisObject.

template<class VM>
Self::ReturnType cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::EvaluateIncremental ( const SplineWarpXform warp,
VM &  localMetric,
const DataGrid::RegionType voi,
Vector3D *const   vectorCache 
) [inline]

Evaluate functional after change of a single parameter.

Parameters:
warpThe current deformation.
localMetricThe local metric oobject for partial recomputation.
voiVolume-of-Influence for the parameter under consideration.
vectorCachePre-allocated cache storage for locally used transformed vectors.
Returns:
The metric after recomputation over the given volume-of-influence.

Definition at line 158 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.

References cmtk::Region< NDIM, T >::From(), cmtk::SplineWarpXform::GetTransformedGridRow(), and cmtk::Region< NDIM, T >::To().

template<class VM>
virtual Self::ReturnType cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::EvaluateWithGradient ( CoordinateVector v,
CoordinateVector g,
const typename Self::ParameterType  step = 1 
) [inline, virtual]

Compute functional value and gradient.

Definition at line 211 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.

References cmtk::Vector< T >::Elements.

template<class VM >
void cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::MatchRefFltIntensities (  ) [virtual]

Match intensities of reference and floating images.

Definition at line 39 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.txx.

References cmtk::TYPE_ITEM.

template<class VM>
virtual void cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::SetForceOutside ( const bool  flag = true,
const Types::DataItem  value = 0 
) [inline, virtual]

Set flag and value for forcing values outside the floating image.

Reimplemented from cmtk::ImagePairRegistrationFunctional.

Definition at line 101 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.

template<class VM>
virtual void cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::SetWarpXform ( SplineWarpXform::SmartPtr warp ) [inline, virtual]

Set warp transformation.

Implements cmtk::ImagePairNonrigidRegistrationFunctional.

Definition at line 109 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.

template<class VM >
void cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::UpdateWarpFixedParameters (  ) [private]

Update set of active and passive parameters.

This function computes local entropies in the neighborhood of all control points of the Warp transformation. Those control points for which both reference and floating image have less than half the maximum entropy in this neighborhood as compared to the rest of the image are set passive. The passive parameters are not considered for gradient computation and therefore save significant computation time.

We cannot use the precomputed table of VOIs here because in "fast" mode, these VOIs are smaller than we want them here.

Definition at line 51 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.txx.

References cmtk::DATACLASS_LABEL, cmtk::Region< NDIM, T >::From(), and cmtk::Region< NDIM, T >::To().


Member Data Documentation

Histogram used for consistency computation.

Definition at line 430 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.

Metric object for incremental computation.

Before computing the incremental metric after change of one parameter, the global metric is copied to this object. It is then used for in-place application of all necessary changes, leaving the original metric intact.

See also:
EvaluateIncremental

Definition at line 71 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.

template<class VM>
std::vector<typename Self::EvaluateCompleteTaskInfo> cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::m_InfoTaskComplete [private]

Info blocks for parallel threads evaluating complete functional.

Definition at line 360 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.

Info blocks for parallel threads evaluating functional gradient.

Definition at line 287 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.

template<class VM>
std::vector<VM> cmtk::ImagePairNonrigidRegistrationFunctionalTemplate< VM >::m_TaskMetric [private]

Metric object for threadwise computation.

The objects in this array are the per-thread equivalent of the ImagePairNonrigidRegistrationFunctional::IncrementalMetric object.

Definition at line 264 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.

Warp's fixed parameters need to be updated.

This flag is set when the warp transformation is set or modified. It signals that the active and passive parameters of the transformation will have to be updated before the next gradient computation.

Definition at line 427 of file cmtkImagePairNonrigidRegistrationFunctionalTemplate.h.


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