CASToR  2.0
Tomographic Reconstruction (PET/SPECT/CT)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iDataFileCT.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 IDATAFILECT_HH
32 #define IDATAFILECT_HH 1
33 
34 #include "gVariables.hh"
35 #include "vDataFile.hh"
36 #include "vScanner.hh"
37 #include "iEventHistoCT.hh"
38 #include "iEventListCT.hh"
39 
40 
48 class iDataFileCT : public vDataFile
49 {
50  // -------------------------------------------------------------------
51  // Constructor & Destructor
52  public:
57  iDataFileCT();
61  ~iDataFileCT();
62 
63  // -------------------------------------------------------------------
64  // Public member functions
65  public:
74  int ReadSpecificInfoInHeader(bool a_affectQuantificationFlag);
80  int WriteHeader();
86  int ComputeSizeEvent();
93  int PrepareDataFile();
101  int WriteEvent(vEvent* ap_Event, int a_th=0);
109  vEvent* GetEventSpecific(char* ap_buffer, int a_th);
117  int InitAngles(FLTNB* ap_angles);
122  void DescribeSpecific();
123 
124  // -------------------------------------------------------------------
125  // Public functions dedicated to the projection script
126  public:
132  int PROJ_InitFile();
139 
140  // -------------------------------------------------------------------
141  // Public Get & Set functions
142  public:
147  inline uint16_t GetNbProjections()
148  {return m_nbOfProjections;};
153  inline FLTNB* GetAngles()
154  {return mp_angles;};
160  inline void SetEventKindFlagOn()
161  {m_eventKindFlag = true;}
167  inline void SetNbProjections(uint16_t a_nbProjections)
168  {m_nbOfProjections = a_nbProjections;}
175  {return m_detectorRotDirection;}
181  inline void SetDetectorRotDirection(int a_direction)
182  {m_detectorRotDirection = a_direction;}
188  inline bool GetEventKindFlag()
189  {return m_eventKindFlag;}
195  inline bool GetScatCorrectionFlag()
196  {return m_scatCorrectionFlag;}
203  {return m_blankCorrectionFlag;}
204 
205  // -------------------------------------------------------------------
206  // Private member functions
207  private:
213  int SetSpecificParametersFrom(vDataFile* ap_DataFile);
234  int WriteHistoEvent(iEventHistoCT* ap_Event, int a_th);
242  int WriteListEvent(iEventListCT* ap_Event, int a_th);
251 
252  // -------------------------------------------------------------------
253  // Data members
254  private:
260  uint16_t m_nbOfProjections;
263 };
264 
265 #endif
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 GetScatCorrectionFlag()
Simply return m_scatCorrectionFlag.
Definition: iDataFileCT.hh:195
#define FLTNB
Definition: gVariables.hh:81
FLTNB * mp_angles
Definition: iDataFileCT.hh:261
int GetDetectorRotDirection()
Simply return m_detectorRotDirection.
Definition: iDataFileCT.hh:174
int InitAngles(FLTNB *ap_angles)
allocate memory for the mp_angles variable using m_nbProjections and initialize the projection angles...
Definition: iDataFileCT.cc:487
int SetSpecificParametersFrom(vDataFile *ap_DataFile)
Initialize all parameters specific to CT from the provided datafile.
Definition: iDataFileCT.cc:123
void SetEventKindFlagOn()
set to true the flag indicating the presence of the kind of a list-mode event in the datafile ...
Definition: iDataFileCT.hh:160
bool m_blankCorrectionFlag
Definition: iDataFileCT.hh:256
void SetNbProjections(uint16_t a_nbProjections)
initialize the number of projections
Definition: iDataFileCT.hh:167
Inherit from iEventCT. Class for CT list-mode events.
Definition: iEventListCT.hh:41
iDataFileCT()
iDataFileCT constructor. Initialize the member variables to their default values. ...
Definition: iDataFileCT.cc:39
bool m_ignoreScatCorrectionFlag
Definition: iDataFileCT.hh:259
uint16_t m_nbOfProjections
Definition: iDataFileCT.hh:260
int ReadSpecificInfoInHeader(bool a_affectQuantificationFlag)
Read through the header file and recover specific CT information.
Definition: iDataFileCT.cc:69
bool m_ignoreBlankCorrectionFlag
Definition: iDataFileCT.hh:257
bool m_scatCorrectionFlag
Definition: iDataFileCT.hh:258
int WriteHeader()
Generate a header file according to the data output information.
Definition: iDataFileCT.cc:671
int WriteListEvent(iEventListCT *ap_Event, int a_th)
Write a CT list-mode event.
Definition: iDataFileCT.cc:630
int ComputeSizeEvent()
Computation of the size of each event according to the mandatory/optional correction fields...
Definition: iDataFileCT.cc:141
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...
Definition: iDataFileCT.cc:271
Declaration of class vScanner.
Declaration of class vDataFile.
FLTNB * GetAngles()
Definition: iDataFileCT.hh:153
Declaration of class iEventHistoCT.
Declaration of class iEventListCT.
int PROJ_GetScannerSpecificParameters()
Get SPECT specific parameters for projections from the scanner object, through the scannerManager...
Definition: iDataFileCT.cc:724
int CheckSpecificParameters()
Check parameters specific to CT data.
Definition: iDataFileCT.cc:373
void DescribeSpecific()
Implementation of the pure virtual eponym function that simply prints info about the datafile...
Definition: iDataFileCT.cc:352
Inherit from iEventCT. Class for CT histogram mode events.
int PROJ_InitFile()
Initialize the fstream objets for output writing as well as some other variables specific to the Proj...
Definition: iDataFileCT.cc:509
bool GetBlankCorrectionFlag()
Simply return m_blankCorrectionFlag.
Definition: iDataFileCT.hh:202
bool GetEventKindFlag()
Simply return m_eventKindFlag.
Definition: iDataFileCT.hh:188
int m_detectorRotDirection
Definition: iDataFileCT.hh:262
int CheckSpecificConsistencyWithAnotherDataFile(vDataFile *ap_DataFile)
Check consistency between 'this' and the provided datafile, for specific characteristics.
Definition: iDataFileCT.cc:449
uint16_t GetNbProjections()
Definition: iDataFileCT.hh:147
int WriteEvent(vEvent *ap_Event, int a_th=0)
Write event according to the chosen type of data.
Definition: iDataFileCT.cc:561
Mother class for the Event objects.
Definition: vEvent.hh:43
Inherit from vDataFile. Class that manages the reading of a CT input file (header + data)...
Definition: iDataFileCT.hh:48
void SetDetectorRotDirection(int a_direction)
initialize the rotation direction of the CT detector
Definition: iDataFileCT.hh:181
~iDataFileCT()
iDataFileCT destructor.
Definition: iDataFileCT.cc:59
bool m_eventKindFlag
Definition: iDataFileCT.hh:255
int WriteHistoEvent(iEventHistoCT *ap_Event, int a_th)
Write a CT histogram event.
Definition: iDataFileCT.cc:592
int PrepareDataFile()
Store different kind of information inside arrays (data relative to specific correction as well as ba...
Definition: iDataFileCT.cc:192
int CheckFileSizeConsistency()
This function is implemented in child classes Check if file size is consistent. ...
Definition: iDataFileCT.cc:403