CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vAlgorithm Class Referenceabstract

This is the base class for reconstructions, containing a framework with iteration and data subset loops.
It contains all the managers and the images. More...

#include <vAlgorithm.hh>

Inheritance diagram for vAlgorithm:
Inheritance graph
Collaboration diagram for vAlgorithm:
Collaboration graph

Public Member Functions

 vAlgorithm ()
 vAlgorithm constructor. Initialize the member variables to their default values. More...
 
virtual ~vAlgorithm ()
 vAlgorithm destructor. More...
 
int Run ()
 Just call either the RunCPU or the RunGPU function as asked for. More...
 
int RunCPU ()
 Perform the iterative loop of the algorithm. Function designed to be executed on the CPU only. More...
 
void SetSaveSensitivityHistoFlag (bool a_saveSensitivityHistoFlag)
 Set the flag that specifies if the sensitivity image in histogram mode has to be saved for each subset/iteration. More...
 
void SetSaveSubsetImageFlag (bool a_saveImageAfterSubsets)
 Set the flag that specifies if the image has to be saved for each subset. More...
 
void SetSaveDynamicBasisCoefficientImages (bool a_saveDynamicBasisCoefficients)
 Set the flag that specifies if the dynamic basis functions coefficients images have to be saved. More...
 
void SetOptimizerManager (oOptimizerManager *ap_OptimizerManager)
 Set the Optimizer Manager Object. More...
 
void SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
 Set the Image Dimensions and Quantification Object. More...
 
void SetImageSpace (oImageSpace *ap_ImageSpace)
 Set the Image Space Object. More...
 
void SetProjectorManager (oProjectorManager *ap_ProjectorManager)
 Set the Projector Manager Object. More...
 
void SetImageConvolverManager (oImageConvolverManager *ap_ImageConvolverManager)
 Set the Image Convolver Manager Object. More...
 
void SetImageProcessingManager (oImageProcessingManager *ap_ImageProcessingManager)
 Set the Image Processing Manager Object. More...
 
void SetDynamicModelManager (oDynamicModelManager *ap_DynamicModelManager)
 Set the Dynamic Model Manager Object. More...
 
void SetDeformationManager (oDeformationManager *ap_DeformationManager)
 Set the Deformation Manager Object. More...
 
void SetDataFile (vDataFile **a2p_DataFile)
 Set the list of DataFile. More...
 
void SetGPUflag (bool a_flagGPU)
 Set the GPU flag. More...
 
void SetVerbose (int a_verboseLevel)
 Set Verbosity. More...
 
void SetNbBeds (int a_nbBeds)
 Set number of beds (bed positions) More...
 
void SetPathInitImage (string a_pathToInitialImage)
 Set path to an initial image. More...
 
void SetPathToAttenuationImage (string a_pathToAttenuationImage)
 This function is used to set the path to the attenuation image. More...
 
void SetPathToSensitivityImage (string a_pathToSensitivityImage)
 Set path to the sensitivity image. More...
 
void SetPathToMultiModalImage (vector< string > a_pathToMultiModalImage)
 Set path to multimodal images. More...
 
void SetPathToMaskImage (string a_pathToMaskImage)
 Set path to a mask image. More...
 
int SetNbIterationsAndSubsets (const string &a_nbIterationsSubsets)
 Set the number of iterations and subsets. More...
 
int SetOutputIterations (const string &a_outputIterations)
 Set the selected output iterations. More...
 
virtual int InitSpecificOptions (string a_specificOptions)
 
virtual void ShowHelpSpecific ()
 Show help for the child algorithm. More...
 

Protected Member Functions

virtual int StepBeforeIterationLoop ()
 This function is called at the beginning of the RunCPU function. More...
 
virtual int StepAfterIterationLoop ()
 This function is called at the end of the RunCPU function. More...
 
virtual int StepBeforeSubsetLoop (int a_iteration)
 This function is called before starting the data subset loop. More...
 
virtual int StepAfterSubsetLoop (int a_iteration)
 This function is called after finishing the data subset loop. More...
 
virtual int StepPreProcessInsideSubsetLoop (int a_iteration, int a_subset)
 This function is called right after starting the data subset loop. More...
 
virtual int StepPostProcessInsideSubsetLoop (int a_iteration, int a_subset)
 
virtual int StepInnerLoopInsideSubsetLoop (int a_iteration, int a_subset, int a_bed)=0
 This function is called inside the subset loop.
It contains the core operations of the algorithm and must be implemented by child classes. More...
 
virtual int StepImageOutput (int a_iteration, int a_subset=-1)=0
 This function deals with everything about saving output images from the reconstruction. More...
 

Protected Attributes

int m_nbIterations
 
int * mp_nbSubsets
 
bool * mp_outputIterations
 
int m_verbose
 
bool m_flagGPU
 
oImageDimensionsAndQuantificationmp_ID
 
vDataFile ** m2p_DataFile
 
oProjectorManagermp_ProjectorManager
 
oOptimizerManagermp_OptimizerManager
 
oDeformationManagermp_DeformationManager
 
oDynamicModelManagermp_DynamicModelManager
 
oImageSpacemp_ImageSpace
 
oImageConvolverManagermp_ImageConvolverManager
 
oImageProcessingManagermp_ImageProcessingManager
 
int m_nbBeds
 
string m_pathToInitialImg
 
string m_pathToAtnImg
 
string m_pathToSensitivityImg
 
vector< string > m_pathToMultiModalImg
 
string m_pathToMaskImg
 
bool m_saveSensitivityHistoFlag
 
bool m_saveImageAfterSubsets
 
bool m_saveDynamicBasisCoefficients
 

Detailed Description

This is the base class for reconstructions, containing a framework with iteration and data subset loops.
It contains all the managers and the images.

Definition at line 51 of file vAlgorithm.hh.

Constructor & Destructor Documentation

◆ vAlgorithm()

vAlgorithm::vAlgorithm ( )

vAlgorithm constructor. Initialize the member variables to their default values.

Definition at line 39 of file vAlgorithm.cc.

◆ ~vAlgorithm()

vAlgorithm::~vAlgorithm ( )
virtual

vAlgorithm destructor.

Definition at line 73 of file vAlgorithm.cc.

Member Function Documentation

◆ InitSpecificOptions()

int vAlgorithm::InitSpecificOptions ( string  a_specificOptions)
virtual
Parameters
a_specificOptions
Returns
0

Reimplemented in iIterativeAlgorithm, and iRCPGSAlgorithm.

Definition at line 516 of file vAlgorithm.cc.

Here is the caller graph for this function:

◆ Run()

int vAlgorithm::Run ( )

Just call either the RunCPU or the RunGPU function as asked for.

Returns
0 if success, positive value otherwise

Definition at line 233 of file vAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunCPU()

int vAlgorithm::RunCPU ( )

Perform the iterative loop of the algorithm. Function designed to be executed on the CPU only.

Loops over the iterations, data subsets, bed positions

StepBeforeIterationLoop()
/ Loop on iterations
| StepBeforeSubsetLoop(iteration)
| / Loop on data subsets
| | StepPreProcessInsideSubsetLoop(iteration,subset)
| | / Loop on bed positions
| | | StepInnerLoopInsideSubsetLoop(iteration,subset,bed)
| | StepPostProcessInsideSubsetLoop(iteration,subset)
| StepAfterSubsetLoop(iteration)
StepAfterIterationLoop()

Returns
0 if success, positive value otherwise

Definition at line 252 of file vAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetDataFile()

public vAlgorithm::SetDataFile ( vDataFile **  a2p_DataFile)
inline

Set the list of DataFile.

Parameters
a2p_DataFile

Definition at line 190 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetDeformationManager()

public vAlgorithm::SetDeformationManager ( oDeformationManager ap_DeformationManager)
inline

Set the Deformation Manager Object.

Parameters
ap_DeformationManager

Definition at line 183 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetDynamicModelManager()

public vAlgorithm::SetDynamicModelManager ( oDynamicModelManager ap_DynamicModelManager)
inline

Set the Dynamic Model Manager Object.

Parameters
ap_DynamicModelManager

Definition at line 176 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetGPUflag()

public vAlgorithm::SetGPUflag ( bool  a_flagGPU)
inline

Set the GPU flag.

Parameters
a_flagGPU

Definition at line 197 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetImageConvolverManager()

public vAlgorithm::SetImageConvolverManager ( oImageConvolverManager ap_ImageConvolverManager)
inline

Set the Image Convolver Manager Object.

Parameters
ap_ImageConvolverManager

Definition at line 162 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetImageDimensionsAndQuantification()

public vAlgorithm::SetImageDimensionsAndQuantification ( oImageDimensionsAndQuantification ap_ImageDimensionsAndQuantification)
inline

Set the Image Dimensions and Quantification Object.

Parameters
ap_ImageDimensionsAndQuantification

Definition at line 141 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetImageProcessingManager()

public vAlgorithm::SetImageProcessingManager ( oImageProcessingManager ap_ImageProcessingManager)
inline

Set the Image Processing Manager Object.

Parameters
ap_ImageProcessingManager

Definition at line 169 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetImageSpace()

public vAlgorithm::SetImageSpace ( oImageSpace ap_ImageSpace)
inline

Set the Image Space Object.

Parameters
ap_ImageSpace

Definition at line 148 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetNbBeds()

public vAlgorithm::SetNbBeds ( int  a_nbBeds)
inline

Set number of beds (bed positions)

Parameters
a_nbBeds

Definition at line 211 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetNbIterationsAndSubsets()

int vAlgorithm::SetNbIterationsAndSubsets ( const string &  a_nbIterationsSubsets)

Set the number of iterations and subsets.

Parameters
a_nbIterationsSubsets

The provided string is a list of iteration:subset pairs separated by commas.

Returns
0 if success, positive value otherwise

Definition at line 85 of file vAlgorithm.cc.

Here is the caller graph for this function:

◆ SetOptimizerManager()

public vAlgorithm::SetOptimizerManager ( oOptimizerManager ap_OptimizerManager)
inline

Set the Optimizer Manager Object.

Parameters
ap_OptimizerManager

Definition at line 134 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetOutputIterations()

int vAlgorithm::SetOutputIterations ( const string &  a_outputIterations)

Set the selected output iterations.

Parameters
a_outputIterations

The provided string is a list of couple a:b separated by commas.
It means that we save one iteration over a until b is reached.
"b" must be incrementing for each successive couples. If the list is empty, we save all iterations by default.
If the list is equal to "-1", then we save only the last iteration.

Returns
0 if success, positive value otherwise

Definition at line 144 of file vAlgorithm.cc.

Here is the caller graph for this function:

◆ SetPathInitImage()

public vAlgorithm::SetPathInitImage ( string  a_pathToInitialImage)
inline

Set path to an initial image.

Parameters
a_pathToInitialImage

Definition at line 218 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetPathToAttenuationImage()

public vAlgorithm::SetPathToAttenuationImage ( string  a_pathToAttenuationImage)
inline

This function is used to set the path to the attenuation image.

Parameters
stringa_pathToAttenuationImage

Definition at line 225 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetPathToMaskImage()

public vAlgorithm::SetPathToMaskImage ( string  a_pathToMaskImage)
inline

Set path to a mask image.

Parameters
a_pathToMaskImage

Definition at line 246 of file vAlgorithm.hh.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetPathToMultiModalImage()

public vAlgorithm::SetPathToMultiModalImage ( vector< string >  a_pathToMultiModalImage)
inline

Set path to multimodal images.

Parameters
a_pathToMultiModalImage

Definition at line 239 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetPathToSensitivityImage()

public vAlgorithm::SetPathToSensitivityImage ( string  a_pathToSensitivityImage)
inline

Set path to the sensitivity image.

Parameters
a_pathToSensitivityImage

Definition at line 232 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetProjectorManager()

public vAlgorithm::SetProjectorManager ( oProjectorManager ap_ProjectorManager)
inline

Set the Projector Manager Object.

Parameters
ap_ProjectorManager

Definition at line 155 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetSaveDynamicBasisCoefficientImages()

public void vAlgorithm::SetSaveDynamicBasisCoefficientImages ( bool  a_saveDynamicBasisCoefficients)
inline

Set the flag that specifies if the dynamic basis functions coefficients images have to be saved.

Parameters
boola_saveDynamicBasisCoefficients

Definition at line 127 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetSaveSensitivityHistoFlag()

public void vAlgorithm::SetSaveSensitivityHistoFlag ( bool  a_saveSensitivityHistoFlag)
inline

Set the flag that specifies if the sensitivity image in histogram mode has to be saved for each subset/iteration.

Parameters
boola_saveSensitivityHistoFlag

Definition at line 113 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetSaveSubsetImageFlag()

public void vAlgorithm::SetSaveSubsetImageFlag ( bool  a_saveImageAfterSubsets)
inline

Set the flag that specifies if the image has to be saved for each subset.

Parameters
boola_saveImageAfterSubsets

Definition at line 120 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ SetVerbose()

public vAlgorithm::SetVerbose ( int  a_verboseLevel)
inline

Set Verbosity.

Parameters
a_verboseLevel

Definition at line 204 of file vAlgorithm.hh.

Here is the caller graph for this function:

◆ ShowHelpSpecific()

public virtual vAlgorithm::ShowHelpSpecific ( )
inlinevirtual

Show help for the child algorithm.

Reimplemented in iRCPGSAlgorithm.

Definition at line 279 of file vAlgorithm.hh.

Here is the call graph for this function:

◆ StepAfterIterationLoop()

int vAlgorithm::StepAfterIterationLoop ( )
protectedvirtual

This function is called at the end of the RunCPU function.

Returns
0 if success, positive value otherwise.

Reimplemented in iIterativeAlgorithm, and iRCPGSAlgorithm.

Definition at line 483 of file vAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StepAfterSubsetLoop()

int vAlgorithm::StepAfterSubsetLoop ( int  a_iteration)
protectedvirtual

This function is called after finishing the data subset loop.

Parameters
a_iteration: iteration index
Returns
0 if success, positive value otherwise.

Reimplemented in iIterativeAlgorithm, and iRCPGSAlgorithm.

Definition at line 472 of file vAlgorithm.cc.

Here is the caller graph for this function:

◆ StepBeforeIterationLoop()

int vAlgorithm::StepBeforeIterationLoop ( )
protectedvirtual

This function is called at the beginning of the RunCPU function.

Returns
0 if success, positive value otherwise.

Reimplemented in iIterativeAlgorithm, and iRCPGSAlgorithm.

Definition at line 388 of file vAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StepBeforeSubsetLoop()

int vAlgorithm::StepBeforeSubsetLoop ( int  a_iteration)
protectedvirtual

This function is called before starting the data subset loop.

Parameters
a_iteration: iteration index
Returns
0 if success, positive value otherwise.

Reimplemented in iIterativeAlgorithm, and iRCPGSAlgorithm.

Definition at line 439 of file vAlgorithm.cc.

Here is the caller graph for this function:

◆ StepImageOutput()

int vAlgorithm::StepImageOutput ( int  a_iteration,
int  a_subset = -1 
)
protectedpure virtual

This function deals with everything about saving output images from the reconstruction.

Implemented in iIterativeAlgorithm, and iRCPGSAlgorithm.

Definition at line 505 of file vAlgorithm.cc.

Here is the caller graph for this function:

◆ StepInnerLoopInsideSubsetLoop()

vAlgorithm::StepInnerLoopInsideSubsetLoop ( int  a_iteration,
int  a_subset,
int  a_bed 
)
protectedpure virtual

This function is called inside the subset loop.
It contains the core operations of the algorithm and must be implemented by child classes.

Parameters
a_iteration: iteration index
a_subset: subset index
a_bed: bed position
Returns
0 if success, positive value otherwise.

Implemented in iIterativeAlgorithm, and iRCPGSAlgorithm.

Here is the caller graph for this function:

◆ StepPostProcessInsideSubsetLoop()

int vAlgorithm::StepPostProcessInsideSubsetLoop ( int  a_iteration,
int  a_subset 
)
protectedvirtual

Reimplemented in iIterativeAlgorithm, and iRCPGSAlgorithm.

Definition at line 461 of file vAlgorithm.cc.

Here is the caller graph for this function:

◆ StepPreProcessInsideSubsetLoop()

int vAlgorithm::StepPreProcessInsideSubsetLoop ( int  a_iteration,
int  a_subset 
)
protectedvirtual

This function is called right after starting the data subset loop.

This function is called right after starting the subset loop.
.

Parameters
a_iteration: iteration index
a_subset: subset index
Returns
0 if success, positive value otherwise.

Reimplemented in iIterativeAlgorithm, and iRCPGSAlgorithm.

Definition at line 450 of file vAlgorithm.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ m2p_DataFile

vDataFile** vAlgorithm::m2p_DataFile
protected

Pointer to the array of vDataFile object

Definition at line 353 of file vAlgorithm.hh.

◆ m_flagGPU

bool vAlgorithm::m_flagGPU
protected

Do we use GPU or not (default=false)

Definition at line 351 of file vAlgorithm.hh.

◆ m_nbBeds

int vAlgorithm::m_nbBeds
protected

number of bed FOVs (1 datafile by bed) (default=-1)

Definition at line 361 of file vAlgorithm.hh.

◆ m_nbIterations

int vAlgorithm::m_nbIterations
protected

Number of iterations (default=1)

Definition at line 347 of file vAlgorithm.hh.

◆ m_pathToAtnImg

string vAlgorithm::m_pathToAtnImg
protected

String of the path to the attenuation images

Definition at line 363 of file vAlgorithm.hh.

◆ m_pathToInitialImg

string vAlgorithm::m_pathToInitialImg
protected

String containing the path to an initialization image

Definition at line 362 of file vAlgorithm.hh.

◆ m_pathToMaskImg

string vAlgorithm::m_pathToMaskImg
protected

String containing the path to a mask image

Definition at line 366 of file vAlgorithm.hh.

◆ m_pathToMultiModalImg

vector<string> vAlgorithm::m_pathToMultiModalImg
protected

String vector containing paths to multimodal images

Definition at line 365 of file vAlgorithm.hh.

◆ m_pathToSensitivityImg

string vAlgorithm::m_pathToSensitivityImg
protected

String containing the path to a sensitivity image

Definition at line 364 of file vAlgorithm.hh.

◆ m_saveDynamicBasisCoefficients

bool vAlgorithm::m_saveDynamicBasisCoefficients
protected

Flag specifying that the dynamic basis coefficient images will be saved

Definition at line 369 of file vAlgorithm.hh.

◆ m_saveImageAfterSubsets

bool vAlgorithm::m_saveImageAfterSubsets
protected

Flag specifying that the image has to be saved after each subset

Definition at line 368 of file vAlgorithm.hh.

◆ m_saveSensitivityHistoFlag

bool vAlgorithm::m_saveSensitivityHistoFlag
protected

Flag specifying that the sensitivity image has to be saved for each subset/iteration in histogram mode

Definition at line 367 of file vAlgorithm.hh.

◆ m_verbose

int vAlgorithm::m_verbose
protected

Verbosity (default=-1)

Definition at line 350 of file vAlgorithm.hh.

◆ mp_DeformationManager

oDeformationManager* vAlgorithm::mp_DeformationManager
protected

Pointer to the Deformation Manager object

Definition at line 356 of file vAlgorithm.hh.

◆ mp_DynamicModelManager

oDynamicModelManager* vAlgorithm::mp_DynamicModelManager
protected

Pointer to the Dynamic Model Manager object

Definition at line 357 of file vAlgorithm.hh.

◆ mp_ID

oImageDimensionsAndQuantification* vAlgorithm::mp_ID
protected

Pointer to the oImageDimensionsAndQuantification object

Definition at line 352 of file vAlgorithm.hh.

◆ mp_ImageConvolverManager

oImageConvolverManager* vAlgorithm::mp_ImageConvolverManager
protected

Pointer to the Image Convolver Manager object

Definition at line 359 of file vAlgorithm.hh.

◆ mp_ImageProcessingManager

oImageProcessingManager* vAlgorithm::mp_ImageProcessingManager
protected

Pointer to the Image Processing Manager object

Definition at line 360 of file vAlgorithm.hh.

◆ mp_ImageSpace

oImageSpace* vAlgorithm::mp_ImageSpace
protected

Pointer to the Image Space object

Definition at line 358 of file vAlgorithm.hh.

◆ mp_nbSubsets

int* vAlgorithm::mp_nbSubsets
protected

Number of subsets (default=1)

Definition at line 348 of file vAlgorithm.hh.

◆ mp_OptimizerManager

oOptimizerManager* vAlgorithm::mp_OptimizerManager
protected

Pointer to the Optimizer Manager object

Definition at line 355 of file vAlgorithm.hh.

◆ mp_outputIterations

bool* vAlgorithm::mp_outputIterations
protected

A boolean for each iteration saying if we save it or not

Definition at line 349 of file vAlgorithm.hh.

◆ mp_ProjectorManager

oProjectorManager* vAlgorithm::mp_ProjectorManager
protected

Pointer to the Projector Manager object

Definition at line 354 of file vAlgorithm.hh.


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