Functional that evaluates a voxel-based similarity measure. More...
#include <cmtkImagePairAffineRegistrationFunctionalTemplate.h>
Classes | |
struct | EvaluateTaskInfo |
Thread parameter block for incremental gradient computation. More... | |
Public Types | |
typedef ImagePairAffineRegistrationFunctionalTemplate < VM > | Self |
This class type. | |
typedef SmartPointer< Self > | SmartPtr |
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. |
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.
typedef Functional::ReturnType cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::ReturnType |
Return type.
Reimplemented from cmtk::Functional.
Definition at line 79 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.
typedef ImagePairAffineRegistrationFunctionalTemplate<VM> cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::Self |
This class type.
Reimplemented from cmtk::ImagePairAffineRegistrationFunctional.
Definition at line 70 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.
typedef SmartPointer<Self> cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::SmartPtr |
Smart pointer to this class.
Reimplemented from cmtk::ImagePairAffineRegistrationFunctional.
Definition at line 73 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.
typedef ImagePairAffineRegistrationFunctional cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::Superclass |
Superclass.
Reimplemented from cmtk::ImagePairAffineRegistrationFunctional.
Definition at line 76 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.
cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::ImagePairAffineRegistrationFunctionalTemplate | ( | UniformVolume::SmartPtr & | reference, |
UniformVolume::SmartPtr & | floating, | ||
const Interpolators::InterpolationEnum | interpolation, | ||
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. |
interpolation | ID of the interpolator to use for the floating image. |
affineXform | A 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.
virtual cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::~ImagePairAffineRegistrationFunctionalTemplate | ( | ) | [inline, virtual] |
Destructor.
Definition at line 102 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.
ImagePairAffineRegistrationFunctionalTemplate< VM >::ReturnType cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::Evaluate | ( | ) | [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 42 of file cmtkImagePairAffineRegistrationFunctionalTemplate.txx.
virtual Self::ReturnType cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::EvaluateAt | ( | CoordinateVector & | v ) | [inline, virtual] |
Evaluate with new parameter vector.
Definition at line 105 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.
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.
std::vector<typename Self::EvaluateTaskInfo> cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::m_EvaluateTaskInfo |
Info blocks for parallel threads evaluating functional gradient.
Definition at line 170 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.
MutexLock cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::m_MetricMutex |
Mutex lock for access to global Metric field.
Definition at line 150 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.
size_t cmtk::ImagePairAffineRegistrationFunctionalTemplate< 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 144 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.
std::vector<VM> cmtk::ImagePairAffineRegistrationFunctionalTemplate< VM >::m_ThreadMetric |
Metric objects for the separate threads.
Definition at line 147 of file cmtkImagePairAffineRegistrationFunctionalTemplate.h.