CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
vEvent.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-2019 all CASToR contributors listed below:
18 
19  --> Didier BENOIT, Claude COMTAT, Marina FILIPOVIC, Thibaut MERLIN, Mael MILLARDET, Simon STUTE, Valentin VIELZEUF
20 
21 This is CASToR version 3.0.
22 */
23 
30 #ifndef VEVENT_HH
31 #define VEVENT_HH 1
32 
33 #include "gVariables.hh"
34 
42 class vEvent
43 {
44  // -------------------------------------------------------------------
45  // Constructor & Destructor
46  public:
51  vEvent();
55  virtual ~vEvent();
56 
57  // -------------------------------------------------------------------
58  // Public member functions
59  public:
67  int AllocateID();
73  virtual int AllocateSpecificData() = 0;
78  virtual void Describe() = 0;
79 
80  // -------------------------------------------------------------------
81  // Public Get & Set functions
82  public:
87  inline uint32_t GetTimeInMs()
88  {return m_timeInMs;}
93  inline uint16_t GetNbLines()
94  {return m_nbLines;};
100  inline uint32_t GetID1(int a_line)
101  {return mp_ID1[a_line];}
107  inline uint32_t GetID2(int a_line)
108  {return mp_ID2[a_line];}
113  inline uint32_t* GetEventID1()
114  {return mp_ID1;}
119  inline uint32_t* GetEventID2()
120  {return mp_ID2;}
125  inline int GetDataType()
126  {return m_dataType;}
131  inline int GetDataMode()
132  {return m_dataMode;}
138  inline void SetTimeInMs(uint32_t a_value)
139  {m_timeInMs = a_value;};
147  virtual void SetEventValue(int a_bin, FLTNBDATA a_value) = 0;
153  inline void SetNbLines(uint16_t a_value)
154  {m_nbLines = a_value;};
161  inline void SetID1(int a_line, uint32_t a_value)
162  {mp_ID1[a_line] = a_value;}
169  inline void SetID2(int a_line, uint32_t a_value)
170  {mp_ID2[a_line] = a_value;}
176  inline void SetVerbose(int a_verbose)
177  {m_verbose = a_verbose;}
184  virtual FLTNB GetEventValue(int a_bin) = 0;
190  virtual FLTNB GetAdditiveCorrections(int a_bin) = 0;
196  inline virtual FLTNB GetBlankValue()
197  {return 0.;}
203  virtual FLTNB GetMultiplicativeCorrections() = 0;
209  virtual INTNB GetNbValueBins() = 0;
215  virtual void MultiplyAdditiveCorrections(FLTNB a_factor) = 0;
216 
217  // -------------------------------------------------------------------
218  // Private member functions
219  private:
220 
221  // -------------------------------------------------------------------
222  // Data members
223  protected:
224  uint32_t m_timeInMs;
225  uint16_t m_nbLines;
226  uint32_t* mp_ID1;
227  uint32_t* mp_ID2;
232  int m_verbose;
233 };
234 
235 #endif
This header file is mainly used to declare some macro definitions and all includes needed from the st...
void SetNbLines(uint16_t a_value)
Set the number of lines of the Event.
Definition: vEvent.hh:153
virtual FLTNB GetBlankValue()
This is a pure virtual function implemented in the child classes.
Definition: vEvent.hh:196
#define FLTNB
Definition: gVariables.hh:81
int m_verbose
Definition: vEvent.hh:232
int GetDataType()
Definition: vEvent.hh:125
uint32_t * mp_ID2
Definition: vEvent.hh:227
virtual FLTNB GetAdditiveCorrections(int a_bin)=0
Pure virtual function implemented in the child classes.
uint32_t * GetEventID2()
Definition: vEvent.hh:119
uint32_t GetID2(int a_line)
Definition: vEvent.hh:107
int m_dataType
Definition: vEvent.hh:229
virtual FLTNB GetMultiplicativeCorrections()=0
This is a pure virtual function implemented in the child classes.
virtual void SetEventValue(int a_bin, FLTNBDATA a_value)=0
This function is implemented by child classes.
Definition: vEvent.hh:139
int GetDataMode()
Definition: vEvent.hh:131
#define FLTNBDATA
Definition: gVariables.hh:87
virtual void MultiplyAdditiveCorrections(FLTNB a_factor)=0
Divide additive corrections by the provided factor.
uint32_t * mp_ID1
Definition: vEvent.hh:226
virtual FLTNB GetEventValue(int a_bin)=0
Pure virtual function implemented in the child classes.
FLTNB m_eventValue
Definition: vEvent.hh:228
vEvent()
vEvent constructor. Initialize the member variables to their default values.
Definition: vEvent.cc:40
int AllocateID()
Instantiate the mp_ID1 and mp_ID2 indices arrays.
Definition: vEvent.cc:68
void SetID2(int a_line, uint32_t a_value)
Set the indice associated with the line index for the 2nd ID of the Event.
Definition: vEvent.hh:169
#define INTNB
Definition: gVariables.hh:92
uint16_t GetNbLines()
Definition: vEvent.hh:93
int m_dataMode
Definition: vEvent.hh:230
virtual int AllocateSpecificData()=0
Pure virtual function implemented in the child classes, dedicated to the allocation of specific data ...
virtual void Describe()=0
This function can be used to get a description of the event printed out.
void SetTimeInMs(uint32_t a_value)
Set the timestamp of the Event.
Definition: vEvent.hh:138
Mother class for the Event objects.
Definition: vEvent.hh:42
uint32_t GetID1(int a_line)
Definition: vEvent.hh:100
virtual INTNB GetNbValueBins()=0
Get the number of event value bins.
uint32_t * GetEventID1()
Definition: vEvent.hh:113
uint16_t m_nbLines
Definition: vEvent.hh:225
uint32_t m_timeInMs
Definition: vEvent.hh:224
void SetVerbose(int a_verbose)
Set verbosity.
Definition: vEvent.hh:176
uint32_t GetTimeInMs()
Definition: vEvent.hh:87
virtual ~vEvent()
vEvent destructor
Definition: vEvent.cc:57
int m_dataSpec
Definition: vEvent.hh:231
void SetID1(int a_line, uint32_t a_value)
Set the indice associated with the line index for the 1st ID of the Event.
Definition: vEvent.hh:161