84 cout <<
"-- This class implements the Patlak Reference Tissue Model : " << endl;
85 cout <<
"-- Patlak CS, Blasberg RG: Graphical evaluation of blood-to-brain transfer constants from multiple-time uptake data" << endl;
86 cout <<
"-- J Cereb Blood Flow Metab 1985, 5(4):5 84-590." << endl;
87 cout <<
"-- DOI http://dx.doi.org/10.1038/jcbfm.1985.87" << endl;
88 cout <<
"-- It is used to model radiotracers which follows as 2-tissue compartment model with irreversible trapping " << endl;
89 cout <<
"-- The Patlak temporal basis functions are composed of the Patlak slope (integral of the reference TAC from the injection time " << endl;
90 cout <<
" divided by the instantaneous reference activity), and intercept (reference tissue TAC) " << endl;
92 cout <<
" It can be initialized using either an ASCII file or a list of option with the following keywords and information :" << endl;
94 cout <<
" For ASCII file options: " << endl;
95 cout <<
" As this class inherits from the iLinearModel class, the following parameters must be declared inside the couple of the following specific tags: " << endl;
96 cout <<
" - DYNAMIC FRAMING/ENDDF " << endl;
97 cout <<
" - The ASCII file must contain the following keywords :" << endl;
98 cout <<
" 'Basis_functions:' (optional) Enter the coefficients of the Patlak basis functions for each time frame (tf) " << endl;
99 cout <<
" on two successive lines, separated by ',' :" << endl;
100 cout <<
" -> Patlak_functions: " << endl;
101 cout <<
" -> coeff_Pplot_tf1,coeff_Pplot_tf2,...,coeff_Pplot_tfn" << endl;
102 cout <<
" -> coeff_Pintc_tf1,coeff_Pintc_tf2,...,coeff_Pintc_tfn" << endl;
104 cout <<
" 'AIC_input_file: path/to/file' (optional) As an alternative to direct input of the basis functions, the sampled Arterial Input Function can be given for " << endl;
105 cout <<
" estimation of the Patlak basis " << endl;
106 cout <<
" The file must contain the following information in successive lines, separated by ',' " << endl;
107 cout <<
" -> AIC_number_of_points: " << endl;
108 cout <<
" -> AIC_time_points: " << endl;
109 cout <<
" -> AIC_data_points: " << endl;
110 cout <<
" -> AIC_units: 'seconds' or 'minutes' " << endl;
112 cout <<
" 'Parametric_image_init: path' (optional) path to an interfile image to be used as initialization for the parametric images." << endl;
114 cout <<
" 'Optimisation_method:' x (mandatory) optimization method available options: " << endl;
115 cout <<
" x=0: Direct ( Implementation of basis functions side by system matrix within each tomographic iterative loop ) " << endl;
116 cout <<
" x=1: Nested EM " << endl;
117 cout <<
" x=2: Iterative non-negative Least-Square " << endl;
118 cout <<
" (C.L. Lawson and R.J. Hanson, Solving Least Squares Problems)" << endl;
119 cout <<
" x=3: Least-Squares linear regression " << endl;
121 cout <<
" For command line list of options: " << endl;
122 cout <<
" The list of options must contain the coefficients of both Patlak functions separated by commas, with the following template :" << endl;
123 cout <<
" coeff_Pplot_tf1,coeff_Pplot_tf2,...,coeff_Pplot_tfn,";
124 cout <<
" coeff_Pintc_tf1,coeff_Pintc_tf2,...,coeff_Pintc_tfn "<< endl;
125 cout <<
" Default optimization method is Nested EM "<< endl;
126 cout <<
" Parametric images will be uniformly initialized with 0.001 and 1. for Patlak slope and intercept by default " << endl;
127 cout <<
" The parametric images estimations will be written on disk for each iteration" << endl;
150 if(
m_verbose >=3)
Cout(
"iLinearPatlakModel::ReadAndCheckConfigurationFileSpecific ..."<< endl);
155 Cerr(
"***** iLinearPatlakModel::ReadAndCheckConfigurationFileSpecific -> Error while trying to read configuration file for generic options of all linear models" << endl);
176 if(
m_verbose >=3)
Cout(
"iLinearPatlakModel::ReadAndCheckOptionsList ..."<< endl);
202 Cerr(
"***** iLinearPatlakModel::CheckSpecificParameters -> A problem occurred while checking specific parameters ! " << endl);
222 if(
m_verbose >=2)
Cout(
"iLinearPatlakModel::InitializeSpecific ..."<< endl);
227 Cerr(
"***** iLinearPatlakModel::InitializeSpecific() -> Error while performing generic initialisations for linear models !" << endl);
248 "Patlak model configuration"))
250 Cerr(
"***** iPatlakModel::Initialize() -> Failed to correctly read the list of parameters in command-line options !" << endl);
269 if(
m_verbose >=2)
Cout(
"iLinearPatlakModel::Estimating Patlak basis functions ..."<< endl);
281 HPFLTNB halfDeltaT = (0.001/2);
283 a_PatlakTAC[0] = a_AICIntrpY[0] * 0.001;
285 for (uint32_t i=1 ;i<(a_frameTimeStopInMs[a_nbTimeFrames - 1]);i++)
287 RunningSum += a_AICIntrpY[i-1] ;
288 a_PatlakTAC[i] = (a_AICIntrpY[0] + 2 * RunningSum + a_AICIntrpY[i])*halfDeltaT ;
297 for (
int fr = 0; fr < a_nbTimeFrames; fr++)
301 for (uint32_t i = a_frameTimeStartInMs[fr]+1 ;i <(a_frameTimeStopInMs[fr]);i++)
303 RunningSum+=a_PatlakTAC[i];
306 2 * RunningSum + a_PatlakTAC[a_frameTimeStopInMs[fr]])*halfDeltaT) ;
311 for (
int fr = 0; fr < a_nbTimeFrames; fr++)
315 for (uint32_t i = a_frameTimeStartInMs[fr]+1; i < (a_frameTimeStopInMs[fr]); i++)
317 RunningSum += a_AICIntrpY[i];
320 2 * RunningSum + a_AICIntrpY[a_frameTimeStopInMs[fr]]) * halfDeltaT);
324 if ( a_PatlakTAC )
delete a_PatlakTAC;
oArterialInputCurve * mp_ArterialInputCurve
void ShowHelp()
This function is used to print out general help about dynamic models.
oImageDimensionsAndQuantification * mp_ID
int InitializeSpecificToAllLinearModels()
This function is used to initialize the parametric images and basis functions for all Linear Models...
int InitializeSpecific()
This function is used to initialize Patlak parametric images and basis functions. ...
This class implements a general linear dynamic model applied between the images of a dynamic acquisit...
Declaration of class iLinearPatlakModel.
void ShowBasisFunctions()
This function is used to print the basis functions.
uint32_t * GetFramesTimeStopArray(int a_bed)
int CheckSpecificParametersForAllLinearModels()
This function is used to check parameters for all Linear Models. .
int ReadAndCheckConfigurationFileSpecific()
This function is used to read options from a configuration file.
FLTNB ** m2p_nestedModelTimeBasisFunctions
uint32_t * GetFramesTimeStartsArray(int a_bed)
Get the array of frame start times for a bed in Ms at uint32_t.
FLTNB ** m2p_parametricImages
~iLinearPatlakModel()
Destructor of iLinearPatlakModel.
int GetNbTimeFrames()
Get the number of time frames.
INTNB GetNbVoxXYZ()
Get the total number of voxels.
int ReadAndCheckOptionsList(string a_listOptions)
This function is used to read parameters from a string.
void ShowHelpModelSpecific()
Print out specific help about the implementation of the Patlak model and its initialization.
#define OPTIMISATION_METHOD_NESTEM
int CheckSpecificParameters()
This function is used to check whether all member variables have been correctly initialized or not...
iLinearPatlakModel()
Constructor of iLinearPatlakModel. Simply set all data members to default values. ...
int ReadAndCheckConfigurationFileSpecificToAllLinearModels()
This function is used to read parameters that are generic for all Linear Models. ...
int ReadStringOption(const string &a_input, T *ap_return, int a_nbElts, const string &sep, const string &a_option)
Parse the 'a_input' string corresponding to the 'a_option' into 'a_nbElts' elements, using the 'sep' separator. The results are returned in the templated 'ap_return' dynamic templated array. Call "ConvertFromString()" to perform the correct conversion depending on the type of the data to convert.