NPL
Neurological Programs and Libraries
npl::RigidInfoComp Class Reference

The Rigid MI Computer is used to compute the mutual information and gradient of mutual information between two images. As the name implies, it is designed for 6 parameter rigid transforms. More...

#include <registration.h>

Public Member Functions

 RigidInfoComp (bool mindiff)
 Constructor for the rigid correlation class. Note that rigid rotation is assumed to be about the center of the fixed image space. * If changes are made to the moving image, then call reinit() to reinitialize the image derivative. More...
 
int valueGrad (const Eigen::VectorXd &params, double &val, Eigen::VectorXd &grad)
 Computes the gradient and value of the correlation. More...
 
int grad (const Eigen::VectorXd &params, Eigen::VectorXd &grad)
 Computes the gradient of the correlation. Note that this function just calls valueGrad because computing the additional values are trivial. More...
 
int value (const Eigen::VectorXd &params, double &val)
 Computes the correlation. More...
 
void setBins (size_t nbins, size_t krad)
 Reallocates histograms and if m_fixed has been set, regenerates histogram estimate of fixed pdf. More...
 
void setFixed (ptr< const MRImage > fixed)
 Set the fixed image for registration/comparison. More...
 
ptr< const MRImagegetFixed ()
 Return the current fixed image. More...
 
void setMoving (ptr< const MRImage > moving)
 Set the moving image for comparison, note that setting this triggers a derivative computation and so is slower than setFixed. More...
 
ptr< const MRImagegetMoving ()
 Return the current moving image. More...
 
size_t nparam ()
 Returns the number of parameters that are being estimated. More...
 

Public Attributes

bool m_compdiff
 Compute the difference of images (negate MI and NMI) More...
 
Metric m_metric
 Metric to use. More...
 

Detailed Description

The Rigid MI Computer is used to compute the mutual information and gradient of mutual information between two images. As the name implies, it is designed for 6 parameter rigid transforms.

Note, if you want to register you should set the m_mindiff variable, so that the negative of mutual information will be computed. Eventually this functional will be somewhat generalized for all information-based metrics.

Definition at line 51 of file registration.h.

Constructor & Destructor Documentation

npl::RigidInfoComp::RigidInfoComp ( bool  mindiff)

Constructor for the rigid correlation class. Note that rigid rotation is assumed to be about the center of the fixed image space. * If changes are made to the moving image, then call reinit() to reinitialize the image derivative.

Parameters
mindiffWhether to use negative correlation (for instance to register images)

Member Function Documentation

ptr<const MRImage> npl::RigidInfoComp::getFixed ( )
inline

Return the current fixed image.

Definition at line 130 of file registration.h.

ptr<const MRImage> npl::RigidInfoComp::getMoving ( )
inline

Return the current moving image.

Note that modification of the moving image outside this class without re-calling setMoving is undefined and will result in an out-of-date moving image derivative. THIS WILL BREAK GRADIENT CALCULATIONS.

Definition at line 151 of file registration.h.

int npl::RigidInfoComp::grad ( const Eigen::VectorXd &  params,
Eigen::VectorXd &  grad 
)

Computes the gradient of the correlation. Note that this function just calls valueGrad because computing the additional values are trivial.

Parameters
paramsParamters (Rx, Ry, Rz, Sx, Sy, Sz).
gradGradient at the given rotation
Returns
0 if successful
size_t npl::RigidInfoComp::nparam ( )
inline

Returns the number of parameters that are being estimated.

Returns
Number of parameters that are being estimated;

Definition at line 158 of file registration.h.

void npl::RigidInfoComp::setBins ( size_t  nbins,
size_t  krad 
)

Reallocates histograms and if m_fixed has been set, regenerates histogram estimate of fixed pdf.

Parameters
nbinsNumber of bins for marginal estimation
kradNumber of bins in kernel radius
void npl::RigidInfoComp::setFixed ( ptr< const MRImage fixed)

Set the fixed image for registration/comparison.

Parameters
fixedInput fixed image (not modified)
void npl::RigidInfoComp::setMoving ( ptr< const MRImage moving)

Set the moving image for comparison, note that setting this triggers a derivative computation and so is slower than setFixed.

Note that modification of the moving image outside this class without re-calling setMoving is undefined and will result in an out-of-date moving image derivative. THIS WILL BREAK GRADIENT CALCULATIONS.

Parameters
movingInput moving image (not modified)
int npl::RigidInfoComp::value ( const Eigen::VectorXd &  params,
double &  val 
)

Computes the correlation.

Parameters
paramsParamters (Rx, Ry, Rz, Sx, Sy, Sz).
valValue at the given rotation
Returns
0 if successful
int npl::RigidInfoComp::valueGrad ( const Eigen::VectorXd &  params,
double &  val,
Eigen::VectorXd &  grad 
)

Computes the gradient and value of the correlation.

Parameters
paramsParamters (Rx, Ry, Rz, Sx, Sy, Sz).
valValue at the given rotation
gradGradient at the given rotation
Returns
0 if successful

Member Data Documentation

bool npl::RigidInfoComp::m_compdiff

Compute the difference of images (negate MI and NMI)

Definition at line 103 of file registration.h.

Metric npl::RigidInfoComp::m_metric

Metric to use.

Definition at line 108 of file registration.h.


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