![]() |
CASToR
1.0
Tomographic Reconstruction (PET/SPECT)
|
This class is designed to manage the computation of the sensitivity image. More...
#include <oSensitivityGenerator.hh>
Public Member Functions | |
oSensitivityGenerator () | |
The constructor of oSensitivityGenerator. | |
~oSensitivityGenerator () | |
The destructor of oSensitivityGenerator. | |
int | CheckParameters () |
A public function used to check the parameters settings. | |
int | Initialize () |
A public function used to initialize the sensitivity generator. | |
int | Launch () |
A public function used to launch the sensitivity generator (compute the sensitivity image) | |
string | GetPathToSensitivityImage () |
This function return the path to the sensitivity image. | |
void | SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification) |
This function is used to set the pointer to the oImageDimensionsAndQuantification in use. | |
void | SetImageSpace (oImageSpace *ap_ImageSpace) |
This function is used to set the pointer to the oImageSpace in use. | |
void | SetScanner (vScanner *ap_Scanner) |
This function is used to set the pointer to the vScanner in use. | |
void | SetProjectorManager (oProjectorManager *ap_ProjectorManager) |
This function is used to set the pointer to the oProjectorManager in use. | |
void | SetImageConvolverManager (oImageConvolverManager *ap_ImageConvolverManager) |
This function is used to set the pointer to the oImageConvolverManager in use. | |
void | SetDeformationManager (oDeformationManager *ap_DeformationManager) |
This function is used to set the pointer to the oDeformationManager in use. | |
void | SetDataFile (vDataFile **a2p_DataFile) |
This function is used to set the pointer to the vDataFile array in use. | |
void | SetPathToNormalizationFileName (vector< string > ap_pathToNormalizationFileName) |
This function is used to set the path to the normalization file names. | |
void | SetNormalizationDataFile (vDataFile ***a3p_NormalizationDataFile) |
This function is used to set the pointer to the vDataFile array in use for normalization. | |
void | SetPathToAttenuationImage (string a_pathToAttenuationImage) |
This function is used to set the path to the attenuation image. | |
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. | |
void | SetVerbose (int a_verboseLevel) |
Private Member Functions | |
int | InitializeAttenuationFiles () |
Initialize the attenuation images provided for sensitivity computation. | |
int | InitializeNormalizationFiles () |
Initialize the normalization datafiles provided for sensitivity computation. | |
int | LaunchCPU () |
Launch the computation of the sensitivity image (CPU version) | |
int | ComputeSensitivityFromNormalizationFile (int a_bed) |
Launch the computation of the sensitivity image for this bed, based on normalization data files. | |
int | ComputeSensitivityFromScanner (int a_bed) |
Launch the computation of the sensitivity image for this bed, based on a loop over all scanner elements. | |
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. | |
Private Attributes | |
string | m_pathToSensitivityImage |
oImageDimensionsAndQuantification * | mp_ImageDimensionsAndQuantification |
oImageSpace * | mp_ImageSpace |
vScanner * | mp_Scanner |
oProjectorManager * | mp_ProjectorManager |
oImageConvolverManager * | mp_ImageConvolverManager |
oDeformationManager * | mp_DeformationManager |
vDataFile ** | m2p_DataFile |
vector< string > | mp_pathToNormalizationFileName |
vDataFile *** | m3p_NormalizationDataFile |
bool | m_OneNormalizationFileForAllBeds |
bool | m_OneNormalizationFileForAllFrames |
string | m_pathToAttenuationImage |
bool | m_attenuationFlag |
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 |
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 34 of file oSensitivityGenerator.hh.
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 27 of file oSensitivityGenerator.cc.
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 59 of file oSensitivityGenerator.cc.
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.
Definition at line 83 of file oSensitivityGenerator.cc.
int oSensitivityGenerator::ComputeSensitivityFromNormalizationFile | ( | int | a_bed | ) | [private] |
Launch the computation of the sensitivity image for this bed, based on normalization data files.
int | a_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.
Definition at line 544 of file oSensitivityGenerator.cc.
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.
int | a_bed |
Definition at line 673 of file oSensitivityGenerator.cc.
This function return the path to the sensitivity image.
Definition at line 914 of file oSensitivityGenerator.cc.
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.
Definition at line 163 of file oSensitivityGenerator.cc.
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.
Definition at line 399 of file oSensitivityGenerator.cc.
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.
Definition at line 229 of file oSensitivityGenerator.cc.
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).
Definition at line 467 of file oSensitivityGenerator.cc.
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.
Definition at line 485 of file oSensitivityGenerator.cc.
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.
oProjectionLine* | ap_Line |
vEvent* | ap_Event |
int | a_bed |
int | a_frame |
int | a_respGate |
int | a_cardGate |
int | a_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.
Definition at line 846 of file oSensitivityGenerator.cc.
public inline void oSensitivityGenerator::SetDataFile | ( | vDataFile ** | a2p_DataFile | ) | [inline] |
This function is used to set the pointer to the vDataFile array in use.
vDataFile** | a2p_DataFile |
Definition at line 213 of file oSensitivityGenerator.hh.
public inline void oSensitivityGenerator::SetDeformationManager | ( | oDeformationManager * | ap_DeformationManager | ) | [inline] |
This function is used to set the pointer to the oDeformationManager in use.
oDeformationManager* | ap_DeformationManager |
Definition at line 206 of file oSensitivityGenerator.hh.
public inline void oSensitivityGenerator::SetGPUflag | ( | bool | a_flagGPU | ) | [inline] |
This function is used to set the GPU flag; do we use GPU or not.
bool | a_flagGPU |
Definition at line 249 of file oSensitivityGenerator.hh.
public inline void oSensitivityGenerator::SetImageConvolverManager | ( | oImageConvolverManager * | ap_ImageConvolverManager | ) | [inline] |
This function is used to set the pointer to the oImageConvolverManager in use.
oImageConvolverManager* | ap_ImageConvolverManager |
Definition at line 199 of file oSensitivityGenerator.hh.
public inline void oSensitivityGenerator::SetImageDimensionsAndQuantification | ( | oImageDimensionsAndQuantification * | ap_ImageDimensionsAndQuantification | ) | [inline] |
This function is used to set the pointer to the oImageDimensionsAndQuantification in use.
oImageDimensionsAndQuantification* | ap_ImageDimensionsAndQuantification |
Definition at line 171 of file oSensitivityGenerator.hh.
public inline void oSensitivityGenerator::SetImageSpace | ( | oImageSpace * | ap_ImageSpace | ) | [inline] |
This function is used to set the pointer to the oImageSpace in use.
oImageSpace* | ap_ImageSpace |
Definition at line 178 of file oSensitivityGenerator.hh.
public inline void oSensitivityGenerator::SetNormalizationDataFile | ( | vDataFile *** | a3p_NormalizationDataFile | ) | [inline] |
This function is used to set the pointer to the vDataFile array in use for normalization.
vDataFile** | a3p_NormalizationDataFile |
Definition at line 227 of file oSensitivityGenerator.hh.
void oSensitivityGenerator::SetNumberOfAtnGateImages | ( | int | a_nbAtnRespGateImages, |
int | a_nbAtnCardGateImages | ||
) | [inline] |
Definition at line 242 of file oSensitivityGenerator.hh.
public inline void oSensitivityGenerator::SetPathToAttenuationImage | ( | string | a_pathToAttenuationImage | ) | [inline] |
This function is used to set the path to the attenuation image.
string | a_pathToAttenuationImage |
Definition at line 234 of file oSensitivityGenerator.hh.
public inline void oSensitivityGenerator::SetPathToNormalizationFileName | ( | vector< string > | ap_pathToNormalizationFileName | ) | [inline] |
This function is used to set the path to the normalization file names.
vector<string> | ap_pathToNormalizationFileName |
Definition at line 220 of file oSensitivityGenerator.hh.
public inline void oSensitivityGenerator::SetProjectorManager | ( | oProjectorManager * | ap_ProjectorManager | ) | [inline] |
This function is used to set the pointer to the oProjectorManager in use.
oProjectorManager* | ap_ProjectorManager |
Definition at line 192 of file oSensitivityGenerator.hh.
public inline void oSensitivityGenerator::SetScanner | ( | vScanner * | ap_Scanner | ) | [inline] |
This function is used to set the pointer to the vScanner in use.
vScanner* | ap_Scanner |
Definition at line 185 of file oSensitivityGenerator.hh.
void oSensitivityGenerator::SetVerbose | ( | int | a_verboseLevel | ) | [inline] |
Definition at line 256 of file oSensitivityGenerator.hh.
vDataFile** oSensitivityGenerator::m2p_DataFile [private] |
Pointer to the array of vDataFile objects
Definition at line 271 of file oSensitivityGenerator.hh.
Pointer to the double array of vDataFile objects for normalization
Definition at line 273 of file oSensitivityGenerator.hh.
bool oSensitivityGenerator::m_attenuationFlag [private] |
Flag to say if an attenuation image has to been provided
Definition at line 277 of file oSensitivityGenerator.hh.
bool oSensitivityGenerator::m_checked [private] |
Boolean that says if the parameters were checked or not
Definition at line 284 of file oSensitivityGenerator.hh.
bool oSensitivityGenerator::m_flagGPU [private] |
Do we use GPU or not (default=false)
Definition at line 282 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 278 of file oSensitivityGenerator.hh.
bool oSensitivityGenerator::m_initialized [private] |
Boolean that says if the projector was initialized or not
Definition at line 285 of file oSensitivityGenerator.hh.
int oSensitivityGenerator::m_nbAtnCardGateImages [private] |
Number of attenuation images corresponding to the cardiac gates
Definition at line 280 of file oSensitivityGenerator.hh.
int oSensitivityGenerator::m_nbAtnRespGateImages [private] |
Number of attenuation images corresponding to the respiratory gates
Definition at line 279 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 274 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 275 of file oSensitivityGenerator.hh.
string oSensitivityGenerator::m_pathToAttenuationImage [private] |
String of the path to the attenuation images
Definition at line 276 of file oSensitivityGenerator.hh.
string oSensitivityGenerator::m_pathToSensitivityImage [private] |
The actual path to the created sensitivity image
Definition at line 257 of file oSensitivityGenerator.hh.
int oSensitivityGenerator::m_verbose [private] |
Verbosity (default=-1)
Definition at line 283 of file oSensitivityGenerator.hh.
Pointer to the Deformation Manager object
Definition at line 270 of file oSensitivityGenerator.hh.
Pointer to the Image Convolver Manager object
Definition at line 269 of file oSensitivityGenerator.hh.
oImageDimensionsAndQuantification* oSensitivityGenerator::mp_ImageDimensionsAndQuantification [private] |
Pointer to the oImageDimensionsAndQuantification object
Definition at line 265 of file oSensitivityGenerator.hh.
oImageSpace* oSensitivityGenerator::mp_ImageSpace [private] |
Pointer to the Image Space object
Definition at line 266 of file oSensitivityGenerator.hh.
uint64_t* oSensitivityGenerator::mp_lineCounter [private] |
Counters of the number of effectively projected lines, 1 per thread
Definition at line 281 of file oSensitivityGenerator.hh.
vector<string> oSensitivityGenerator::mp_pathToNormalizationFileName [private] |
Vector of normalization file names
Definition at line 272 of file oSensitivityGenerator.hh.
Pointer to the Projector Manager object
Definition at line 268 of file oSensitivityGenerator.hh.
vScanner* oSensitivityGenerator::mp_Scanner [private] |
Pointer to the Scanner object
Definition at line 267 of file oSensitivityGenerator.hh.