CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
sScannerManager.hh
Go to the documentation of this file.
1 
8 #ifndef SSCANNERMANAGER_HH
9 #define SSCANNERMANAGER_HH 1
10 
11 #include "gVariables.hh"
12 #include "gOptions.hh"
13 #include "sOutputManager.hh"
14 #ifdef _WIN32
15 #include "oDirentWin32.hh"
16 #else
17 #include "dirent.h"
18 #endif
19 #include "vScanner.hh"
20 
21 
22 
31 #define SCANNER_UNKNOWN -1
32 
33 #define SCANNER_PET 0
34 
35 #define SCANNER_SPECT_PINHOLE 1
36 
37 #define SCANNER_SPECT_CONVERGENT 2
38 
39 #define SCANNER_CT 3
40 
41 #define SCANNER_SINOGRAM 4
42 
52 {
53  // -----------------------------------------------------------------------------------------
54  // Constructor & Destructor
55  public:
63  {
64  if (mp_Instance == NULL)
66  return mp_Instance;
67  }
68 
69  // -----------------------------------------------------------------------------------------
70  // Public member functions
71  public:
77  int CheckParameters();
85  int Initialize();
100  int FindScannerSystem(string a_scannerName);
107  int BuildScannerObject();
115  int GetGeometricInfoFromDatafile(string a_pathToDataFilename);
122  int InstantiateScanner();
128  int BuildLUT();
136  int GetScannerLayerNbRings(int a_layer);
137 
138 
139  // -------------------------------------------------------------------
140  // Get & Set functions
141  public:
146  inline bool HasUserScannerFile()
147  {return m_hasUserScannerFile;}
152  inline string GetPathToScannerFile()
153  {return m_pathToScannerFile;}
158  inline string GetScannerName()
159  {return m_scannerName;}
165  inline int GetScannerType()
166  {return (mp_Scanner!=NULL) ? mp_Scanner->GetScannerType() : SCANNER_UNKNOWN ;}
172  {return mp_Scanner;}
177  inline int GetSystemNbElts()
178  {return mp_Scanner->GetSystemNbElts();}
184  inline void SetVerbose(int a_verboseLevel)
185  {m_verbose = a_verboseLevel;};
192  inline void SetSaveLUTFlag(bool a_flag)
193  {m_saveLUTFlag = a_flag;}
200  inline bool SaveLUTFlag()
201  {return m_saveLUTFlag;}
202 
203 
204  // -------------------------------------------------------------------
205  // Analytical projection functions
206  public:
221  int64_t PROJ_GetModalityStartValueInnerLoop(int64_t a_elt1);
238  int64_t PROJ_GetCurrentProgression(int64_t a_elt1, int64_t a_elt2, int64_t* ap_nbEltsArray, int a_nbRGates, int a_nbCGates, int a_fr, int a_rg, int a_cg);
246 
247 
248  // -------------------------------------------------------------------
249  // Functions dedicated to transfer geometric information for Projection, from the main class to the scanner class (Set)
250  // from the scanner class to the datafile (Get, for datafile header writing)
251  public:
252  // RECONSTRUCTION
265  int GetSPECTSpecificParameters(uint16_t* ap_nbOfProjections,
266  uint16_t* ap_nbHeads,
267  uint16_t* ap_nbOfBins,
268  FLTNB* ap_pixSizeXY,
269  FLTNB*& ap_angles,
270  FLTNB*& ap_CORtoDetectorDistance,
271  int* ap_headRotDirection);
272  // ANALYTICAL PROJECTION
280  int PROJ_GetPETSpecificParameters(int* a_maxRingDiff);
288  int PROJ_SetPETSpecificParameters(int a_maxRingDiff);
302  int PROJ_SetSPECTSpecificParameters(uint16_t* ap_nbOfBins,
303  uint32_t a_nbOfProjections,
304  FLTNB a_firstAngle,
305  FLTNB a_stepAngle,
306  FLTNB* ap_projectionAngles,
307  FLTNB a_CORtoDetectorDistance,
308  string a_rotDirection);
309 
310 
311  // -------------------------------------------------------------------
312  // Private member functions
313  private:
320  sScannerManager();
325  // Prevent the compiler to generate methods to copy the object :
327  void operator=(sScannerManager const&){};
335  int GetAvailableScanners(vector<string> *ap_scannerNames);
336 
337 
338  // -------------------------------------------------------------------
339  // Data members
340  private:
343  int m_verbose;
345  string m_scannerName;
350 };
351 
352 #endif
This header file is mainly used to declare some macro definitions and all includes needed from the st...
sScannerManager(sScannerManager const &)
static sScannerManager * GetInstance()
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
int GetAvailableScanners(vector< string > *ap_scannerNames)
Gather all the names of the header files (.geom & .hscan) in the repository folder in the vector<stri...
int64_t PROJ_GetModalityStartValueInnerLoop(int64_t a_elt1)
Get the start value for the inner loop of analytic projection depending on the modality.
#define FLTNB
Definition: gVariables.hh:55
int FindScannerSystem(string a_scannerName)
Look for a file matching with the scanner name in parameter inside the scanner repository.
int BuildScannerObject()
Instantiate the specific scanner object related to the modality, and set verbosity of scanner object...
int64_t PROJ_GetProgressionFinalValue()
Get numerator value according to the modality to compute percent progression during the projection pr...
int PROJ_GetPETSpecificParameters(int *a_maxRingDiff)
Transfer addresses to each geometric parameter of the PET scanner objets to the corresponding pointer...
#define SCANNER_UNKNOWN
static sScannerManager * mp_Instance
string GetPathToScannerFile()
void SetSaveLUTFlag(bool a_flag)
Set to on the flag indicating a LUT generated by a geom file should be written on disk or not...
int CheckParameters()
Check if all parameters have been correctly initialized, and call the CheckParameters function of the...
int GetSPECTSpecificParameters(uint16_t *ap_nbOfProjections, uint16_t *ap_nbHeads, uint16_t *ap_nbOfBins, FLTNB *ap_pixSizeXY, FLTNB *&ap_angles, FLTNB *&ap_CORtoDetectorDistance, int *ap_headRotDirection)
Transfer geometric information recovered from the datafile to the scanner object. ...
int InstantiateScanner()
Instantiate scanner using the related function in the scanner classes.
sScannerManager()
sScannerManager constructor.
int BuildLUT()
Call the eponym function of the scanner class.
Declaration of class vScanner.
Singleton class that Instantiate and initialize the scanner object.
int PROJ_SetPETSpecificParameters(int a_maxRingDiff)
Deliver to the PET scanner object all informations provided from the datafile header.
bool SaveLUTFlag()
Get flag indicating a LUT generated by a geom file should be written on disk or not.
vScanner * GetScannerObject()
int ShowScannersDescription()
Get the description associated to the different scanners and print all on screen. Walk through the ...
~sScannerManager()
sScannerManager destructor.
int PROJ_SetSPECTSpecificParameters(uint16_t *ap_nbOfBins, uint32_t a_nbOfProjections, FLTNB a_firstAngle, FLTNB a_stepAngle, FLTNB *ap_projectionAngles, FLTNB a_CORtoDetectorDistance, string a_rotDirection)
Deliver to the SPECT scanner object all informations provided from the acquisition parameters...
void operator=(sScannerManager const &)
int Initialize()
Initialization : .
virtual int GetSystemNbElts()=0
This is a pure virtual method that must be implemented by children.
vScanner * mp_Scanner
Declaration of class sOutputManager.
int64_t PROJ_GetCurrentProgression(int64_t a_elt1, int64_t a_elt2, int64_t *ap_nbEltsArray, int a_nbRGates, int a_nbCGates, int a_fr, int a_rg, int a_cg)
Get numerator value according to the modality to compute percent progression during the analytical pr...
int GetScannerLayerNbRings(int a_layer)
Ask the number of rings to the scanner object for a specific layer. Returns an error if this inform...
This file is used for all kind of different functions designed for options parsing and ASCII file rea...
int GetGeometricInfoFromDatafile(string a_pathToDataFilename)
Call the specialized function of the scanner object in order to get geometric informations from the d...
void SetVerbose(int a_verboseLevel)
set verbosity
int64_t PROJ_GetModalityStopValueMainLoop()
Get the stop value for the main loop of analytic projection depending on the modality.
int GetScannerType()
Definition: vScanner.hh:218
Generic class for scanner objects.
Definition: vScanner.hh:48