86 Cerr(
"***** oOptimizerManager::CheckParameters() -> No image dimensions provided !" << endl);
92 Cerr(
"***** oOptimizerManager::CheckParameters() -> No image space provided !" << endl);
98 Cerr(
"***** oOptimizerManager::CheckParameters() -> No or meaningless data mode provided !" << endl);
104 Cerr(
"***** oOptimizerManager::CheckParameters() -> No or meaningless data type provided !" << endl);
110 Cerr(
"***** oOptimizerManager::CheckParameters() -> No or meaningless data specificity provided (emission or transmission) !" << endl);
116 Cerr(
"***** oOptimizerManager::CheckParameters() -> No optimizer options provided !" << endl);
122 Cerr(
"***** oOptimizerManager::CheckParameters() -> Wrong verbosity level provided !" << endl);
137 if (
m_verbose>=1)
Cout(
"oOptimizerManager::Initialize() -> Initialize optimizer and penalty" << endl);
142 Cerr(
"***** oOptimizerManager::Initialize() -> A problem occured while parsing optimizer options and initializing it !" << endl);
161 string name_optimizer =
"";
162 string list_options_optimizer =
"";
163 string file_options_optimizer =
"";
174 Cerr(
"***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> No optimizer provided !" << endl);
183 if (colon!=string::npos)
190 list_options_optimizer =
"";
193 else if (comma!=string::npos)
200 file_options_optimizer =
"";
208 list_options_optimizer =
"";
211 file_options_optimizer = p_output_manager->
GetPathToConfigDir() +
"/optimizer/" + name_optimizer +
".conf";
220 if (list_optimizer[name_optimizer])
mp_Optimizer = list_optimizer[name_optimizer]();
223 Cerr(
"***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> Optimizer '" << name_optimizer <<
"' does not exist !" << endl);
239 Cerr(
"***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while reading and checking optimizer's configuration file !" << endl);
245 Cerr(
"***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while parsing and reading optimizer's options !" << endl);
251 Cerr(
"***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while checking optimizer parameters !" << endl);
257 Cerr(
"***** oOptimizerManager::ParseOptionsAndInitializeOptimizerAndPenalty() -> A problem occured while initializing the optimizer !" << endl);
388 Cerr(
"***** oOptimizerManager::PreDataUpdateStep() -> A problem occured while applying the pre-data-update step to the optimizer !" << endl);
405 Cerr(
"***** oOptimizerManager::PostDataUpdateStep() -> A problem occured while applying the post-data-update step to the optimizer !" << endl);
418 int a_bed,
int a_timeFrame,
int a_respGate,
int a_cardGate,
419 int a_iteration,
int a_thread)
429 if (multiplicative_correction<=0.)
return 0;
444 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while forward projecting !" << endl);
451 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while performing optional step 1 !" << endl);
458 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while backward projecting the sensitivity !" << endl);
465 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while performing optional step 2 !" << endl);
472 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while computing correction terms !" << endl);
479 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while performing optional step 3 !" << endl);
486 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while backward projecting the correction !" << endl);
493 Cerr(
"***** oOptimizerManager::DataUpdateStep() -> An error occured while computing FOMs !" << endl);
509 if (
m_verbose>=2)
Cout(
"oOptimizerManager::ImageUpdateStep() -> Proceed to image update" << endl);
514 Cerr(
"***** oOptimizerManager::ImageUpdateStep() -> Problem while updating visited voxels !" << endl);
527 Cerr(
"***** oOptimizerManager::ImageUpdateStep() -> Problem while updating image space !" << endl);
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
virtual int ImageUpdateStep(int a_iteration, int a_nbSubsets)
A public function used to perform the image update step of the optimizer.
void SetMultiplicativeCorrection(FLTNB a_multiplicativeCorrection)
This function is used to set the multiplicative correction to be applied during forward and backward ...
virtual int DataStep6Optional(oProjectionLine *ap_Line, 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.
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.
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.
virtual int DataStep4Optional(oProjectionLine *ap_Line, 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.
static sOutputManager * GetInstance()
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
int PostDataUpdateStep(int a_iteration, int a_nbIterations, int a_subset, int *ap_nbSubsets)
A public function used to do stuff that need to be done at the beginning of a subset (before the data...
oImageSpace * mp_ImageSpace
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.
int PostDataUpdateStep(int a_iteration, int a_nbIterations, int a_subset, int *ap_nbSubsets)
A function that simply calls the eponym function from the vOptimizer.
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.
virtual int DataStep3BackwardProjectSensitivity(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 back-project the sensitivity terms for the provided event.
vOptimizer * mp_Optimizer
virtual int DataStep1ForwardProjectModel(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 model: forward projection of the provided event.
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.
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.
#define SPEC_TRANSMISSION
int ImageUpdateStep(int a_iteration, int a_nbSubsets)
A function dedicated to the update step in the image space (performed after the loop on events) ...
int DataUpdateStep(oProjectionLine *ap_Line, 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) ...
void SetDataSpec(int a_dataSpec)
Set the data physical specificity in use.
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.
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...
int PreDataUpdateStep(int a_iteration, int a_nbIterations, int a_subset, int *ap_nbSubsets)
A public function used to do stuff that need to be done at the beginning of a subset (before the data...
int PreDataUpdateStep(int a_iteration, int a_nbIterations, int a_subset, int *ap_nbSubsets)
A function that simply calls the eponym function from the vOptimizer.
virtual int DataStep2Optional(oProjectionLine *ap_Line, 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.
oOptimizerManager()
The constructor of oOptimizerManager.
int UpdateVisitedVoxels()
A public function used to update the 'visited' voxels after each subset.
Declaration of class oOptimizerManager.
void SetVerbose(int a_verbose)
Set the verbose level.
FLTNB **** m4p_attenuation
virtual int DataStep7BackwardProjectCorrections(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 back-project the correction terms into the backward correction image...
string m_optionsOptimizer
void SetDataMode(int a_dataMode)
Set the data mode in use.
int CheckParameters()
A public function used to check the parameters settings.
Declaration of class sAddonManager.
void SetImageSpace(oImageSpace *ap_ImageSpace)
Set the pointer to the image space in use.