CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
vProjector.hh
Go to the documentation of this file.
1 
8 #ifndef VPROJECTOR_HH
9 #define VPROJECTOR_HH 1
10 
11 #include "gVariables.hh"
12 #include "vEvent.hh"
13 #include "oProjectionLine.hh"
14 #include "vScanner.hh"
16 
25 #define USE_TOFBIN 1
26 
27 #define USE_TOFPOS 2
28 
29 #define USE_NOTOF 3
30 
55 {
56  // -------------------------------------------------------------------
57  // Constructor & Destructor
58  public:
65  vProjector();
73  virtual ~vProjector();
74 
75 
76  // -------------------------------------------------------------------
77  // Public member functions
78  public:
84  void ShowHelp();
90  static void ShowCommonHelp();
96  int ReadCommonOptionsList(const string& a_optionsList);
105  int CheckParameters();
115  int Initialize();
138  int Project(int a_direction, oProjectionLine* ap_ProjectionLine, uint32_t* ap_index1, uint32_t* ap_index2, int a_nbIndices);
139 
140 
141  // -------------------------------------------------------------------
142  // Virtual but not pure for children
143  public:
154 
155 
156  // -------------------------------------------------------------------
157  // Pure virtual public member functions that need to be implemented by children
158  public:
169  virtual int ReadConfigurationFile(const string& a_configurationFile) = 0;
180  virtual int ReadOptionsList(const string& a_optionsList) = 0;
181 
182 
183  // -------------------------------------------------------------------
184  // Pure virtual private member functions that need to be implemented by children
185  private:
194  virtual void ShowHelpSpecific() = 0;
203  virtual int CheckSpecificParameters() = 0;
213  virtual int InitializeSpecific() = 0;
223  virtual int ProjectWithoutTOF( int a_direction, oProjectionLine* ap_ProjectionLine ) = 0;
234  virtual int ProjectWithTOFPos( int a_direction, oProjectionLine* ap_ProjectionLine ) = 0;
245  virtual int ProjectWithTOFBin( int a_direction, oProjectionLine* ap_ProjectionLine ) = 0;
246 
247 
248  // -------------------------------------------------------------------
249  // Public Get & Set functions
250  public:
256  inline void SetVerbose(int a_verbose)
257  {m_verbose = a_verbose;}
263  inline void SetScanner(vScanner* ap_Scanner)
264  {mp_Scanner = ap_Scanner;}
271  /*inline void SetTOFnbSigmas(FLTNB a_TOFnbSigmas)
272  {m_TOFnbSigmas = a_TOFnbSigmas;}*/
279  int SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification);
288  int SetTOFAndPOIOptions(int a_dataType, bool a_ignoreTOF, bool a_ignorePOI);
295 
296 
297  // -------------------------------------------------------------------
298  // Data members
299  protected:
300  // Few data from the oImageDimensionsAndQuantification to avoid getting them too often
305  // Image dimensions
308  // Scanner
310  // Integer flag to say if TOF are applied and how
313  // Flag for POI
314  bool m_applyPOI;
316  // Flag that says if the projector is compatible with SPECT attenuation correction
318  // Verbosity
319  int m_verbose;
320  // Has been checked ?
321  bool m_checked;
322  // Has been initialized ?
324 };
325 
326 // ----------------------------------------------------------------------
327 // Part of code that manages the auto declaration of children classes
328 // ----------------------------------------------------------------------
329 
330 // Macro for the function that creates the object
331 #define FUNCTION_PROJECTOR(CLASS) \
332  static vProjector *make_projector() { return new CLASS(); };
333 
334 // Macro for the class that links the appropriate function to the map of objects
335 #define CLASS_PROJECTOR(NAME,CLASS) \
336  class NAME##ProjectorCreator \
337  { \
338  public: \
339  NAME##ProjectorCreator() \
340  { sAddonManager::GetInstance()->mp_listOfProjectors[#NAME] = CLASS::make_projector; } \
341  }; \
342  static NAME##ProjectorCreator ProjectorCreator##NAME;
343 
344 #endif
bool m_applyPOI
Definition: vProjector.hh:314
This header file is mainly used to declare some macro definitions and all includes needed from the st...
bool m_checked
Definition: vProjector.hh:321
bool m_compatibleWithSPECTAttenuationCorrection
Definition: vProjector.hh:317
Declaration of class oImageDimensionsAndQuantification.
FLTNB mp_sizeVox[3]
Definition: vProjector.hh:301
static void ShowCommonHelp()
This function is used to print out some help about the use of options common to all projectors...
Definition: vProjector.cc:127
INTNB m_nbVoxXY
Definition: vProjector.hh:303
INTNB mp_nbVox[3]
Definition: vProjector.hh:302
#define FLTNB
Definition: gVariables.hh:55
void SetScanner(vScanner *ap_Scanner)
Set the pointer to the scanner in use.
Definition: vProjector.hh:263
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
Definition: vProjector.hh:307
This class is designed to generically described any on-the-fly projector.
Definition: vProjector.hh:54
vProjector()
The constructor of vProjector.
Definition: vProjector.cc:27
int Initialize()
A public function used to initialize the projector.
Definition: vProjector.cc:242
virtual int ProjectWithoutTOF(int a_direction, oProjectionLine *ap_ProjectionLine)=0
A function to project without TOF.
int Project(int a_direction, oProjectionLine *ap_ProjectionLine, uint32_t *ap_index1, uint32_t *ap_index2, int a_nbIndices)
A function use to computed the projection elements with respect to the provided parameters.
Definition: vProjector.cc:276
int SetTOFAndPOIOptions(int a_dataType, bool a_ignoreTOF, bool a_ignorePOI)
Set the TOF use as well as POI and checks compatibility with current data type.
Definition: vProjector.cc:94
virtual int ProjectWithTOFBin(int a_direction, oProjectionLine *ap_ProjectionLine)=0
A function to project with TOF binned information.
bool GetCompatibilityWithSPECTAttenuationCorrection()
Definition: vProjector.hh:293
virtual int CheckSpecificParameters()=0
A private function used to check the parameters settings specific to the child projector.
int ReadCommonOptionsList(const string &a_optionsList)
This function is used to read options common to all projectors given as a string. ...
Definition: vProjector.cc:162
void SetVerbose(int a_verbose)
Set the verbose level.
Definition: vProjector.hh:256
Declaration of class oProjectionLine.
virtual void ShowHelpSpecific()=0
A function used to show help about the child module.
bool m_initialized
Definition: vProjector.hh:323
virtual ~vProjector()
The destructor of vProjector.
Definition: vProjector.cc:56
Declaration of class vScanner.
int CheckParameters()
A public function used to check the parameters settings.
Definition: vProjector.cc:185
virtual int ReadOptionsList(const string &a_optionsList)=0
A function used to read options from a list of options.
virtual int ReadConfigurationFile(const string &a_configurationFile)=0
A function used to read options from a configuration file.
Declaration of class vEvent.
FLTNB m_TOFnbSigmas
Definition: vProjector.hh:312
#define INTNB
Definition: gVariables.hh:64
This class is designed to manage and store system matrix elements associated to a vEvent...
virtual int ProjectWithTOFPos(int a_direction, oProjectionLine *ap_ProjectionLine)=0
A function to project with TOF continuous information.
virtual int InitializeSpecific()=0
A private function used to initialize everything specific to the child projector. ...
FLTNB mp_halfFOV[3]
Definition: vProjector.hh:304
This class is designed to manage all dimensions and quantification related stuff. ...
virtual INTNB EstimateMaxNumberOfVoxelsPerLine()
This function is used to compute and provide an estimate of the maximum number of voxels that could c...
Definition: vProjector.cc:266
void ShowHelp()
A function used to show help about the projector.
Definition: vProjector.cc:148
int SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Set the pointer to the image dimensions in use and copy locally some often use variables.
Definition: vProjector.cc:65
vScanner * mp_Scanner
Definition: vProjector.hh:309
Generic class for scanner objects.
Definition: vScanner.hh:48
int m_applyTOF
Definition: vProjector.hh:311