CASToR  2.0
Tomographic Reconstruction (PET/SPECT/CT)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iDataFilePET.hh
Go to the documentation of this file.
1 /*
2 This file is part of CASToR.
3 
4  CASToR is free software: you can redistribute it and/or modify it under the
5  terms of the GNU General Public License as published by the Free Software
6  Foundation, either version 3 of the License, or (at your option) any later
7  version.
8 
9  CASToR is distributed in the hope that it will be useful, but WITHOUT ANY
10  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12  details.
13 
14  You should have received a copy of the GNU General Public License along with
15  CASToR (in file GNU_GPL.TXT). If not, see <http://www.gnu.org/licenses/>.
16 
17 Copyright 2017-2018 all CASToR contributors listed below:
18 
19  --> current contributors: Thibaut MERLIN, Simon STUTE, Didier BENOIT, Claude COMTAT, Marina FILIPOVIC, Mael MILLARDET
20  --> past contributors: Valentin VIELZEUF
21 
22 This is CASToR version 2.0.
23 */
24 
31 #ifndef IDATAFILEPET_HH
32 #define IDATAFILEPET_HH 1
33 
34 #include "gVariables.hh"
35 #include "vDataFile.hh"
36 
44 class iDataFilePET : public vDataFile
45 {
46  // -------------------------------------------------------------------
47  // Constructor & Destructor
48  public:
53  iDataFilePET();
57  ~iDataFilePET();
58 
59  // -------------------------------------------------------------------
60  // Public member functions
61  public:
70  int ReadSpecificInfoInHeader(bool a_affectQuantificationFlag);
76  int WriteHeader();
82  int ComputeSizeEvent();
89  int PrepareDataFile();
97  int WriteEvent(vEvent* ap_Event, int a_th);
105  vEvent* GetEventSpecific(char* ap_buffer, int a_th);
110  void DescribeSpecific();
111 
112  // -------------------------------------------------------------------
113  // Public Get & Set functions
114  public:
119  inline bool GetTOFInfoFlag()
120  {return m_TOFInfoFlag;}
125  inline bool GetIgnoreTOFFlag()
126  {return m_ignoreTOFFlag;}
132  {return m_resolutionTOF;}
137  inline int GetNbTOFBins()
138  {return m_nbBinsTOF;}
144  {return m_binSizeTOF;}
150  {return m_TOFMeasurementRange;}
156  {return m_maxAxialDiffmm;}
161  inline void SetMaxNumberOfLinesPerEvent(uint16_t a_value)
162  {m_maxNumberOfLinesPerEvent = a_value;}
167  inline uint16_t GetMaxNumberOfLinesPerEvent()
176  inline void SetIsotope(string a_value)
177  {m_isotope = a_value;}
182  inline string GetIsotope()
183  {return m_isotope;}
189  inline void SetIgnoreTOFFlag(bool a_ignoreTOFFlag)
190  {m_ignoreTOFFlag = a_ignoreTOFFlag;}
197  inline void SetEventKindFlagOn()
198  {m_eventKindFlag = true;}
205  {m_atnCorrectionFlag = true;}
212  {m_normCorrectionFlag = true;}
219  {m_scatCorrectionFlag = true;}
226  {m_randCorrectionFlag = true;}
232  inline bool GetNormCorrectionFlag()
233  {return m_normCorrectionFlag;}
239  inline bool GetAtnCorrectionFlag()
240  {return m_atnCorrectionFlag;}
246  inline bool GetEventKindFlag()
247  {return m_eventKindFlag;}
253  inline bool GetScatCorrectionFlag()
254  {return m_scatCorrectionFlag;}
260  inline bool GetRandCorrectionFlag()
261  {return m_randCorrectionFlag;}
262 
263  // -------------------------------------------------------------------
264  // Public functions dedicated to the projection script
265  public:
271  int PROJ_InitFile();
278 
279  // -------------------------------------------------------------------
280  // Private member functions
281  private:
287  int SetSpecificParametersFrom(vDataFile* ap_DataFile);
301  int WriteListEvent(iEventListPET* ap_Event, int a_th=0);
309  int WriteHistoEvent(iEventHistoPET* ap_Event, int a_th);
325 
326  // -------------------------------------------------------------------
327  // Data members
328  private:
331  string m_isotope;
347 };
348 
349 #endif
int WriteEvent(vEvent *ap_Event, int a_th)
Write event according to the chosen type of data.
bool m_randCorrectionFlag
This class is designed to be a mother virtual class for DataFile.
Definition: vDataFile.hh:103
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()
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:81
FLTNB m_binSizeTOF
bool m_ignoreNormCorrectionFlag
bool m_ignoreTOFFlag
void DescribeSpecific()
Implementation of the pure virtual eponym function that simply prints info about the datafile...
FLTNB m_maxAxialDiffmm
void SetScatterCorrectionFlagOn()
set to true the flag indicating the presence of scatter correction factors in the datafile ...
int CheckSpecificConsistencyWithAnotherDataFile(vDataFile *ap_DataFile)
Check consistency between 'this' and the provided datafile, for specific characteristics.
iDataFilePET()
iDataFilePET constructor. Initialize the member variables to their default values.
Definition: iDataFilePET.cc:39
int ReadSpecificInfoInHeader(bool a_affectQuantificationFlag)
Read through the header file and gather specific PET information.
Definition: iDataFilePET.cc:76
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.
vEvent * GetEventSpecific(char *ap_buffer, int a_th)
Read an event from the position pointed by 'ap_buffer', parse the generic or modality-specific inform...
bool m_ignoreScatCorrectionFlag
int ComputeSizeEvent()
Computation of the size of each event according to the mandatory/optional correction fields...
bool m_eventKindFlag
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:69
FLTNB GetTOFResolution()
FLTNB m_TOFMeasurementRange
Declaration of class vDataFile.
FLTNB m_resolutionTOF
bool m_ignoreAttnCorrectionFlag
bool GetScatCorrectionFlag()
Simply return m_scatCorrectionFlag.
int SetSpecificParametersFrom(vDataFile *ap_DataFile)
Initialize all parameters specific to PET from the provided datafile.
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 WriteHistoEvent(iEventHistoPET *ap_Event, int a_th)
Write a PET histogram event.
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 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...
FLTNB GetMaxAxialDiffmm()
bool GetIgnoreTOFFlag()
Mother class for the Event objects.
Definition: vEvent.hh:43
FLTNB GetTOFBinSize()
string m_isotope
FLTNB GetTOFMeasurementRange()
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:44
bool m_scatCorrectionFlag
void SetMaxNumberOfLinesPerEvent(uint16_t a_value)
set the max number of line per event in the datafile
bool m_ignoreRandCorrectionFlag
int WriteListEvent(iEventListPET *ap_Event, int a_th=0)
Write a PET list-mode event.