NPL
Neurological Programs and Libraries
npl::ProbDistCorrInfoComp 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. In this variant the moving image should be a probability map. More...

#include <registration.h>

Public Member Functions

 ProbDistCorrInfoComp (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 initialize (ptr< const MRImage > fixed, ptr< const MRImage > moving, size_t m_krad, size_t nbins, double space, int dir)
 Initializes the computer. This is much simipler to keep track of properly than several initialize functions that could be called in any order (eventually I'll probably move all the Comp classes to this model). More...
 
ptr< const MRImagegetFixed ()
 Return the current fixed image. More...
 
ptr< const MRImagegetMoving ()
 Return the current moving image. More...
 
ptr< MRImagegetDeform ()
 Returns the current deformation. More...
 

Public Attributes

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. In this variant the moving image should be a probability map.

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

Constructor & Destructor Documentation

npl::ProbDistCorrInfoComp::ProbDistCorrInfoComp ( 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::ProbDistCorrInfoComp::getDeform ( )
inline

Returns the current deformation.

Returns

Definition at line 443 of file registration.h.

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

Return the current fixed image.

Definition at line 427 of file registration.h.

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

int npl::ProbDistCorrInfoComp::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::ProbDistCorrInfoComp::initialize ( ptr< const MRImage fixed,
ptr< const MRImage moving,
size_t  m_krad,
size_t  nbins,
double  space,
int  dir 
)

Initializes the computer. This is much simipler to keep track of properly than several initialize functions that could be called in any order (eventually I'll probably move all the Comp classes to this model).

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
fixedNew fixed image
movingInput moving image, should be 4D with each volume containing a probability map (not modified)
m_kradradius of kernel during histogram estimation
nbinsnumber of bins to estimate histograms with
dirDirection of distortion (the dimension, must be >= 0)
spaceSpacing between knots, in physical coordinates
size_t npl::ProbDistCorrInfoComp::nparam ( )
inline

Returns the number of parameters (knots)

Returns
Number of parameters that are being estimated;

Definition at line 401 of file registration.h.

int npl::ProbDistCorrInfoComp::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::ProbDistCorrInfoComp::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::ProbDistCorrInfoComp::m_compdiff

Compute the difference of images (negate MI and NMI)

Definition at line 379 of file registration.h.

double npl::ProbDistCorrInfoComp::m_jac_reg

Jacobian regularization weight.

Definition at line 389 of file registration.h.

Metric npl::ProbDistCorrInfoComp::m_metric

Metric to use.

Definition at line 394 of file registration.h.

double npl::ProbDistCorrInfoComp::m_tps_reg

Thin-plate spline regularization weight.

Definition at line 384 of file registration.h.


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