90 cout <<
"This optimizer is a version of the MLTR algorithm implemented from equation 16 of the paper from K. Van Slambrouck and J. Nuyts:" << endl;
91 cout <<
"\"Reconstruction scheme for accelerated maximum lihelihood reconstruction: the patchwork structure\"," << endl;
92 cout <<
"IEEE Trans. Nucl. Sci., vol. 61, pp. 173-81, 2014." << endl;
93 cout <<
"An additional empiric relaxation factor has been added onto the additive update. Its value onto the first and last updates" << endl;
94 cout <<
"can be parameterized. Its value for all updates in between is computed linearly from these first and last provided values." << endl;
95 cout <<
"Subsets can be used." << endl;
96 cout <<
"The following options can be used (in this particular order when provided as a list):" << endl;
97 cout <<
" initial image value: to set the uniform voxel value for the initial image" << endl;
98 cout <<
" alpha ratio: to set the ratio between exterior and interior of the cylindrical FOV alpha values (0 value means 0 inside exterior)" << endl;
99 cout <<
" initial relaxation factor: to set the empiric multiplicative factor on the additive update used at the first update" << endl;
100 cout <<
" final relaxation factor: to set the empiric multiplicative factor on the additive update used at the last update" << endl;
101 cout <<
" non-negativity constraint: 0 if no constraint or 1 in order to apply the constraint during the image update" << endl;
111 string key_word =
"";
113 key_word =
"initial image value";
116 Cerr(
"***** iOptimizerMLTR::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
120 key_word =
"alpha ratio";
123 Cerr(
"***** iOptimizerMLTR::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
127 key_word =
"initial relaxation factor";
130 Cerr(
"***** iOptimizerMLTR::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
134 key_word =
"final relaxation factor";
137 Cerr(
"***** iOptimizerMLTR::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
141 key_word =
"non-negativity constraint";
144 Cerr(
"***** iOptimizerMLTR::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
159 const int nb_options = 5;
160 FLTNB options[nb_options];
162 if (
ReadStringOption(a_optionsList, options, nb_options,
",",
"MLTR configuration"))
164 Cerr(
"***** iOptimizerMLTR::ReadOptionsList() -> Failed to correctly read the list of options !" << endl);
188 Cerr(
"***** iOptimizerMLTR->CheckSpecificParameters() -> Provided alpha ratio (" <<
m_alphaRatio <<
") must be positive !" << endl);
194 Cerr(
"***** iOptimizerMLTR->CheckSpecificParameters() -> Provided initial relaxation factor (" <<
m_initialRelaxationFactor <<
") must be positive !" << endl);
199 Cerr(
"***** iOptimizerMLTR->CheckSpecificParameters() -> Provided final relaxation factor (" <<
m_finalRelaxationFactor <<
") must be positive !" << endl);
216 Cout(
"iOptimizerMLTR::InitializeSpecific() -> Use the MLTR optimizer" << endl);
237 FLTNB alpha_interior = 1.;
249 squared_radius_x *= squared_radius_x;
251 squared_radius_y *= squared_radius_y;
258 #pragma omp parallel for private(x) schedule(guided)
263 squared_distance_x *= squared_distance_x;
269 squared_distance_y *= squared_distance_y;
271 FLTNB alpha_value = 0.;
273 if ( squared_distance_x/squared_radius_x + squared_distance_y/squared_radius_y <= 1. ) alpha_value = alpha_interior;
275 else alpha_value = alpha_exterior;
304 if (a_nbIterations==1 && ap_nbSubsets[0]==1)
309 Cerr(
"***** iOptimizerMLTR::PostDataUpdateSpecificStep() -> Initial and final relaxation differ while there is only one update to do !" << endl);
317 int total_number_of_updates_minus_one = -1;
318 for (
int it=0; it<a_nbIterations; it++) total_number_of_updates_minus_one += ap_nbSubsets[it];
320 int current_update_index = 0;
321 for (
int it=0; it<a_iteration; it++) current_update_index += ap_nbSubsets[it];
322 current_update_index += a_subset;
324 FLTNB ratio_of_updates = ((
FLTNB)current_update_index) / ((
FLTNB)total_number_of_updates_minus_one);
342 FLTNB a_multiplicativeCorrections,
FLTNB a_additiveCorrections,
FLTNB a_blankValue,
357 FLTNB a_multiplicativeCorrections,
FLTNB a_additiveCorrections,
FLTNB a_blankValue,
361 if (a_data<0.) a_data = 0.;
363 *ap_backwardValues = a_forwardModel - a_data;
379 *ap_newImageValue = a_currentImageValue + image_update_factor;
FLTNB GetVoxSizeX()
Get the voxel's size along the X axis, in mm.
~iOptimizerMLTR()
The destructor of iOptimizerMLTR.
bool m_listmodeCompatibility
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
FLTNB m_initialRelaxationFactor
void ShowHelpSpecific()
A function used to show help about the child optimizer.
FLTNB ForwardProject(oProjectionLine *ap_Line, FLTNB *ap_image=NULL)
A function used to forward project the provided image (or 1 if NULL), based on the provided oProjecti...
int DataSpaceSpecificOperations(FLTNB a_data, FLTNB a_forwardModel, FLTNB *ap_backwardValues, FLTNB a_multiplicativeCorrections, FLTNB a_additiveCorrections, FLTNB a_blankValue, FLTNB a_quantificationFactor, oProjectionLine *ap_Line)
This function performs the data space operations specific to the optimizer (computes the values to be...
FLTNB m_currentRelaxationFactor
FLTNB GetVoxSizeY()
Get the voxel's size along the Y axis, in mm.
bool m_emissionCompatibility
iOptimizerMLTR()
The constructor of iOptimizerMLTR.
int CheckSpecificParameters()
A private function used to check the parameters settings specific to the child optimizer.
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...
int ReadOptionsList(const string &a_optionsList)
A function used to read options from a list of options.
Declaration of class iOptimizerMLTR.
int ImageSpaceSpecificOperations(FLTNB a_currentImageValue, FLTNB *ap_newImageValue, FLTNB a_sensitivity, FLTNB *ap_correctionValues, INTNB a_voxel)
This function perform the image update step specific to the optimizer.
bool m_histogramCompatibility
INTNB GetNbVoxXY()
Get the number of voxels in a slice.
int InitializeSpecific()
This function is used to initialize specific stuff to the child optimizer.
#define KEYWORD_MANDATORY
int PostDataUpdateSpecificStep(int a_iteration, int a_nbIterations, int a_subset, int *ap_nbSubsets)
This function is overloaded from the vOptimizer that does nothing by default.
bool m_transmissionCompatibility
This class is designed to generically described any iterative optimizer.
This class is designed to manage and store system matrix elements associated to a vEvent...
bool m_nonNegativityConstraint
FLTNB m_finalRelaxationFactor
Declaration of class sOutputManager.
oImageSpace * mp_ImageSpace
FLTNB * AllocateMiscellaneousImage()
Allocate a new miscellaneous image on m2p_miscellaneousImages and return the pointer to this image...
INTNB GetNbVoxX()
Get the number of voxels along the X axis.
int ReadConfigurationFile(const string &a_configurationFile)
A function used to read options from a configuration file.
INTNB GetNbVoxZ()
Get the number of voxels along the Z axis.
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.
int SensitivitySpecificOperations(FLTNB a_data, FLTNB a_forwardModel, FLTNB *ap_weight, FLTNB a_multiplicativeCorrections, FLTNB a_additiveCorrections, FLTNB a_blankValue, FLTNB a_quantificationFactor, oProjectionLine *ap_Line)
This function compute the weight associated to the provided event (for sensitivity computation) ...
INTNB GetNbVoxY()
Get the number of voxels along the Y axis.