CASToR
2.0
Tomographic Reconstruction (PET/SPECT/CT)
|
This class is designed to manage the computation of the sensitivity image. More...
#include <oSensitivityGenerator.hh>
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 |
oImageDimensionsAndQuantification * | mp_ImageDimensionsAndQuantification |
oImageSpace * | mp_ImageSpace |
vScanner * | mp_Scanner |
oProjectorManager * | mp_ProjectorManager |
oImageConvolverManager * | mp_ImageConvolverManager |
oDeformationManager * | mp_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 |
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.
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.
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.
Definition at line 96 of file oSensitivityGenerator.cc.
|
private |
Launch the computation of the sensitivity image for this bed, based on the input histogram data files.
int | a_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.
Definition at line 634 of file oSensitivityGenerator.cc.
|
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 768 of file oSensitivityGenerator.cc.
|
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 930 of file oSensitivityGenerator.cc.
string oSensitivityGenerator::GetPathToSensitivityImage | ( | ) |
This function return the path to the sensitivity image.
Definition at line 1203 of file oSensitivityGenerator.cc.
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.
Definition at line 172 of file oSensitivityGenerator.cc.
|
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 427 of file oSensitivityGenerator.cc.
|
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 246 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 496 of file oSensitivityGenerator.cc.
|
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 514 of file oSensitivityGenerator.cc.
|
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 1135 of file oSensitivityGenerator.cc.
|
inline |
This function is used to set the m_computeFromHistogramFlag.
bool | a_computeFromHistogramFlag |
Definition at line 251 of file oSensitivityGenerator.hh.
|
inline |
This function is used to set the pointer to the vDataFile array in use.
vDataFile** | a2p_DataFile |
Definition at line 244 of file oSensitivityGenerator.hh.
|
inline |
This function is used to set the pointer to the oDeformationManager in use.
oDeformationManager* | ap_DeformationManager |
Definition at line 237 of file oSensitivityGenerator.hh.
|
inline |
This function is used to set the GPU flag; do we use GPU or not.
bool | a_flagGPU |
Definition at line 288 of file oSensitivityGenerator.hh.
|
inline |
This function is used to set the pointer to the oImageConvolverManager in use.
oImageConvolverManager* | ap_ImageConvolverManager |
Definition at line 230 of file oSensitivityGenerator.hh.
|
inline |
This function is used to set the pointer to the oImageDimensionsAndQuantification in use.
oImageDimensionsAndQuantification* | ap_ImageDimensionsAndQuantification |
Definition at line 202 of file oSensitivityGenerator.hh.
|
inline |
This function is used to set the pointer to the oImageSpace in use.
oImageSpace* | ap_ImageSpace |
Definition at line 209 of file oSensitivityGenerator.hh.
|
inline |
Definition at line 281 of file oSensitivityGenerator.hh.
|
inline |
This function is used to set the path to the attenuation image.
string | a_pathToAttenuationImage |
Definition at line 267 of file oSensitivityGenerator.hh.
|
inline |
Set path to a mask image.
a_pathToMaskImage |
Definition at line 274 of file oSensitivityGenerator.hh.
|
inline |
This function is used to set the path to the normalization file names, and the flag saying if their order must be reversed.
vector<string> | ap_pathToNormalizationFileName |
bool | a_inverseDataFileOrderFlag |
Definition at line 259 of file oSensitivityGenerator.hh.
|
inline |
This function is used to set the pointer to the oProjectorManager in use.
oProjectorManager* | ap_ProjectorManager |
Definition at line 223 of file oSensitivityGenerator.hh.
|
inline |
This function is used to set the pointer to the vScanner in use.
vScanner* | ap_Scanner |
Definition at line 216 of file oSensitivityGenerator.hh.
|
inline |
Definition at line 295 of file oSensitivityGenerator.hh.
|
private |
Pointer to the array of vDataFile objects
Definition at line 310 of file oSensitivityGenerator.hh.
|
private |
Pointer to the double array of vDataFile objects for normalization
Definition at line 314 of file oSensitivityGenerator.hh.
|
private |
Boolean that says if the parameters were checked or not
Definition at line 326 of file oSensitivityGenerator.hh.
|
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.
|
private |
Do we use GPU or not (default=false)
Definition at line 324 of file oSensitivityGenerator.hh.
|
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.
|
private |
Boolean that says if the projector was initialized or not
Definition at line 327 of file oSensitivityGenerator.hh.
|
private |
Flag to say that the provided normalization data file names order must be reversed
Definition at line 313 of file oSensitivityGenerator.hh.
|
private |
Flag to say if an attenuation image has to been provided
Definition at line 319 of file oSensitivityGenerator.hh.
|
private |
Number of attenuation images corresponding to the cardiac gates
Definition at line 322 of file oSensitivityGenerator.hh.
|
private |
Number of attenuation images corresponding to the respiratory gates
Definition at line 321 of file oSensitivityGenerator.hh.
|
private |
A boolean to specify if only one normalization file has been provided for all beds
Definition at line 315 of file oSensitivityGenerator.hh.
|
private |
A boolean to specify if only one normalization file has been provided for all frames
Definition at line 316 of file oSensitivityGenerator.hh.
|
private |
String of the path to the attenuation images
Definition at line 317 of file oSensitivityGenerator.hh.
|
private |
String of the path to the mask image
Definition at line 318 of file oSensitivityGenerator.hh.
|
private |
The actual path to the created sensitivity image
Definition at line 296 of file oSensitivityGenerator.hh.
|
private |
Verbosity (default=-1)
Definition at line 325 of file oSensitivityGenerator.hh.
|
private |
Pointer to the Deformation Manager object
Definition at line 309 of file oSensitivityGenerator.hh.
|
private |
Pointer to the Image Convolver Manager object
Definition at line 308 of file oSensitivityGenerator.hh.
|
private |
Pointer to the oImageDimensionsAndQuantification object
Definition at line 304 of file oSensitivityGenerator.hh.
|
private |
Pointer to the Image Space object
Definition at line 305 of file oSensitivityGenerator.hh.
|
private |
Counters of the number of effectively projected lines, 1 per thread
Definition at line 323 of file oSensitivityGenerator.hh.
|
private |
Vector of normalization file names
Definition at line 312 of file oSensitivityGenerator.hh.
|
private |
Pointer to the Projector Manager object
Definition at line 307 of file oSensitivityGenerator.hh.
|
private |
Pointer to the Scanner object
Definition at line 306 of file oSensitivityGenerator.hh.