CASToR  2.0
Tomographic Reconstruction (PET/SPECT/CT)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
oSensitivityGenerator Class Reference

This class is designed to manage the computation of the sensitivity image. More...

#include <oSensitivityGenerator.hh>

Collaboration diagram for oSensitivityGenerator:
Collaboration graph

Public Member Functions

 oSensitivityGenerator ()
 The constructor of oSensitivityGenerator. More...
 
 ~oSensitivityGenerator ()
 The destructor of oSensitivityGenerator. More...
 
int CheckParameters ()
 A public function used to check the parameters settings. More...
 
int Initialize ()
 A public function used to initialize the sensitivity generator. More...
 
int Launch ()
 A public function used to launch the sensitivity generator (compute the sensitivity image) More...
 
string GetPathToSensitivityImage ()
 This function return the path to the sensitivity image. More...
 
void SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
 This function is used to set the pointer to the oImageDimensionsAndQuantification in use. More...
 
void SetImageSpace (oImageSpace *ap_ImageSpace)
 This function is used to set the pointer to the oImageSpace in use. More...
 
void SetScanner (vScanner *ap_Scanner)
 This function is used to set the pointer to the vScanner in use. More...
 
void SetProjectorManager (oProjectorManager *ap_ProjectorManager)
 This function is used to set the pointer to the oProjectorManager in use. More...
 
void SetImageConvolverManager (oImageConvolverManager *ap_ImageConvolverManager)
 This function is used to set the pointer to the oImageConvolverManager in use. More...
 
void SetDeformationManager (oDeformationManager *ap_DeformationManager)
 This function is used to set the pointer to the oDeformationManager in use. More...
 
void SetDataFile (vDataFile **a2p_DataFile)
 This function is used to set the pointer to the vDataFile array in use. More...
 
void SetComputeFromHistogramFlag (bool a_computeFromHistogramFlag)
 This function is used to set the m_computeFromHistogramFlag. More...
 
void SetPathToNormalizationFileName (vector< string > ap_pathToNormalizationFileName, bool a_inverseDataFileOrderFlag)
 This function is used to set the path to the normalization file names, and the flag saying if their order must be reversed. More...
 
void SetPathToAttenuationImage (string a_pathToAttenuationImage)
 This function is used to set the path to the attenuation image. More...
 
void SetPathToMaskImage (string a_pathToMaskImage)
 Set path to a mask image. More...
 
void SetNumberOfAtnGateImages (int a_nbAtnRespGateImages, int a_nbAtnCardGateImages)
 
void SetGPUflag (bool a_flagGPU)
 This function is used to set the GPU flag; do we use GPU or not. More...
 
void SetVerbose (int a_verboseLevel)
 

Private Member Functions

int InitializeAttenuationFiles ()
 Initialize the attenuation images provided for sensitivity computation. More...
 
int InitializeNormalizationFiles ()
 Initialize the normalization datafiles provided for sensitivity computation. More...
 
int LaunchCPU ()
 Launch the computation of the sensitivity image (CPU version) More...
 
int ComputeSensitivityFromHistogramDataFile (int a_bed)
 Launch the computation of the sensitivity image for this bed, based on the input histogram data files. More...
 
int ComputeSensitivityFromNormalizationFile (int a_bed)
 Launch the computation of the sensitivity image for this bed, based on normalization data files. More...
 
int ComputeSensitivityFromScanner (int a_bed)
 Launch the computation of the sensitivity image for this bed, based on a loop over all scanner elements. More...
 
int ProcessThisLine (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_frame, int a_respGate, int a_cardGate, int a_thread)
 This function manages the computation of the sensitivity contribution of the projection line provided as a parameter. More...
 

Private Attributes

string m_pathToSensitivityImage
 
oImageDimensionsAndQuantificationmp_ImageDimensionsAndQuantification
 
oImageSpacemp_ImageSpace
 
vScannermp_Scanner
 
oProjectorManagermp_ProjectorManager
 
oImageConvolverManagermp_ImageConvolverManager
 
oDeformationManagermp_DeformationManager
 
vDataFile ** m2p_DataFile
 
bool m_computeFromHistogramFlag
 
vector< string > mp_pathToNormalizationFileName
 
bool m_inverseDataFileOrderFlag
 
vDataFile *** m3p_NormalizationDataFile
 
bool m_oneNormalizationFileForAllBeds
 
bool m_oneNormalizationFileForAllFrames
 
string m_pathToAttenuationImage
 
string m_pathToMaskImg
 
bool m_mumapAttenuationFlag
 
bool m_forwardProjectAttenuation
 
int m_nbAtnRespGateImages
 
int m_nbAtnCardGateImages
 
uint64_t * mp_lineCounter
 
bool m_flagGPU
 
int m_verbose
 
bool m_checked
 
bool m_initialized
 

Detailed Description

This class is designed to manage the computation of the sensitivity image.

The sensitivity computation can be done in two ways:
(i) using a normalization data file if provided, where the loop for computation will be done on all events included in the datafile, with included normalization factors;
(ii) if no normalization file is provided, using a loop on all scanner elements.
A mumap in cm-1 can also be provided in order to include the attenuation correction in the sensitivity image.

Definition at line 56 of file oSensitivityGenerator.hh.

Constructor & Destructor Documentation

oSensitivityGenerator::oSensitivityGenerator ( )

The constructor of oSensitivityGenerator.

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 40 of file oSensitivityGenerator.cc.

oSensitivityGenerator::~oSensitivityGenerator ( )

The destructor of oSensitivityGenerator.

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.

Definition at line 75 of file oSensitivityGenerator.cc.

Here is the call graph for this function:

Member Function Documentation

int oSensitivityGenerator::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.

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

Definition at line 96 of file oSensitivityGenerator.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int oSensitivityGenerator::ComputeSensitivityFromHistogramDataFile ( int  a_bed)
private

Launch the computation of the sensitivity image for this bed, based on the input histogram data files.

Parameters
inta_bed

The loop is done over the events of the histogram data files, which represent the collection of all data channels for the different dynamic frames.

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

Definition at line 634 of file oSensitivityGenerator.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int oSensitivityGenerator::ComputeSensitivityFromNormalizationFile ( int  a_bed)
private

Launch the computation of the sensitivity image for this bed, based on normalization data files.

Parameters
inta_bed

The loop is done over the events of the normalization data files, which represent the collection of all data channels for the different dynamic frames.

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

Definition at line 768 of file oSensitivityGenerator.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int oSensitivityGenerator::ComputeSensitivityFromScanner ( int  a_bed)
private

Launch the computation of the sensitivity image for this bed, based on a loop over all scanner elements.

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

Definition at line 930 of file oSensitivityGenerator.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

string oSensitivityGenerator::GetPathToSensitivityImage ( )

This function return the path to the sensitivity image.

Returns
m_pathToSensitivityImage

Definition at line 1203 of file oSensitivityGenerator.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int oSensitivityGenerator::Initialize ( )

A public function used to initialize the sensitivity generator.

This function does not take any parameter and is used to initialize everything that should be initialized.

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

Definition at line 172 of file oSensitivityGenerator.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int oSensitivityGenerator::InitializeAttenuationFiles ( )
private

Initialize the attenuation images provided for sensitivity computation.

This function is called by the Initialize() function. It checks and reads the provided attenuation images to be taken into account for sensitivity computation.

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

Definition at line 427 of file oSensitivityGenerator.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int oSensitivityGenerator::InitializeNormalizationFiles ( )
private

Initialize the normalization datafiles provided for sensitivity computation.

This function is called by the Initialize() function. It checks and reads the provided normalization datafiles to be taken into account for sensitivity computation.

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

Definition at line 246 of file oSensitivityGenerator.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int oSensitivityGenerator::Launch ( )

A public function used to launch the sensitivity generator (compute the sensitivity image)

This function does not take any parameter and is used to launch the computation of the sensitivity image. In fact, it simply switches between the CPU and GPU versions of the function (which are private).

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

Definition at line 496 of file oSensitivityGenerator.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int oSensitivityGenerator::LaunchCPU ( )
private

Launch the computation of the sensitivity image (CPU version)

This function calls either the ComputeSensitivityFromNormalizationFile() or the ComputeSensitivityFromScanner() function based on normalization data files provided or not.
It does the loop over all bed positions.

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

Definition at line 514 of file oSensitivityGenerator.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int oSensitivityGenerator::ProcessThisLine ( oProjectionLine ap_Line,
vEvent ap_Event,
int  a_bed,
int  a_frame,
int  a_respGate,
int  a_cardGate,
int  a_thread 
)
private

This function manages the computation of the sensitivity contribution of the projection line provided as a parameter.

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

For the given line, the given event, the current bed, frame, respiratory and cardiac gates, the function performs the forward projectio into the attenuation images (if any), compute the sensitivity contribution, and back-projects this contribution into the sensitivity image.

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

Definition at line 1135 of file oSensitivityGenerator.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

public inline void oSensitivityGenerator::SetComputeFromHistogramFlag ( bool  a_computeFromHistogramFlag)
inline

This function is used to set the m_computeFromHistogramFlag.

Parameters
boola_computeFromHistogramFlag

Definition at line 251 of file oSensitivityGenerator.hh.

Here is the caller graph for this function:

public inline void oSensitivityGenerator::SetDataFile ( vDataFile **  a2p_DataFile)
inline

This function is used to set the pointer to the vDataFile array in use.

Parameters
vDataFile**a2p_DataFile

Definition at line 244 of file oSensitivityGenerator.hh.

Here is the caller graph for this function:

public inline void oSensitivityGenerator::SetDeformationManager ( oDeformationManager ap_DeformationManager)
inline

This function is used to set the pointer to the oDeformationManager in use.

Parameters
oDeformationManager*ap_DeformationManager

Definition at line 237 of file oSensitivityGenerator.hh.

Here is the caller graph for this function:

public inline void oSensitivityGenerator::SetGPUflag ( bool  a_flagGPU)
inline

This function is used to set the GPU flag; do we use GPU or not.

Parameters
boola_flagGPU

Definition at line 288 of file oSensitivityGenerator.hh.

Here is the caller graph for this function:

public inline void oSensitivityGenerator::SetImageConvolverManager ( oImageConvolverManager ap_ImageConvolverManager)
inline

This function is used to set the pointer to the oImageConvolverManager in use.

Parameters
oImageConvolverManager*ap_ImageConvolverManager

Definition at line 230 of file oSensitivityGenerator.hh.

Here is the caller graph for this function:

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

This function is used to set the pointer to the oImageDimensionsAndQuantification in use.

Parameters
oImageDimensionsAndQuantification*ap_ImageDimensionsAndQuantification

Definition at line 202 of file oSensitivityGenerator.hh.

Here is the caller graph for this function:

public inline void oSensitivityGenerator::SetImageSpace ( oImageSpace ap_ImageSpace)
inline

This function is used to set the pointer to the oImageSpace in use.

Parameters
oImageSpace*ap_ImageSpace

Definition at line 209 of file oSensitivityGenerator.hh.

Here is the caller graph for this function:

void oSensitivityGenerator::SetNumberOfAtnGateImages ( int  a_nbAtnRespGateImages,
int  a_nbAtnCardGateImages 
)
inline

Definition at line 281 of file oSensitivityGenerator.hh.

Here is the caller graph for this function:

public inline void oSensitivityGenerator::SetPathToAttenuationImage ( string  a_pathToAttenuationImage)
inline

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

Parameters
stringa_pathToAttenuationImage

Definition at line 267 of file oSensitivityGenerator.hh.

Here is the caller graph for this function:

public oSensitivityGenerator::SetPathToMaskImage ( string  a_pathToMaskImage)
inline

Set path to a mask image.

Parameters
a_pathToMaskImage

Definition at line 274 of file oSensitivityGenerator.hh.

Here is the caller graph for this function:

public inline void oSensitivityGenerator::SetPathToNormalizationFileName ( vector< string >  ap_pathToNormalizationFileName,
bool  a_inverseDataFileOrderFlag 
)
inline

This function is used to set the path to the normalization file names, and the flag saying if their order must be reversed.

Parameters
vector<string>ap_pathToNormalizationFileName
boola_inverseDataFileOrderFlag

Definition at line 259 of file oSensitivityGenerator.hh.

Here is the caller graph for this function:

public inline void oSensitivityGenerator::SetProjectorManager ( oProjectorManager ap_ProjectorManager)
inline

This function is used to set the pointer to the oProjectorManager in use.

Parameters
oProjectorManager*ap_ProjectorManager

Definition at line 223 of file oSensitivityGenerator.hh.

Here is the caller graph for this function:

public inline void oSensitivityGenerator::SetScanner ( vScanner ap_Scanner)
inline

This function is used to set the pointer to the vScanner in use.

Parameters
vScanner*ap_Scanner

Definition at line 216 of file oSensitivityGenerator.hh.

Here is the caller graph for this function:

void oSensitivityGenerator::SetVerbose ( int  a_verboseLevel)
inline

Definition at line 295 of file oSensitivityGenerator.hh.

Here is the caller graph for this function:

Member Data Documentation

vDataFile** oSensitivityGenerator::m2p_DataFile
private

Pointer to the array of vDataFile objects

Definition at line 310 of file oSensitivityGenerator.hh.

vDataFile*** oSensitivityGenerator::m3p_NormalizationDataFile
private

Pointer to the double array of vDataFile objects for normalization

Definition at line 314 of file oSensitivityGenerator.hh.

bool oSensitivityGenerator::m_checked
private

Boolean that says if the parameters were checked or not

Definition at line 326 of file oSensitivityGenerator.hh.

bool oSensitivityGenerator::m_computeFromHistogramFlag
private

A boolean to specify if the datafile is histogram and that the sensitivity must be computed from it

Definition at line 311 of file oSensitivityGenerator.hh.

bool oSensitivityGenerator::m_flagGPU
private

Do we use GPU or not (default=false)

Definition at line 324 of file oSensitivityGenerator.hh.

bool oSensitivityGenerator::m_forwardProjectAttenuation
private

Flag to say that we need to forward project the provided attenuation map (many conditions for that)

Definition at line 320 of file oSensitivityGenerator.hh.

bool oSensitivityGenerator::m_initialized
private

Boolean that says if the projector was initialized or not

Definition at line 327 of file oSensitivityGenerator.hh.

bool oSensitivityGenerator::m_inverseDataFileOrderFlag
private

Flag to say that the provided normalization data file names order must be reversed

Definition at line 313 of file oSensitivityGenerator.hh.

bool oSensitivityGenerator::m_mumapAttenuationFlag
private

Flag to say if an attenuation image has to been provided

Definition at line 319 of file oSensitivityGenerator.hh.

int oSensitivityGenerator::m_nbAtnCardGateImages
private

Number of attenuation images corresponding to the cardiac gates

Definition at line 322 of file oSensitivityGenerator.hh.

int oSensitivityGenerator::m_nbAtnRespGateImages
private

Number of attenuation images corresponding to the respiratory gates

Definition at line 321 of file oSensitivityGenerator.hh.

bool oSensitivityGenerator::m_oneNormalizationFileForAllBeds
private

A boolean to specify if only one normalization file has been provided for all beds

Definition at line 315 of file oSensitivityGenerator.hh.

bool oSensitivityGenerator::m_oneNormalizationFileForAllFrames
private

A boolean to specify if only one normalization file has been provided for all frames

Definition at line 316 of file oSensitivityGenerator.hh.

string oSensitivityGenerator::m_pathToAttenuationImage
private

String of the path to the attenuation images

Definition at line 317 of file oSensitivityGenerator.hh.

string oSensitivityGenerator::m_pathToMaskImg
private

String of the path to the mask image

Definition at line 318 of file oSensitivityGenerator.hh.

string oSensitivityGenerator::m_pathToSensitivityImage
private

The actual path to the created sensitivity image

Definition at line 296 of file oSensitivityGenerator.hh.

int oSensitivityGenerator::m_verbose
private

Verbosity (default=-1)

Definition at line 325 of file oSensitivityGenerator.hh.

oDeformationManager* oSensitivityGenerator::mp_DeformationManager
private

Pointer to the Deformation Manager object

Definition at line 309 of file oSensitivityGenerator.hh.

oImageConvolverManager* oSensitivityGenerator::mp_ImageConvolverManager
private

Pointer to the Image Convolver Manager object

Definition at line 308 of file oSensitivityGenerator.hh.

oImageDimensionsAndQuantification* oSensitivityGenerator::mp_ImageDimensionsAndQuantification
private

Pointer to the oImageDimensionsAndQuantification object

Definition at line 304 of file oSensitivityGenerator.hh.

oImageSpace* oSensitivityGenerator::mp_ImageSpace
private

Pointer to the Image Space object

Definition at line 305 of file oSensitivityGenerator.hh.

uint64_t* oSensitivityGenerator::mp_lineCounter
private

Counters of the number of effectively projected lines, 1 per thread

Definition at line 323 of file oSensitivityGenerator.hh.

vector<string> oSensitivityGenerator::mp_pathToNormalizationFileName
private

Vector of normalization file names

Definition at line 312 of file oSensitivityGenerator.hh.

oProjectorManager* oSensitivityGenerator::mp_ProjectorManager
private

Pointer to the Projector Manager object

Definition at line 307 of file oSensitivityGenerator.hh.

vScanner* oSensitivityGenerator::mp_Scanner
private

Pointer to the Scanner object

Definition at line 306 of file oSensitivityGenerator.hh.


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