![]() |
CASToR
1.0
Tomographic Reconstruction (PET/SPECT)
|
Inherit from vDataFile. Class that manages the reading of a SPECT input file (header + data). More...
#include <iDataFileSPECT.hh>
Public Member Functions | |
iDataFileSPECT () | |
iDataFileSPECT constructor. Initialize the member variables to their default values. | |
~iDataFileSPECT () | |
iDataFileSPECT destructor. | |
int | ReadSpecificInfoInHeader () |
Read through the header file and recover specific SPECT information. | |
int | ComputeSizeEvent () |
Computation of the size of each event according to the mandatory/optional correction fields. | |
int | PrepareDataFile () |
Store different kind of information inside arrays (data relative to specific correction as well as basic raw data for the case data is loaded in RAM) Use the flag provided by the user to determine how the data has to be sorted (preloaded or read on the fly) | |
vEvent * | GetEventFromBuffer (char *ap_buffer, int a_th) |
Read an event from the position pointed by 'ap_buffer', parse the generic or modality-specific information, and store them in the (multithreaded) 'm2p_BufferEvent' object. | |
int | PROJ_InitFile () |
Initialize the fstream objets for output writing as well as some other variables specific to the Projection script (Event-based correction flags, Estimated size of data file) | |
int | PROJ_WriteEvent (vEvent *ap_Event, int a_th) |
Write event according to the chosen type of data. | |
int | PROJ_WriteHeader () |
Generate a header file according to the projection and data output informations. Used by Projection algorithm. | |
int | PROJ_GetScannerSpecificParameters () |
Get SPECT specific parameters for projections from the scanner object, through the scannerManager. | |
uint16_t | GetNbProjections () |
uint16_t | GetNbBins (int axis) |
void | SetEventKindFlagOn () |
void | SetIsotope (string a_value) |
void | SetNbBins (uint16_t a_binTrs, uint16_t a_binAxl) |
initialize the bin values | |
void | SetNbProjections (uint16_t a_nbProjections) |
initialize the number of projections | |
int | InitAngles (FLTNB *ap_angles) |
allocate memory for the mp_angles variable using m_nbProjections and initialize the projection angles with the provided list of values | |
int | InitCorToDetectorDistance (FLTNB *ap_CORtoDetectorDistance) |
allocate memory for the ap_CORtoDetectorDistance variable using m_nbProjections, and initialize the projection angles with the provided list of values | |
void | SetHeadRotDirection (int a_direction) |
initialize the rotation direction of the gamma camera(s) | |
Private Member Functions | |
int | CheckSpecificParameters () |
Check parameters specific to SPECT data. | |
int | CheckFileSizeConsistency () |
This function is implemented in child classes Check if file size is consistent. | |
int | PROJ_WriteHistoEvent (iEventHistoSPECT *ap_Event, int a_th) |
Write a SPECT histogram event. | |
int | PROJ_WriteListEvent (iEventListSPECT *ap_Event, int a_th) |
Write a SPECT list-mode event. | |
Private Attributes | |
string | m_isotope |
bool | m_eventKindFlag |
bool | m_normCorrectionFlag |
bool | m_ignoreNormCorrectionFlag |
bool | m_scatCorrectionFlag |
bool | m_ignoreScatCorrectionFlag |
uint16_t | mp_nbOfBins [2] |
uint16_t | m_nbOfProjections |
FLTNB * | mp_angles |
uint16_t | m_nbHeads |
FLTNB * | mp_CORtoDetectorDistance |
int | m_headRotDirection |
Inherit from vDataFile. Class that manages the reading of a SPECT input file (header + data).
It contains several arrays corresponding to the different kind of informations the data file could contain.
As many booleans as arrays say if the data are here or not. The data file can be either completely loaded, or read event by event during reconstruction.
MPI is coming here to cut the data file into peaces (also either can be loaded or read on-the-fly).
Definition at line 28 of file iDataFileSPECT.hh.
iDataFileSPECT constructor. Initialize the member variables to their default values.
Definition at line 34 of file iDataFileSPECT.cc.
iDataFileSPECT destructor.
Definition at line 61 of file iDataFileSPECT.cc.
int iDataFileSPECT::CheckFileSizeConsistency | ( | ) | [private, virtual] |
This function is implemented in child classes
Check if file size is consistent.
Implements vDataFile.
Definition at line 441 of file iDataFileSPECT.cc.
int iDataFileSPECT::CheckSpecificParameters | ( | ) | [private, virtual] |
Check parameters specific to SPECT data.
Implements vDataFile.
Definition at line 401 of file iDataFileSPECT.cc.
int iDataFileSPECT::ComputeSizeEvent | ( | ) | [virtual] |
Computation of the size of each event according to the mandatory/optional correction fields.
Implements vDataFile.
Definition at line 168 of file iDataFileSPECT.cc.
vEvent * iDataFileSPECT::GetEventFromBuffer | ( | char * | ap_buffer, |
int | a_th | ||
) | [virtual] |
Read an event from the position pointed by 'ap_buffer', parse the generic or modality-specific information, and store them in the (multithreaded) 'm2p_BufferEvent' object.
ap_buffer | : address pointing to the event to recover |
a_th | : index of the thread from which the function was called |
Implements vDataFile.
Definition at line 304 of file iDataFileSPECT.cc.
iDataFileSPECT::GetNbBins | ( | int | axis | ) | [inline] |
axis | : axis corresponding to transaxial (0) or axial (1) bins |
Definition at line 122 of file iDataFileSPECT.hh.
iDataFileSPECT::GetNbProjections | ( | ) | [inline] |
Definition at line 116 of file iDataFileSPECT.hh.
int iDataFileSPECT::InitAngles | ( | FLTNB * | ap_angles | ) |
allocate memory for the mp_angles variable using m_nbProjections and initialize the projection angles with the provided list of values
ap_angles |
Definition at line 557 of file iDataFileSPECT.cc.
int iDataFileSPECT::InitCorToDetectorDistance | ( | FLTNB * | ap_CORtoDetectorDistance | ) |
allocate memory for the ap_CORtoDetectorDistance variable using m_nbProjections, and initialize the projection angles with the provided list of values
ap_CORtoDetectorDistance |
Definition at line 588 of file iDataFileSPECT.cc.
int iDataFileSPECT::PrepareDataFile | ( | ) | [virtual] |
Store different kind of information inside arrays (data relative to specific correction as well as basic raw data for the case data is loaded in RAM)
Use the flag provided by the user to determine how the data has to be sorted (preloaded or read on the fly)
Implements vDataFile.
Definition at line 219 of file iDataFileSPECT.cc.
int iDataFileSPECT::PROJ_GetScannerSpecificParameters | ( | ) | [virtual] |
Get SPECT specific parameters for projections from the scanner object, through the scannerManager.
Implements vDataFile.
Definition at line 920 of file iDataFileSPECT.cc.
int iDataFileSPECT::PROJ_InitFile | ( | ) | [virtual] |
Initialize the fstream objets for output writing as well as some other variables specific to the Projection script (Event-based correction flags, Estimated size of data file)
Implements vDataFile.
Definition at line 619 of file iDataFileSPECT.cc.
int iDataFileSPECT::PROJ_WriteEvent | ( | vEvent * | ap_Event, |
int | a_th | ||
) | [virtual] |
Write event according to the chosen type of data.
ap_Event | : event containing the data to write |
a_th | : index of the thread from which the function was called |
Implements vDataFile.
Definition at line 685 of file iDataFileSPECT.cc.
int iDataFileSPECT::PROJ_WriteHeader | ( | ) | [virtual] |
Generate a header file according to the projection and data output informations.
Used by Projection algorithm.
Implements vDataFile.
Definition at line 845 of file iDataFileSPECT.cc.
int iDataFileSPECT::PROJ_WriteHistoEvent | ( | iEventHistoSPECT * | ap_Event, |
int | a_th | ||
) | [private] |
Write a SPECT histogram event.
ap_Event | : event containing the data to write |
a_th | : index of the thread from which the function was called |
Definition at line 726 of file iDataFileSPECT.cc.
int iDataFileSPECT::PROJ_WriteListEvent | ( | iEventListSPECT * | ap_Event, |
int | a_th | ||
) | [private] |
Write a SPECT list-mode event.
ap_Event | : event containing the data to write |
a_th | : index of the thread from which the function was called |
Definition at line 774 of file iDataFileSPECT.cc.
int iDataFileSPECT::ReadSpecificInfoInHeader | ( | ) | [virtual] |
Read through the header file and recover specific SPECT information.
Implements vDataFile.
Definition at line 79 of file iDataFileSPECT.cc.
void iDataFileSPECT::SetEventKindFlagOn | ( | ) | [inline] |
Definition at line 129 of file iDataFileSPECT.hh.
iDataFileSPECT::SetHeadRotDirection | ( | int | a_direction | ) | [inline] |
initialize the rotation direction of the gamma camera(s)
a_direction |
Definition at line 183 of file iDataFileSPECT.hh.
void iDataFileSPECT::SetIsotope | ( | string | a_value | ) | [inline] |
iDataFileSPECT::SetNbBins | ( | uint16_t | a_binTrs, |
uint16_t | a_binAxl | ||
) | [inline] |
initialize the bin values
a_binTrs | |
a_binAxl |
Definition at line 148 of file iDataFileSPECT.hh.
iDataFileSPECT::SetNbProjections | ( | uint16_t | a_nbProjections | ) | [inline] |
initialize the number of projections
a_nbProjections |
Definition at line 156 of file iDataFileSPECT.hh.
bool iDataFileSPECT::m_eventKindFlag [private] |
Flag for informations about the event nature (true, scatter) in the data. Default value = false
Definition at line 225 of file iDataFileSPECT.hh.
int iDataFileSPECT::m_headRotDirection [private] |
Head rotation direction (0=clockwise, 1=counterclockwise)
Definition at line 240 of file iDataFileSPECT.hh.
bool iDataFileSPECT::m_ignoreNormCorrectionFlag [private] |
Flag to say if we ignore the normalization correction even if present. Default = false
Definition at line 227 of file iDataFileSPECT.hh.
bool iDataFileSPECT::m_ignoreScatCorrectionFlag [private] |
Flag to say if we ignore the scatter correction even if present. Default = false
Definition at line 229 of file iDataFileSPECT.hh.
string iDataFileSPECT::m_isotope [private] |
Isotope. Default value =unknown
Definition at line 224 of file iDataFileSPECT.hh.
uint16_t iDataFileSPECT::m_nbHeads [private] |
Number of heads in the SPECT systems. Default =1
Definition at line 234 of file iDataFileSPECT.hh.
uint16_t iDataFileSPECT::m_nbOfProjections [private] |
Total number of projections during the acquisition(for all the heads). No Default
Definition at line 231 of file iDataFileSPECT.hh.
bool iDataFileSPECT::m_normCorrectionFlag [private] |
Flag that says if normalization correction terms are included in the data. Default = false
Definition at line 226 of file iDataFileSPECT.hh.
bool iDataFileSPECT::m_scatCorrectionFlag [private] |
Flag that says if scatter correction terms are included in the data. Default = false
Definition at line 228 of file iDataFileSPECT.hh.
FLTNB* iDataFileSPECT::mp_angles [private] |
Angle [for each projection] in degrees. If SPECT system contains several heads, first head angles should be entered first, followed by 2nd head angles, etc.. No Default
Definition at line 232 of file iDataFileSPECT.hh.
FLTNB* iDataFileSPECT::mp_CORtoDetectorDistance [private] |
Distance camera surface to COR (mm) [for each projection].
if not provided, the distance given for each heads in the camera description file is taken and considered constant for each projections related to each head
if provided then: if positive value (either a constant value, or a value specific to each projection) then it overwrites the one given in the camera file
if negative, the distance given for each heads in the camera description file is taken and considered constant for each projections related to each head
Default value = Recovered from the camera description file
Definition at line 235 of file iDataFileSPECT.hh.
uint16_t iDataFileSPECT::mp_nbOfBins[2] [private] |
Transaxial/Axial number of bins. Default value =1,1
Definition at line 230 of file iDataFileSPECT.hh.