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

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

#include <iDataFileSPECT.hh>

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

List of all members.

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)
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.
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
FLTNBmp_angles
uint16_t m_nbHeads
FLTNBmp_CORtoDetectorDistance
int m_headRotDirection

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

int iDataFileSPECT::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 441 of file iDataFileSPECT.cc.

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

Check parameters specific to SPECT data.

Returns:
0 if success, and positive value otherwise.

Implements vDataFile.

Definition at line 401 of file iDataFileSPECT.cc.

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 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.

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 304 of file iDataFileSPECT.cc.

Here is the call graph for this function:

iDataFileSPECT::GetNbBins ( int  axis) [inline]
Parameters:
axis: axis corresponding to transaxial (0) or axial (1) bins
Returns:
number of bins corresponding to the axis passed in parameter

Definition at line 122 of file iDataFileSPECT.hh.

Returns:
total number of projections in the SPECT acquisition

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

Parameters:
ap_angles
Returns:
0 if success, positive value otherwise

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

Parameters:
ap_CORtoDetectorDistance
Returns:
0 if success, positive value otherwise

Definition at line 588 of file iDataFileSPECT.cc.

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 219 of file iDataFileSPECT.cc.

Here is the call graph for this function:

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

Returns:
0 if success, positive value otherwise

Implements vDataFile.

Definition at line 920 of file iDataFileSPECT.cc.

Here is the call graph for this function:

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)

Returns:
0 if success, and positive value otherwise.

Implements vDataFile.

Definition at line 619 of file iDataFileSPECT.cc.

Here is the call graph for this function:

int iDataFileSPECT::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 685 of file iDataFileSPECT.cc.

Here is the call graph for this function:

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 845 of file iDataFileSPECT.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int iDataFileSPECT::PROJ_WriteHistoEvent ( iEventHistoSPECT ap_Event,
int  a_th 
) [private]

Write a SPECT 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 726 of file iDataFileSPECT.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int iDataFileSPECT::PROJ_WriteListEvent ( iEventListSPECT ap_Event,
int  a_th 
) [private]

Write a SPECT 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 774 of file iDataFileSPECT.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Read through the header file and recover specific SPECT information.

Returns:
0 is success, positive value otherwise

Implements vDataFile.

Definition at line 79 of file iDataFileSPECT.cc.

Here is the call graph for this function:

Definition at line 129 of file iDataFileSPECT.hh.

iDataFileSPECT::SetHeadRotDirection ( int  a_direction) [inline]

initialize the rotation direction of the gamma camera(s)

Parameters:
a_direction

Definition at line 183 of file iDataFileSPECT.hh.

void iDataFileSPECT::SetIsotope ( string  a_value) [inline]

Definition at line 139 of file iDataFileSPECT.hh.

Here is the caller graph for this function:

iDataFileSPECT::SetNbBins ( uint16_t  a_binTrs,
uint16_t  a_binAxl 
) [inline]

initialize the bin values

Parameters:
a_binTrs
a_binAxl

Definition at line 148 of file iDataFileSPECT.hh.

iDataFileSPECT::SetNbProjections ( uint16_t  a_nbProjections) [inline]

initialize the number of projections

Parameters:
a_nbProjections

Definition at line 156 of file iDataFileSPECT.hh.


Member Data Documentation

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

Definition at line 225 of file iDataFileSPECT.hh.

Head rotation direction (0=clockwise, 1=counterclockwise)

Definition at line 240 of file iDataFileSPECT.hh.

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

Definition at line 227 of file iDataFileSPECT.hh.

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.

Total number of projections during the acquisition(for all the heads). No Default

Definition at line 231 of file iDataFileSPECT.hh.

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

Definition at line 226 of file iDataFileSPECT.hh.

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

Definition at line 228 of file iDataFileSPECT.hh.

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.

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.


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