CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
i1TCModel Class Reference

This class implements a 1 compartiment model, to model kinetics of radiotracers such as radiowater. More...

#include <i1TCModel.hh>

Inheritance diagram for i1TCModel:
Inheritance graph
Collaboration diagram for i1TCModel:
Collaboration graph

Public Member Functions

 i1TCModel ()
 Constructor of i1TCModel. Simply set all data members to default values. More...
 
 ~i1TCModel ()
 Destructor of i1TCModel. More...
 
int CheckSpecificParameters ()
 This function is used to check whether all member variables have been correctly initialized or not. More...
 
int ReadAndCheckConfigurationFileSpecific ()
 This function is used to read options from a configuration file. More...
 
int ReadAndCheckOptionsList (string a_listOptions)
 This function is used to read parameters from a string. More...
 
int InitializeSpecific ()
 This function is used to initialize parametric images and basis functions. More...
 
void ShowHelp ()
 Print out specific help about the implementation of the model model and its initialization. More...
 
int EstimateModelParameters (oImageSpace *ap_Image, int a_ite, int a_sset)
 Estimate K1, k2, Va parametric images. More...
 
int EstimateImageWithModel (oImageSpace *ap_Image, int a_ite, int a_sset)
 Estimate image using model parametric images and basis functions. More...
 
- Public Member Functions inherited from vDynamicModel
 vDynamicModel ()
 Constructor of vDynamicModel. Simply set all data members to default values. More...
 
virtual ~vDynamicModel ()
 Destructor of vDynamicModel. More...
 
void SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
 Set the image dimensions in use. More...
 
void SetVerbose (int a_verbose)
 Set the verbose level. More...
 
virtual int CheckParameters ()
 This function is used to check parameters after the latter have been all set using Set functions. More...
 
int ReadAndCheckConfigurationFile (string a_fileOptions)
 This function is used to read options from a configuration file.
It looks for the parameters implemented by the mother class, such as 'No image update', 'No parameters update', or 'Save parametric images'. More...
 
int Initialize ()
 A public function used to initialize the dynamic model. More...
 
virtual int EstimateModel (oImageSpace *ap_Image, int a_ite, int a_sset)
 This function checks if the EstimateModelParameters() function (specific to each model) must be called at this stage of the reconstruction depending on the m_xxxUpdateflags. More...
 
virtual int EstimateImage (oImageSpace *ap_Image, int a_ite, int a_sset)
 
int SaveParametricImages (int a_iteration, int a_subset=-1)
 This function is virtual it can be overloaded by children if required. More...
 
virtual int ApplyOutputFOVMaskingOnParametricImages ()
 Mask the outside of the transaxial FOV based on the m_fovOutPercent. More...
 
bool GetAICflag ()
 
bool GetModelBasisFunctionsRequiredFlag ()
 
int GetNbTimeBasisFunctions ()
 
FLTNB ** GetTimeBasisFunctions ()
 
virtual void ComputeOutputParImage ()
 Compute output image using the m2p_parametricImages matrix Store the result in the m2p_outputParImages matrix. More...
 
int NNLS (FLTNB **A, int m, int n, FLTNB *B, FLTNB *X, FLTNB *rnorm, FLTNB *wp, FLTNB *zzp, int *indexp)
 Implementation of NNLS (non-negative least squares) algorithm Derived from Turku PET center libraries (authors: Vesa Oikonen and Kaisa Sederholm) This routine is based on the text and fortran code in C.L. Lawson and R.J. Hanson, Solving Least Squares Problems, Prentice-Hall, Englewood Cliffs, New Jersey, 1974. More...
 

Protected Attributes

bool m_savePImgFlag
 
int m_OptimisationMethodFlag
 
FLTNB ** m2p_ct
 
FLTNB ** m2p_cti
 
FLTNBmp_w
 
FLTNB *** m3p_nnlsA
 
FLTNB ** m2p_nnlsB
 
FLTNB ** m2p_nnlsMat
 
uint16_t m_nnlsN =3
 
FLTNBmp_parUpperBounds
 
FLTNBmp_parLowerBounds
 
FLTNB m_RRcst
 
bool m_ridgeRegressionFlag
 
FLTNBmp_DT2
 
FLTNBmp_wpoQ
 
FLTNBmp_wpoA
 
FLTNB ** m2p_wpoP
 
FLTNB ** m2p_wpoFD
 
FLTNB ** m2p_wpoBD
 
bool m_intMethodFlag
 
oMatrix ** mp_Y
 
oMatrix ** mp_X
 
oMatrix ** mp_Xt
 
oMatrix ** mp_XtX
 
oMatrix ** mp_LSnum
 
oMatrix ** mp_LSden
 
oMatrix ** mp_Theta
 
oMatrixmp_RRm
 
oMatrixmp_RRw
 
oMatrix ** mp_RRnum
 
FLTNBmp_VaImage
 
- Protected Attributes inherited from vDynamicModel
oImageDimensionsAndQuantificationmp_ID
 
int m_verbose
 
int m_nbTimeBF
 
int m_nbWeightFactors
 
int m_nbModelParam
 
int m_nbRGModelParam
 
int m_nbCGModelParam
 
string m_AICfile
 
oArterialInputCurvemp_ArterialInputCurve
 
FLTNB ** m2p_parametricImages
 
FLTNBmp_blackListedvoxelsImage
 
FLTNB ** m2p_nestedModelTimeBasisFunctions
 
FLTNB ** m2p_outputParImages
 
FLTNB ** m2p_RGParametricImages
 
FLTNB ** m2p_CGParametricImages
 
string m_fileOptions
 
string m_listOptions
 
bool m_checked
 
bool m_initialized
 
bool m_saveParImageFlag
 
bool m_saveBlacklistedImageMaskFlag
 
bool m_AICfileProvided
 
bool m_ModelSpecificBasisFunctionsRequired
 
bool m_noImageUpdateFlag
 
bool m_noParametersUpdateFlag
 
int m_startIteUpdateFlag
 
FLTNBmp_maskModel
 
INTNB m_nbVoxelsMask
 
FLTNBmp_w
 
FLTNB *** m3p_nnlsA
 
FLTNB ** m2p_nnlsB
 
FLTNB ** m2p_nnlsMat
 
FLTNB ** m2p_nnlsX
 
FLTNB ** m2p_nnlsWp
 
int ** m2p_nnlsIdx
 
uint16_t m_nnlsN =0
 

Private Member Functions

int EstimateModelParametersWithLS (oImageSpace *ap_ImageS)
 Estimate K1, k2, Va parametric images using LS. More...
 
int EstimateModelParametersWithNNLS (oImageSpace *ap_ImageS)
 Estimate K1, k2, Va parametric images using NNLS. More...
 
int EstimateModelParametersWithBF (oImageSpace *ap_ImageS)
 Estimate K1, k2, Va parametric images using basis functions approach. More...
 
int RRLS (uint16_t a_nP, uint16_t a_nT, FLTNB **a2p_model, FLTNB *ap_data, FLTNB *ap_w, FLTNB *ap_result)
 Non-linear least square estimator with Ridge-Regression. More...
 
int LS (uint16_t a_nP, uint16_t a_nT, FLTNB **a2p_model, FLTNB *ap_data, FLTNB *ap_w, FLTNB *ap_result)
 Non-linear least square estimator. More...
 
FLTNB WPOinc (uint32_t a_time, FLTNB tac, FLTNB b_tac, FLTNB bb_tac, FLTNB n_tac)
 Estimate the next integration value for a specific time point of a tac using WPO. More...
 
int IntegrateTAC (FLTNB *ap_tac, FLTNB *ap_citac, int a_th)
 Call one of the TAC integration method. More...
 
int WPO (FLTNB *ap_tac, FLTNB *ap_citac, int a_th)
 return integral for each time point t (WPO_S), and cumulative integral (cumWPO_S ) More...
 
int Trapz (FLTNB *ap_tac, FLTNB *ap_citac)
 return integral for each time point t (WPO_S), and cumulative integral (cumWPO_S ) More...
 

Detailed Description

This class implements a 1 compartiment model, to model kinetics of radiotracers such as radiowater.

Definition at line 73 of file i1TCModel.hh.

Constructor & Destructor Documentation

◆ i1TCModel()

i1TCModel::i1TCModel ( )

Constructor of i1TCModel. Simply set all data members to default values.

Definition at line 51 of file i1TCModel.cc.

◆ ~i1TCModel()

i1TCModel::~i1TCModel ( )

Destructor of i1TCModel.

Definition at line 110 of file i1TCModel.cc.

Here is the call graph for this function:

Member Function Documentation

◆ CheckSpecificParameters()

int i1TCModel::CheckSpecificParameters ( )
virtual

This function is used to check whether all member variables have been correctly initialized or not.

Returns
0 if success, positive value otherwise.

Implements vDynamicModel.

Definition at line 455 of file i1TCModel.cc.

Here is the call graph for this function:

◆ EstimateImageWithModel()

int i1TCModel::EstimateImageWithModel ( oImageSpace ap_Image,
int  a_ite,
int  a_sset 
)
virtual

Estimate image using model parametric images and basis functions.

Parameters
ap_ImageS: pointer to the ImageSpace
a_ite: index of the actual iteration (not used)
a_sset: index of the actual subset (not used)
Returns
0 if success, other value otherwise.

Implements vDynamicModel.

Definition at line 1737 of file i1TCModel.cc.

Here is the call graph for this function:

◆ EstimateModelParameters()

int i1TCModel::EstimateModelParameters ( oImageSpace ap_Image,
int  a_ite,
int  a_sset 
)
virtual

Estimate K1, k2, Va parametric images.

Parameters
ap_ImageS: pointer to the ImageSpace
a_ite: index of the actual iteration (not used)
a_sset: index of the actual subset (not used)
Returns
0 if success, other value otherwise.

Implements vDynamicModel.

Definition at line 898 of file i1TCModel.cc.

Here is the call graph for this function:

◆ EstimateModelParametersWithBF()

int i1TCModel::EstimateModelParametersWithBF ( oImageSpace ap_ImageS)
private

Estimate K1, k2, Va parametric images using basis functions approach.

Parameters
ap_ImageS: pointer to the ImageSpace
Returns
0 if success, other value otherwise.

Definition at line 1181 of file i1TCModel.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EstimateModelParametersWithLS()

int i1TCModel::EstimateModelParametersWithLS ( oImageSpace ap_ImageS)
private

Estimate K1, k2, Va parametric images using LS.

Parameters
ap_ImageS: pointer to the ImageSpace
Returns
0 if success, other value otherwise.

Definition at line 1216 of file i1TCModel.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EstimateModelParametersWithNNLS()

int i1TCModel::EstimateModelParametersWithNNLS ( oImageSpace ap_ImageS)
private

Estimate K1, k2, Va parametric images using NNLS.

Parameters
ap_ImageS: pointer to the ImageSpace
Returns
0 if success, other value otherwise.

Definition at line 1002 of file i1TCModel.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializeSpecific()

int i1TCModel::InitializeSpecific ( )
virtual

This function is used to initialize parametric images and basis functions.

Returns
0 if success, other value otherwise.

Implements vDynamicModel.

Definition at line 518 of file i1TCModel.cc.

Here is the call graph for this function:

◆ IntegrateTAC()

int i1TCModel::IntegrateTAC ( FLTNB ap_tac,
FLTNB ap_citac,
int  a_th 
)
private

Call one of the TAC integration method.

Parameters
ap_tac: vector with nb time frames elements containing the time activity curve from which integral will be computed
ap_citac: (returned) vector with nb time frames elements recovering the cumulative integral for each time point t
a_th: thread index
Returns
0 if success, positive value otherwise

Definition at line 1898 of file i1TCModel.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LS()

int i1TCModel::LS ( uint16_t  a_nP,
uint16_t  a_nT,
FLTNB **  a2p_model,
FLTNB ap_data,
FLTNB ap_w,
FLTNB ap_result 
)
private

Non-linear least square estimator.

Parameters
a_nP: number of parameters (P)
a_nT: number of data samples (T)
a2p_model: matrix containing the model functions (TxP elts)
ap_data: data vector (T elts)
ap_w: vector containing the weights (T elts)
ap_result: vector recovering the estimated parameters (P elts)

This function will estimate a set of parameters (O) by minimizing the weighted residual sum of squares (WRSS) difference between the data and the model function Ô = [ X'WX ]-1 X'Wy y = data vector X = model matrix W = weights vector

Returns
0 if success, other value otherwise.

Definition at line 1578 of file i1TCModel.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadAndCheckConfigurationFileSpecific()

int i1TCModel::ReadAndCheckConfigurationFileSpecific ( )
virtual

This function is used to read options from a configuration file.

Returns
0 if success, other value otherwise.

Implements vDynamicModel.

Definition at line 316 of file i1TCModel.cc.

Here is the call graph for this function:

◆ ReadAndCheckOptionsList()

int i1TCModel::ReadAndCheckOptionsList ( string  a_listOptions)
virtual

This function is used to read parameters from a string.

Parameters
conststring& a_optionsList : a list of parameters separated by commas
Returns
0 if success, other value otherwise.

Implements vDynamicModel.

Definition at line 430 of file i1TCModel.cc.

◆ RRLS()

int i1TCModel::RRLS ( uint16_t  a_nP,
uint16_t  a_nT,
FLTNB **  a2p_model,
FLTNB ap_data,
FLTNB ap_w,
FLTNB ap_result 
)
private

Non-linear least square estimator with Ridge-Regression.

Parameters
a_nP: number of parameters (P)
a_nT: number of data samples (T)
a2p_model: matrix containing the model functions (TxP elts)
ap_data: data vector (T elts)
ap_w: vector containing the weights (T elts)
ap_result: vector recovering the estimated parameters (P elts)

This function will estimate a set of parameters (O) by minimizing the weighted residual sum of squares (WRSS) difference between the data and the model function Ô = [ X'*W*X + t.Rw ]-1 [ X'*W*y ]

  • [ X'*W*X + t.Rw ]-1 [ t.Rw*Rm ] y = data vector X = model matrix W = weights vector t = Ridge constant Rw= Ridge weights Rm= Ridge means
Returns
0 if success, other value otherwise.

Definition at line 1376 of file i1TCModel.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowHelp()

void i1TCModel::ShowHelp ( )
virtual

Print out specific help about the implementation of the model model and its initialization.

Implements vDynamicModel.

Definition at line 201 of file i1TCModel.cc.

◆ Trapz()

int i1TCModel::Trapz ( FLTNB ap_tac,
FLTNB ap_citac 
)
private

return integral for each time point t (WPO_S), and cumulative integral (cumWPO_S )

Parameters
ap_tac: vector with nb time frames elements containing the time activity curve from which integral will be computed
ap_citac: (returned) vector with nb time frames elements recovering the cumulative integral for each time point t
Returns
0 if success, positive value otherwise

Definition at line 1990 of file i1TCModel.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WPO()

int i1TCModel::WPO ( FLTNB ap_tac,
FLTNB ap_citac,
int  a_th 
)
private

return integral for each time point t (WPO_S), and cumulative integral (cumWPO_S )

Parameters
ap_tac: vector with nb time frames elements containing the time activity curve from which integral will be computed
ap_citac: (returned) vector with nb time frames elements recovering the cumulative integral for each time point t
a_th: thread index
Returns
0 if success, positive value otherwise

Definition at line 1920 of file i1TCModel.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WPOinc()

FLTNB i1TCModel::WPOinc ( uint32_t  a_time,
FLTNB  tac,
FLTNB  b_tac,
FLTNB  bb_tac,
FLTNB  n_tac 
)
private

Estimate the next integration value for a specific time point of a tac using WPO.

Parameters
a_time: time point for which the integral will be computed
tac: tac value at time t
b_tac: tac value at time t-1
bb_tac: tac value at time t-2
n_tac: tac value at time t+1
Returns
The estimated value of the integral for this time point

Definition at line 1846 of file i1TCModel.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m2p_ct

FLTNB** i1TCModel::m2p_ct
protected

Vector containing voxel TACs (multithreaded)

Definition at line 287 of file i1TCModel.hh.

◆ m2p_cti

FLTNB** i1TCModel::m2p_cti
protected

Vector containing the integral of voxel TACs (multithreaded)

Definition at line 288 of file i1TCModel.hh.

◆ m2p_nnlsB

FLTNB** i1TCModel::m2p_nnlsB
protected

1D vector for NNLS estimation, containing the solution (multithreaded)

Definition at line 291 of file i1TCModel.hh.

◆ m2p_nnlsMat

FLTNB** i1TCModel::m2p_nnlsMat
protected

1D working vector for NNLS estimation (multithreaded)

Definition at line 292 of file i1TCModel.hh.

◆ m2p_wpoBD

FLTNB** i1TCModel::m2p_wpoBD
protected

Definition at line 306 of file i1TCModel.hh.

◆ m2p_wpoFD

FLTNB** i1TCModel::m2p_wpoFD
protected

Definition at line 305 of file i1TCModel.hh.

◆ m2p_wpoP

FLTNB** i1TCModel::m2p_wpoP
protected

Definition at line 304 of file i1TCModel.hh.

◆ m3p_nnlsA

FLTNB*** i1TCModel::m3p_nnlsA
protected

2D coefficient matrix for NNLS estimation (multithreaded)

Definition at line 290 of file i1TCModel.hh.

◆ m_intMethodFlag

bool i1TCModel::m_intMethodFlag
protected

Flag indicating the method for TACs integral computation (default=true)

Definition at line 307 of file i1TCModel.hh.

◆ m_nnlsN

uint16_t i1TCModel::m_nnlsN =3
protected

Number of parameters in NNLS/LS estimation

Definition at line 293 of file i1TCModel.hh.

◆ m_OptimisationMethodFlag

int i1TCModel::m_OptimisationMethodFlag
protected

Flag containing the optimization method

Definition at line 285 of file i1TCModel.hh.

◆ m_ridgeRegressionFlag

bool i1TCModel::m_ridgeRegressionFlag
protected

Flag indicating if ridge regression is enabled (default=false)

Definition at line 298 of file i1TCModel.hh.

◆ m_RRcst

FLTNB i1TCModel::m_RRcst
protected

Regularization parameter for ridge regression

Definition at line 297 of file i1TCModel.hh.

◆ m_savePImgFlag

bool i1TCModel::m_savePImgFlag
protected

Flag indicating if parametric images should be written on disk (default=true)

Definition at line 284 of file i1TCModel.hh.

◆ mp_DT2

FLTNB* i1TCModel::mp_DT2
protected

Vector containing the half frame time duration (for integral computation)

Definition at line 300 of file i1TCModel.hh.

◆ mp_LSden

oMatrix** i1TCModel::mp_LSden
protected

Matrix for computation (th)

Definition at line 315 of file i1TCModel.hh.

◆ mp_LSnum

oMatrix** i1TCModel::mp_LSnum
protected

Matrix for computation (th)

Definition at line 314 of file i1TCModel.hh.

◆ mp_parLowerBounds

FLTNB* i1TCModel::mp_parLowerBounds
protected

Vector containing parameters lower bound

Definition at line 296 of file i1TCModel.hh.

◆ mp_parUpperBounds

FLTNB* i1TCModel::mp_parUpperBounds
protected

Vector containing parameters upper bound

Definition at line 295 of file i1TCModel.hh.

◆ mp_RRm

oMatrix* i1TCModel::mp_RRm
protected

Ridge means

Definition at line 319 of file i1TCModel.hh.

◆ mp_RRnum

oMatrix** i1TCModel::mp_RRnum
protected

Ridge numerator for computation (th)

Definition at line 321 of file i1TCModel.hh.

◆ mp_RRw

oMatrix* i1TCModel::mp_RRw
protected

Ridge weights

Definition at line 320 of file i1TCModel.hh.

◆ mp_Theta

oMatrix** i1TCModel::mp_Theta
protected

Estimated parameters Matrix (th)

Definition at line 316 of file i1TCModel.hh.

◆ mp_VaImage

FLTNB* i1TCModel::mp_VaImage
protected

Optional input image containing the blood volume

Definition at line 323 of file i1TCModel.hh.

◆ mp_w

FLTNB* i1TCModel::mp_w
protected

Vector containing the weights for NNLS estimation

Definition at line 289 of file i1TCModel.hh.

◆ mp_wpoA

FLTNB* i1TCModel::mp_wpoA
protected

Definition at line 303 of file i1TCModel.hh.

◆ mp_wpoQ

FLTNB* i1TCModel::mp_wpoQ
protected

Definition at line 302 of file i1TCModel.hh.

◆ mp_X

oMatrix** i1TCModel::mp_X
protected

Model Matrix (threaded)

Definition at line 311 of file i1TCModel.hh.

◆ mp_Xt

oMatrix** i1TCModel::mp_Xt
protected

Matrix for computation (th)

Definition at line 312 of file i1TCModel.hh.

◆ mp_XtX

oMatrix** i1TCModel::mp_XtX
protected

Matrix for computation (th)

Definition at line 313 of file i1TCModel.hh.

◆ mp_Y

oMatrix** i1TCModel::mp_Y
protected

Data Matrix (threaded)

Definition at line 310 of file i1TCModel.hh.


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