CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
iDataFilePET.hh
Go to the documentation of this file.
1 
10 #ifndef IDATAFILEPET_HH
11 #define IDATAFILEPET_HH 1
12 
13 #include "gVariables.hh"
14 #include "vDataFile.hh"
15 
16 
17 
18 
26 class iDataFilePET : public vDataFile
27 {
28  // -------------------------------------------------------------------
29  // Constructor & Destructor
30  public:
35  iDataFilePET();
39  ~iDataFilePET();
40 
41 
42  // -------------------------------------------------------------------
43  // Public member functions
44  public:
53  int ReadSpecificInfoInHeader(bool a_affectQuantificationFlag);
59  int ComputeSizeEvent();
66  int PrepareDataFile();
74  vEvent* GetEventFromBuffer(char* ap_buffer, int a_th);
75 
76 
77  // -------------------------------------------------------------------
78  // Public Get & Set functions
79  public:
84  inline bool GetTOFInfoFlag()
85  {return m_TOFInfoFlag;}
90  inline bool GetIgnoreTOFFlag()
91  {return m_ignoreTOFFlag;}
97  {return m_resolutionTOF;}
102  inline int GetNbTOFBins()
103  {return m_nbBinsTOF;}
109  {return m_binSizeTOF;}
114  inline int GetMaxRingDiff()
115  {return m_maxRingDiff;}
120  inline void SetMaxNumberOfLinesPerEvent(uint16_t a_value)
121  {m_maxNumberOfLinesPerEvent = a_value;}
126  inline uint16_t GetMaxNumberOfLinesPerEvent()
135  inline void SetIsotope(string a_value)
136  {m_isotope = a_value;}
141  inline string GetIsotope()
142  {return m_isotope;}
143  /* OBS
144  \fn iDataFilePET::SetTOFResolution()
145  \param a_value
146  \brief initialize the TOF resolution (for list-mode)
147  \details This function is dedicated to datafile conversion scripts
148  inline void SetTOFResolution(FLTNB a_value)
149  {m_resolutionTOF = a_value; m_TOFInfoFlag = true;}
150 * */
151 
152  /* OBS
153  \fn iDataFilePET::SetNbTOFBins()
154  \param a_value
155  \brief initialize the number of TOF bins (for histogram-mode)
156  \details This function is dedicated to datafile conversion scripts
157  inline void SetNbTOFBins(int a_value)
158  {m_nbBinsTOF = a_value; m_TOFInfoFlag = true;}
159 * */
165  inline void SetIgnoreTOFFlag(bool a_ignoreTOFFlag)
166  {m_ignoreTOFFlag = a_ignoreTOFFlag;}
167  /* OBS
168  \fn iDataFilePET::SetTOFBinSize()
169  \param a_value
170  \brief initialize the size of TOF bins (for histogram-mode)
171  \details This function is dedicated to datafile conversion scripts
172  inline void SetTOFBinSize(FLTNB a_value)
173  {m_binSizeTOF = a_value; m_TOFInfoFlag = true;}
174 * */
181  inline void SetEventKindFlagOn()
182  {m_eventKindFlag = true;}
189  {m_atnCorrectionFlag = true;}
196  {m_normCorrectionFlag = true;}
203  {m_scatCorrectionFlag = true;}
210  {m_randCorrectionFlag = true;}
216  inline bool GetNormCorrectionFlag()
217  {return m_normCorrectionFlag;}
223  inline bool GetAtnCorrectionFlag()
224  {return m_atnCorrectionFlag;}
230  inline bool GetEventKindFlag()
231  {return m_eventKindFlag;}
237  inline bool GetScatCorrectionFlag()
238  {return m_scatCorrectionFlag;}
244  inline bool GetRandCorrectionFlag()
245  {return m_randCorrectionFlag;}
246 
247 
248  // -------------------------------------------------------------------
249  // Public functions dedicated to the projection script
250  public:
257  int PROJ_InitFile();
258 
259 
269  int PROJ_WriteEvent(vEvent* ap_Event, int a_th);
270 
277  int PROJ_WriteHeader();
278 
285 
286 
287  // -------------------------------------------------------------------
288  // Private member functions
289  private:
304  int PROJ_WriteListEvent(iEventListPET* ap_Event, int a_th);
312  int PROJ_WriteHistoEvent(iEventHistoPET* ap_Event, int a_th);
328 
329 
330  // -------------------------------------------------------------------
331  // Data members
332  private:
335  string m_isotope;
350 };
351 
352 #endif
bool m_randCorrectionFlag
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.
bool GetTOFInfoFlag()
Definition: iDataFilePET.hh:84
void SetAtnCorrectionFlagOn()
set to true the flag indicating the presence of attenuation correction factors in the datafile ...
int PROJ_GetScannerSpecificParameters()
Get PET specific parameters for projections from the scanner object, through the scannerManager.
#define FLTNB
Definition: gVariables.hh:55
FLTNB m_binSizeTOF
bool m_ignoreNormCorrectionFlag
bool m_ignoreTOFFlag
void SetScatterCorrectionFlagOn()
set to true the flag indicating the presence of scatter correction factors in the datafile ...
iDataFilePET()
iDataFilePET constructor. Initialize the member variables to their default values.
Definition: iDataFilePET.cc:16
int ReadSpecificInfoInHeader(bool a_affectQuantificationFlag)
Read through the header file and gather specific PET information.
Definition: iDataFilePET.cc:51
int CheckSpecificConsistencyWithAnotherDatafile(vDataFile *ap_Datafile)
Check consistency between 'this' and the provided datafile, for specific characteristics.
void SetEventKindFlagOn()
set to true the flag indicating the presence of the kind of a list-mode event in the datafile TODO ch...
int CheckSpecificParameters()
Check parameters specific to PET data.
bool m_ignoreScatCorrectionFlag
int ComputeSizeEvent()
Computation of the size of each event according to the mandatory/optional correction fields...
Definition: iDataFilePET.cc:88
bool m_eventKindFlag
int PROJ_WriteHistoEvent(iEventHistoPET *ap_Event, int a_th)
Write a PET histogram event.
string GetIsotope()
void SetIsotope(string a_value)
initialize the isotope string value
Inherit from iEventPET. Class for PET list-mode events.
Inherit from iEventPET. Class for PET histogram mode events.
~iDataFilePET()
iDataFilePET destructor.
Definition: iDataFilePET.cc:44
FLTNB GetTOFResolution()
Definition: iDataFilePET.hh:96
int PROJ_WriteEvent(vEvent *ap_Event, int a_th)
Write event according to the chosen type of data.
Declaration of class vDataFile.
FLTNB m_resolutionTOF
bool m_ignoreAttnCorrectionFlag
bool GetScatCorrectionFlag()
Simply return m_scatCorrectionFlag.
void SetRandomCorrectionFlagOn()
set to true the flag indicating the presence of random correction factors in the datafile ...
uint16_t GetMaxNumberOfLinesPerEvent()
bool GetEventKindFlag()
Simply return m_eventKindFlag.
int PROJ_InitFile()
Initialize the fstream objets for output writing as well as some other variables specific to the Proj...
int PROJ_WriteHeader()
Generate a header file according to the projection and data output informations. Used by Projection...
int GetMaxRingDiff()
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...
void SetIgnoreTOFFlag(bool a_ignoreTOFFlag)
Set a boolean that that if we ignore TOF information or not.
int PrepareDataFile()
Store different kind of information inside arrays (data relative to specific correction as well as ba...
bool GetIgnoreTOFFlag()
Definition: iDataFilePET.hh:90
Mother class for the Event objects.
Definition: vEvent.hh:23
FLTNB GetTOFBinSize()
string m_isotope
int PROJ_WriteListEvent(iEventListPET *ap_Event, int a_th)
Write a PET list-mode event.
bool GetRandCorrectionFlag()
Simply return m_randCorrectionFlag.
void SetNormCorrectionFlagOn()
set to true the flag indicating the presence of normalization correction factors in the datafile ...
int GetNbTOFBins()
int CheckFileSizeConsistency()
This function is implemented in child classes Check if file size is consistent. ...
bool m_atnCorrectionFlag
bool m_normCorrectionFlag
uint16_t m_maxNumberOfLinesPerEvent
bool GetAtnCorrectionFlag()
Simply return m_atnCorrectionFlag.
Inherit from vDataFile. Class that manages the reading of a PET input file (header + data)...
Definition: iDataFilePET.hh:26
bool m_scatCorrectionFlag
void SetMaxNumberOfLinesPerEvent(uint16_t a_value)
set the max number of line per event in the datafile
bool m_ignoreRandCorrectionFlag