CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
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-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 IDATAFILECT_HH
31 #define IDATAFILECT_HH 1
32 
33 #include "gVariables.hh"
34 #include "vDataFile.hh"
35 #include "vScanner.hh"
36 #include "iEventHistoCT.hh"
37 #include "iEventListCT.hh"
38 
39 
47 class iDataFileCT : public vDataFile
48 {
49  // -------------------------------------------------------------------
50  // Constructor & Destructor
51  public:
56  iDataFileCT();
60  ~iDataFileCT();
61 
62  // -------------------------------------------------------------------
63  // Public member functions
64  public:
73  int ReadSpecificInfoInHeader(bool a_affectQuantificationFlag);
79  int WriteHeader();
85  int ComputeSizeEvent();
92  int PrepareDataFile();
100  int WriteEvent(vEvent* ap_Event, int a_th=0);
108  vEvent* GetEventSpecific(char* ap_buffer, int a_th);
116  int InitAngles(FLTNB* ap_angles);
121  void DescribeSpecific();
122 
123  // -------------------------------------------------------------------
124  // Public functions dedicated to the projection script
125  public:
131  int PROJ_InitFile();
138 
139  // -------------------------------------------------------------------
140  // Public Get & Set functions
141  public:
146  inline uint16_t GetNbProjections()
147  {return m_nbOfProjections;};
152  inline FLTNB* GetAngles()
153  {return mp_angles;};
159  inline void SetEventKindFlagOn()
160  {m_eventKindFlag = true;}
166  inline void SetNbProjections(uint16_t a_nbProjections)
167  {m_nbOfProjections = a_nbProjections;}
174  {return m_detectorRotDirection;}
180  inline void SetDetectorRotDirection(int a_direction)
181  {m_detectorRotDirection = a_direction;}
187  inline bool GetEventKindFlag()
188  {return m_eventKindFlag;}
194  inline bool GetScatCorrectionFlag()
195  {return m_scatCorrectionFlag;}
202  {return m_blankCorrectionFlag;}
203 
204  // -------------------------------------------------------------------
205  // Private member functions
206  private:
212  int SetSpecificParametersFrom(vDataFile* ap_DataFile);
233  int WriteHistoEvent(iEventHistoCT* ap_Event, int a_th);
241  int WriteListEvent(iEventListCT* ap_Event, int a_th);
250 
251  // -------------------------------------------------------------------
252  // Data members
253  private:
259  uint16_t m_nbOfProjections;
262 };
263 
264 #endif
This class is designed to be a mother virtual class for DataFile.
Definition: vDataFile.hh:102
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:194
#define FLTNB
Definition: gVariables.hh:81
FLTNB * mp_angles
Definition: iDataFileCT.hh:260
int GetDetectorRotDirection()
Simply return m_detectorRotDirection.
Definition: iDataFileCT.hh:173
int InitAngles(FLTNB *ap_angles)
allocate memory for the mp_angles variable using m_nbProjections and initialize the projection angles...
Definition: iDataFileCT.cc:486
int SetSpecificParametersFrom(vDataFile *ap_DataFile)
Initialize all parameters specific to CT from the provided datafile.
Definition: iDataFileCT.cc:122
void SetEventKindFlagOn()
set to true the flag indicating the presence of the kind of a list-mode event in the datafile ...
Definition: iDataFileCT.hh:159
bool m_blankCorrectionFlag
Definition: iDataFileCT.hh:255
void SetNbProjections(uint16_t a_nbProjections)
initialize the number of projections
Definition: iDataFileCT.hh:166
Inherit from iEventCT. Class for CT list-mode events.
Definition: iEventListCT.hh:40
iDataFileCT()
iDataFileCT constructor. Initialize the member variables to their default values. ...
Definition: iDataFileCT.cc:38
bool m_ignoreScatCorrectionFlag
Definition: iDataFileCT.hh:258
uint16_t m_nbOfProjections
Definition: iDataFileCT.hh:259
int ReadSpecificInfoInHeader(bool a_affectQuantificationFlag)
Read through the header file and recover specific CT information.
Definition: iDataFileCT.cc:68
bool m_ignoreBlankCorrectionFlag
Definition: iDataFileCT.hh:256
bool m_scatCorrectionFlag
Definition: iDataFileCT.hh:257
int WriteHeader()
Generate a header file according to the data output information.
Definition: iDataFileCT.cc:670
int WriteListEvent(iEventListCT *ap_Event, int a_th)
Write a CT list-mode event.
Definition: iDataFileCT.cc:629
int ComputeSizeEvent()
Computation of the size of each event according to the mandatory/optional correction fields...
Definition: iDataFileCT.cc:140
vEvent * GetEventSpecific(char *ap_buffer, int a_th)
Read an event from the position pointed by &#39;ap_buffer&#39;, parse the generic or modality-specific inform...
Definition: iDataFileCT.cc:270
Declaration of class vScanner.
Declaration of class vDataFile.
FLTNB * GetAngles()
Definition: iDataFileCT.hh:152
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:723
int CheckSpecificParameters()
Check parameters specific to CT data.
Definition: iDataFileCT.cc:372
void DescribeSpecific()
Implementation of the pure virtual eponym function that simply prints info about the datafile...
Definition: iDataFileCT.cc:351
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:508
bool GetBlankCorrectionFlag()
Simply return m_blankCorrectionFlag.
Definition: iDataFileCT.hh:201
bool GetEventKindFlag()
Simply return m_eventKindFlag.
Definition: iDataFileCT.hh:187
int m_detectorRotDirection
Definition: iDataFileCT.hh:261
int CheckSpecificConsistencyWithAnotherDataFile(vDataFile *ap_DataFile)
Check consistency between &#39;this&#39; and the provided datafile, for specific characteristics.
Definition: iDataFileCT.cc:448
uint16_t GetNbProjections()
Definition: iDataFileCT.hh:146
int WriteEvent(vEvent *ap_Event, int a_th=0)
Write event according to the chosen type of data.
Definition: iDataFileCT.cc:560
Mother class for the Event objects.
Definition: vEvent.hh:42
Inherit from vDataFile. Class that manages the reading of a CT input file (header + data)...
Definition: iDataFileCT.hh:47
void SetDetectorRotDirection(int a_direction)
initialize the rotation direction of the CT detector
Definition: iDataFileCT.hh:180
~iDataFileCT()
iDataFileCT destructor.
Definition: iDataFileCT.cc:58
bool m_eventKindFlag
Definition: iDataFileCT.hh:254
int WriteHistoEvent(iEventHistoCT *ap_Event, int a_th)
Write a CT histogram event.
Definition: iDataFileCT.cc:591
int PrepareDataFile()
Store different kind of information inside arrays (data relative to specific correction as well as ba...
Definition: iDataFileCT.cc:191
int CheckFileSizeConsistency()
This function is implemented in child classes Check if file size is consistent. ...
Definition: iDataFileCT.cc:402