CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
Public Member Functions | Private Member Functions | List of all members
iDataFileTransmission Class Reference

Inherit from vDataFile. More...

#include <iDataFileTransmission.hh>

Inheritance diagram for iDataFileTransmission:
Inheritance graph
Collaboration diagram for iDataFileTransmission:
Collaboration graph

Public Member Functions

 iDataFileTransmission ()
 
virtual ~iDataFileTransmission ()
 
int ComputeSizeEvent ()
 This function is implemented in child classes
Computation of the size of each event according to the mandatory/optional correction fields. More...
 
int PrepareDataFile ()
 This function is implemented in child classes
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...
 
vEventGetEventFromBuffer (char *ap_buffer, int a_th)
 This function is implemented in child classes
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...
 
int PROJ_InitFile ()
 This function is implemented in child classes
Initialize the fstream objets for output writing as well as some other variables specific to the Projection script. More...
 
int PROJ_GetScannerSpecificParameters ()
 This function is implemented in child classes
It is used to set several variables of the datafile when using the projection script.
Get modality specific parameters from the scanner object, through the scannerManager. More...
 
int PROJ_WriteEvent (vEvent *ap_Event, int a_th)
 This function is implemented in child classes
Write event according to the chosen type of data. More...
 
int PROJ_WriteHeader ()
 This function is implemented in child classes.
Generate a header file according to the projection and data output informations. 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...
 
vEventGetEventWithAscendingOrderAssumption (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...
 
vEventGetEventWithoutOrderAssumption (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...
 
vEventGetEventFromFile (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...
 
vEventPROJ_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 ()
 
FLTNBGetPOIResolution ()
 
bool GetPOIInfoFlag ()
 
bool GetIgnorePOIFlag ()
 
virtual int GetMaxRingDiff ()
 Return an error by default.
This function is surcharged by the PET (and CT) scanner daughter class. More...
 
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 ()
 This function is implemented in child classes
Check specific parameters of child classes. More...
 
int CheckFileSizeConsistency ()
 
int ReadSpecificInfoInHeader (bool a_affectQuantificationFlag)
 This function is implemented in child classes
Read and check modality-specific information from the header datafile. More...
 
int CheckSpecificConsistencyWithAnotherDatafile (vDataFile *ap_Datafile)
 Check consistency between 'this' and the provided datafile, for specific characteristics. More...
 

Additional Inherited Members

- Protected Attributes inherited from vDataFile
oImageDimensionsAndQuantificationmp_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
 

Detailed Description

Inherit from vDataFile.

Nothing is implemented yet here. The constructor throw an error for the moment.
All pure virtual functions are simply declared and return a dummy value.

Definition at line 24 of file iDataFileTransmission.hh.

Constructor & Destructor Documentation

iDataFileTransmission::iDataFileTransmission ( )

Definition at line 17 of file iDataFileTransmission.cc.

Here is the call graph for this function:

iDataFileTransmission::~iDataFileTransmission ( )
virtual

Definition at line 28 of file iDataFileTransmission.cc.

Member Function Documentation

int iDataFileTransmission::CheckFileSizeConsistency ( )
inlineprivatevirtual

Implements vDataFile.

Definition at line 49 of file iDataFileTransmission.hh.

int iDataFileTransmission::CheckSpecificConsistencyWithAnotherDatafile ( vDataFile ap_Datafile)
inlineprivatevirtual

Check consistency between 'this' and the provided datafile, for specific characteristics.

Parameters
vDataFile*ap_Datafile

Pure virtual function implemented by children. It checks correction flags, etc.

Returns
0 if the provided datafile is consistent with 'this', another value otherwise

Implements vDataFile.

Definition at line 51 of file iDataFileTransmission.hh.

int iDataFileTransmission::CheckSpecificParameters ( )
inlineprivatevirtual

This function is implemented in child classes
Check specific parameters of child classes.

Returns
0 if success, and positive value otherwise.

Implements vDataFile.

Definition at line 48 of file iDataFileTransmission.hh.

int iDataFileTransmission::ComputeSizeEvent ( )
inlinevirtual

This function is implemented in child classes
Computation of the size of each event according to the mandatory/optional correction fields.

Returns
0 is success, positive value otherwise

Implements vDataFile.

Definition at line 36 of file iDataFileTransmission.hh.

vEvent* iDataFileTransmission::GetEventFromBuffer ( char *  ap_buffer,
int  a_th 
)
inlinevirtual

This function is implemented in child classes
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.

Parameters
ap_buffer: address pointing to the event to recover in the event buffer array
a_th: index of the thread from which the function was called
Returns
the thread-specific 'm2p_BufferEvent' object containing the modality-specific information for the event

Implements vDataFile.

Definition at line 38 of file iDataFileTransmission.hh.

int iDataFileTransmission::PrepareDataFile ( )
inlinevirtual

This function is implemented in child classes
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)

Returns
0 is success, positive value otherwise

Implements vDataFile.

Definition at line 37 of file iDataFileTransmission.hh.

int iDataFileTransmission::PROJ_GetScannerSpecificParameters ( )
inlinevirtual

This function is implemented in child classes
It is used to set several variables of the datafile when using the projection script.
Get modality specific parameters from the scanner object, through the scannerManager.

Returns
0 if success, positive value otherwise

Implements vDataFile.

Definition at line 40 of file iDataFileTransmission.hh.

int iDataFileTransmission::PROJ_InitFile ( )
inlinevirtual

This function is implemented in child classes
Initialize the fstream objets for output writing as well as some other variables specific to the Projection script.

Returns
0 if success, and positive value otherwise.

Implements vDataFile.

Definition at line 39 of file iDataFileTransmission.hh.

int iDataFileTransmission::PROJ_WriteEvent ( vEvent ap_Event,
int  a_th 
)
inlinevirtual

This function is implemented in child classes
Write event according to the chosen type of data.

Parameters
ap_Event: Event to write
a_th: index of the thread from which the function was called
Returns
0 if success, and positive value otherwise.

Implements vDataFile.

Definition at line 41 of file iDataFileTransmission.hh.

int iDataFileTransmission::PROJ_WriteHeader ( )
inlinevirtual

This function is implemented in child classes.
Generate a header file according to the projection and data output informations.

Returns
0 if success, and positive value otherwise.

Implements vDataFile.

Definition at line 42 of file iDataFileTransmission.hh.

int iDataFileTransmission::ReadSpecificInfoInHeader ( bool  a_affectQuantificationFlag)
inlineprivatevirtual

This function is implemented in child classes
Read and check modality-specific information from the header datafile.

Parameters
boola_affectQuantificationFlag = true

If the parameter flag is on, then affect the quantification factors from the oImageDimensionsAndQuantification after reading relevant information

Returns
0 if success, and positive value otherwise.

Implements vDataFile.

Definition at line 50 of file iDataFileTransmission.hh.


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