CASToR  1.0
Tomographic Reconstruction (PET/SPECT)
Public Member Functions | Private Member Functions | Private Attributes
iDataFilePET Class Reference

Inherit from vDataFile. Class that manages the reading of a PET input file (header + data). More...

#include <iDataFilePET.hh>

Inheritance diagram for iDataFilePET:
Inheritance graph
[legend]
Collaboration diagram for iDataFilePET:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 iDataFilePET ()
 iDataFilePET constructor. Initialize the member variables to their default values.
 ~iDataFilePET ()
 iDataFilePET destructor.
int ReadSpecificInfoInHeader ()
 Read through the header file and gather specific PET 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)
vEventGetEventFromBuffer (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.
bool GetTOFInfoFlag ()
bool GetIgnoreTOFFlag ()
FLTNB GetResolutionTOF ()
int GetNbBinsTOF ()
FLTNB GetBinSizeTOF ()
int GetMaxRingDiff ()
void SetMaxNberLinesPerEvent (uint16_t a_value)
 set the max number of line per event in the datafile
void SetIsotope (string a_value)
 initialize the isotope string value
void SetTOFResolution (FLTNB a_value)
 initialize the TOF resolution (for list-mode)
void SetNbTOFBins (int a_value)
 initialize the number of TOF bins (for histogram-mode)
void SetIgnoreTOFFlag (bool a_ignoreTOFFlag)
 Set a boolean that that if we ignore TOF information or not.
void SetTOFBinSize (FLTNB a_value)
 initialize the size of TOF bins (for histogram-mode)
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
void SetAtnCorrectionFlagOn ()
 set to true the flag indicating the presence of attenuation correction factors in the datafile
void SetNormCorrectionFlagOn ()
 set to true the flag indicating the presence of normalization correction factors in the datafile
void SetScatterCorrectionFlagOn ()
 set to true the flag indicating the presence of scatter correction factors in the datafile
void SetRandomCorrectionFlagOn ()
 set to true the flag indicating the presence of random correction factors in the datafile
bool GetNormCorrectionFlag ()
 Simply return m_normCorrectionFlag.
bool GetAtnCorrectionFlag ()
 Simply return m_atnCorrectionFlag.
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 PET specific parameters for projections from the scanner object, through the scannerManager.

Private Member Functions

int CheckSpecificParameters ()
 Check parameters specific to PET data.
int PROJ_WriteListEvent (iEventListPET *ap_Event, int a_th)
 Write a PET list-mode event.
int PROJ_WriteHistoEvent (iEventHistoPET *ap_Event, int a_th)
 Write a PET histogram event.
int CheckFileSizeConsistency ()
 This function is implemented in child classes
Check if file size is consistent.

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

Detailed Description

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.


Constructor & Destructor Documentation

iDataFilePET constructor. Initialize the member variables to their default values.

Definition at line 30 of file iDataFilePET.cc.

iDataFilePET destructor.

Definition at line 61 of file iDataFilePET.cc.


Member Function Documentation

int iDataFilePET::CheckFileSizeConsistency ( ) [private, virtual]

This function is implemented in child classes
Check if file size is consistent.

Returns:
0 if success, and positive value otherwise.

Implements vDataFile.

Definition at line 614 of file iDataFilePET.cc.

int iDataFilePET::CheckSpecificParameters ( ) [private, virtual]

Check parameters specific to PET data.

Returns:
0 if success, and positive value otherwise.

Implements vDataFile.

Definition at line 534 of file iDataFilePET.cc.

Here is the call graph for this function:

int iDataFilePET::ComputeSizeEvent ( ) [virtual]

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 117 of file iDataFilePET.cc.

Here is the caller graph for this function:

Simply return m_atnCorrectionFlag.

Returns:
m_atnCorrectionFlag

Definition at line 207 of file iDataFilePET.hh.

Here is the caller graph for this function:

Returns:
size of TOF bins in the acquisition

Definition at line 105 of file iDataFilePET.hh.

vEvent * iDataFilePET::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.

Parameters:
ap_buffer: address pointing to the event to recover
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 321 of file iDataFilePET.cc.

Here is the call graph for this function:

Returns:
m_ignoreTOFFlag

Definition at line 87 of file iDataFilePET.hh.

Here is the caller graph for this function:

iDataFilePET::GetMaxRingDiff ( ) [inline, virtual]
Returns:
max ring difference in the acquisition

Reimplemented from vDataFile.

Definition at line 111 of file iDataFilePET.hh.

Returns:
number of TOF bins in the acquisition

Definition at line 99 of file iDataFilePET.hh.

Here is the caller graph for this function:

Simply return m_normCorrectionFlag.

Returns:
m_normCorrectionFlag

Definition at line 200 of file iDataFilePET.hh.

Here is the caller graph for this function:

Returns:
TOF resolution for the acquisition

Definition at line 93 of file iDataFilePET.hh.

Here is the caller graph for this function:

Returns:
m_TOFInfoFlag

Definition at line 81 of file iDataFilePET.hh.

Here is the caller graph for this function:

int iDataFilePET::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)

Returns:
0 is success, positive value otherwise

Implements vDataFile.

Definition at line 201 of file iDataFilePET.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Get PET specific parameters for projections from the scanner object, through the scannerManager.

Returns:
0 if success, positive value otherwise

Implements vDataFile.

Definition at line 1201 of file iDataFilePET.cc.

Here is the call graph for this function:

int iDataFilePET::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)

Returns:
0 if success, and positive value otherwise.

Implements vDataFile.

Definition at line 768 of file iDataFilePET.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int iDataFilePET::PROJ_WriteEvent ( vEvent ap_Event,
int  a_th 
) [virtual]

Write event according to the chosen type of data.

Parameters:
ap_Event: event containing the data 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 836 of file iDataFilePET.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int iDataFilePET::PROJ_WriteHeader ( ) [virtual]

Generate a header file according to the projection and data output informations.
Used by Projection algorithm.

Returns:
0 if success, and positive value otherwise.

Implements vDataFile.

Definition at line 1066 of file iDataFilePET.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int iDataFilePET::PROJ_WriteHistoEvent ( iEventHistoPET ap_Event,
int  a_th 
) [private]

Write a PET histogram event.

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

Definition at line 875 of file iDataFilePET.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int iDataFilePET::PROJ_WriteListEvent ( iEventListPET ap_Event,
int  a_th 
) [private]

Write a PET list-mode event.

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

Definition at line 955 of file iDataFilePET.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Read through the header file and gather specific PET information.

Returns:
0 is success, positive value otherwise

Implements vDataFile.

Definition at line 74 of file iDataFilePET.cc.

Here is the call graph for this function:

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 172 of file iDataFilePET.hh.

Here is the caller graph for this function:

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 165 of file iDataFilePET.hh.

iDataFilePET::SetIgnoreTOFFlag ( bool  a_ignoreTOFFlag) [inline]

Set a boolean that that if we ignore TOF information or not.

Parameters:
a_flag

Definition at line 149 of file iDataFilePET.hh.

iDataFilePET::SetIsotope ( string  a_value) [inline]

initialize the isotope string value

Parameters:
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 126 of file iDataFilePET.hh.

Here is the caller graph for this function:

iDataFilePET::SetMaxNberLinesPerEvent ( uint16_t  a_value) [inline]

set the max number of line per event in the datafile

Definition at line 117 of file iDataFilePET.hh.

Here is the caller graph for this function:

iDataFilePET::SetNbTOFBins ( int  a_value) [inline]

initialize the number of TOF bins (for histogram-mode)

Parameters:
a_value

This function is dedicated to datafile conversion scripts

Definition at line 142 of file iDataFilePET.hh.

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 179 of file iDataFilePET.hh.

Here is the caller graph for this function:

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 193 of file iDataFilePET.hh.

Here is the caller graph for this function:

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 186 of file iDataFilePET.hh.

Here is the caller graph for this function:

iDataFilePET::SetTOFBinSize ( FLTNB  a_value) [inline]

initialize the size of TOF bins (for histogram-mode)

Parameters:
a_value

This function is dedicated to datafile conversion scripts

Definition at line 157 of file iDataFilePET.hh.

iDataFilePET::SetTOFResolution ( FLTNB  a_value) [inline]

initialize the TOF resolution (for list-mode)

Parameters:
a_value

This function is dedicated to datafile conversion scripts

Definition at line 134 of file iDataFilePET.hh.


Member Data Documentation

Flag that says if attenuation correction terms are included in the data. Default = false

Definition at line 292 of file iDataFilePET.hh.

Size of TOF bins for histogram mode. Default = -1.0

Definition at line 304 of file iDataFilePET.hh.

Flag for informations about the event nature (true, scatter, random) in the data. Default = false

Definition at line 291 of file iDataFilePET.hh.

Flag to say if we ignore the attenuation correction even if present. Default = false

Definition at line 293 of file iDataFilePET.hh.

Flag to say if we ignore the normalization correction even if present. Default = false

Definition at line 295 of file iDataFilePET.hh.

Flag to say if we ignore the random correction even if present. Default = false

Definition at line 299 of file iDataFilePET.hh.

Flag to say if we ignore the scatter correction even if present. Default = false

Definition at line 297 of file iDataFilePET.hh.

Flag to say if we ignore the TOF data even if present, or not. Default = false

Definition at line 301 of file iDataFilePET.hh.

string iDataFilePET::m_isotope [private]

Isotope. Default = unknown

Definition at line 290 of file iDataFilePET.hh.

Number of lines in each event in the datafile. Default = 1

Definition at line 288 of file iDataFilePET.hh.

Max ring difference between 2 crystals in a LOR. Default value calculated from the scanner files

Definition at line 289 of file iDataFilePET.hh.

Number of TOF bins for histogram mode. Default = 1

Definition at line 303 of file iDataFilePET.hh.

Flag that says if normalization correction terms are included in the data. Default = false

Definition at line 294 of file iDataFilePET.hh.

Flag that says if random correction terms are included in the data. Default = false

Definition at line 298 of file iDataFilePET.hh.

TOF resolution in mm. Default = -1.0

Definition at line 302 of file iDataFilePET.hh.

Flag that says if scatter correction terms are included in the data. Default = false

Definition at line 296 of file iDataFilePET.hh.

Flag that says if TOF information is included in the data. Default = false

Definition at line 300 of file iDataFilePET.hh.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Defines