Functional that evaluates a voxel-based similarity measure. More...
#include <cmtkVoxelMatchingAffineFunctionalTemplate.h>
Classes | |
struct | EvaluateTaskInfo |
Thread parameter block for incremental gradient computation. More... | |
Public Types | |
typedef VoxelMatchingAffineFunctionalTemplate < VM > | Self |
This class type. | |
typedef SmartPointer< Self > | SmartPtr |
Smart pointer to this class. | |
typedef VoxelMatchingAffineFunctional | Superclass |
Superclass. | |
typedef Functional::ReturnType | ReturnType |
Return type. | |
Public Member Functions | |
VoxelMatchingAffineFunctionalTemplate (UniformVolume::SmartPtr &reference, UniformVolume::SmartPtr &floating, AffineXform::SmartPtr &affineXform) | |
Constructor. | |
virtual | ~VoxelMatchingAffineFunctionalTemplate () |
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. |
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 59 of file cmtkVoxelMatchingAffineFunctionalTemplate.h.
typedef Functional::ReturnType cmtk::VoxelMatchingAffineFunctionalTemplate< VM >::ReturnType |
Return type.
Reimplemented from cmtk::Functional.
Definition at line 76 of file cmtkVoxelMatchingAffineFunctionalTemplate.h.
typedef VoxelMatchingAffineFunctionalTemplate<VM> cmtk::VoxelMatchingAffineFunctionalTemplate< VM >::Self |
This class type.
Reimplemented from cmtk::VoxelMatchingAffineFunctional.
Definition at line 67 of file cmtkVoxelMatchingAffineFunctionalTemplate.h.
typedef SmartPointer<Self> cmtk::VoxelMatchingAffineFunctionalTemplate< VM >::SmartPtr |
Smart pointer to this class.
Reimplemented from cmtk::VoxelMatchingAffineFunctional.
Definition at line 70 of file cmtkVoxelMatchingAffineFunctionalTemplate.h.
typedef VoxelMatchingAffineFunctional cmtk::VoxelMatchingAffineFunctionalTemplate< VM >::Superclass |
Superclass.
Reimplemented from cmtk::VoxelMatchingAffineFunctional.
Definition at line 73 of file cmtkVoxelMatchingAffineFunctionalTemplate.h.
cmtk::VoxelMatchingAffineFunctionalTemplate< VM >::VoxelMatchingAffineFunctionalTemplate | ( | UniformVolume::SmartPtr & | reference, |
UniformVolume::SmartPtr & | floating, | ||
AffineXform::SmartPtr & | affineXform | ||
) | [inline] |
Constructor.
Init pointers to volume and transformation objects and initialize internal data structures.
reference | The reference (i.e. static) volume. |
floating | The floating (i.e. transformed) volume. |
affineXform | A transformation template. This object determines the type of transformation to be optimized. Its initial value is not relevant. |
Definition at line 85 of file cmtkVoxelMatchingAffineFunctionalTemplate.h.
virtual cmtk::VoxelMatchingAffineFunctionalTemplate< VM >::~VoxelMatchingAffineFunctionalTemplate | ( | ) | [inline, virtual] |
Destructor.
Definition at line 94 of file cmtkVoxelMatchingAffineFunctionalTemplate.h.
virtual Self::ReturnType cmtk::VoxelMatchingAffineFunctionalTemplate< VM >::Evaluate | ( | ) | [inline, virtual] |
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.
Reimplemented from cmtk::Functional.
Definition at line 115 of file cmtkVoxelMatchingAffineFunctionalTemplate.h.
virtual Self::ReturnType cmtk::VoxelMatchingAffineFunctionalTemplate< VM >::EvaluateAt | ( | CoordinateVector & | v ) | [inline, virtual] |
Evaluate with new parameter vector.
Definition at line 97 of file cmtkVoxelMatchingAffineFunctionalTemplate.h.
static void cmtk::VoxelMatchingAffineFunctionalTemplate< VM >::EvaluateThread | ( | void *const | args, |
const size_t | taskIdx, | ||
const size_t | taskCnt, | ||
const size_t | threadIdx, | ||
const | size_t | ||
) | [inline, 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 195 of file cmtkVoxelMatchingAffineFunctionalTemplate.h.
std::vector<typename Self::EvaluateTaskInfo> cmtk::VoxelMatchingAffineFunctionalTemplate< VM >::m_EvaluateTaskInfo |
Info blocks for parallel threads evaluating functional gradient.
Definition at line 185 of file cmtkVoxelMatchingAffineFunctionalTemplate.h.
MutexLock cmtk::VoxelMatchingAffineFunctionalTemplate< VM >::m_MetricMutex |
Mutex lock for access to global Metric field.
Definition at line 165 of file cmtkVoxelMatchingAffineFunctionalTemplate.h.
size_t cmtk::VoxelMatchingAffineFunctionalTemplate< VM >::m_NumberOfThreads |
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 159 of file cmtkVoxelMatchingAffineFunctionalTemplate.h.
std::vector<VM> cmtk::VoxelMatchingAffineFunctionalTemplate< VM >::m_ThreadMetric |
Metric objects for the separate threads.
Definition at line 162 of file cmtkVoxelMatchingAffineFunctionalTemplate.h.