141 cout <<
"-- This class implements a general linear dynamic model applied between the images of a dynamic acquisition." << endl;
142 cout <<
"-- The model is applied on a voxel-by-voxel basis between the images of the frames and/or respiratory/cardiac gates. " << endl;
143 cout <<
"-- The main keywords 'DYNAMIC FRAMING', 'RESPIRATORY GATING' and 'CARDIAC GATING' ahead of the parameters allow to define at which level the model parameters must be applied. " << endl;
144 cout <<
"-- Main parameters to define are:" << endl;
145 cout <<
" -> The number of basis functions / parametric images defined in the model" << endl;
146 cout <<
" -> Basis function initial values" << endl;
147 cout <<
" -> Parametric images initialization (optional)" << endl;
148 cout <<
" -> Optimisation_method : x (mandatory) optimization method for voxelwise parameters estimation." << endl;
150 cout <<
" It can be initialized using a configuration text file with the following keywords and information :" << endl;
151 cout <<
" - Mandatory keywords :" << endl;
152 cout <<
" The following keywords are mandatory for at least one dynamic image level (Dynamic frame, Respiratory gating or Cardiac gating) :" << endl;
153 cout <<
" 'Number_basis_functions:' Enter the number of basis function for each image of time frame or respiratory/cardiac gate " << endl;
154 cout <<
" 'Basis_functions:' Enter the basis function (bf) coefficients for each image (im) of time frame or respiratory/cardiac gate " << endl;
155 cout <<
" on successive lines, separated by ',' :" << endl;
156 cout <<
" -> basis_functions: " << endl;
157 cout <<
" -> coeff_bf1_im1,coeff_bf1_im2,...,coeff_bf1_imn" << endl;
158 cout <<
" -> coeff_bf2_im1,coeff_bf2_im2,...,coeff_bf2_imn" << endl;
159 cout <<
" -> etc..." << endl;
160 cout <<
" Optimisation_method : x (mandatory) optimization method available options: " << endl;
161 cout <<
" x=0: Direct ( Implementation of basis functions side by system matrix in each tomographic iterative loop " << endl;
162 cout <<
" (! Currently not compatible with motion correction)" << endl;
163 cout <<
" x=1: Nested EM " << endl;
164 cout <<
" x=2: Iterative non-negative Least-Square " << endl;
165 cout <<
" (C.L. Lawson and R.J. Hanson, Solving Least Squares Problems)" << endl;
167 cout <<
" - Optional keywords :" << endl;
168 cout <<
" 'Parametric_image_init: image_file' Set an image file to initialize the parametric images of each dynamic model. Default initialization: '1.0 for each voxel." << endl;
170 cout <<
" 'Number_weight_values:' Enter the number of weights to be applied for each dynamic frame for performing WLS optimisation (Optimisation method=2) " << endl;
171 cout <<
" 'Weight_values:' Enter the weight values to be applied for each dynamic frame ( within DYNAMIC FRAMING/ENDDF) " << endl;
172 cout <<
" on one single line, separated by ',' " << endl;
173 cout <<
" The previous parameters must be declared inside the couple of the following specific tags: " << endl;
174 cout <<
" - DYNAMIC FRAMING/ENDDF for chronological frame model (dynamic model applied to chronological frames of a dynamic aquisition)" << endl;
175 cout <<
" - RESPIRATORY GATING/ENDRG for respiratory model (dynamic model applied to respiratory gates of a dynamic aquisition)" << endl;
176 cout <<
" - CARDIAC GATING/ENDCG for cardiac model (dynamic model applied to cardiac gates of a dynamic aquisition)" << endl;
177 cout <<
" Different levels of dynamic model can be enabled simultaneously (i.e a dynamic frame model can be used simultaneously with respiratory and/or cardiac gating model) " << endl;
180 cout <<
" The following keywords are optional and common to each dynamic model (Dynamic frame, Respiratory gating or Cardiac gating) :" << endl;
181 cout <<
" 'Number_model_iterations: x' Number of iterations of the model parameters and basis functions updates in one cycle of Nested EM" << endl;
182 cout <<
" (Default x == 1) (one cycle consists in x iterations in which either the parametric images or the basis functions are updated) " << endl;
183 cout <<
" The ratio of parametric images / basis functions updates depends on the following parameter:" << endl;
184 cout <<
" 'Basis_function_update_ratio: x' Ratio of update between parametric images and basis functions updates cycle " << endl;
185 cout <<
" (Default x == 0) Cycles consist in x iterations of the parametric images, following by x iterations of the basis functions" << endl;
186 cout <<
" If x == 0, only the parametric images are updated" << endl;
187 cout <<
" 'Basis_function_start_ite : x' Starting iteration for the update of basis functions " << endl;
188 cout <<
" (Default x == -1) If negative, no update of the basis functions is performed (only parametric images are updated) " << endl;
191 cout <<
" ---------------------------" << endl;
192 cout <<
" Example of initialization: " << endl;
193 cout <<
" DYNAMIC FRAMING" << endl;
194 cout <<
" Number_basis_functions : 2" << endl;
195 cout <<
" Basis_functions :" << endl;
196 cout <<
" 23682.79, 25228.74, 26636.99, 27923.61, 29101.16" << endl;
197 cout <<
" 5.4, 4.91, 4.48, 4.1, 3.75" << endl;
198 cout <<
" ENDDF" << endl;
200 cout <<
" RESPIRATORY GATING" << endl;
201 cout <<
" Number_basis_functions : 6" << endl;
202 cout <<
" Basis_functions :" << endl;
203 cout <<
" 1, 0.8, 0.6, 0.4, 0.2, 0.01" << endl;
204 cout <<
" 0.7, 0.9, 0.7, 0.5, 0.3, 0.1" << endl;
205 cout <<
" 0.4, 0.6, 0.8, 0.6, 0.4, 0.2" << endl;
206 cout <<
" 0.2, 0.4, 0.6, 0.8, 0.6, 0.4" << endl;
207 cout <<
" 0.1, 0.3, 0.5, 0.7, 0.9, 0.7" << endl;
208 cout <<
" 0.01, 0.2, 0.4, 0.6, 0.8, 1" << endl;
209 cout <<
" ENDRG" << endl;
211 cout <<
" Number_model_iterations : 1" << endl;
212 cout <<
" Basis_function_start_ite : -1" << endl;
213 cout <<
" Basis_function_update_ratio : 0" << endl;
214 cout <<
" ---------------------------" << endl;
236 if(
m_verbose >=3)
Cout(
"iLinearModel::ReadAndCheckConfigurationFileSpecific ..."<< endl);
241 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecific -> Error while trying to read and check specific configuration " <<
m_fileOptions << endl);
260 if(
m_verbose >=3)
Cout(
"iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels ..."<< endl);
268 bool file_is_good =
false;
270 string line=
"", kword_to_search=
"";
271 while(!in_file.eof())
273 getline(in_file, line);
276 if (line.find(
"#") != string::npos) line = line.substr(0, line.find_first_of(
"#")) ;
278 if (line.find(
"DYNAMIC FRAMING") != string::npos)
280 if(kword_to_search !=
"")
282 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error, found an end tag 'END**' before 'DYNAMIC FRAMING' in configuration file: " <<
m_fileOptions << endl);
286 kword_to_search =
"ENDDF";
289 else if (line.find(
"RESPIRATORY GATING") != string::npos)
291 if(kword_to_search !=
"")
293 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error, found an end tag 'END**' before 'RESPIRATORY GATING' in configuration file: " <<
m_fileOptions << endl);
297 kword_to_search =
"ENDRG";
300 else if (line.find(
"CARDIAC GATING") != string::npos)
302 if(kword_to_search !=
"")
304 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error, found an end tag 'END**' before 'CARDIAC GATING' in configuration file: " <<
m_fileOptions << endl);
308 kword_to_search =
"ENDCG";
311 else if (kword_to_search !=
"" 312 && line.find(kword_to_search) != string::npos)
314 kword_to_search =
"";
321 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error, no mandatory tags ('DYNAMIC FRAMING'/'ENDDF', 'RESPIRATORY GATING'/'ENDRG', 'CARDIAC GATING'/'ENDCG' detected in configuration file: " 328 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Number_basis_functions' flag in " <<
m_fileOptions << endl);
334 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Number_basis_functions' flag in " <<
m_fileOptions << endl);
340 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Number_basis_functions' flag in " <<
m_fileOptions << endl);
346 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Number_basis_functions' flag in " <<
m_fileOptions << endl);
352 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Number_model_iterations' flag in " <<
m_fileOptions << endl);
358 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Basis_function_start_ite' flag in " <<
m_fileOptions << endl);
364 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Basis_function_update_ratio' flag in " <<
m_fileOptions << endl);
370 Cerr(
"***** ***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Optimisation_method' keyword in " <<
m_fileOptions << endl);
378 Cout(
"iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels() -> Selected optimization method : NNLS (2)" << endl);
380 Cout(
"iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels() -> Selected optimization method : Nested-EM (1)" << endl);
382 Cout(
"iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels() -> Selected optimization method : Direct Dynamic (0)" << endl);
387 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read configuration file at: " <<
m_fileOptions << endl);
415 if(
m_verbose >=3)
Cout(
"iLinearModel::ReadAndCheckOptionsList ..."<< endl);
422 Cerr(
"***** iLinearModel::ReadAndCheckOptionsList() -> Initialization with command line options is not implemented for this class. Please use a configuration file instead" << endl);
448 Cerr(
"***** iLinearModel::CheckSpecificParameters -> A problem occurred while checking specific parameters ! " << endl);
472 if(
m_verbose >=2)
Cout(
"iLinearModel::CheckSpecificParametersForAllLinearModels ..."<< endl);
477 Cerr(
"***** iLinearModel::CheckSpecificParametersForAllLinearModels() -> Error, the variables corresponding to the number of basis function has not been initialized. There might be an error in the configuration process/file !" << endl);
493 Cerr(
"***** iLinearModel::CheckSpecificParametersForAllLinearModels() -> Error, the number of weight factors doesn't match the number of input frames. There might be an error in the configuration process/file !" << endl);
502 Cerr(
"***** iLinearModel::CheckSpecificParametersForAllLinearModels -> Either a file or a list of options have to be selected to initialize the model, but not both ! " << endl);
509 Cerr(
"***** iLinearModel::CheckSpecificParametersForAllLinearModels -> Either a file or a list of options should have been provided at this point ! " << endl);
516 Cerr(
"***** iLinearModel::CheckSpecificParametersForAllLinearModels -> Optimization method Linear Regression (=3) only available when using two time basis functions ! " << endl);
523 Cerr(
"***** iLinearModel::CheckSpecificParametersForAllLinearModels -> Optimization method 'Direct' (=0) only available when using castor-recon ! " << endl);
544 if(
m_verbose >=2)
Cout(
"iLinearModel::InitializeSpecificToAllLinearModels ..."<< endl);
549 Cerr(
"***** iLinearModel::InitializeSpecificToAllLinearModels() -> Must call CheckParameters functions before Initialize() !" << endl);
693 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read frame basis functions coefficients !" << endl);
694 Cerr(
" 'Basis_functions' keyword inside DYNAMIC FRAMING / ENDDF paragraph in " <<
m_fileOptions << endl);
706 "RESPIRATORY GATING",
709 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read respiratory gates basis functions coefficients !" << endl);
710 Cerr(
" 'Basis_functions' keyword inside RESPIRATORY GATING / ENDRG paragraph in " <<
m_fileOptions << endl);
725 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read cardiac gates basis functions coefficients !" << endl);
726 Cerr(
" 'Basis_functions' keyword inside CARDIAC GATING / ENDCG paragraph in " <<
m_fileOptions << endl);
732 "Optimisation_method",
737 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read 'Optimisation_method' keyword in " <<
m_fileOptions << endl);
752 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read frame weight factor coefficients !" << endl);
753 Cerr(
" 'Weight_values' keyword inside DYNAMIC FRAMING / ENDDF paragraph in " <<
m_fileOptions << endl);
761 string input_image =
"";
762 int return_value = 0;
765 "Parametric_images_init",
772 if( return_value == 0)
782 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read the provided initialization parametric images : " << input_image << endl);
786 else if( return_value == 1)
788 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read dynamic frame model parametric images !" << endl);
806 "Parametric_images_init",
810 "RESPIRATORY GATING",
813 if( return_value == 0)
823 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read the provided initialization parametric images : " << input_image << endl);
827 else if( return_value == 1)
829 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read respiratory gate model parametric images !" << endl);
848 "Parametric_images_init",
855 if( return_value == 0)
865 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read the provided initialization parametric images : " << input_image << endl);
869 else if( return_value == 1)
871 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read cardiac gate model parametric images !" << endl);
886 Cerr(
"***** iLinearModel::Initialize() -> Error while trying to read configuration file at: " <<
m_fileOptions << endl);
897 Cerr(
"***** iLinearModel::CheckSpecificParametersForAllLinearModels() -> Error, negative weight factors found. Only positive non-zero factors allowed !" << endl);
900 if(
m_verbose >=4)
Cout(
"iLinearModel::NNLS optimisation weight for frame: "<< t <<
" set at "<<
mp_w[t]<< endl);
947 Cout(
"***** iLinearModel::InitializeSpecificToAllLinearModels() -> Time Basis Function coefficients :" << endl);
951 Cout(
"Basis function["<<b+1<<
"] : ");
975 if(
m_verbose >=2)
Cout(
"iLinearModel::InitializeSpecific ..."<< endl);
980 Cerr(
"***** oDynamicModelManager::InitializeSpecific() -> Must call CheckParameters functions before Initialize() !" << endl);
987 Cerr(
"***** iLinearModel::InitializeSpecific() -> Error while performing generic initialisations for linear models !" << endl);
1018 Cerr(
"***** iLinearModel::EstimateModelParameters() -> Called while not initialized !" << endl);
1030 Cerr(
"***** iLinearModel::EstimateModelParameters() -> An error occured while using the nested EM parametric image estimation method !" << endl);
1037 Cout(
"iLinearModel::EstimateModelParameters() -> Skipping nested calculation, not required for direct method " << endl);
1045 Cerr(
"***** iLinearModel::EstimateModelParameters() -> An error occured while using the Patlak LS Estimation Method !" << endl);
1054 Cerr(
"***** iLinearModel::EstimateModelParameters() -> An error occured while using the Least-Squares linear regression Estimation Method !" << endl);
1061 Cerr(
"***** iLinearModel::EstimateModelParameters() -> Error : unknown method to estimate images ! !" << endl);
1075 Cout(
"iLinearModel::EstimateModelParameters() -> Frame parametric image["<<fb<<
"] avg value:" << avg << endl);
1096 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() ..." <<endl);
1100 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() cycle "<< it+1 <<
"/" << m_nbLinearModelCycles <<endl);
1106 #pragma omp parallel for private(v) schedule(static, 1) 1156 FLTNB parametric_image_norm = 0;
1160 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() -> Estimate Basis Functions - Frame basis functions estimation step" <<endl);
1165 parametric_image_norm = 0;
1191 #pragma omp parallel for private(v) schedule(static, 1) 1200 th = omp_get_thread_num();
1206 * m2p_CGParametricImages[cb][v];
1224 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() -> Estimate Basis Functions - Respiratory gate basis functions estimation step" <<endl);
1229 parametric_image_norm = 0;
1254 #pragma omp parallel for private(v) schedule(static, 1) 1263 th = omp_get_thread_num();
1268 * m2p_CGParametricImages[cb][v];
1287 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() -> Estimate Basis Functions - Cardiac gate basis functions estimation step" <<endl);
1292 parametric_image_norm = 0;
1317 #pragma omp parallel for private(v) schedule(static, 1) 1326 th = omp_get_thread_num();
1331 * m2p_CGParametricImages[cb][v];
1358 Cout(
"iLinearModel::NestedEM() -> Basis function ["<<rb<<
"] coefficients for resp gate ["<<rg<<
"] :" <<
m2p_respBasisFunctions[rb][rg] << endl);
1362 Cout(
"iLinearModel::NestedEM() -> Basis function ["<<cb<<
"] coefficients for card gate ["<<cg<<
"] :" <<
m2p_cardBasisFunctions[cb][cg] << endl);
1372 FLTNB basis_functions_norm = 0.;
1377 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() -> Estimate Coefficients - Frame coeffs estimation step" <<endl);
1385 basis_functions_norm = 0.;
1399 #pragma omp parallel for private(v) schedule(static, 1) 1429 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() -> Estimate Coefficients - Respiratory Gate coeffs estimation step" <<endl);
1437 basis_functions_norm = 0.;
1450 #pragma omp parallel for private(v) schedule(static, 1) 1480 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() -> Estimate Coefficients - Cardiac Gate coeffs estimation step" <<endl);
1488 basis_functions_norm = 0.;
1501 #pragma omp parallel for private(v) schedule(static, 1) 1541 Cout(
"iLinearModel::NestedEM() -> Frame parametric image["<<fb<<
"] avg value:" << avg << endl);
1554 Cout(
"iLinearModel::NestedEM() -> Resp gate parametric image["<<rb<<
"] avg value:" << avg << endl);
1567 Cout(
"iLinearModel::NestedEM() -> Card gate parametric image["<<cb<<
"] avg value:" << avg << endl);
1593 if(
m_verbose >=3)
Cout(
"iLinearModel::EstimateParametersWithNNLS() ..." <<endl);
1598 if(
m_verbose >=3)
Cout(
"iLinearModel::EstimateParametersWithNNLS() -> Estimate Coefficients - Frame coeffs estimation step" <<endl);
1604 #pragma omp parallel for private(v) schedule(guided) 1613 th = omp_get_thread_num();
1619 FLTNB *p_nnls_zz=NULL;
1629 p_nnls_B[ t ]=ap_ImageS->
m4p_image[ t ][ rg ][ cg ][ v ] *
mp_w[ t ];
1657 if(
m_verbose >=3)
Cout(
"iLinearModel::EstimateParametersWithNNLS() -> Estimate Coefficients - Respiratory Gate coeffs estimation step" <<endl);
1663 #pragma omp parallel for private(v) schedule(guided) 1672 th = omp_get_thread_num();
1678 FLTNB *p_nnls_zz=NULL;
1688 p_nnls_B[ rg ]=ap_ImageS->
m4p_image[ fr ][ rg ][ cg ][ v ];
1716 if(
m_verbose >=3)
Cout(
"iLinearModel::EstimateParametersWithNNLS() -> Estimate Coefficients - Cardiac Gate coeffs estimation step" <<endl);
1722 #pragma omp parallel for private(v) schedule(guided) 1731 th = omp_get_thread_num();
1737 FLTNB *p_nnls_zz=NULL;
1747 p_nnls_B[ cg ]=ap_ImageS->
m4p_image[ fr ][ rg ][ cg ][ v ];
1784 Cout(
"iLinearModel::EstimateParametersWithNNLS() -> Frame parametric image["<<fb<<
"] avg value:" << avg << endl);
1797 Cout(
"iLinearModel::EstimateParametersWithNNLS() -> Resp gate parametric image["<<rb<<
"] avg value:" << avg << endl);
1810 Cout(
"iLinearModel::EstimateParametersWithNNLS() -> Card gate parametric image["<<cb<<
"] avg value:" << avg << endl);
1832 if(
m_verbose >=3)
Cout(
"iLinearPatlakModel::Patlak_LS ..." <<endl);
1835 #pragma omp parallel for private(v) schedule(guided) 1867 Cov += (Xt-xmean) * (Yt-ymean);
1868 Var += (Xt-xmean) * (Xt-xmean);
1872 K = (Var != 0) ? Cov/Var : 0.;
1878 Vd = ymean - K*xmean;
1905 if(
m_verbose >= 3)
Cout(
"iLinearModel::EstimateImageWithModel ... " <<endl);
1910 Cerr(
"***** iLinearModel::EstimateImageWithModel() -> Called while not initialized !" << endl);
1916 #pragma omp parallel for private(v) schedule(static, 1) 1927 ap_ImageS->
m4p_image[fr][rg][cg][v] = 0.;
#define INTF_LERP_DISABLED
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...
Declaration of class iLinearModel.
void ShowHelp()
This function is used to print out general help about dynamic models.
int EstimateImageWithModel(oImageSpace *ap_Image, int a_ite, int a_sset)
Re-estimate image using the linear parametric images and basis functions.
oImageDimensionsAndQuantification * mp_ID
This is the mother class of dynamic model classes.
FLTNB * mp_corrBasisCoeffs
#define OPTIMISATION_METHOD_DR
int InitializeSpecificToAllLinearModels()
This function is used to initialize the parametric images and basis functions for all Linear Models...
FLTNB ** m2p_RGParametricImages
bool m_useModelInReconstruction
void ShowHelpModelSpecific()
This function is used to print out specific help about the dynamic model and its options. It is pure virtual so must be implemented by children.
int ReadAndCheckOptionsList(string a_listOptions)
This function is used to read parameters from a string.
iLinearModel()
Constructor of iLinearModel. Simply set all data members to default values.
void ShowBasisFunctions()
This function is used to print the basis functions.
FLTNB ****** m6p_backwardImage
FLTNB * mp_corrBasisFunctions
FLTNB ** m2p_outputParImages
int CheckSpecificParametersForAllLinearModels()
This function is used to check parameters for all Linear Models. .
FLTNB ** m2p_CGParametricImages
int ReadDataASCIIFile(const string &a_file, const string &a_keyword, T *ap_return, int a_nbElts, bool a_mandatoryFlag)
Look for "a_nbElts" elts in the "a_file" file matching the "a_keyword" string passed as parameter a...
virtual int ReadAndCheckConfigurationFileSpecific()
This function is used to read options from a configuration file.
int EstimateParametersWithNNLS(oImageSpace *ap_ImageS, int a_ite)
Estimate parametric images using the NNLS method.
bool m_ModelSpecificBasisFunctionsRequired
FLTNB ** m2p_nestedModelTimeBasisFunctions
#define KEYWORD_MANDATORY
uint32_t m_nbLinearModelCycles
#define OPTIMISATION_METHOD_LS
int InitializeSpecific()
This function is used to initialize the parametric images and basis functions for all Linear Models...
FLTNB ** m2p_cardBasisFunctions
int m_basisFunctionsUpdIdx
int GetNbCardGates()
Get the number of cardiac gates.
FLTNB ** m2p_parametricImages
This class holds all the matrices in the image domain that can be used in the algorithm: image...
int CheckSpecificParameters()
This function is used to check whether all member variables have been correctly initialized or not...
int GetNbThreadsForImageComputation()
Get the number of threads used for image operations.
int GetNbTimeFrames()
Get the number of time frames.
INTNB GetNbVoxXYZ()
Get the total number of voxels.
~iLinearModel()
Destructor of iLinearModel.
int Patlak_LS(oImageSpace *ap_ImageS, int a_ite)
Estimate parametric images using linear regression.
#define OPTIMISATION_METHOD_NNLS
int GetNbThreadsForProjection()
Get the number of threads used for projections.
#define OPTIMISATION_METHOD_NESTEM
int m_basisFunctionsUpdRatio
int GetNbRespGates()
Get the number of respiratory gates.
FLTNB ** m2p_respBasisFunctions
int IntfReadImgDynCoeffFile(const string &a_pathToHeaderFile, FLTNB **a2p_ImgMatrix, oImageDimensionsAndQuantification *ap_ID, int a_nbFbases, int vb, bool a_lerpFlag)
Function dedicated to Interfile image reading for dynamic coefficients images.
int NestedEM(oImageSpace *ap_ImageS, int a_ite)
Estimate parametric images and basis functions (if enabled) using the nested EM method.
int m_basisFunctionsUpdStartIte
int ReadAndCheckConfigurationFileSpecificToAllLinearModels()
This function is used to read parameters that are generic for all Linear Models. ...
FLTNB * mp_blackListedvoxelsImage
int EstimateModelParameters(oImageSpace *ap_Image, int a_ite, int a_sset)
Estimate model parameters (parametric images and basis functions)