CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
iDataFileSPECT.hh
Go to the documentation of this file.
1 
9 #ifndef IDATAFILESPECT_HH
10 #define IDATAFILESPECT_HH 1
11 
12 #include "gVariables.hh"
13 #include "vDataFile.hh"
14 #include "vScanner.hh"
15 #include "iEventHistoSPECT.hh"
16 #include "iEventListSPECT.hh"
17 
18 
19 
20 
28 class iDataFileSPECT : public vDataFile
29 {
30  // -------------------------------------------------------------------
31  // Constructor & Destructor
32  public:
42 
43 
44  // -------------------------------------------------------------------
45  // Public member functions
46  public:
55  int ReadSpecificInfoInHeader(bool a_affectQuantificationFlag);
61  int ComputeSizeEvent();
68  int PrepareDataFile();
76  vEvent* GetEventFromBuffer(char* ap_buffer, int a_th);
84  int InitAngles(FLTNB* ap_angles);
93  int InitCorToDetectorDistance(FLTNB* ap_CORtoDetectorDistance);
94 
95  // -------------------------------------------------------------------
96  // Public functions dedicated to the projection script
97  public:
103  int PROJ_InitFile();
113  int PROJ_WriteEvent(vEvent* ap_Event, int a_th);
120  int PROJ_WriteHeader();
127 
128  // -------------------------------------------------------------------
129  // Public Get & Set functions
130  public:
135  inline uint16_t GetNbProjections()
136  {return m_nbOfProjections;};
142  inline uint16_t GetNbBins(int axis)
143  {return mp_nbOfBins[axis];};
149  inline void SetEventKindFlagOn()
150  {m_eventKindFlag = true;}
158  inline void SetIsotope(string a_value)
159  {m_isotope = a_value;}
164  inline string GetIsotope()
165  {return m_isotope;}
172  inline void SetNbBins(uint16_t a_binTrs, uint16_t a_binAxl)
173  {mp_nbOfBins[0] = a_binTrs; mp_nbOfBins[1]=a_binAxl;}
179  inline void SetNbProjections(uint16_t a_nbProjections)
180  {m_nbOfProjections = a_nbProjections;}
186  inline void SetHeadRotDirection(int a_direction)
187  {m_headRotDirection = a_direction;}
193  inline bool GetEventKindFlag()
194  {return m_eventKindFlag;}
200  inline bool GetScatCorrectionFlag()
201  {return m_scatCorrectionFlag;}
207  inline bool GetNormCorrectionFlag()
208  {return m_normCorrectionFlag;}
209 
210 
211  // -------------------------------------------------------------------
212  // Private member functions
213  private:
234  int PROJ_WriteHistoEvent(iEventHistoSPECT* ap_Event, int a_th);
242  int PROJ_WriteListEvent(iEventListSPECT* ap_Event, int a_th);
251 
252  // -------------------------------------------------------------------
253  // Data members
254  private:
255  string m_isotope;
261  uint16_t mp_nbOfBins[2];
262  uint16_t m_nbOfProjections;
265  uint16_t m_nbHeads;
272 };
273 
274 #endif
This class is designed to be a mother virtual class for Datafile.
Definition: vDataFile.hh:67
This header file is mainly used to declare some macro definitions and all includes needed from the st...
bool GetNormCorrectionFlag()
Simply return m_normCorrectionFlag.
int InitAngles(FLTNB *ap_angles)
allocate memory for the mp_angles variable using m_nbProjections and initialize the projection angles...
int CheckSpecificConsistencyWithAnotherDatafile(vDataFile *ap_Datafile)
Check consistency between 'this' and the provided datafile, for specific characteristics.
int ReadSpecificInfoInHeader(bool a_affectQuantificationFlag)
Read through the header file and recover specific SPECT information.
#define FLTNB
Definition: gVariables.hh:55
bool GetEventKindFlag()
Simply return m_eventKindFlag.
iDataFileSPECT()
iDataFileSPECT constructor. Initialize the member variables to their default values.
Inherit from iEventSPECT. Class for SPECT histogram mode events.
int PROJ_WriteListEvent(iEventListSPECT *ap_Event, int a_th)
Write a SPECT list-mode event.
void SetHeadRotDirection(int a_direction)
initialize the rotation direction of the gamma camera(s)
~iDataFileSPECT()
iDataFileSPECT destructor.
uint16_t m_nbOfProjections
void SetNbProjections(uint16_t a_nbProjections)
initialize the number of projections
void SetIsotope(string a_value)
initialize the isotope string value
int PROJ_WriteEvent(vEvent *ap_Event, int a_th)
Write event according to the chosen type of data.
int PROJ_GetScannerSpecificParameters()
Get SPECT specific parameters for projections from the scanner object, through the scannerManager...
void SetNbBins(uint16_t a_binTrs, uint16_t a_binAxl)
initialize the bin values
int ComputeSizeEvent()
Computation of the size of each event according to the mandatory/optional correction fields...
Declaration of class vScanner.
int CheckSpecificParameters()
Check parameters specific to SPECT data.
Declaration of class vDataFile.
int CheckFileSizeConsistency()
This function is implemented in child classes Check if file size is consistent. ...
int InitCorToDetectorDistance(FLTNB *ap_CORtoDetectorDistance)
allocate memory for the ap_CORtoDetectorDistance variable using m_nbProjections, and initialize the p...
uint16_t GetNbBins(int axis)
uint16_t GetNbProjections()
Inherit from vDataFile. Class that manages the reading of a SPECT input file (header + data)...
Declaration of class iEventListSPECT.
vEvent * GetEventFromBuffer(char *ap_buffer, int a_th)
Read an event from the position pointed by 'ap_buffer', parse the generic or modality-specific inform...
int PROJ_InitFile()
Initialize the fstream objets for output writing as well as some other variables specific to the Proj...
bool m_ignoreNormCorrectionFlag
FLTNB * mp_CORtoDetectorDistance
Declaration of class iEventHistoSPECT.
int PROJ_WriteHistoEvent(iEventHistoSPECT *ap_Event, int a_th)
Write a SPECT histogram event.
Mother class for the Event objects.
Definition: vEvent.hh:23
void SetEventKindFlagOn()
set to true the flag indicating the presence of the kind of a list-mode event in the datafile ...
int PROJ_WriteHeader()
Generate a header file according to the projection and data output informations. Used by Projection...
int PrepareDataFile()
Store different kind of information inside arrays (data relative to specific correction as well as ba...
bool m_ignoreScatCorrectionFlag
uint16_t mp_nbOfBins[2]
bool GetScatCorrectionFlag()
Simply return m_scatCorrectionFlag.
Inherit from iEventSPECT. Class for SPECT list-mode events.