CASToR
1.1
Tomographic Reconstruction (PET/SPECT)
|
Inherit from vDataFile. Class that manages the reading of a PET input file (header + data). More...
#include <iDataFilePET.hh>
Public Member Functions | |
iDataFilePET () | |
iDataFilePET constructor. Initialize the member variables to their default values. More... | |
~iDataFilePET () | |
iDataFilePET destructor. More... | |
int | ReadSpecificInfoInHeader (bool a_affectQuantificationFlag) |
Read through the header file and gather specific PET information. More... | |
int | ComputeSizeEvent () |
Computation of the size of each event according to the mandatory/optional correction fields. More... | |
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) More... | |
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. More... | |
bool | GetTOFInfoFlag () |
bool | GetIgnoreTOFFlag () |
FLTNB | GetTOFResolution () |
int | GetNbTOFBins () |
FLTNB | GetTOFBinSize () |
int | GetMaxRingDiff () |
void | SetMaxNumberOfLinesPerEvent (uint16_t a_value) |
set the max number of line per event in the datafile More... | |
uint16_t | GetMaxNumberOfLinesPerEvent () |
void | SetIsotope (string a_value) |
initialize the isotope string value More... | |
string | GetIsotope () |
void | SetIgnoreTOFFlag (bool a_ignoreTOFFlag) |
Set a boolean that that if we ignore TOF information or not. More... | |
void | SetEventKindFlagOn () |
set to true the flag indicating the presence of the kind of a list-mode event in the datafile TODO check if consistent with datafile type More... | |
void | SetAtnCorrectionFlagOn () |
set to true the flag indicating the presence of attenuation correction factors in the datafile More... | |
void | SetNormCorrectionFlagOn () |
set to true the flag indicating the presence of normalization correction factors in the datafile More... | |
void | SetScatterCorrectionFlagOn () |
set to true the flag indicating the presence of scatter correction factors in the datafile More... | |
void | SetRandomCorrectionFlagOn () |
set to true the flag indicating the presence of random correction factors in the datafile More... | |
bool | GetNormCorrectionFlag () |
Simply return m_normCorrectionFlag. More... | |
bool | GetAtnCorrectionFlag () |
Simply return m_atnCorrectionFlag. More... | |
bool | GetEventKindFlag () |
Simply return m_eventKindFlag. More... | |
bool | GetScatCorrectionFlag () |
Simply return m_scatCorrectionFlag. More... | |
bool | GetRandCorrectionFlag () |
Simply return m_randCorrectionFlag. More... | |
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) More... | |
int | PROJ_WriteEvent (vEvent *ap_Event, int a_th) |
Write event according to the chosen type of data. More... | |
int | PROJ_WriteHeader () |
Generate a header file according to the projection and data output informations. Used by Projection algorithm. More... | |
int | PROJ_GetScannerSpecificParameters () |
Get PET specific parameters for projections from the scanner object, through the scannerManager. More... | |
Public Member Functions inherited from vDataFile | |
vDataFile () | |
vDataFile constructor. More... | |
virtual | ~vDataFile () |
vDataFile destructor. More... | |
int | ReadInfoInHeader (bool a_affectQuantificationFlag=true) |
Read and check general information from the header datafile Call the ReadSpecificInformationInHeader() function implemented in child classes. More... | |
int | CheckParameters () |
Check the initialization of member variables Call the CheckSpecificParameters() function implemented in child classes. More... | |
int | InitializeFile () |
Instantiate the fstream objets for input reading and check if the related datafile's existence and consistency. Also init the char* buffers for event read directly from files. More... | |
void | ResetBufferRange () |
Simply set the m_1stIdxArrayEvents and m_lastIdxArrayEvents to -1 only if the percentage load is strictly between 0 and 100. More... | |
int | FillBuffer (int64_t a_eventIndex) |
Fill 'mp_arrayEvents' from the 'a_eventIndex' position in the data file. The filling process stops after 'm_sizeArrayEvents' new events have been added, or if we reach the last event of the datafile. More... | |
vEvent * | GetEventWithAscendingOrderAssumption (int64_t a_eventIndex, int64_t a_eventIndexLimit, int a_th) |
According to the current part of the datafile loaded in memory, either read from this buffer or directly from datafile. More... | |
vEvent * | GetEventWithoutOrderAssumption (int64_t a_eventIndex, int a_th) |
According to the current part of the datafile loaded in memory, either read from this buffer or directly from datafile. More... | |
vEvent * | GetEventFromFile (int64_t a_eventIndex, int a_th) |
Return the a_eventIndex event from the datafile. More... | |
void | GetEventIndexStartAndStop (int64_t *ap_indexStart, int64_t *ap_indexStop, int a_subsetNum=0, int a_NbSubsets=1) |
Compute the index start and stop of the events loop with respect to the current subset and MPI size and rank. More... | |
int | CheckConsistencyWithAnotherBedDatafile (vDataFile *ap_Datafile) |
Check consistency between 'this' and the provided datafile as two bed positions. More... | |
int | PROJ_WriteData () |
Write/Merge chunk of data in a general data file. More... | |
int | PROJ_DeleteTmpDatafile () |
Delete temporary datafile used for multithreaded output writing if needed. More... | |
vEvent * | PROJ_GenerateEvent (int idx_elt1, int idx_elt2, int a_th) |
Generate a standard event and set up its ID Used by the projection, list-mode sensitivity generation, and datafile converter scripts. More... | |
int | GetBedIndex () |
int | GetDataMode () |
int | GetDataType () |
int64_t | GetSize () |
int64_t | GetEventSize () |
string | GetHeaderDataFileName () |
string | GetDataFileName () |
int64_t | GetStartTime () |
int64_t | GetDuration () |
FLTNB | GetCalibrationFactor () |
FLTNB * | GetPOIResolution () |
bool | GetPOIInfoFlag () |
bool | GetIgnorePOIFlag () |
void | SetDataMode (int a_dataMode) |
set the data mode More... | |
void | SetDataType (int a_dataType) |
set the data type More... | |
void | SetBedIndex (int a_bedIndex) |
set the bed index corresponding to this data file More... | |
void | SetPercentageLoad (int a_percentageLoad) |
Set the percentage of the data file that will be loaded in memory. More... | |
int | GetPercentageLoad () |
Get the percentage of the data file that will be loaded in memory. More... | |
void | SetVerbose (int a_verboseLevel) |
set verbosity More... | |
int | GetVerbose () |
Get the verbose level. More... | |
void | SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification) |
set the pointer to the oImageDimensionsAndQuantification object More... | |
void | SetPOIResolution (FLTNB ap_value[3]) |
initialize the POI resolution (for list-mode) More... | |
void | SetIgnorePOIFlag (bool a_ignorePOIFlag) |
Set a boolean that that if we ignore POI information or not. More... | |
void | SetHeaderDataFileName (const string &a_headerFileName) |
set the data header file name More... | |
void | SetCalibrationFactor (FLTNB a_value) |
initialize the global calibration factor with a FLTNB value More... | |
void | SetNbEvents (int64_t a_value) |
initialize the number of events with a int64_t value More... | |
void | SetStartTime (FLTNB a_value) |
void | SetDuration (FLTNB a_value) |
string | GetScannerName () |
Private Member Functions | |
int | CheckSpecificParameters () |
Check parameters specific to PET data. More... | |
int | PROJ_WriteListEvent (iEventListPET *ap_Event, int a_th) |
Write a PET list-mode event. More... | |
int | PROJ_WriteHistoEvent (iEventHistoPET *ap_Event, int a_th) |
Write a PET histogram event. More... | |
int | CheckFileSizeConsistency () |
This function is implemented in child classes Check if file size is consistent. More... | |
int | CheckSpecificConsistencyWithAnotherDatafile (vDataFile *ap_Datafile) |
Check consistency between 'this' and the provided datafile, for specific characteristics. More... | |
Private Attributes | |
uint16_t | m_maxNumberOfLinesPerEvent |
int | m_maxRingDiff |
string | m_isotope |
bool | m_eventKindFlag |
bool | m_atnCorrectionFlag |
bool | m_ignoreAttnCorrectionFlag |
bool | m_normCorrectionFlag |
bool | m_ignoreNormCorrectionFlag |
bool | m_scatCorrectionFlag |
bool | m_ignoreScatCorrectionFlag |
bool | m_randCorrectionFlag |
bool | m_ignoreRandCorrectionFlag |
bool | m_TOFInfoFlag |
bool | m_ignoreTOFFlag |
FLTNB | m_resolutionTOF |
int | m_nbBinsTOF |
FLTNB | m_binSizeTOF |
Additional Inherited Members | |
Protected Attributes inherited from vDataFile | |
oImageDimensionsAndQuantification * | mp_ID |
int | m_verbose |
fstream ** | m2p_dataFile |
string | m_headerFileName |
string | m_dataFileName |
int64_t | m_totalNbEvents |
int | m_dataMode |
int | m_dataType |
FLTNB | m_startTimeInSec |
FLTNB | m_durationInSec |
FLTNB | m_calibrationFactor |
int | m_bedIndex |
int64_t | m_sizeEvent |
string | m_scannerName |
bool | m_POIInfoFlag |
bool | m_ignorePOIFlag |
bool | mp_POIDirectionFlag [3] |
FLTNB | mp_POIResolution [3] |
vEvent ** | m2p_BufferEvent |
char * | mp_arrayEvents |
char ** | m2p_bufferEventFromFile |
int64_t | m_mpi1stEvent |
int64_t | m_mpiLastEvent |
int64_t | m_mpiNbEvents |
int64_t | m_1stIdxArrayEvents |
int64_t | m_lastIdxArrayEvents |
int64_t | m_sizeArrayEvents |
int | m_percentageLoad |
bool | m_requestBufferFilling |
bool | m_currentlyFillingBuffer |
bool * | mp_currentlyReadingBuffer |
bool * | mp_overBufferRange |
int64_t * | mp_nbEventsReadFromFile |
Inherit from vDataFile. Class that manages the reading of a PET 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 26 of file iDataFilePET.hh.
iDataFilePET::iDataFilePET | ( | ) |
iDataFilePET constructor. Initialize the member variables to their default values.
Definition at line 16 of file iDataFilePET.cc.
iDataFilePET::~iDataFilePET | ( | ) |
iDataFilePET destructor.
Definition at line 44 of file iDataFilePET.cc.
|
privatevirtual |
This function is implemented in child classes
Check if file size is consistent.
Implements vDataFile.
Definition at line 553 of file iDataFilePET.cc.
|
privatevirtual |
Check consistency between 'this' and the provided datafile, for specific characteristics.
vDataFile* | ap_Datafile |
Implementation of the pure virtual function from vDataFile. It checks correction flags, etc.
Implements vDataFile.
Definition at line 631 of file iDataFilePET.cc.
|
privatevirtual |
Check parameters specific to PET data.
Implements vDataFile.
Definition at line 478 of file iDataFilePET.cc.
|
virtual |
Computation of the size of each event according to the mandatory/optional correction fields.
Implements vDataFile.
Definition at line 88 of file iDataFilePET.cc.
|
inline |
Simply return m_atnCorrectionFlag.
Definition at line 223 of file iDataFilePET.hh.
|
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 276 of file iDataFilePET.cc.
|
inline |
Simply return m_eventKindFlag.
Definition at line 230 of file iDataFilePET.hh.
|
inline |
Definition at line 90 of file iDataFilePET.hh.
|
inline |
Definition at line 141 of file iDataFilePET.hh.
|
inline |
Definition at line 126 of file iDataFilePET.hh.
|
inlinevirtual |
Reimplemented from vDataFile.
Definition at line 114 of file iDataFilePET.hh.
|
inline |
Definition at line 102 of file iDataFilePET.hh.
|
inline |
Simply return m_normCorrectionFlag.
Definition at line 216 of file iDataFilePET.hh.
|
inline |
Simply return m_randCorrectionFlag.
Definition at line 244 of file iDataFilePET.hh.
|
inline |
Simply return m_scatCorrectionFlag.
Definition at line 237 of file iDataFilePET.hh.
|
inline |
Definition at line 108 of file iDataFilePET.hh.
|
inline |
Definition at line 84 of file iDataFilePET.hh.
|
inline |
Definition at line 96 of file iDataFilePET.hh.
|
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 161 of file iDataFilePET.cc.
|
virtual |
Get PET specific parameters for projections from the scanner object, through the scannerManager.
Implements vDataFile.
Definition at line 1172 of file iDataFilePET.cc.
|
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 739 of file iDataFilePET.cc.
|
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 807 of file iDataFilePET.cc.
|
virtual |
Generate a header file according to the projection and data output informations.
Used by Projection algorithm.
Implements vDataFile.
Definition at line 1037 of file iDataFilePET.cc.
|
private |
Write a PET 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 846 of file iDataFilePET.cc.
|
private |
Write a PET 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 926 of file iDataFilePET.cc.
|
virtual |
Read through the header file and gather specific PET information.
bool | a_affectQuantificationFlag |
If the parameter flag is on, then affect the quantification factors from the oImageDimensionsAndQuantification after reading relevant information
Implements vDataFile.
Definition at line 51 of file iDataFilePET.cc.
|
inline |
set to true the flag indicating the presence of attenuation correction factors in the datafile
This function is dedicated to datafile conversion scripts
Definition at line 188 of file iDataFilePET.hh.
|
inline |
set to true the flag indicating the presence of the kind of a list-mode event in the datafile TODO check if consistent with datafile type
This function is dedicated to datafile conversion scripts
Definition at line 181 of file iDataFilePET.hh.
|
inline |
Set a boolean that that if we ignore TOF information or not.
a_flag |
Definition at line 165 of file iDataFilePET.hh.
|
inline |
initialize the isotope string value
a_value |
The name should corresponds to one corresponding tag in the isotope configuration file in config/. This function is dedicated to datafile conversion scripts
Definition at line 135 of file iDataFilePET.hh.
|
inline |
set the max number of line per event in the datafile
Definition at line 120 of file iDataFilePET.hh.
|
inline |
set to true the flag indicating the presence of normalization correction factors in the datafile
This function is dedicated to datafile conversion scripts
Definition at line 195 of file iDataFilePET.hh.
|
inline |
set to true the flag indicating the presence of random correction factors in the datafile
This function is dedicated to datafile conversion scripts
Definition at line 209 of file iDataFilePET.hh.
|
inline |
set to true the flag indicating the presence of scatter correction factors in the datafile
This function is dedicated to datafile conversion scripts
Definition at line 202 of file iDataFilePET.hh.
|
private |
Flag that says if attenuation correction terms are included in the data. Default = false
Definition at line 337 of file iDataFilePET.hh.
|
private |
Size of TOF bins for histogram mode. Default = -1.0
Definition at line 349 of file iDataFilePET.hh.
|
private |
Flag for informations about the event nature (true, scatter, random) in the data. Default = false
Definition at line 336 of file iDataFilePET.hh.
|
private |
Flag to say if we ignore the attenuation correction even if present. Default = false
Definition at line 338 of file iDataFilePET.hh.
|
private |
Flag to say if we ignore the normalization correction even if present. Default = false
Definition at line 340 of file iDataFilePET.hh.
|
private |
Flag to say if we ignore the random correction even if present. Default = false
Definition at line 344 of file iDataFilePET.hh.
|
private |
Flag to say if we ignore the scatter correction even if present. Default = false
Definition at line 342 of file iDataFilePET.hh.
|
private |
Flag to say if we ignore the TOF data even if present, or not. Default = false
Definition at line 346 of file iDataFilePET.hh.
|
private |
Isotope. Default = unknown
Definition at line 335 of file iDataFilePET.hh.
|
private |
Number of lines in each event in the datafile. Default = 1
Definition at line 333 of file iDataFilePET.hh.
|
private |
Max ring difference between 2 crystals in a LOR. Default value calculated from the scanner files
Definition at line 334 of file iDataFilePET.hh.
|
private |
Number of TOF bins for histogram mode. Default = 1
Definition at line 348 of file iDataFilePET.hh.
|
private |
Flag that says if normalization correction terms are included in the data. Default = false
Definition at line 339 of file iDataFilePET.hh.
|
private |
Flag that says if random correction terms are included in the data. Default = false
Definition at line 343 of file iDataFilePET.hh.
|
private |
TOF resolution in mm. Default = -1.0
Definition at line 347 of file iDataFilePET.hh.
|
private |
Flag that says if scatter correction terms are included in the data. Default = false
Definition at line 341 of file iDataFilePET.hh.
|
private |
Flag that says if TOF information is included in the data. Default = false
Definition at line 345 of file iDataFilePET.hh.