CASToR  3.2
Tomographic Reconstruction (PET/SPECT/CT)
include/datafile/iDataFilePET.hh
Go to the documentation of this file.
1 
8 #ifndef IDATAFILEPET_HH
9 #define IDATAFILEPET_HH 1
10 
11 #include "gVariables.hh"
12 #include "vDataFile.hh"
13 
21 class iDataFilePET : public vDataFile
22 {
23  // -------------------------------------------------------------------
24  // Constructor & Destructor
25  public:
30  iDataFilePET();
34  ~iDataFilePET();
35 
36  // -------------------------------------------------------------------
37  // Public member functions
38  public:
47  int ReadSpecificInfoInHeader(bool a_affectQuantificationFlag);
53  int WriteHeader();
59  int ComputeSizeEvent();
66  int PrepareDataFile();
74  int WriteEvent(vEvent* ap_Event, int a_th);
82  vEvent* GetEventSpecific(char* ap_buffer, int a_th);
87  void DescribeSpecific();
88 
89  // -------------------------------------------------------------------
90  // Public Get & Set functions
91  public:
96  inline bool GetTOFInfoFlag()
97  {return m_TOFInfoFlag;}
102  inline void SetTOFInfoFlag()
103  {m_TOFInfoFlag = true;}
108  inline bool GetIgnoreTOFFlag()
109  {return m_ignoreTOFFlag;}
114  inline void SetTOFResolutionInPs(FLTNB a_TOFResolutionInPs)
115  {m_TOFResolutionInPs = a_TOFResolutionInPs;}
121  {return m_TOFResolutionInPs;}
126  inline int GetNbTOFBins()
127  {return m_nbTOFBins;}
133  {return m_TOFBinSizeInPs;}
144  inline void SetTOFMeasurementRangeInPs(FLTNB a_TOFMeasurementRangeInPs)
145  {m_TOFMeasurementRangeInPs = a_TOFMeasurementRangeInPs;}
151  {return m_TOFMeasurementRangeInPs;}
157  {return m_maxAxialDiffmm;}
162  inline void SetMaxNumberOfLinesPerEvent(uint16_t a_value)
163  {m_maxNumberOfLinesPerEvent = a_value;}
168  inline uint16_t GetMaxNumberOfLinesPerEvent()
177  inline void SetIsotope(string a_value)
178  {m_isotope = a_value;}
183  inline string GetIsotope()
184  {return m_isotope;}
190  inline void SetIgnoreTOFFlag(bool a_ignoreTOFFlag)
191  {m_ignoreTOFFlag = a_ignoreTOFFlag;}
198  inline void SetEventKindFlagOn()
199  {m_eventKindFlag = true;}
206  {m_atnCorrectionFlag = true;}
213  {m_normCorrectionFlag = true;}
220  {m_scatCorrectionFlag = true;}
227  {m_randCorrectionFlag = true;}
233  inline bool GetNormCorrectionFlag()
234  {return m_normCorrectionFlag;}
240  inline bool GetAtnCorrectionFlag()
241  {return m_atnCorrectionFlag;}
247  inline bool GetEventKindFlag()
248  {return m_eventKindFlag;}
254  inline bool GetScatCorrectionFlag()
255  {return m_scatCorrectionFlag;}
261  inline bool GetRandCorrectionFlag()
262  {return m_randCorrectionFlag;}
268  inline void SetIgnoreScatCorrectionFlag(bool a_ignoreScatCorrectionFlag)
269  {m_ignoreScatCorrectionFlag = a_ignoreScatCorrectionFlag;}
275  inline void SetIgnoreRandCorrectionFlag(bool a_ignoreRandCorrectionFlag)
276  {m_ignoreRandCorrectionFlag = a_ignoreRandCorrectionFlag;}
282  inline void SetIgnoreNormCorrectionFlag(bool a_ignoreNormCorrectionFlag)
283  {m_ignoreNormCorrectionFlag = a_ignoreNormCorrectionFlag;}
289  inline void SetIgnoreAttnCorrectionFlag(bool a_ignoreAttnCorrectionFlag)
290  {m_ignoreAttnCorrectionFlag = a_ignoreAttnCorrectionFlag;}
291 
297  inline bool GetPerEventTOFResolutionFlag() const
298  { return m_perEventTOFResolutionFlag; }
299 
305  inline void SetPerEventTOFResolutionFlag(bool a_perEventTOFResolutionFlag)
306  { m_perEventTOFResolutionFlag = a_perEventTOFResolutionFlag; }
307  // -------------------------------------------------------------------
308  // Public functions dedicated to the projection script
309  public:
315  int PROJ_InitFile();
322 
323  // -------------------------------------------------------------------
324  // Private member functions
325  private:
331  int SetSpecificParametersFrom(vDataFile* ap_DataFile);
345  int WriteListEvent(iEventListPET* ap_Event, int a_th=0);
353  int WriteHistoEvent(iEventHistoPET* ap_Event, int a_th);
361  int WriteNormEvent(iEventNorm* ap_Event, int a_th);
377 
378  // -------------------------------------------------------------------
379  // Data members
380  private:
381  uint16_t m_maxNumberOfLinesPerEvent;
383  string m_isotope;
384  bool m_eventKindFlag;
385  bool m_atnCorrectionFlag;
387  bool m_normCorrectionFlag;
389  bool m_scatCorrectionFlag;
391  bool m_randCorrectionFlag;
393  bool m_TOFInfoFlag;
394  bool m_ignoreTOFFlag;
396  int m_nbTOFBins;
401 };
402 
403 #endif
int WriteEvent(vEvent *ap_Event, int a_th)
This class is designed to be a mother virtual class for DataFile.
Declaration of class vDataFile.
int PROJ_GetScannerSpecificParameters()
Get PET specific parameters for projections from the scanner object, through the scannerManager.
void DescribeSpecific()
Implementation of the pure virtual eponym function that simply prints info about the datafile...
void SetPerEventTOFResolutionFlag(bool a_perEventTOFResolutionFlag)
Set a boolean indicating the presence of per event time-of-flight (ToF) resolution values in datafile...
void SetIsotope(string a_value)
int WriteNormEvent(iEventNorm *ap_Event, int a_th)
int CheckSpecificConsistencyWithAnotherDataFile(vDataFile *ap_DataFile)
iDataFilePET()
iDataFilePET constructor. Initialize the member variables to their default values.
int ReadSpecificInfoInHeader(bool a_affectQuantificationFlag)
int CheckSpecificParameters()
Check parameters specific to PET data.
vEvent * GetEventSpecific(char *ap_buffer, int a_th)
void SetIgnoreRandCorrectionFlag(bool a_ignoreRandCorrectionFlag)
Set the boolean m_ignoreRandCorrectionFlag to a_ignoreRandCorrectionFlag.
int ComputeSizeEvent()
Computation of the size of each event according to the mandatory/optional correction fields...
Inherit from iEventPET. Class for PET list-mode events.
void SetIgnoreAttnCorrectionFlag(bool a_ignoreAttnCorrectionFlag)
Set the boolean m_ignoreAttnCorrectionFlag to a_ignoreAttnCorrectionFlag.
Inherit from iEventPET. Class for PET histogram mode events.
void SetTOFMeasurementRangeInPs(FLTNB a_TOFMeasurementRangeInPs)
bool GetPerEventTOFResolutionFlag() const
Simply return m_perEventTOFResolutionFlag.
~iDataFilePET()
iDataFilePET destructor.
void SetMaxNumberOfLinesPerEvent(uint16_t a_value)
int SetSpecificParametersFrom(vDataFile *ap_DataFile)
void SetTOFResolutionInPs(FLTNB a_TOFResolutionInPs)
int WriteHistoEvent(iEventHistoPET *ap_Event, int a_th)
int WriteHeader()
Generate a header file according to the data output information.
int PROJ_InitFile()
Initialize the fstream objets for output writing as well as some other variables specific to the Proj...
void SetIgnoreScatCorrectionFlag(bool a_ignoreScatCorrectionFlag)
Set the boolean m_ignoreScatCorrectionFlag to a_ignoreScatCorrectionFlag.
Inherit from vEvent. Used for normalization events for sensitivity computation.
int PrepareDataFile()
Store different kind of information inside arrays (data relative to specific correction as well as ba...
Mother class for the Event objects.
int CheckFileSizeConsistency()
This function is implemented in child classes Check if file size is consistent. ...
Inherit from vDataFile. Class that manages the reading of a PET input file (header + data)...
int WriteListEvent(iEventListPET *ap_Event, int a_th=0)
void SetIgnoreNormCorrectionFlag(bool a_ignoreNormCorrectionFlag)
Set the boolean m_ignoreNormCorrectionFlag to a_ignoreNormCorrectionFlag.
void SetIgnoreTOFFlag(bool a_ignoreTOFFlag)