CASToR  2.0
Tomographic Reconstruction (PET/SPECT/CT)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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-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 VEVENT_HH
32 #define VEVENT_HH 1
33 
34 #include "gVariables.hh"
35 
43 class vEvent
44 {
45  // -------------------------------------------------------------------
46  // Constructor & Destructor
47  public:
52  vEvent();
56  virtual ~vEvent();
57 
58  // -------------------------------------------------------------------
59  // Public member functions
60  public:
68  int AllocateID();
74  virtual int AllocateSpecificData() = 0;
79  virtual void Describe() = 0;
80 
81  // -------------------------------------------------------------------
82  // Public Get & Set functions
83  public:
88  inline uint32_t GetTimeInMs()
89  {return m_timeInMs;}
94  inline uint16_t GetNbLines()
95  {return m_nbLines;};
101  inline uint32_t GetID1(int a_line)
102  {return mp_ID1[a_line];}
108  inline uint32_t GetID2(int a_line)
109  {return mp_ID2[a_line];}
114  inline uint32_t* GetEventID1()
115  {return mp_ID1;}
120  inline uint32_t* GetEventID2()
121  {return mp_ID2;}
126  inline int GetDataType()
127  {return m_dataType;}
132  inline int GetDataMode()
133  {return m_dataMode;}
139  inline void SetTimeInMs(uint32_t a_value)
140  {m_timeInMs = a_value;};
148  virtual void SetEventValue(int a_bin, FLTNBDATA a_value) = 0;
154  inline void SetNbLines(uint16_t a_value)
155  {m_nbLines = a_value;};
162  inline void SetID1(int a_line, uint32_t a_value)
163  {mp_ID1[a_line] = a_value;}
170  inline void SetID2(int a_line, uint32_t a_value)
171  {mp_ID2[a_line] = a_value;}
177  inline void SetVerbose(int a_verbose)
178  {m_verbose = a_verbose;}
185  virtual FLTNB GetEventValue(int a_bin) = 0;
191  virtual FLTNB GetAdditiveCorrections(int a_bin) = 0;
197  inline virtual FLTNB GetBlankValue()
198  {return 0.;}
204  virtual FLTNB GetMultiplicativeCorrections() = 0;
210  virtual INTNB GetNbValueBins() = 0;
216  virtual void MultiplyAdditiveCorrections(FLTNB a_factor) = 0;
217 
218  // -------------------------------------------------------------------
219  // Private member functions
220  private:
221 
222  // -------------------------------------------------------------------
223  // Data members
224  protected:
225  uint32_t m_timeInMs;
226  uint16_t m_nbLines;
227  uint32_t* mp_ID1;
228  uint32_t* mp_ID2;
233  int m_verbose;
234 };
235 
236 #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:154
virtual FLTNB GetBlankValue()
This is a pure virtual function implemented in the child classes.
Definition: vEvent.hh:197
#define FLTNB
Definition: gVariables.hh:81
int m_verbose
Definition: vEvent.hh:233
int GetDataType()
Definition: vEvent.hh:126
uint32_t * mp_ID2
Definition: vEvent.hh:228
virtual FLTNB GetAdditiveCorrections(int a_bin)=0
Pure virtual function implemented in the child classes.
uint32_t * GetEventID2()
Definition: vEvent.hh:120
uint32_t GetID2(int a_line)
Definition: vEvent.hh:108
int m_dataType
Definition: vEvent.hh:230
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:140
int GetDataMode()
Definition: vEvent.hh:132
#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:227
virtual FLTNB GetEventValue(int a_bin)=0
Pure virtual function implemented in the child classes.
FLTNB m_eventValue
Definition: vEvent.hh:229
vEvent()
vEvent constructor. Initialize the member variables to their default values.
Definition: vEvent.cc:41
int AllocateID()
Instantiate the mp_ID1 and mp_ID2 indices arrays.
Definition: vEvent.cc:69
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:170
#define INTNB
Definition: gVariables.hh:92
uint16_t GetNbLines()
Definition: vEvent.hh:94
int m_dataMode
Definition: vEvent.hh:231
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:139
Mother class for the Event objects.
Definition: vEvent.hh:43
uint32_t GetID1(int a_line)
Definition: vEvent.hh:101
virtual INTNB GetNbValueBins()=0
Get the number of event value bins.
uint32_t * GetEventID1()
Definition: vEvent.hh:114
uint16_t m_nbLines
Definition: vEvent.hh:226
uint32_t m_timeInMs
Definition: vEvent.hh:225
void SetVerbose(int a_verbose)
Set verbosity.
Definition: vEvent.hh:177
uint32_t GetTimeInMs()
Definition: vEvent.hh:88
virtual ~vEvent()
vEvent destructor
Definition: vEvent.cc:58
int m_dataSpec
Definition: vEvent.hh:232
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:162