69 Cerr(
"***** oOptimizerManager::CheckParameters() -> No image dimensions provided !" << endl);
75 Cerr(
"***** oOptimizerManager::CheckParameters() -> No or meaningless data mode provided !" << endl);
81 Cerr(
"***** oOptimizerManager::CheckParameters() -> No or meaningless data type provided !" << endl);
87 Cerr(
"***** oOptimizerManager::CheckParameters() -> No optimizer options provided !" << endl);
93 Cerr(
"***** oOptimizerManager::CheckParameters() -> Wrong verbosity level provided !" << endl);
108 if (
m_verbose>=1)
Cout(
"oOptimizerManager::Initialize() -> Initialize optimizer and penalty" << endl);
113 Cerr(
"***** oOptimizerManager::Initialize() -> A problem occured while parsing optimizer options and initializing it !" << endl);
132 string name_optimizer =
"";
133 string list_options_optimizer =
"";
134 string file_options_optimizer =
"";
145 Cerr(
"***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> No optimizer provided !" << endl);
154 if (colon!=string::npos)
161 list_options_optimizer =
"";
164 else if (comma!=string::npos)
171 file_options_optimizer =
"";
179 list_options_optimizer =
"";
182 file_options_optimizer = p_output_manager->
GetPathToConfigDir() +
"/optimizer/" + name_optimizer +
".conf";
191 if (list_optimizer[name_optimizer])
mp_Optimizer = list_optimizer[name_optimizer]();
194 Cerr(
"***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> Optimizer '" << name_optimizer <<
"' does not exist !" << endl);
208 Cerr(
"***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while reading and checking optimizer's configuration file !" << endl);
214 Cerr(
"***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while parsing and reading optimizer's options !" << endl);
220 Cerr(
"***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while checking optimizer parameters !" << endl);
226 Cerr(
"***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while initializing the optimizer !" << endl);
357 Cerr(
"***** oOptimizerManager::PreDataUpdateStep() -> A problem occured while applying the pre-data-update step to the optimizer !" << endl);
374 Cerr(
"***** oOptimizerManager::PostDataUpdateStep() -> A problem occured while applying the post-data-update step to the optimizer !" << endl);
387 int a_bed,
int a_timeFrame,
int a_respGate,
int a_cardGate,
388 int a_iteration,
int a_thread)
398 if (multiplicative_correction<=0.)
return 0;
413 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while forward projecting !" << endl);
420 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while performing optional step 1 !" << endl);
427 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while backward projecting the sensitivity !" << endl);
434 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while performing optional step 2 !" << endl);
441 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while computing correction terms !" << endl);
448 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while performing optional step 3 !" << endl);
455 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while backward projecting the correction !" << endl);
462 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while computing FOMs !" << endl);
478 if (
m_verbose>=2)
Cout(
"oOptimizerManager::ImageUpdateStep() -> Proceed to image update" << endl);
483 Cerr(
"***** oOptimizerManager::ImageUpdateStep() -> Problem while updating visited voxels !" << endl);
496 Cerr(
"***** oOptimizerManager::ImageUpdateStep() -> Problem while updating image space !" << endl);
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
void SetMultiplicativeCorrection(FLTNB a_multiplicativeCorrection)
This function is used to set the multiplicative correction to be applied during forward and backward ...
void SetFOMFlag(bool a_optimizerFOMFlag)
Set the FOM flag specifying if figures-of-merit will be computed or not.
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.
#define TYPE_TRANSMISSION
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.
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Set the pointer to the image dimensions in use.
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.
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.
void SetNbTOFBins(int a_nbTOFBins)
Set the number of TOF bins in use.
static sAddonManager * GetInstance()
std::map< string, maker_optimizer > mp_listOfOptimizers
void SetDataType(int a_dataType)
Set the data type in use.
bool m_optimizerImageStatFlag
int ParseOptionsAndInitializeOptimizerAndPenalty()
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...
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.
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.
int UpdateVisitedVoxels(oImageSpace *ap_Image)
A public function used to update the 'visited' voxels after each subset.
void SetImageStatFlag(bool a_optimizerImageStatFlag)
Set the image stat flag specifying if basic statistics about image udpate will be computed or not...
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...
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.
This class is designed to generically described any iterative optimizer.
void SetAttenuationImage(FLTNB *ap_attenuationImage, int a_thread)
Set the attenuation image corresponding to the current thread and current event.
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.
Declaration of class sOutputManager.
This class holds all the matrices in the image domain that can be used in the algorithm: image...
Mother class for the Event objects.
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...
oOptimizerManager()
The constructor of oOptimizerManager.
Declaration of class oOptimizerManager.
void SetVerbose(int a_verbose)
Set the verbose level.
FLTNB **** m4p_attenuation
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...
string m_optionsOptimizer
void SetDataMode(int a_dataMode)
Set the data mode in use.
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.
int CheckParameters()
A public function used to check the parameters settings.
Declaration of class sAddonManager.