CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
iPatlakModel.cc
Go to the documentation of this file.
1 
2 /*
3  Implementation of class iPatlakModel
4 
5  - separators: X
6  - doxygen: X
7  - default initialization: none (require user inputs (Patlak basis functions), no sense to provide 'standard' configuration file as for optimizer/projector)
8  - CASTOR_DEBUG: X
9  - CASTOR_VERBOSE: X
10 */
11 
19 #include "iPatlakModel.hh"
20 
21 
22 // =====================================================================
23 // ---------------------------------------------------------------------
24 // ---------------------------------------------------------------------
25 // =====================================================================
26 /*
27  \fn iPatlakModel
28  \brief Constructor of iPatlakModel. Simply set all data members to default values.
29 */
31 {
32  m_nbTimeBF = 2; // Two basis functions in the Patlak model
33  m2p_parametricImages = NULL;
34  m2p_patlakTACs = NULL;
35 
36  m_fileOptions = "";
37  m_listOptions = "";
38 
39  m_savePImgFlag = true;
40 }
41 
42 
43 
44 
45 // =====================================================================
46 // ---------------------------------------------------------------------
47 // ---------------------------------------------------------------------
48 // =====================================================================
49 /*
50  \fn ~iPatlakModel
51  \brief Destructor of iPatlakModel
52 */
54 {
55  if(m_initialized)
56  {
57  for(int b=0 ; b<m_nbTimeBF ; b++)
58  {
59  if (m2p_patlakTACs[b]) delete m2p_patlakTACs[b];
61  }
62 
63  if (m2p_patlakTACs) delete[] m2p_patlakTACs;
65  }
66 }
67 
68 
69 
70 
71 // =====================================================================
72 // ---------------------------------------------------------------------
73 // ---------------------------------------------------------------------
74 // =====================================================================
75 /*
76  \fn ShowHelp
77  \brief Print out specific help about the implementation of the Patlak
78  model and its initialization
79 */
81 {
82  cout << "-- This class implements the Patlak Reference Tissue Model : " << endl;
83  cout << "-- Patlak CS, Blasberg RG: Graphical evaluation of blood-to-brain transfer constants from multiple-time uptake data" << endl;
84  cout << "-- J Cereb Blood Flow Metab 1985, 5(4):5 84-590." << endl;
85  cout << "-- DOI http://dx.doi.org/10.1038/jcbfm.1985.87" << endl;
86  cout << "-- It is used to model radiotracers which follows as 2-tissue compartment model with irreversible trapping " << endl;
87  cout << "-- The Patlak temporal basis functions are composed of the Patlak slope (integral of the reference TAC from the injection time " << endl;
88  cout << " divided by the instantaneous reference activity), and intercept (reference tissue TAC) " << endl;
89  cout << endl;
90  cout << " It can be initialized using either an ASCII file or a list of option with the following keywords and information :" << endl;
91  cout << " - The ASCII file must contain the following keywords :" << endl;
92  cout << " 'Patlak_functions:' (mandatory) Enter the coefficients of Patlak plot and intercept for each time frame (tf) ";
93  cout << " on two successive lines, separated by ',' :" << endl;
94  cout << " -> Patlak_functions: " << endl;
95  cout << " -> coeff_Pplot_tf1,coeff_Pplot_tf2,...,coeff_Pplot_tfn" << endl;
96  cout << " -> coeff_Pintc_tf1,coeff_Pintc_tf2,...,coeff_Pintc_tfn" << endl;
97  cout << " 'Parametric_image_init:' (optional) path to an interfile image to be used as initialization for the parametric images" << endl;
98  cout << " 'Patlak_save_images:' (optional) boolean indicating if the parametric images should be saved (1) or not (0)" << endl;
99  cout << endl;
100  cout << " - The list of options must contain the coefficients of both Patlak functions separated by commas, with the following template :" << endl;
101  cout << " coeff_Pplot_tf1,coeff_Pplot_tf2,...,coeff_Pplot_tfn,";
102  cout << " coeff_Pintc_tf1,coeff_Pintc_tf2,...,coeff_Pintc_tfn "<< endl;
103  cout << " Parametric images will be initialized with 1.0 by default " << endl;
104  cout << " The parametric images estimations will be written on disk for each iteration" << endl;
105  cout << " " << endl;
106 }
107 
108 
109 
110 
111 // =====================================================================
112 // ---------------------------------------------------------------------
113 // ---------------------------------------------------------------------
114 // =====================================================================
115 /*
116  \fn ReadAndCheckConfigurationFile
117  \param const string& a_configurationFile : ASCII file containing informations about a dynamic model
118  \brief This function is used to read options from a configuration file.
119  \return 0 if success, other value otherwise.
120 */
122 {
123  if(m_verbose >=2) Cout("iPatlakModel::ReadAndCheckConfigurationFile ..."<< endl);
124 
125  // Recover the file path here, it will be processed in the Initialize() function
126  m_fileOptions = a_fileOptions;
127 
128  ifstream in_file(a_fileOptions.c_str(), ios::in);
129 
130  if(in_file)
131  {
132  if( ReadDataASCIIFile(a_fileOptions, "Patlak_save_images", &m_savePImgFlag, 1, KEYWORD_OPTIONAL) == 1)
133  {
134  Cerr("***** iPatlakModel::ReadAndCheckConfigurationFile -> Error while trying to read 'Patlak_save_images' flag in " << a_fileOptions << endl);
135  return 1;
136  }
137  }
138  else
139  {
140  Cerr("***** iPatlakModel::ReadAndCheckConfigurationFile -> Error while trying to read configuration file at: " << a_fileOptions << endl);
141  return 1;
142  }
143 
144  return 0;
145 }
146 
147 
148 
149 
150 // =====================================================================
151 // ---------------------------------------------------------------------
152 // ---------------------------------------------------------------------
153 // =====================================================================
154 /*
155  \fn ReadAndCheckOptionsList
156  \param const string& a_optionsList : a list of parameters separated by commas
157  \brief This function is used to read parameters from a string.
158  \return 0 if success, other value otherwise.
159 */
160 int iPatlakModel::ReadAndCheckOptionsList(string a_listOptions)
161 {
162  if(m_verbose >=2) Cout("iPatlakModel::ReadAndCheckOptionsList ..."<< endl);
163 
164  // Just recover the string here, it will be processed in the Initialize() function
165  m_listOptions = a_listOptions;
166 
167  // Normal end
168  return 0;
169 }
170 
171 
172 
173 
174 // =====================================================================
175 // ---------------------------------------------------------------------
176 // ---------------------------------------------------------------------
177 // =====================================================================
178 /*
179  \fn CheckSpecificParameters
180  \brief This function is used to check whether all member variables
181  have been correctly initialized or not.
182  \return 0 if success, positive value otherwise.
183 */
185 {
186  if(m_verbose >=2) Cout("iPatlakModel::CheckSpecificParameters ..."<< endl);
187 
188  // Check image dimensions
189  if (mp_ID==NULL)
190  {
191  Cerr("***** iPatlakModel::CheckParameters() -> ImageDimensions object has not been provided !" << endl);
192  return 1;
193  }
194 
195  // Check number time basis functions
196  if (m_nbTimeBF<0)
197  {
198  Cerr("***** iPatlakModel::CheckParameters() -> Wrong number of time frame basis functions !" << endl);
199  return 1;
200  }
201 
202  // Check if we have somehow both a file and a list of options for init...
203  if(m_listOptions != "" && m_fileOptions != "")
204  {
205  Cerr("***** iPatlakModel::Initialize -> Either a file or a list of options have to be selected to initialize the model, but not both ! " << endl);
206  return 1;
207  }
208 
209  // Check if we have no file not list of options for some reason...
210  if(m_listOptions == "" && m_fileOptions == "")
211  {
212  Cerr("***** iPatlakModel::Initialize -> Either a file or a list of options should have been provided at this point ! " << endl);
213  return 1;
214  }
215 
216  // Check if we reconstruct gated data. Throw warning if it is the case
217  if(mp_ID->GetNbRespGates()>1 || mp_ID->GetNbCardGates()>1)
218  {
219  Cerr("***** iPatlakModel::Initialize -> WARNING : the implemented Patlak model should not be used with gated reconstruction (parametric images will be the same for each gate)! " << endl);
220  //return 1;
221  }
222 
223 
224  // Normal end
225  return 0;
226 }
227 
228 
229 
230 
231 // =====================================================================
232 // ---------------------------------------------------------------------
233 // ---------------------------------------------------------------------
234 // =====================================================================
235 /*
236  \fn Initialize
237  \brief This function is used to initialize Patlak parametric images and basis functions
238  \return 0 if success, other value otherwise.
239 */
241 {
242  if(m_verbose >=2) Cout("iPatlakModel::Initialize ..."<< endl);
243 
244  // Forbid initialization without check
245  if (!m_checked)
246  {
247  Cerr("***** oDynamicModelManager::Initialize() -> Must call CheckParameters functions before Initialize() !" << endl);
248  return 1;
249  }
250 
251  // --- Memory Allocation --- //
252 
253  // Allocate memory for Parametric images and functions of Patlak model
256 
257  for(int b=0 ; b<m_nbTimeBF ; b++)
258  {
261  }
262 
263 
264  // --- Data Initialization with a configuration file --- //
265 
266  if(m_fileOptions != "")
267  {
268  ifstream in_file(m_fileOptions.c_str(), ios::in);
269 
270  if(in_file)
271  {
272  // Patlak basis functions Initialization
274  "Patlak_functions",
277  m_nbTimeBF,
279  {
280  Cerr("***** iPatlakModel::Initialize -> Error while trying to read Patlak functions coefficients !" << endl);
281  Cerr(" 'Patlak_functions' keyword in " << m_fileOptions << endl);
282  return 1;
283  }
284 
285  // Patlak Parametric images initialization
286  string input_image = "";
287  int return_value = 0;
288 
289  return_value = ReadDataASCIIFile(m_fileOptions,
290  "Parametric_images_init",
291  &input_image,
292  1,
294 
295  if( return_value == 0) // Image have been provided
296  {
297  // Read image // INTF_LERP_DISABLED = interpolation disabled for input image reading
298  if( IntfReadImgDynCoeffFile(input_image,
300  mp_ID,
301  m_nbTimeBF,
302  m_verbose,
303  INTF_LERP_DISABLED) ) // Image have been provided
304  {
305  Cerr("***** iPatlakModel::Initialize -> Error while trying to read the provided initialization parametric images : " << input_image << endl);
306  return 1;
307  }
308 
309  //normal end
310  return 0;
311  }
312  else if( return_value == 1) // Error during reading
313  {
314  Cerr("***** iPatlakModel::Initialize -> Error while trying to read Patlak functions coefficients !" << endl);
315  Cerr(" 'Parametric_image_init' keyword in " << m_fileOptions << endl);
316  return 1;
317  }
318  else //(return_value >= 1 ) // Keyword not found : no initialization provided
319  {
320  // Standard initialization
321  for(int b=0 ; b<m_nbTimeBF ; b++)
322  for(int v=0 ; v<mp_ID->GetNbVoxXYZ() ; v++)
323  m2p_parametricImages[b][v] = 1.;
324  }
325 
326  }
327 
328  else
329  {
330  Cerr("***** iPatlakModel::Initialize() -> Error while trying to read configuration file at: " << m_fileOptions << endl);
331  return 1;
332  }
333  }
334 
335 
336  // --- Data Initialization with a list of options --- //
337 
338  if(m_listOptions != "")
339  {
340  // We expect here the coefficients of the Patlak functions for each time point
341  // Patlak slope before Patlak intercept
342 
343  // Allocate memory to recover the elements in one tmp vector
344  FLTNB *p_coeffs = new FLTNB[m_nbTimeBF * mp_ID->GetNbTimeFrames()];
345 
346  // Read them
348  p_coeffs,
349  m_nbTimeBF * mp_ID->GetNbTimeFrames(),
350  ",",
351  "Patlak model configuration"))
352  {
353  Cerr("***** iPatlakModel::Initialize() -> Failed to correctly read the list of parameters in command-line options !" << endl);
354  return 1;
355  }
356 
357  // Affect coeffs
358  for(int c=0 ; c<m_nbTimeBF * mp_ID->GetNbTimeFrames() ; c++)
359  {
360  int bf = int(c/mp_ID->GetNbTimeFrames()); // Patlak basis function index
361  int fr = int(c%mp_ID->GetNbTimeFrames()); // Frame index
362  m2p_patlakTACs[bf][fr] = p_coeffs[c];
363  }
364 
365  // Delete the tmp vector
366  delete[] p_coeffs;
367 
368 
369  // Standard initialization for the parametric images
370  for(int b=0 ; b<m_nbTimeBF ; b++)
371  for(int v=0 ; v<mp_ID->GetNbVoxXYZ() ; v++)
372  m2p_parametricImages[b][v] = 1.;
373  }
374 
375  // Display Patlak TACs
376  if(m_verbose >=2)
377  {
378  Cout("iPatlakModel::Initialize() -> Patlak Normalized Time TAC coefficients :" << endl);
379  Cout(" ");
380  for(int fr=0 ; fr<mp_ID->GetNbTimeFrames() ; fr++)
381  Cout(m2p_patlakTACs[0][fr] << ", ");
382  Cout(endl);
383  Cout("iPatlakModel::Initialize() -> Patlak Reference Time TAC coefficients :" << endl);
384  Cout(" ");
385  for(int fr=0 ; fr<mp_ID->GetNbTimeFrames() ; fr++)
386  Cout(m2p_patlakTACs[1][fr] << ", ");
387  Cout(endl);
388  }
389 
390  // Normal end
391  m_initialized = true;
392  return 0;
393 }
394 
395 
396 
397 
398 // =====================================================================
399 // ---------------------------------------------------------------------
400 // ---------------------------------------------------------------------
401 // =====================================================================
402 /*
403  \fn EstimateModelParameters
404  \param ap_ImageS : pointer to the ImageSpace
405  \param a_ite : index of the actual iteration (not used)
406  \param a_sset : index of the actual subset (not used)
407  \brief Estimate Patlak parametric images
408  \return 0 if success, other value otherwise.
409 */
410 int iPatlakModel::EstimateModelParameters(oImageSpace* ap_ImageS, int a_ite, int a_sset)
411 {
412  if(m_verbose >=2) Cout("iPatlakModel::EstimateModelParameters ..." <<endl);
413 
414  #ifdef CASTOR_DEBUG
415  if (!m_initialized)
416  {
417  Cerr("***** iPatlakModel::EstimateModelParameters() -> Called while not initialized !" << endl);
418  Exit(EXIT_DEBUG);
419  }
420  #endif
421 
422  // Generate estimated image from coefficients and basis functions
423  // (We use the backward image which is useless at this point, as temporary image
424  // to estimate the image generated using the current estimation of the Patlak parametric images)
425  for (int fr=0 ; fr<mp_ID->GetNbTimeFrames() ; fr++)
426  for (int rg=0 ; rg<mp_ID->GetNbRespGates() ; rg++)
427  for (int cg=0 ; cg<mp_ID->GetNbCardGates() ; cg++)
428  for (int v=0 ; v<mp_ID->GetNbVoxXYZ() ; v++)
429  {
430  // Reset this voxel to 0
431  ap_ImageS->m6p_backwardImage[0][0][fr][rg][cg][v] = 0;
432 
433  // Retrieve current estimation of image according to the current value of Patlak parametric images and basis functions
434  // C(fr,v) = Patlak Parametric(v) * normalized time(fr) +
435  // Patlak Intercept(v) * Reference tissue TAC(fr)
436  for (int b=0 ; b<m_nbTimeBF ; b++)
437  ap_ImageS->m6p_backwardImage[0][0][fr][rg][cg][v] += m2p_patlakTACs[b][fr] * m2p_parametricImages[b][v];
438  }
439 
440  // Get correction images using the ratio of the current estimation of the image (m4p_image)
441  // and the image generated with the combination of Patlak functions and parametric images (stored in ap_Image->m6p_backwardImage)
442  // (Again, use backward image as temporary image to get the result)
443  for (int fr=0 ; fr<mp_ID->GetNbTimeFrames() ; fr++)
444  for (int rg=0 ; rg<mp_ID->GetNbRespGates() ; rg++)
445  for (int cg=0 ; cg<mp_ID->GetNbCardGates() ; cg++)
446  for (int v=0 ; v<mp_ID->GetNbVoxXYZ() ; v++)
447  ap_ImageS->m6p_backwardImage[0][0][fr][rg][cg][v] = ap_ImageS->m4p_image[fr][rg][cg][v] / ap_ImageS->m6p_backwardImage[0][0][fr][rg][cg][v];
448 
449 
450  // Loop on the 2 Patlak parametric images
451  for (int b=0 ; b<m_nbTimeBF ; b++)
452  {
453  double temporal_basis_functions_norm = 0;
454 
455  // Compute normalization related to the temporal basis functions.
456  for (int fr=0 ; fr<mp_ID->GetNbTimeFrames() ; fr++)
457  temporal_basis_functions_norm += m2p_patlakTACs[b][fr];
458 
459  // Compute voxelwise corrections for the parametric images
460  int v;
461  #pragma omp parallel for private(v) schedule(guided)
462  for (v=0 ; v<mp_ID->GetNbVoxXYZ() ; v++)
463  {
464  double corr_factor = 0.;
465 
466  // Note : We don't consider here parametric images specific to respiratory (rg) or cardiac gates (cg)
467  // The model is applied to every voxels in the image
468  for (int fr=0 ; fr<mp_ID->GetNbTimeFrames() ; fr++)
469  for (int rg=0 ; rg<mp_ID->GetNbRespGates() ; rg++)
470  for (int cg=0 ; cg<mp_ID->GetNbCardGates() ; cg++)
471  corr_factor += ap_ImageS->m6p_backwardImage[0][0][fr][rg][cg][v] * m2p_patlakTACs[b][fr];
472 
473  // Apply corrections and normalization to the vowelwise time basis functions coefficients.
474  if (corr_factor > 0.)
475  m2p_parametricImages[b][v] *= corr_factor/temporal_basis_functions_norm;
476  }
477  }
478 
479  return 0;
480 }
481 
482 
483 
484 // =====================================================================
485 // ---------------------------------------------------------------------
486 // ---------------------------------------------------------------------
487 // =====================================================================
488 /*
489  \fn FitModel
490  \param ap_ImageS : pointer to the ImageSpace
491  \param a_ite : index of the actual iteration (not used)
492  \param a_sset : index of the actual subset (not used)
493  \brief Estimate image using Patlak parametric images and basis functions
494  \return 0 if success, other value otherwise.
495 */
496 int iPatlakModel::FitModel(oImageSpace* ap_ImageS, int a_ite, int a_sset)
497 {
498  if(m_verbose >= 2) Cout("iPatlakModel::FitModel ... " <<endl);
499 
500  #ifdef CASTOR_DEBUG
501  if (!m_initialized)
502  {
503  Cerr("***** iPatlakModel::FitModel() -> Called while not initialized !" << endl);
504  Exit(EXIT_DEBUG);
505  }
506  #endif
507 
508  for (int fr=0 ; fr<mp_ID->GetNbTimeFrames() ; fr++)
509  for (int rg=0 ; rg<mp_ID->GetNbRespGates() ; rg++)
510  for (int cg=0 ; cg<mp_ID->GetNbCardGates() ; cg++)
511  for (int v=0 ; v<mp_ID->GetNbVoxXYZ() ; v++)
512  {
513  // Reset current estimated value
514  ap_ImageS->m4p_image[fr][rg][cg][v] = 0;
515 
516  // C(fr,v) = Patlak Parametric(v) * normalized time(fr) +
517  // Patlak Intercept(v) * Reference tissue TAC(fr)
518  for (int b=0 ; b<m_nbTimeBF ; b++)
519  ap_ImageS->m4p_image[fr][rg][cg][v] += m2p_parametricImages[b][v] * m2p_patlakTACs[b][fr];
520  }
521 
522  return 0;
523 }
524 
525 
526 
527 
528 
529 // =====================================================================
530 // ---------------------------------------------------------------------
531 // ---------------------------------------------------------------------
532 // =====================================================================
533 /*
534  \fn SaveParametricImages
535  \param ap_ImageS : pointer to the ImageSpace
536  \param a_ite : index of the actual iteration
537  \brief Write parametric images on disk if 'm_savePImgFlag' is enabled
538  \todo Interfile management
539  \return 0 if success, other value otherwise.
540 */
542 {
543  if(m_verbose >=2) Cout("iPatlakModel::SaveParametricImages ..." <<endl);
544 
545  if(m_savePImgFlag)
546  {
547  // Get the output manager
548  sOutputManager* p_output_manager = sOutputManager::GetInstance();
549  /*
550  for(int bimg=0 ; bimg<m_nbTimeBF ; bimg++)
551  {
552  string data_file = p_output_manager->GetPathName() + p_output_manager->GetBaseName();
553  if (a_ite >= 0) // Add a suffix for iteration
554  {
555  stringstream ss;
556  ss << a_ite;
557  data_file.append("_ite_").append(ss.str());
558  }
559 
560  // Add a suffix for (basis functions) coefficients images
561  stringstream ss;
562  ss << bimg;
563  data_file.append("_fbimg_").append(ss.str()).append(".bin");
564 
565  ofstream out_dfile;
566 
567  out_dfile.open(data_file.c_str(), ios::binary | ios::out);
568 
569  if(!out_dfile.is_open())
570  {
571  cout<<"***** iPatlakModel::SaveCoeffImages()->Failed to create output file for the dynamic image : "<< data_file.c_str() << endl;
572  return 1;
573  }
574 
575  out_dfile.write(reinterpret_cast<char*>(m2p_parametricImages[bimg]), mp_ID->GetNbVoxXYZ()*sizeof(FLTNB));
576  out_dfile.close();
577  }
578  */
579 
580  // Interfile
581  string path_to_image = p_output_manager->GetPathName() + p_output_manager->GetBaseName();
582 
583  // Add a suffix for iteration
584  if (a_ite >= 0)
585  {
586  stringstream ss; ss << a_ite + 1;
587  path_to_image.append("patlak_it").append(ss.str());
588  }
589 
590  // Write interfile parametric image
591  if(IntfWriteImgDynCoeffFile(path_to_image,
593  mp_ID,
594  m_nbTimeBF,
595  m_verbose) )
596  {
597  Cerr("***** iPatlakModel::SaveParametricImages()-> Error writing Interfile of output image !" << endl);
598  return 1;
599  }
600 
601  }
602 
603  return 0;
604 }
605 
606 
#define INTF_LERP_DISABLED
Definition: oInterfileIO.hh:75
Declaration of class iPatlakModel.
int ReadAndCheckOptionsList(string a_listOptions)
This function is used to read parameters from a string.
#define FLTNB
Definition: gVariables.hh:55
void ShowHelp()
Print out specific help about the implementation of the Patlak model and its initialization.
Definition: iPatlakModel.cc:80
int EstimateModelParameters(oImageSpace *ap_Image, int a_ite, int a_sset)
Estimate Patlak parametric images.
int FitModel(oImageSpace *ap_Image, int a_ite, int a_sset)
Estimate image using Patlak parametric images and basis functions.
oImageDimensionsAndQuantification * mp_ID
This is the mother class of dynamic model classes.
int Initialize()
This function is used to initialize Patlak parametric images and basis functions. ...
int CheckSpecificParameters()
This function is used to check whether all member variables have been correctly initialized or not...
iPatlakModel()
Constructor of iPatlakModel. Simply set all data members to default values.
Definition: iPatlakModel.cc:30
static sOutputManager * GetInstance()
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
void Exit(int code)
string m_fileOptions
#define Cerr(MESSAGE)
const string & GetPathName()
FLTNB ****** m6p_backwardImage
Definition: oImageSpace.hh:75
FLTNB **** m4p_image
Definition: oImageSpace.hh:61
Singleton class that manages output writing on disk (images, sinograms, etc). It also manages loggi...
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...
Definition: gOptions.cc:111
string m_listOptions
FLTNB ** m2p_patlakTACs
int ReadAndCheckConfigurationFile(string a_fileOptions)
This function is used to read options from a configuration file.
#define KEYWORD_MANDATORY
Definition: gOptions.hh:25
#define KEYWORD_OPTIONAL
Definition: gOptions.hh:27
int SaveParametricImages(int a_iteration)
Write parametric images on disk if 'm_savePImgFlag' is enabled.
const string & GetBaseName()
int GetNbCardGates()
Get the number of cardiac gates.
int IntfWriteImgDynCoeffFile(const string &a_pathToImg, FLTNB **a2p_ImgMatrix, oImageDimensionsAndQuantification *ap_ID, int a_nbParImgs, int vb)
Function dedicated to Interfile image writing for dynamic coefficients images.
This class holds all the matrices in the image domain that can be used in the algorithm: image...
Definition: oImageSpace.hh:41
int GetNbTimeFrames()
Get the number of time frames.
INTNB GetNbVoxXYZ()
Get the total number of voxels.
FLTNB ** m2p_parametricImages
#define EXIT_DEBUG
Definition: gVariables.hh:69
~iPatlakModel()
Destructor of iPatlakModel.
Definition: iPatlakModel.cc:53
int GetNbRespGates()
Get the number of respiratory gates.
#define Cout(MESSAGE)
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 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.
Definition: gOptions.cc:50