CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
iScannerSPECTConv.hh
Go to the documentation of this file.
1 
8 #ifndef ISCANNERSPECTConv_HH
9 #define ISCANNERSPECTConv_HH 1
10 
11 #include "gVariables.hh"
12 #include "vScanner.hh"
13 #include "sAddonManager.hh"
14 
15 
23 {
24  // -------------------------------------------------------------------
25  // Constructor & Destructor
26  public:
36 
37 
38  // -------------------------------------------------------------------
39  // Public member functions
40  public:
41  // Function for automatic insertion (put the class name as the parameters and do not add semi-colon at the end of the line)
51  int Instantiate(bool a_scannerFileIsLUT);
58  int CheckParameters();
64  int Initialize();
72  int BuildLUT( bool a_scannerFileIsLUT );
88  int GetPositionsAndOrientations( int a_index1, int a_index2,
89  FLTNB ap_Position1[3], FLTNB ap_Position2[3],
90  FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3],
91  FLTNB* ap_POI1 = NULL, FLTNB* ap_POI2 = NULL );
108  int GetRdmPositionsAndOrientations( int a_index1, int a_index2,
109  FLTNB ap_Position1[3], FLTNB ap_Position2[3],
110  FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3] );
121  int GetPositionWithRandomDepth( int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3] );
134  int GetTwoCorners( int a_index1, int a_index2,
135  FLTNB ap_CornerInf1[3], FLTNB ap_CornerSup1[3],
136  FLTNB ap_CornerInf2[3], FLTNB ap_CornerSup2[3] );
148  int GetGeometricInfoFromDatafile( string a_pathToDF );
155  inline int GetSystemNbElts()
156  {return m_nbCrystals;}
162  void ShowHelp();
163 
164 
165  // -------------------------------------------------------------------
166  // Functions dedicated to Analytic Projection
167  public:
177  inline int IsAvailableLOR(int a_elt1, int a_elt2)
178  {return 1;};
192  int GetSPECTSpecificParameters( uint16_t* ap_nbOfProjections,
193  uint16_t* ap_nbHeads,
194  uint16_t* ap_nbOfBins,
195  FLTNB* ap_pixSizeXY,
196  FLTNB*& ap_angles,
197  FLTNB*& ap_CORtoDetectorDistance,
198  int* ap_headRotDirection);
205  int PROJ_SetSPECTAngles(FLTNB* ap_projectionAngles);
218  inline uint16_t PROJ_GetSPECTNbProjections()
219  {return m_nbOfProjections;}
224  inline uint16_t PROJ_GetSPECTNbPixels()
231  int PROJ_GetSPECTNbBins(uint16_t* ap_nbOfBins);
238  int PROJ_SetSPECTNbBins(uint16_t* ap_nbOfBins);
245  int PROJ_SetSPECTNbProjections(uint32_t a_nbOfProjections);
246 
247  // -------------------------------------------------------------------
248  // Private member functions
249  private:
257  int LoadLUT();
266  int ComputeLUT();
283  int ComputeFocalPositions( FLTNB a_posX, FLTNB a_posY, FLTNB a_posZ, int a_headID, int a_cryID );
284 
285 
286  // -------------------------------------------------------------------
287  // Data members
288  private:
290  int m_nbHeads;
292  uint16_t mp_nbOfBins[2];
293  uint16_t m_nbOfProjections;
299  uint32_t m_nbPixelsTrans;
303  uint32_t m_nbPixelsAxial;
307  uint32_t m_vNbPixelsTrans;
308  uint32_t m_vNbPixelsAxial;
334 };
335 
336 
337 // Class for automatic insertion (set here the visible scanner type name, put the class name as the parameters and do not add semi-colon at the end of the line)
338 CLASS_SCANNER(SPECT_CONVERGENT,iScannerSPECTConv)
339 
340 #endif
This class is used to represent any SPECT camera with parallel/convergent collimator.
This header file is mainly used to declare some macro definitions and all includes needed from the st...
uint16_t PROJ_GetSPECTNbPixels()
#define FLTNB
Definition: gVariables.hh:55
FLTNB * mp_crystalCentralPositionX
int IsAvailableLOR(int a_elt1, int a_elt2)
Check if the LOR formed by the crystalf whose indices are passed in parameters is available according...
#define CLASS_SCANNER(NAME, CLASS)
Definition: vScanner.hh:383
FLTNB ** m2p_axialFocalParameters
int GetPositionWithRandomDepth(int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3])
Get the positions and orientations of scanner elements from their indices, with a random depth...
FLTNB ** m2p_transFocalParameters
int GetPositionsAndOrientations(int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3], FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3], FLTNB *ap_POI1=NULL, FLTNB *ap_POI2=NULL)
This is a pure virtual method that must be implemented by children. Get the central positions and o...
void ShowHelp()
Display help.
int PROJ_SetSPECTCORtoDetectorDistance(FLTNB a_distance)
Set distance between the center of rotation and SPECT detectors if arg value>0, Set with the geomet...
FLTNB * mp_crystalCentralPositionY
iScannerSPECTConv()
iScannerSPECTConv constructor. Initialize the member variables to their default values.
int PROJ_SetSPECTAngles(FLTNB *ap_projectionAngles)
Set the projection angles with the array provided in parameter.
int ComputeLUT()
Computes the LUT of the scanner from a generic (.geom) file.
Declaration of class vScanner.
int BuildLUT(bool a_scannerFileIsLUT)
Call the functions to generate the LUT or read the user-made LUT depending on the user choice...
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)
Set pointers passed in argument with the related SPECT specific variables This function is used to ...
int ComputeFocalPositions(FLTNB a_posX, FLTNB a_posY, FLTNB a_posZ, int a_headID, int a_cryID)
Compute focal positions for a specific crystal ID.
#define FUNCTION_SCANNER(CLASS)
Definition: vScanner.hh:379
uint16_t PROJ_GetSPECTNbProjections()
int GetRdmPositionsAndOrientations(int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3], FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3])
Get the focal point and random positions on the crystal surface and its orientations from the event i...
int GetSystemNbElts()
Get the number of elements in the system. For a SPECT system, returns the number of crystal in one ga...
int Initialize()
Check general initialization and set several parameters to their default value.
int PROJ_SetSPECTNbBins(uint16_t *ap_nbOfBins)
Set number of bins.
int CheckParameters()
Check that all parameters have been correctly initialized.
int PROJ_SetSPECTNbProjections(uint32_t a_nbOfProjections)
Set number of projections.
FLTNB * mp_crystalCentralPositionZ
int GetGeometricInfoFromDatafile(string a_pathToDF)
Recover geometric informations specific to the scanner class from the datafile header.
int PROJ_GetSPECTNbBins(uint16_t *ap_nbOfBins)
Get the number of SPECT heads in the pointer provided in parameter.
int Instantiate(bool a_scannerFileIsLUT)
Get mandatory informations from the scanner file and allocate memory for the member variables...
~iScannerSPECTConv()
iScannerSPECTConv destructor.
int GetTwoCorners(int a_index1, int a_index2, FLTNB ap_CornerInf1[3], FLTNB ap_CornerSup1[3], FLTNB ap_CornerInf2[3], FLTNB ap_CornerSup2[3])
Get the cartesian coordinaters of the two opposite corners of a scanner element.
Declaration of class sAddonManager.
Generic class for scanner objects.
Definition: vScanner.hh:48
int LoadLUT()
Load a precomputed scanner LUT.