CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
oOptimizerManager.cc
Go to the documentation of this file.
1 
2 /*
3  Implementation of class oOptimizerManager
4 
5  - separators: X
6  - doxygen: X
7  - default initialization: X
8  - CASTOR_DEBUG:
9  - CASTOR_VERBOSE:
10 */
11 
18 #include "oOptimizerManager.hh"
19 #include "sOutputManager.hh"
20 #include "sAddonManager.hh"
21 
22 // =====================================================================
23 // ---------------------------------------------------------------------
24 // ---------------------------------------------------------------------
25 // =====================================================================
26 
28 {
29  // Image dimensions
31  // Data mode
33  // Data type
35  // Number of TOF bins
36  m_nbTOFBins = 0;
37  // Optimizer and penalty options
38  m_optionsOptimizer = "";
39  m_optionsPenalty = "";
40  // Optimizer and penalty
41  mp_Optimizer = NULL;
42  mp_Penalty = NULL;
43  // Verbosity
44  m_verbose = 0;
45  // Optimizer FOM computation, and image update stat flags
46  m_optimizerFOMFlag = false;
48 }
49 
50 // =====================================================================
51 // ---------------------------------------------------------------------
52 // ---------------------------------------------------------------------
53 // =====================================================================
54 
56 {
57 }
58 
59 // =====================================================================
60 // ---------------------------------------------------------------------
61 // ---------------------------------------------------------------------
62 // =====================================================================
63 
65 {
66  // Check image dimensions
68  {
69  Cerr("***** oOptimizerManager::CheckParameters() -> No image dimensions provided !" << endl);
70  return 1;
71  }
72  // Check data mode
74  {
75  Cerr("***** oOptimizerManager::CheckParameters() -> No or meaningless data mode provided !" << endl);
76  return 1;
77  }
78  // Check data type
80  {
81  Cerr("***** oOptimizerManager::CheckParameters() -> No or meaningless data type provided !" << endl);
82  return 1;
83  }
84  // Check optimizer options
85  if (m_optionsOptimizer=="")
86  {
87  Cerr("***** oOptimizerManager::CheckParameters() -> No optimizer options provided !" << endl);
88  return 1;
89  }
90  // Check verbosity
91  if (m_verbose<0)
92  {
93  Cerr("***** oOptimizerManager::CheckParameters() -> Wrong verbosity level provided !" << endl);
94  return 1;
95  }
96  // Normal end
97  return 0;
98 }
99 
100 // =====================================================================
101 // ---------------------------------------------------------------------
102 // ---------------------------------------------------------------------
103 // =====================================================================
104 
106 {
107  // Verbose
108  if (m_verbose>=1) Cout("oOptimizerManager::Initialize() -> Initialize optimizer and penalty" << endl);
109 
110  // Parse projector options and initialize them
112  {
113  Cerr("***** oOptimizerManager::Initialize() -> A problem occured while parsing optimizer options and initializing it !" << endl);
114  return 1;
115  }
116 
117  // Normal end
118  return 0;
119 }
120 
121 // =====================================================================
122 // ---------------------------------------------------------------------
123 // ---------------------------------------------------------------------
124 // =====================================================================
125 
127 {
128  // ---------------------------------------------------------------------------------------------------
129  // Manage optimizer options
130  // ---------------------------------------------------------------------------------------------------
131 
132  string name_optimizer = "";
133  string list_options_optimizer = "";
134  string file_options_optimizer = "";
135 
136  // This is for the automatic initialization of the optimizer and penalty
137  typedef vOptimizer *(*maker_optimizer) ();
138 
139  // ______________________________________________________________________________
140  // Get the optimizer name in the options and isolate the real optimizer's options
141 
142  // First check emptyness of the options
143  if (m_optionsOptimizer=="")
144  {
145  Cerr("***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> No optimizer provided !" << endl);
146  return 1;
147  }
148 
149  // Search for a colon ":", this indicates that a configuration file is provided after the optimizer name
150  size_t colon = m_optionsOptimizer.find_first_of(":");
151  size_t comma = m_optionsOptimizer.find_first_of(",");
152 
153  // Case 1: we have a colon
154  if (colon!=string::npos)
155  {
156  // Get the optimizer name before the colon
157  name_optimizer = m_optionsOptimizer.substr(0,colon);
158  // Get the configuration file after the colon
159  file_options_optimizer = m_optionsOptimizer.substr(colon+1);
160  // List of options is empty
161  list_options_optimizer = "";
162  }
163  // Case 2: we have a comma
164  else if (comma!=string::npos)
165  {
166  // Get the optimizer name before the first comma
167  name_optimizer = m_optionsOptimizer.substr(0,comma);
168  // Get the list of options after the first comma
169  list_options_optimizer = m_optionsOptimizer.substr(comma+1);
170  // Configuration file is empty
171  file_options_optimizer = "";
172  }
173  // Case 3: no colon and no comma (a single optimizer name)
174  else
175  {
176  // Get the optimizer name
177  name_optimizer = m_optionsOptimizer;
178  // List of options is empty
179  list_options_optimizer = "";
180  // Build the default configuration file
181  sOutputManager* p_output_manager = sOutputManager::GetInstance();
182  file_options_optimizer = p_output_manager->GetPathToConfigDir() + "/optimizer/" + name_optimizer + ".conf";
183  }
184 
185  // ______________________________________________________________________________
186  // Construct and initialize the optimizer
187 
188  // Get optimizer's listfrom addon manager
189  std::map <string,maker_optimizer> list_optimizer = sAddonManager::GetInstance()->mp_listOfOptimizers;
190  // Create the optimizer
191  if (list_optimizer[name_optimizer]) mp_Optimizer = list_optimizer[name_optimizer]();
192  else
193  {
194  Cerr("***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> Optimizer '" << name_optimizer << "' does not exist !" << endl);
195  return 1;
196  }
197  // Set parameters
205  // Provide configuration file if any (child specific function)
206  if (file_options_optimizer!="" && mp_Optimizer->ReadConfigurationFile(file_options_optimizer))
207  {
208  Cerr("***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while reading and checking optimizer's configuration file !" << endl);
209  return 1;
210  }
211  // Provide options if any (child specific function)
212  if (list_options_optimizer!="" && mp_Optimizer->ReadOptionsList(list_options_optimizer))
213  {
214  Cerr("***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while parsing and reading optimizer's options !" << endl);
215  return 1;
216  }
217  // Check parameters (mother generic function that will call the child specific function at the end)
219  {
220  Cerr("***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while checking optimizer parameters !" << endl);
221  return 1;
222  }
223  // Initialize the optimizer (mother generic function that will call the child specific function at the end)
224  if (mp_Optimizer->Initialize())
225  {
226  Cerr("***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while initializing the optimizer !" << endl);
227  return 1;
228  }
229 
230  // ---------------------------------------------------------------------------------------------------
231  // Manage penalty options (not yet implemented, a lot of work to do)
232  // ---------------------------------------------------------------------------------------------------
233  /* Do not remove
234  string name_penalty = "";
235  string list_options_penalty = "";
236  string file_options_penalty = "";
237 
238  // This is for the automatic initialization of the penalty
239  typedef vPenalty *(*maker_penalty) ();
240 
241  // ______________________________________________________________________________
242  // Get the penalty name in the options and isolate the real penalty's options
243 
244  // If no penalty, then return now
245  if (m_optionsPenalty=="")
246  {
247  return 0;
248  }
249  // Otherwise, check if the optimizer accepts penalties
250  else
251  {
252  if (!mp_Optimizer->GetAcceptPenalty())
253  {
254  Cerr("***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> Penalty provided while the selected optimizer does not accept penalties !" << endl);
255  Cerr(" Remove penalty or change for another optimizer that accepts penalties." << endl);
256  return 1;
257  }
258  }
259 
260  // Search for a colon ":", this indicates that a configuration file is provided after the penalty name
261  colon = m_optionsPenalty.find_first_of(":");
262  comma = m_optionsPenalty.find_first_of(",");
263 
264  // Case 1: we have a colon
265  if (colon!=string::npos)
266  {
267  // Get the penalty name before the colon
268  name_penalty = m_optionsPenalty.substr(0,colon);
269  // Get the configuration file after the colon
270  file_options_penalty = m_optionsPenalty.substr(colon+1);
271  // List of options is empty
272  list_options_penalty = "";
273  }
274  // Case 2: we have a comma
275  else if (comma!=string::npos)
276  {
277  // Get the penalty name before the first comma
278  name_penalty = m_optionsPenalty.substr(0,comma);
279  // Get the list of options after the first comma
280  list_options_penalty = m_optionsPenalty.substr(comma+1);
281  // Configuration file is empty
282  file_options_penalty = "";
283  }
284  // Case 3: no colon and no comma (a single penalty name)
285  else
286  {
287  // Get the penalty name
288  name_penalty = m_optionsPenalty;
289  // List of options is empty
290  list_options_penalty = "";
291  // Build the default configuration file
292  sOutputManager* p_output_manager = sOutputManager::GetInstance();
293  file_options_penalty = p_output_manager->GetPathToConfigDir() + "/penalty/" + name_optimizer + ".conf";
294  }
295 
296  // ______________________________________________________________________________
297  // Construct and initialize the penalty
298 
299  // Get penalty's list from addon manager
300  std::map <string,maker_penalty> list_penalty = sAddonManager::GetInstance()->mp_listOfPenalties;
301  // Create the penalty
302  if (list_penalty[name_penalty]) mp_Penalty = list_penalty[name_penalty]();
303  else
304  {
305  Cerr("***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> Penalty '" << name_penalty << "' does not exist !" << endl);
306  return 1;
307  }
308  // Set parameters
309  mp_Penalty->SetImageDimensionsAndQuantification(mp_ImageDimensionsAndQuantification);
310  mp_Penalty->SetVerbose(m_verbose);
311  // Check parameters
312  if (mp_Penalty->CheckParameters())
313  {
314  Cerr("***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while checking penalty parameters !" << endl);
315  return 1;
316  }
317  // Provide configuration file if any
318  if (file_options_penalty!="" && mp_Penalty->ReadAndCheckConfigurationFile(file_options_penalty))
319  {
320  Cerr("***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while reading and checking penalty's configuration file !" << endl);
321  return 1;
322  }
323  // Provide options if any
324  if (list_options_penalty!="" && mp_Penalty->ReadAndCheckOptionsList(list_options_penalty))
325  {
326  Cerr("***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while parsing and reading penalty's options !" << endl);
327  return 1;
328  }
329  // Initialize the penalty
330  if (mp_Penalty->Initialize())
331  {
332  Cerr("***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while initializing the penalty !" << endl);
333  return 1;
334  }
335  // Check that the derivatives order of the penalty is compatible with the optimizer
336  if (mp_Penalty->GetPenaltyEnergyFunctionDerivativesOrder() != mp_Optimizer->GetPenaltyEnergyFunctionDerivativesOrder())
337  {
338  Cerr("***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> Derivatives order allowed by chosen penalty is not compatible with the order accepted by the optimizer !" << endl);
339  return 1;
340  }
341  */
342 
343  // Normal end
344  return 0;
345 }
346 
347 // =====================================================================
348 // ---------------------------------------------------------------------
349 // ---------------------------------------------------------------------
350 // =====================================================================
351 
352 int oOptimizerManager::PreDataUpdateStep(int a_iteration, int a_nbIterations, int a_subset, int a_nbSubsets)
353 {
354  // Simply call the homonymous function from the vOptimizer
355  if (mp_Optimizer->PreDataUpdateStep(a_iteration, a_nbIterations, a_subset, a_nbSubsets))
356  {
357  Cerr("***** oOptimizerManager::PreDataUpdateStep() -> A problem occured while applying the pre-data-update step to the optimizer !" << endl);
358  return 1;
359  }
360  // Normal end
361  return 0;
362 }
363 
364 // =====================================================================
365 // ---------------------------------------------------------------------
366 // ---------------------------------------------------------------------
367 // =====================================================================
368 
369 int oOptimizerManager::PostDataUpdateStep(int a_iteration, int a_nbIterations, int a_subset, int a_nbSubsets)
370 {
371  // Simply call the homonymous function from the vOptimizer
372  if (mp_Optimizer->PostDataUpdateStep(a_iteration, a_nbIterations, a_subset, a_nbSubsets))
373  {
374  Cerr("***** oOptimizerManager::PostDataUpdateStep() -> A problem occured while applying the post-data-update step to the optimizer !" << endl);
375  return 1;
376  }
377  // Normal end
378  return 0;
379 }
380 
381 // =====================================================================
382 // ---------------------------------------------------------------------
383 // ---------------------------------------------------------------------
384 // =====================================================================
385 
387  int a_bed, int a_timeFrame, int a_respGate, int a_cardGate,
388  int a_iteration, int a_thread)
389 {
390  // ---------------------------------------------------------------------------------
391  // Deal with all multiplicative correction factors to be included in the projections
392  // ---------------------------------------------------------------------------------
393 
394  // Compute the global multiplicative correction factor
395  FLTNB multiplicative_correction = ap_Event->GetMultiplicativeCorrections() * mp_ImageDimensionsAndQuantification->GetQuantificationFactor(a_bed,a_timeFrame, a_respGate, a_cardGate);
396 
397  // Do nothing if the multiplicative correction factor is null or negative
398  if (multiplicative_correction<=0.) return 0;
399 
400  // Set the multiplicative correction to the oProjectionLine so that it is part of the system matrix and automatically applied
401  ap_Line->SetMultiplicativeCorrection(multiplicative_correction);
402 
403  // Set the current attenuation image for SPECT attenuation correction
404  if (m_dataType==TYPE_SPECT && ap_Image->m4p_attenuation!=NULL) mp_Optimizer->SetAttenuationImage(ap_Image->m4p_attenuation[a_timeFrame][a_respGate][a_cardGate], a_thread);
405 
406  // --------------------------------------------------------------------------------
407  // Decompose the data update step into 4 steps mandatory steps and 3 optional steps
408  // --------------------------------------------------------------------------------
409 
410  // Mandatory 1: Compute model (forward-projection + additive background)
411  if (mp_Optimizer->DataStep1ForwardProjectModel( ap_Line, ap_Image, ap_Event, a_bed, a_timeFrame, a_respGate, a_cardGate, a_thread ))
412  {
413  Cerr("***** oOptimizerManager::DataUpdateStep() -> An error occured while forward projecting !" << endl);
414  return 1;
415  }
416 
417  // Optional 1: Do what is done in the child optimizer
418  if (mp_Optimizer->DataStep2Optional( ap_Line, ap_Image, ap_Event, a_bed, a_timeFrame, a_respGate, a_cardGate, a_iteration, a_thread ))
419  {
420  Cerr("***** oOptimizerManager::DataUpdateStep() -> An error occured while performing optional step 1 !" << endl);
421  return 1;
422  }
423 
424  // Mandatory 2: Compute sensitivity in histogram mode
425  if (ap_Event->GetDataMode()==MODE_HISTOGRAM && mp_Optimizer->DataStep3BackwardProjectSensitivity( ap_Line, ap_Image, ap_Event, a_bed, a_timeFrame, a_respGate, a_cardGate, a_thread ))
426  {
427  Cerr("***** oOptimizerManager::DataUpdateStep() -> An error occured while backward projecting the sensitivity !" << endl);
428  return 1;
429  }
430 
431  // Optional 2: Do what is done in the child optimizer
432  if (mp_Optimizer->DataStep4Optional( ap_Line, ap_Image, ap_Event, a_bed, a_timeFrame, a_respGate, a_cardGate, a_iteration, a_thread ))
433  {
434  Cerr("***** oOptimizerManager::DataUpdateStep() -> An error occured while performing optional step 2 !" << endl);
435  return 1;
436  }
437 
438  // Mandatory 3: Compute the correction terms
439  if (mp_Optimizer->DataStep5ComputeCorrections( ap_Line, ap_Event, a_bed, a_timeFrame, a_respGate, a_cardGate, a_thread ))
440  {
441  Cerr("***** oOptimizerManager::DataUpdateStep() -> An error occured while computing correction terms !" << endl);
442  return 1;
443  }
444 
445  // Optional 3: Do what is done in the child optimizer
446  if (mp_Optimizer->DataStep6Optional( ap_Line, ap_Image, ap_Event, a_bed, a_timeFrame, a_respGate, a_cardGate, a_iteration, a_thread ))
447  {
448  Cerr("***** oOptimizerManager::DataUpdateStep() -> An error occured while performing optional step 3 !" << endl);
449  return 1;
450  }
451 
452  // Mandatory 4: Backproject correction terms
453  if (mp_Optimizer->DataStep7BackwardProjectCorrections( ap_Line, ap_Image, ap_Event, a_bed, a_timeFrame, a_respGate, a_cardGate, a_thread ))
454  {
455  Cerr("***** oOptimizerManager::DataUpdateStep() -> An error occured while backward projecting the correction !" << endl);
456  return 1;
457  }
458 
459  // Compute FOM is asked for
460  if (m_optimizerFOMFlag && mp_Optimizer->DataStep8ComputeFOM( ap_Line, ap_Event, a_timeFrame, a_respGate, a_cardGate, a_thread ))
461  {
462  Cerr("***** oOptimizerManager::DataUpdateStep() -> An error occured while computing FOMs !" << endl);
463  return 1;
464  }
465 
466  // End
467  return 0;
468 }
469 
470 // =====================================================================
471 // ---------------------------------------------------------------------
472 // ---------------------------------------------------------------------
473 // =====================================================================
474 
475 int oOptimizerManager::ImageUpdateStep(oImageSpace* ap_Image, int a_iteration, int a_nbSubsets)
476 {
477  // Verbose
478  if (m_verbose>=2) Cout("oOptimizerManager::ImageUpdateStep() -> Proceed to image update" << endl);
479 
480  // Update visited voxels
481  if (mp_Optimizer->UpdateVisitedVoxels( ap_Image ))
482  {
483  Cerr("***** oOptimizerManager::ImageUpdateStep() -> Problem while updating visited voxels !" << endl);
484  return 1;
485  }
486 
487  // Manage penalty computation
488  if (mp_Penalty!=NULL)
489  {
490  // Loops on frames, etc ...
491  }
492 
493  // Image update step
494  if (mp_Optimizer->ImageUpdateStep( ap_Image, a_iteration, a_nbSubsets ))
495  {
496  Cerr("***** oOptimizerManager::ImageUpdateStep() -> Problem while updating image space !" << endl);
497  return 1;
498  }
499 
500  // End
501  return 1;
502 }
503 
504 // =====================================================================
505 // ---------------------------------------------------------------------
506 // ---------------------------------------------------------------------
507 // =====================================================================
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
void SetMultiplicativeCorrection(FLTNB a_multiplicativeCorrection)
This function is used to set the multiplicative correction to be applied during forward and backward ...
#define MODE_HISTOGRAM
Definition: vDataFile.hh:36
#define TYPE_PET
Definition: vDataFile.hh:51
#define TYPE_UNKNOWN
Definition: vDataFile.hh:49
#define MODE_LIST
Definition: vDataFile.hh:34
#define FLTNB
Definition: gVariables.hh:55
void SetFOMFlag(bool a_optimizerFOMFlag)
Set the FOM flag specifying if figures-of-merit will be computed or not.
Definition: vOptimizer.hh:505
virtual int ReadConfigurationFile(const string &a_configurationFile)=0
A function used to read options from a configuration file.
virtual int DataStep3BackwardProjectSensitivity(oProjectionLine *ap_Line, oImageSpace *ap_Image, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread)
A public function used to back-project the sensitivity terms for the provided event.
Definition: vOptimizer.cc:548
#define TYPE_TRANSMISSION
Definition: vDataFile.hh:55
int PreDataUpdateStep(int a_iteration, int a_nbIterations, int a_subset, int a_nbSubsets)
A function that simply calls the eponym function from the vOptimizer.
virtual int ImageUpdateStep(oImageSpace *ap_Image, int a_iteration, int a_nbSubsets)
A public function used to perform the image update step of the optimizer.
Definition: vOptimizer.cc:751
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Set the pointer to the image dimensions in use.
Definition: vOptimizer.hh:469
virtual FLTNB GetMultiplicativeCorrections()=0
This is a pure virtual function implemented in the child classes.
int ImageUpdateStep(oImageSpace *ap_Image, int a_iteration, int a_nbSubsets)
A function dedicated to the update step in the image space (performed after the loop on events) ...
static sOutputManager * GetInstance()
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
#define TYPE_SPECT
Definition: vDataFile.hh:53
virtual int ReadOptionsList(const string &a_optionsList)=0
A function used to read options from a list of options.
int Initialize()
A function used to initialize the manager and the optimizer it manages.
virtual int DataStep1ForwardProjectModel(oProjectionLine *ap_Line, oImageSpace *ap_Image, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread)
A public function used to compute the model: forward projection of the provided event.
Definition: vOptimizer.cc:472
int GetDataMode()
Definition: vEvent.hh:112
void SetNbTOFBins(int a_nbTOFBins)
Set the number of TOF bins in use.
Definition: vOptimizer.hh:476
static sAddonManager * GetInstance()
std::map< string, maker_optimizer > mp_listOfOptimizers
void SetDataType(int a_dataType)
Set the data type in use.
Definition: vOptimizer.hh:490
int ParseOptionsAndInitializeOptimizerAndPenalty()
#define Cerr(MESSAGE)
Singleton class that manages output writing on disk (images, sinograms, etc). It also manages loggi...
const string & GetPathToConfigDir()
Return the path to the CASTOR config directory.
int PostDataUpdateStep(int a_iteration, int a_nbIterations, int a_subset, int a_nbSubsets)
A function that simply calls the eponym function from the vOptimizer.
int DataUpdateStep(oProjectionLine *ap_Line, oImageSpace *ap_Image, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_iteration, int a_thread)
A function dedicated to the update step in the data space (for each event inside the loop) ...
vOptimizer * mp_Optimizer
int PreDataUpdateStep(int a_iteration, int a_nbIterations, int a_subset, int a_nbSubsets)
A public function used to do stuff that need to be done at the beginning of a subset (before the data...
Definition: vOptimizer.cc:355
virtual int DataStep4Optional(oProjectionLine *ap_Line, oImageSpace *ap_Image, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_iteration, int a_thread)
A public function which does nothing but being virtual.
Definition: vOptimizer.cc:587
FLTNB GetQuantificationFactor(int a_bed, int a_frame, int a_respGate, int a_cardGate)
Get the quantification factor corresponding to the provided bed, frame, respiratory and cardiac gates...
virtual int DataStep8ComputeFOM(oProjectionLine *ap_Line, vEvent *ap_Event, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread)
A public function used to update the computation of figures-of-merit in the data space.
Definition: vOptimizer.cc:703
int UpdateVisitedVoxels(oImageSpace *ap_Image)
A public function used to update the 'visited' voxels after each subset.
Definition: vOptimizer.cc:731
void SetImageStatFlag(bool a_optimizerImageStatFlag)
Set the image stat flag specifying if basic statistics about image udpate will be computed or not...
Definition: vOptimizer.hh:512
int CheckParameters()
A function used to check the parameters settings.
int PostDataUpdateStep(int a_iteration, int a_nbIterations, int a_subset, int a_nbSubsets)
A public function used to do stuff that need to be done at the beginning of a subset (before the data...
Definition: vOptimizer.cc:397
virtual int DataStep2Optional(oProjectionLine *ap_Line, oImageSpace *ap_Image, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_iteration, int a_thread)
A public function which does nothing but being virtual.
Definition: vOptimizer.cc:535
This class is designed to generically described any iterative optimizer.
Definition: vOptimizer.hh:36
void SetAttenuationImage(FLTNB *ap_attenuationImage, int a_thread)
Set the attenuation image corresponding to the current thread and current event.
Definition: vOptimizer.hh:498
This class is designed to manage and store system matrix elements associated to a vEvent...
~oOptimizerManager()
The destructor of oOptimizerManager.
int Initialize()
A public function used to initialize the optimizer.
Definition: vOptimizer.cc:277
Declaration of class sOutputManager.
This class holds all the matrices in the image domain that can be used in the algorithm: image...
Definition: oImageSpace.hh:41
Mother class for the Event objects.
Definition: vEvent.hh:23
virtual int DataStep5ComputeCorrections(oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread)
A public function used to compute the correction terms in the data space, for the provided event...
Definition: vOptimizer.cc:600
oOptimizerManager()
The constructor of oOptimizerManager.
Declaration of class oOptimizerManager.
#define MODE_UNKNOWN
Definition: vDataFile.hh:32
#define Cout(MESSAGE)
void SetVerbose(int a_verbose)
Set the verbose level.
Definition: vOptimizer.hh:462
FLTNB **** m4p_attenuation
Definition: oImageSpace.hh:108
virtual int DataStep7BackwardProjectCorrections(oProjectionLine *ap_Line, oImageSpace *ap_Image, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread)
A public function used to back-project the correction terms into the backward correction image...
Definition: vOptimizer.cc:648
void SetDataMode(int a_dataMode)
Set the data mode in use.
Definition: vOptimizer.hh:483
virtual int DataStep6Optional(oProjectionLine *ap_Line, oImageSpace *ap_Image, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_iteration, int a_thread)
A public function which does nothing but being virtual.
Definition: vOptimizer.cc:635
int CheckParameters()
A public function used to check the parameters settings.
Definition: vOptimizer.cc:206
Declaration of class sAddonManager.