CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
vOptimizer Class Referenceabstract

This class is designed to generically described any iterative optimizer. More...

#include <vOptimizer.hh>

Inheritance diagram for vOptimizer:
Inheritance graph
Collaboration diagram for vOptimizer:
Collaboration graph

Public Member Functions

 vOptimizer ()
 The constructor of vOptimizer. More...
 
virtual ~vOptimizer ()
 The destructor of vOptimizer. More...
 
void ShowHelp ()
 A function used to show help about the optimizer. More...
 
int CheckParameters ()
 A public function used to check the parameters settings. More...
 
int Initialize ()
 A public function used to initialize the optimizer. More...
 
int UpdateVisitedVoxels (oImageSpace *ap_Image)
 A public function used to update the 'visited' voxels after each subset. More...
 
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 update step; i.e. the loop over all events) More...
 
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 update step; i.e. the loop over all events) More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual int ReadConfigurationFile (const string &a_configurationFile)=0
 A function used to read options from a configuration file. More...
 
virtual int ReadOptionsList (const string &a_optionsList)=0
 A function used to read options from a list of options. More...
 
void SetVerbose (int a_verbose)
 Set the verbose level. More...
 
void SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
 Set the pointer to the image dimensions in use. More...
 
void SetNbTOFBins (int a_nbTOFBins)
 Set the number of TOF bins in use. More...
 
void SetDataMode (int a_dataMode)
 Set the data mode in use. More...
 
void SetDataType (int a_dataType)
 Set the data type in use. More...
 
void SetAttenuationImage (FLTNB *ap_attenuationImage, int a_thread)
 Set the attenuation image corresponding to the current thread and current event. More...
 
void SetFOMFlag (bool a_optimizerFOMFlag)
 Set the FOM flag specifying if figures-of-merit will be computed or not. More...
 
void SetImageStatFlag (bool a_optimizerImageStatFlag)
 Set the image stat flag specifying if basic statistics about image udpate will be computed or not. More...
 
int GetNbBackwardImages ()
 Get the number of backward images used by the specific optimizer. More...
 
FLTNB GetInitialValue ()
 Get the initial image value (for initialization) More...
 

Protected Member Functions

FLTNB ComputeSensitivity (FLTNB ****a4p_sensitivityImage, int a_timeBasisFunction, int a_respBasisFunction, int a_cardBasisFunction, int a_voxel, int a_nbSubsets)
 A function used to compute the sensitivity of a given voxel and a given set of dynamic basis functions. More...
 
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 oProjectionLine. More...
 
void BackwardProject (oProjectionLine *ap_Line, FLTNB *ap_image, FLTNB a_value)
 A function used to backward project the provided value into the provided image, based on the provided oProjectionLine. More...
 

Protected Attributes

int m_verbose
 
int m_nbBackwardImages
 
int m_nbTOFBins
 
FLTNB ** m2p_forwardValues
 
FLTNB *** m3p_backwardValues
 
FLTNB m_initialValue
 
bool m_listmodeCompatibility
 
bool m_histogramCompatibility
 
oImageDimensionsAndQuantificationmp_ImageDimensionsAndQuantification
 
int m_dataMode
 
int m_dataType
 
FLTNB ** m2p_attenuationImage
 
bool m_optimizerFOMFlag
 
FLTNB **** m4p_FOMLogLikelihood
 
FLTNB **** m4p_FOMRMSE
 
uint64_t **** m4p_FOMNbBins
 
double **** m4p_FOMNbData
 
bool m_optimizerImageStatFlag
 
INTNBmp_imageStatNbVox
 
FLTNBmp_imageStatMin
 
FLTNBmp_imageStatMax
 
double * mp_imageStatMean
 
double * mp_imageStatVariance
 
double * mp_correctionStatMean
 
double * mp_correctionStatVariance
 

Private Member Functions

virtual int PreDataUpdateSpecificStep (int a_iteration, int a_nbIterations, int a_subset, int a_nbSubsets)
 A private function used to perform any step required by the child optimizer, before the loop on event inside the subset loop. More...
 
virtual int PostDataUpdateSpecificStep (int a_iteration, int a_nbIterations, int a_subset, int a_nbSubsets)
 A private function used to perform any step required by the child optimizer, after the loop on event inside the subset loop. More...
 
virtual void ShowHelpSpecific ()=0
 A function used to show help about the child module. More...
 
virtual int CheckSpecificParameters ()=0
 A private function used to check the parameters settings specific to the child optimizer. More...
 
virtual int InitializeSpecific ()=0
 A private function used to initialize everything specific to the child optimizer. More...
 
virtual int SensitivitySpecificOperations (FLTNB a_data, FLTNB a_forwardModel, FLTNB *ap_weight, FLTNB a_multiplicativeCorrections, FLTNB a_additiveCorrections, FLTNB a_quantificationFactor, oProjectionLine *ap_Line)=0
 A private function used to compute the sensitivity weight associated to the provided data. More...
 
virtual int DataSpaceSpecificOperations (FLTNB a_data, FLTNB a_forwardModel, FLTNB *ap_backwardValues, FLTNB a_multiplicativeCorrections, FLTNB a_additiveCorrections, FLTNB a_quantificationFactor, oProjectionLine *ap_Line)=0
 A private function used to compute the correction term in the data space from the provided data. More...
 
virtual int ImageSpaceSpecificOperations (FLTNB a_currentImageValue, FLTNB *ap_newImageValue, FLTNB a_sensitivity, FLTNB *ap_correctionValues)=0
 A private function used to update the image value from the provided data. More...
 

Detailed Description

This class is designed to generically described any iterative optimizer.

This class is an abstract one, in the sense that it cannot be used on its own because several pure virtual functions belong to it. Its children are implementations of actual optimizers. Everywhere in the code, this parent class should be used instead of any of its children. The optimizer is created by the oOptimizerManager is used during the iterative process of the algorithm through the call of multiple functions. All functions prefixed by DataStepX are called within the DataUpdateStep() function of the oOptimizerManager. The other main function is the ImageUpdateStep() function called by the eponym function from the manager. Anyway, all these aforementioned functions are virtual, but are designed to be flexible enaugh for any kind of optimizer. Finally, a particular optimizer (a child of this vOptimizer) will be characterized by the implementation of some pure virtual functions, some for options and initialization management, and three particular ones that really describe what this particular optimizer does: SensitivitySpecificOperations(), DataSpaceSpecificOperations() and ImageSpaceSpecificOperations(). Read the description of these functions below to get more details.

Definition at line 36 of file vOptimizer.hh.

Constructor & Destructor Documentation

vOptimizer::vOptimizer ( )

The constructor of vOptimizer.

This is the default and unique constructor. It does not take any parameter and its role is only to affect default values to each member of the class.

Definition at line 25 of file vOptimizer.cc.

vOptimizer::~vOptimizer ( )
virtual

The destructor of vOptimizer.

This is the default and unique destructor. It does not take any parameter and its role is only to free or delete all structures that were built by this class. It is virtual, so that it is automatically called when a child object is deleted.

Definition at line 61 of file vOptimizer.cc.

Here is the call graph for this function:

Member Function Documentation

void vOptimizer::BackwardProject ( oProjectionLine ap_Line,
FLTNB ap_image,
FLTNB  a_value 
)
protected

A function used to backward project the provided value into the provided image, based on the provided oProjectionLine.

Parameters
oProjectionLine*ap_Line
FLTNB*ap_image
FLTNBa_value

Based on the data type, the function calls the projection function of the oProjectionLine class to backward project the value into the image taking the multiplicative terms into account, and eventually dealing with the SPECT attenuation.

Definition at line 928 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int vOptimizer::CheckParameters ( )

A public function used to check the parameters settings.

This function does not take any parameter and is used to check that all mandatory members were correctly parameterized. At the end, it calls the pure virtual CheckSpecificParameters() function implemented by children.

Returns
An integer reflecting the check status; 0 if no problem, another value otherwise.

Definition at line 206 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

private virtual int vOptimizer::CheckSpecificParameters ( )
privatepure virtual

A private function used to check the parameters settings specific to the child optimizer.

This function is used to check that all parameters specific to the optimizer are correctly set within allowed values. It is called by the CheckParameters() function. It is pure virtual so is implemented by children.

Returns
An integer reflecting the check status; 0 if no problem, another value otherwise.

Implemented in iOptimizerNEGML, iOptimizerOriginalAML, iOptimizerLandweber, iOptimizerTemplate, and iOptimizerMLEM.

Here is the caller graph for this function:

FLTNB vOptimizer::ComputeSensitivity ( FLTNB ****  a4p_sensitivityImage,
int  a_timeBasisFunction,
int  a_respBasisFunction,
int  a_cardBasisFunction,
int  a_voxel,
int  a_nbSubsets 
)
protected

A function used to compute the sensitivity of a given voxel and a given set of dynamic basis functions.

Parameters
FLTNB****a4p_sensitivityImage
inta_timeBasisFunction
inta_respBasisFunction
inta_cardBasisFunction
inta_voxel
inta_nbSubsets

This function computes the sensitivity for a given set of dynamic basis functions and for a given number of subsets. It loops over the dynamic frames and gates to compute the sensitivity based on basis functions coefficients. In list-mode, as the sensitivity is computed for the whole FOV, the value is divided by the current number of subsets of the current iteration, given as a parameter.

Returns
The computed sensitivity

Definition at line 943 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

private virtual int vOptimizer::DataSpaceSpecificOperations ( FLTNB  a_data,
FLTNB  a_forwardModel,
FLTNB ap_backwardValues,
FLTNB  a_multiplicativeCorrections,
FLTNB  a_additiveCorrections,
FLTNB  a_quantificationFactor,
oProjectionLine ap_Line 
)
privatepure virtual

A private function used to compute the correction term in the data space from the provided data.

Parameters
FLTNBa_data
FLTNBa_forwardModel
FLTNB*ap_backwardValues
FLTNBa_multiplicativeCorrections
FLTNBa_additiveCorrections
FLTNBa_quantificationFactor
oProjectionLine*ap_Line

This function is pure virtual, so must be implemented by specific optimizers. The computed correction term must be put at the ap_backwardValues pointer. All potentially useful information is provided as parameters. This is the operation that the optimization algorithm performs in the data space, in the loop on events. Note that the multiplicate corrections parameter only includes such correction specific to the event; in other words, it does not include the quantification factor which is given separately.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Implemented in iOptimizerNEGML, iOptimizerOriginalAML, iOptimizerLandweber, iOptimizerTemplate, and iOptimizerMLEM.

Here is the caller graph for this function:

int vOptimizer::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 
)
virtual

A public function used to compute the model: forward projection of the provided event.

Parameters
oProjectionLine*ap_Line
oImageSpace*ap_Image
vEvent*ap_Event
inta_bed
inta_timeFrame
inta_respGate
inta_cardGate
inta_thread

Inside the DataUpdateStep() of the oOptimizerManager, this is the first function called. This function performs the forward projection of the provided event, following the provided projection line. It takes all dynamic dimensions into account, including the intrinsic basis functions. Note that this function uses the ForwardProject() function that automatically deals with attenuation for SPECT and includes all multiplicative terms theoretically included in the system matrix. Then, all additive corrections are added to the forward projection. So the unit of the resulting model is the same as the data. The result of this forward projection is put in the m2p_forwardValues table (for the given thread). The other dimension of this table is for the TOF bins.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Definition at line 472 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int vOptimizer::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 
)
virtual

A public function which does nothing but being virtual.

Parameters
oProjectionLine*ap_Line
oImageSpace*ap_Image
vEvent*ap_Event
inta_bed
inta_timeFrame
inta_respGate
inta_cardGate
inta_iteration
inta_thread

Inside the DataUpdateStep() of the oOptimizerManager, this is the second function called. This function can be overloaded by specific optimizers if needed.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Definition at line 535 of file vOptimizer.cc.

Here is the caller graph for this function:

int vOptimizer::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 
)
virtual

A public function used to back-project the sensitivity terms for the provided event.

Parameters
oProjectionLine*ap_Line
oImageSpace*ap_Image
vEvent*ap_Event
inta_bed
inta_timeFrame
inta_respGate
inta_cardGate
inta_thread

Inside the DataUpdateStep() of the oOptimizerManager, this is the third function called. This function is only called when using histogram data. Before performing the back-projection into the sensitivity image, it calls the pure virtual SensitivitySpecificOperations() function whose role is simply to provide the weight associated to the projection line. Note that this function uses the BackwardProject() function that automatically deals with attenuation for SPECT and includes all multiplicative terms theoretically included in the system matrix.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Definition at line 548 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int vOptimizer::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 
)
virtual

A public function which does nothing but being virtual.

Parameters
oProjectionLine*ap_Line
oImageSpace*ap_Image
vEvent*ap_Event
inta_bed
inta_timeFrame
inta_respGate
inta_cardGate
inta_iteration
inta_thread

Inside the DataUpdateStep() of the oOptimizerManager, this is the fourth function called. This function can be overloaded by specific optimizers if needed.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Definition at line 587 of file vOptimizer.cc.

Here is the caller graph for this function:

int vOptimizer::DataStep5ComputeCorrections ( oProjectionLine ap_Line,
vEvent ap_Event,
int  a_bed,
int  a_timeFrame,
int  a_respGate,
int  a_cardGate,
int  a_thread 
)
virtual

A public function used to compute the correction terms in the data space, for the provided event.

Parameters
oProjectionLine*ap_Line
vEvent*ap_Event
inta_bed
inta_timeFrame
inta_respGate
inta_cardGate
inta_thread

Inside the DataUpdateStep() of the oOptimizerManager, this is the fifth function called. Its role is to compute the correction terms in the data space, based on the forward model and the data. In order to be specific to each optimizer, it calls the pure virtual function DataSpaceSpecificOperations(), where the computation is done. The correction terms are put in the m3p_backwardValues (a dimension for threads, one for the number of backward images and the last for TOF bins).

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Definition at line 600 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int vOptimizer::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 
)
virtual

A public function which does nothing but being virtual.

Parameters
oProjectionLine*ap_Line
oImageSpace*ap_Image
vEvent*ap_Event
inta_bed
inta_timeFrame
inta_respGate
inta_cardGate
inta_iteration
inta_thread

Inside the DataUpdateStep() of the oOptimizerManager, this is the sixth function called. This function can be overloaded by specific optimizers if needed.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Definition at line 635 of file vOptimizer.cc.

Here is the caller graph for this function:

int vOptimizer::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 
)
virtual

A public function used to back-project the correction terms into the backward correction image.

Parameters
oProjectionLine*ap_Line
oImageSpace*ap_Image
vEvent*ap_Event
inta_bed
inta_timeFrame
inta_respGate
inta_cardGate
inta_thread

Inside the DataUpdateStep() of the oOptimizerManager, this is the seventh function called. This function performs the backward projection of the correction terms held into the m3p_backwardValues, for the provided event and following the provided projection line. It takes all dynamic dimensions into account, including the intrinsic basis functions. Note that this function uses the BackwardProject() function that automatically deals with attenuation for SPECT and automatically includes all multiplicative terms theoretically included in the system matrix.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Definition at line 648 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int vOptimizer::DataStep8ComputeFOM ( oProjectionLine ap_Line,
vEvent ap_Event,
int  a_timeFrame,
int  a_respGate,
int  a_cardGate,
int  a_thread 
)
virtual

A public function used to update the computation of figures-of-merit in the data space.

Parameters
oProjectionLine*ap_Line
vEvent*ap_Event
inta_timeFrame
inta_respGate
inta_cardGate
inta_thread

Inside the DataUpdateStep() of the oOptimizerManager, this is the eighth function called. This function updates the computation of figures-of-merit in the data space for the provided event. It uses the m4p_FOMXXX structures. The computation is done only if the FOM flag is set. For the moment, log-likelihood and RMSE are computed.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Definition at line 703 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

FLTNB vOptimizer::ForwardProject ( oProjectionLine ap_Line,
FLTNB ap_image = NULL 
)
protected

A function used to forward project the provided image (or 1 if NULL), based on the provided oProjectionLine.

Parameters
oProjectionLine*ap_Line
FLTNB*ap_image = NULL

Based on the data type, the function calls the projection function of the oProjectionLine class to forward project the image taking the multiplicative terms into account, and eventually dealing with the SPECT attenuation.

Returns
The computed forward projection

Definition at line 913 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

public inline FLTNB vOptimizer::GetInitialValue ( )
inline

Get the initial image value (for initialization)

Returns
m_initialValue

Definition at line 526 of file vOptimizer.hh.

Here is the caller graph for this function:

public inline int vOptimizer::GetNbBackwardImages ( )
inline

Get the number of backward images used by the specific optimizer.

Returns
m_nbBackwardImages

Definition at line 519 of file vOptimizer.hh.

Here is the caller graph for this function:

private virtual int vOptimizer::ImageSpaceSpecificOperations ( FLTNB  a_currentImageValue,
FLTNB ap_newImageValue,
FLTNB  a_sensitivity,
FLTNB ap_correctionValues 
)
privatepure virtual

A private function used to update the image value from the provided data.

Parameters
FLTNBa_currentImageValue
FLTNB*ap_newImageValue
FLTNBa_sensitivity
FLTNB*ap_correctionValues

This function is pure virtual, so must be implemented by specific optimizers. The old values are provided, as well as the location of the new that will be calculated. This is the operation that the optimization algorithm performs in the image update step, after the loop on events. Note that based on the number of backward images used by the specific optimizer, there can be multiple correction values in ap_correctionValues, explaining why it is provided as a pointer. Note also that this function is only called for non-zero sensitivity, so no need to check it. The design of this function will evolve in order to take into account optimizers with penalties and alternated optimizers like MLAA which estimate the attenuation at the same time.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Implemented in iOptimizerNEGML, iOptimizerOriginalAML, iOptimizerLandweber, iOptimizerTemplate, and iOptimizerMLEM.

Here is the caller graph for this function:

int vOptimizer::ImageUpdateStep ( oImageSpace ap_Image,
int  a_iteration,
int  a_nbSubsets 
)
virtual

A public function used to perform the image update step of the optimizer.

Parameters
oImageSpace*ap_Image
inta_iteration
inta_nbSubsets

This function is called by the eponym function from the oOptimizerManager. It will manage the dynamic loops, compute the sensitivity using the private ComputeSensitivity() function, and update each voxel according to the specific optimizer by calling the pure virtual ImageSpaceSpecificOperations() function.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Definition at line 751 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int vOptimizer::Initialize ( )

A public function used to initialize the optimizer.

This function does not take any parameter and is used to initialize everything that should be initialized. At the end, it calls the pure virtual InitializeSpecific() function implemented by children.

Returns
An integer reflecting the initialization status; 0 if no problem, another value otherwise.

Definition at line 277 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

private virtual int vOptimizer::InitializeSpecific ( )
privatepure virtual

A private function used to initialize everything specific to the child optimizer.

This function is used to initialize everything specific to the optimizer that should be initialized. It is called by the Initialize() function. It is pure virtual so is implemented by children.

Returns
An integer reflecting the initialization status; 0 if no problem, another value otherwise.

Implemented in iOptimizerNEGML, iOptimizerOriginalAML, iOptimizerLandweber, iOptimizerTemplate, and iOptimizerMLEM.

Here is the caller graph for this function:

int vOptimizer::PostDataUpdateSpecificStep ( int  a_iteration,
int  a_nbIterations,
int  a_subset,
int  a_nbSubsets 
)
privatevirtual

A private function used to perform any step required by the child optimizer, after the loop on event inside the subset loop.

Parameters
inta_iteration
inta_nbIterations
inta_subset
inta_nbSubsets

The vOptimizer implementation just does nothing. It is called by the PostDataUpdateStep() function. It is virtual so it can be overloaded by the child optimizer if needed.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Definition at line 461 of file vOptimizer.cc.

Here is the caller graph for this function:

int vOptimizer::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 update step; i.e. the loop over all events)

Parameters
inta_iteration
inta_nbIterations
inta_subset
inta_nbSubsets

It does some reseting for the FOM computation. At the end, it calls the PostDataUpdateSpecificStep() function, which does nothing but being virtual, so it can be overloaded to perform specific stuff at this step by specific optimizers that would need to do so.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Definition at line 397 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int vOptimizer::PreDataUpdateSpecificStep ( int  a_iteration,
int  a_nbIterations,
int  a_subset,
int  a_nbSubsets 
)
privatevirtual

A private function used to perform any step required by the child optimizer, before the loop on event inside the subset loop.

Parameters
inta_iteration
inta_nbIterations
inta_subset
inta_nbSubsets

The vOptimizer implementation just does nothing. It is called by the PreDataUpdateStep() function. It is virtual so it can be overloaded by the child optimizer if needed.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Definition at line 386 of file vOptimizer.cc.

Here is the caller graph for this function:

int vOptimizer::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 update step; i.e. the loop over all events)

Parameters
inta_iteration
inta_nbIterations
inta_subset
inta_nbSubsets

It does some reseting for the FOM computation. At the end, it calls the PreDataUpdateSpecificStep() function, which does nothing but being virtual, so it can be overloaded to perform specific stuff at this step by specific optimizers that would need to do so.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Definition at line 355 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

public virtual int vOptimizer::ReadConfigurationFile ( const string &  a_configurationFile)
pure virtual

A function used to read options from a configuration file.

Parameters
conststring& a_configurationFile

This function implements the reading of all options associated to a child optimizer, from a configuration file. It is pure virtual so is implemented by children. It checks the reading status but not the options values that will be checked by the CheckSpecificParameters() function.

Returns
An integer reflecting the reading success; 0 if success, another value otherwise.

Implemented in iOptimizerNEGML, iOptimizerOriginalAML, iOptimizerLandweber, iOptimizerMLEM, and iOptimizerTemplate.

Here is the caller graph for this function:

public virtual int vOptimizer::ReadOptionsList ( const string &  a_optionsList)
pure virtual

A function used to read options from a list of options.

Parameters
conststring& a_optionsList

This function implements the reading of all options associated to a child optimizer, from a list of options. It is pure virtual so is implemented by children. It checks the reading status but not the options values that will be checked by the CheckSpecificParameters() function.

Returns
An integer reflecting the reading success; 0 if success, another value otherwise.

Implemented in iOptimizerNEGML, iOptimizerOriginalAML, iOptimizerLandweber, iOptimizerMLEM, and iOptimizerTemplate.

Here is the caller graph for this function:

private virtual int vOptimizer::SensitivitySpecificOperations ( FLTNB  a_data,
FLTNB  a_forwardModel,
FLTNB ap_weight,
FLTNB  a_multiplicativeCorrections,
FLTNB  a_additiveCorrections,
FLTNB  a_quantificationFactor,
oProjectionLine ap_Line 
)
privatepure virtual

A private function used to compute the sensitivity weight associated to the provided data.

Parameters
FLTNBa_data
FLTNBa_forwardModel
FLTNB*ap_weight
FLTNBa_multiplicativeCorrections
FLTNBa_additiveCorrections
FLTNBa_quantificationFactor
oProjectionLine*ap_Line

This function is pure virtual, so must be implemented by specific optimizers. The computed sensitivity term must be put at the ap_weight pointer. All potentially useful information is provided as parameters. Note that the multiplicate corrections parameter only includes such correction specific to the event; in other words, it does not include the quantification factor which is given separately.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Implemented in iOptimizerNEGML, iOptimizerOriginalAML, iOptimizerLandweber, iOptimizerTemplate, and iOptimizerMLEM.

Here is the caller graph for this function:

public inline void vOptimizer::SetAttenuationImage ( FLTNB ap_attenuationImage,
int  a_thread 
)
inline

Set the attenuation image corresponding to the current thread and current event.

Parameters
FLTNB*ap_attenuationImage
inta_thread

Definition at line 498 of file vOptimizer.hh.

Here is the caller graph for this function:

public inline void vOptimizer::SetDataMode ( int  a_dataMode)
inline

Set the data mode in use.

Parameters
inta_dataMode

Definition at line 483 of file vOptimizer.hh.

Here is the caller graph for this function:

public inline void vOptimizer::SetDataType ( int  a_dataType)
inline

Set the data type in use.

Parameters
inta_dataType

Definition at line 490 of file vOptimizer.hh.

Here is the caller graph for this function:

public inline void vOptimizer::SetFOMFlag ( bool  a_optimizerFOMFlag)
inline

Set the FOM flag specifying if figures-of-merit will be computed or not.

Parameters
boola_optimizerFOMFlag

Definition at line 505 of file vOptimizer.hh.

Here is the caller graph for this function:

public inline void vOptimizer::SetImageDimensionsAndQuantification ( oImageDimensionsAndQuantification ap_ImageDimensionsAndQuantification)
inline

Set the pointer to the image dimensions in use.

Parameters
oImageDimensionsAndQuantification*ap_ImageDimensionsAndQuantification

Definition at line 469 of file vOptimizer.hh.

Here is the caller graph for this function:

public inline void vOptimizer::SetImageStatFlag ( bool  a_optimizerImageStatFlag)
inline

Set the image stat flag specifying if basic statistics about image udpate will be computed or not.

Parameters
boola_optimizerImageStatFlag

Definition at line 512 of file vOptimizer.hh.

Here is the caller graph for this function:

public inline void vOptimizer::SetNbTOFBins ( int  a_nbTOFBins)
inline

Set the number of TOF bins in use.

Parameters
inta_nbTOFBins

Definition at line 476 of file vOptimizer.hh.

Here is the caller graph for this function:

public inline void vOptimizer::SetVerbose ( int  a_verbose)
inline

Set the verbose level.

Parameters
inta_verboseLevel

Definition at line 462 of file vOptimizer.hh.

Here is the caller graph for this function:

void vOptimizer::ShowHelp ( )

A function used to show help about the optimizer.

This function simply calls the ShowHelpSpecific() function implemented by children.

Definition at line 190 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

private virtual void vOptimizer::ShowHelpSpecific ( )
privatepure virtual

A function used to show help about the child module.

This function must describe what the optimizer does and how to use it. It describes in details the different parameters of the optimizer, and how to set them through the use of a configuration file or a list of options. It is pure virtual so is implemented by children. It is private because called by the public ShowHelp() function.

Implemented in iOptimizerNEGML, iOptimizerOriginalAML, iOptimizerLandweber, iOptimizerTemplate, and iOptimizerMLEM.

Here is the caller graph for this function:

int vOptimizer::UpdateVisitedVoxels ( oImageSpace ap_Image)

A public function used to update the 'visited' voxels after each subset.

Parameters
oImageSpace*ap_Image

This function is called at the end of each subset. Based on the sensitivity image, it labels which voxel has been visited or not during each subset. At the end of the iteration, all voxels that have not been visited in any subset are set to 0. There is a dedicated matrix in the oImageSpace to keep track of visited voxels. Practically, this avoids having those never visited voxels trapped in their initial value if the latter is different from 0.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Definition at line 731 of file vOptimizer.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

FLTNB** vOptimizer::m2p_attenuationImage
protected

The attenuation image currently in use for the current event, one per thread (used for SPECT)

Definition at line 594 of file vOptimizer.hh.

FLTNB** vOptimizer::m2p_forwardValues
protected

Buffer for forward projected values, as many as threads and as many as TOF bins

Definition at line 585 of file vOptimizer.hh.

FLTNB*** vOptimizer::m3p_backwardValues
protected

Buffer for values to be back-projected, as many as threads, as many as TOF bins and as many as backward images

Definition at line 586 of file vOptimizer.hh.

FLTNB**** vOptimizer::m4p_FOMLogLikelihood
protected

The log-likelihood FOM, as many as frames, respiratory gates, cardiac gates and threads

Definition at line 597 of file vOptimizer.hh.

uint64_t**** vOptimizer::m4p_FOMNbBins
protected

The number of bins contributing to the FOM computation, as many as frames, respiratory gates, cardiac gates and threads

Definition at line 599 of file vOptimizer.hh.

double**** vOptimizer::m4p_FOMNbData
protected

The number of data (counts) contributing to the FOM computation, as many as frames, respiratory gates, cardiac gates and threads

Definition at line 600 of file vOptimizer.hh.

FLTNB**** vOptimizer::m4p_FOMRMSE
protected

The RMSE FOM, as many as frames, respiratory gates, cardiac gates and threads

Definition at line 598 of file vOptimizer.hh.

int vOptimizer::m_dataMode
protected

The mode of the data (list-mode or histogram)

Definition at line 592 of file vOptimizer.hh.

int vOptimizer::m_dataType
protected

The type of the data (PET, SPECT, ...)

Definition at line 593 of file vOptimizer.hh.

bool vOptimizer::m_histogramCompatibility
protected

A flag saying if the optimizer is compatible with histogram data

Definition at line 589 of file vOptimizer.hh.

FLTNB vOptimizer::m_initialValue
protected

The initial value of the image for the specific optimizer

Definition at line 587 of file vOptimizer.hh.

bool vOptimizer::m_listmodeCompatibility
protected

A flag saying if the optimizer is compatible with list-mode data

Definition at line 588 of file vOptimizer.hh.

int vOptimizer::m_nbBackwardImages
protected

The number of backward images used by the specific optimizer

Definition at line 583 of file vOptimizer.hh.

int vOptimizer::m_nbTOFBins
protected

The number of TOF bins in use

Definition at line 584 of file vOptimizer.hh.

bool vOptimizer::m_optimizerFOMFlag
protected

A flag saying if figures-of-merit are computed in the data space

Definition at line 596 of file vOptimizer.hh.

bool vOptimizer::m_optimizerImageStatFlag
protected

A flag saying if some basic statistics about image update are computed

Definition at line 602 of file vOptimizer.hh.

int vOptimizer::m_verbose
protected

The verbose level

Definition at line 582 of file vOptimizer.hh.

double* vOptimizer::mp_correctionStatMean
protected

The mean additive update correction value, one per thread to be thread safe

Definition at line 608 of file vOptimizer.hh.

double* vOptimizer::mp_correctionStatVariance
protected

The variance of additive update correction values, one per thread to be thread safe

Definition at line 609 of file vOptimizer.hh.

oImageDimensionsAndQuantification* vOptimizer::mp_ImageDimensionsAndQuantification
protected

Pointer to the image dimensions and quantification object

Definition at line 591 of file vOptimizer.hh.

FLTNB* vOptimizer::mp_imageStatMax
protected

The maximum image value, one per thread to be thread safe

Definition at line 605 of file vOptimizer.hh.

double* vOptimizer::mp_imageStatMean
protected

The mean image value, one per thread to be thread safe

Definition at line 606 of file vOptimizer.hh.

FLTNB* vOptimizer::mp_imageStatMin
protected

The minimum image value, one per thread to be thread safe

Definition at line 604 of file vOptimizer.hh.

INTNB* vOptimizer::mp_imageStatNbVox
protected

The number of voxels contributing to the image statistics, one per thread to be thread safe

Definition at line 603 of file vOptimizer.hh.

double* vOptimizer::mp_imageStatVariance
protected

The image variance value, one per thread to be thread safe

Definition at line 607 of file vOptimizer.hh.


The documentation for this class was generated from the following files: