NPL
Neurological Programs and Libraries
npl::DistCorrInfoComp Class Reference

The distortion correction MI Computer is used to compute the mutual information and gradient of mutual information between two images using nonrigid, unidirectional, B-spline transform. More...

#include <registration.h>

Public Member Functions

 DistCorrInfoComp (bool mindiff)
 Constructor for the distortion correction class. 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...
 
size_t nparam ()
 Returns the number of parameters (knots) 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 initializeKnots (double space)
 Initializes knot spacing and if m_fixed has been set, then initializes the m_deform image. 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, int dir=-1)
 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...
 
ptr< MRImagegetDeform ()
 Returns the current deformation. More...
 

Public Attributes

int m_dir
 Phase encode (distortion) dimensions. More...
 
bool m_compdiff
 Compute the difference of images (negate MI and NMI) More...
 
double m_tps_reg
 Thin-plate spline regularization weight. More...
 
double m_jac_reg
 Jacobian regularization weight. More...
 
Metric m_metric
 Metric to use. More...
 

Detailed Description

The distortion correction MI Computer is used to compute the mutual information and gradient of mutual information between two images using nonrigid, unidirectional, B-spline transform.

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 578 of file registration.h.

Constructor & Destructor Documentation

npl::DistCorrInfoComp::DistCorrInfoComp ( bool  mindiff)

Constructor for the distortion correction class.

Parameters
mindiffMinimize difference? Set to true if you are using this for registration

Member Function Documentation

ptr<MRImage> npl::DistCorrInfoComp::getDeform ( )
inline

Returns the current deformation.

Returns

Definition at line 713 of file registration.h.

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

Return the current fixed image.

Definition at line 684 of file registration.h.

ptr<const MRImage> npl::DistCorrInfoComp::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 706 of file registration.h.

int npl::DistCorrInfoComp::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
void npl::DistCorrInfoComp::initializeKnots ( double  space)

Initializes knot spacing and if m_fixed has been set, then initializes the m_deform image.

Parameters
spaceSpacing between knots, in physical coordinates
size_t npl::DistCorrInfoComp::nparam ( )
inline

Returns the number of parameters (knots)

Returns
Number of parameters that are being estimated;

Definition at line 654 of file registration.h.

void npl::DistCorrInfoComp::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::DistCorrInfoComp::setFixed ( ptr< const MRImage fixed)

Set the fixed image for registration/comparison.

Parameters
fixedInput fixed image (not modified)
void npl::DistCorrInfoComp::setMoving ( ptr< const MRImage moving,
int  dir = -1 
)

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)
dirDirection of distortion (the dimension, must be >= 0)
int npl::DistCorrInfoComp::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::DistCorrInfoComp::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::DistCorrInfoComp::m_compdiff

Compute the difference of images (negate MI and NMI)

Definition at line 632 of file registration.h.

int npl::DistCorrInfoComp::m_dir

Phase encode (distortion) dimensions.

Definition at line 627 of file registration.h.

double npl::DistCorrInfoComp::m_jac_reg

Jacobian regularization weight.

Definition at line 642 of file registration.h.

Metric npl::DistCorrInfoComp::m_metric

Metric to use.

Definition at line 647 of file registration.h.

double npl::DistCorrInfoComp::m_tps_reg

Thin-plate spline regularization weight.

Definition at line 637 of file registration.h.


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