CASToR  2.0
Tomographic Reconstruction (PET/SPECT/CT)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iScannerSPECTConv.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 ISCANNERSPECTConv_HH
32 #define ISCANNERSPECTConv_HH 1
33 
34 #include "gVariables.hh"
35 #include "vScanner.hh"
36 #include "sAddonManager.hh"
37 
45 {
46  // -------------------------------------------------------------------
47  // Constructor & Destructor
48  public:
58 
59 
60  // -------------------------------------------------------------------
61  // Public member functions
62  public:
63  // Function for automatic insertion (put the class name as the parameters and do not add semi-colon at the end of the line)
69  void DescribeSpecific();
78  int Instantiate(bool a_scannerFileIsLUT);
85  int CheckParameters();
91  int Initialize();
99  int BuildLUT( bool a_scannerFileIsLUT );
115  int GetPositionsAndOrientations( int a_index1, int a_index2,
116  FLTNB ap_Position1[3], FLTNB ap_Position2[3],
117  FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3],
118  FLTNB* ap_POI1 = NULL, FLTNB* ap_POI2 = NULL );
135  int GetRdmPositionsAndOrientations( int a_index1, int a_index2,
136  FLTNB ap_Position1[3], FLTNB ap_Position2[3],
137  FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3] );
148  int GetPositionWithRandomDepth( int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3] );
161  int GetTwoCorners( int a_index1, int a_index2,
162  FLTNB ap_CornerInf1[3], FLTNB ap_CornerSup1[3],
163  FLTNB ap_CornerInf2[3], FLTNB ap_CornerSup2[3] );
181  int GetEdgesCenterPositions( int a_index1, int a_index2,
182  FLTNB ap_pos_line_point1[3], FLTNB ap_pos_line_point2[3],
183  FLTNB ap_pos_point1_x[4], FLTNB ap_pos_point1_y[4], FLTNB ap_pos_point1_z[4],
184  FLTNB ap_pos_point2_x[4], FLTNB ap_pos_point2_y[4], FLTNB ap_pos_point2_z[4] );
196  int GetGeometricInfoFromDataFile( string a_pathToDF );
203  inline int GetSystemNbElts()
204  {return m_nbCrystals;}
210  void ShowHelp();
217  {return m_vPixelsSizeTrans;}
224  {return m_vPixelsSizeTrans;}
225 
226  // -------------------------------------------------------------------
227  // Functions dedicated to Analytic Projection
228  public:
238  inline int IsAvailableLOR(int a_elt1, int a_elt2)
239  {return 1;};
254  int GetSPECTSpecificParameters( uint16_t* ap_nbOfProjections,
255  uint16_t* ap_nbHeads,
256  FLTNB* ap_acquisitionZoom,
257  uint16_t* ap_nbOfBins,
258  FLTNB* ap_pixSizeXY,
259  FLTNB*& ap_angles,
260  FLTNB*& ap_CORtoDetectorDistance,
261  int* ap_headRotDirection);
268  int PROJ_SetSPECTAngles(FLTNB* ap_projectionAngles);
281  inline uint16_t PROJ_GetSPECTNbProjections()
282  {return m_nbOfProjections;}
287  inline uint16_t PROJ_GetSPECTNbPixels()
294  int PROJ_GetSPECTNbBins(uint16_t* ap_nbOfBins);
301  int PROJ_SetSPECTNbBins(uint16_t* ap_nbOfBins);
308  int PROJ_SetSPECTNbProjections(uint32_t a_nbOfProjections);
309 
310  // -------------------------------------------------------------------
311  // Private member functions
312  private:
320  int LoadLUT();
329  int ComputeLUT();
346  int ComputeFocalPositions( FLTNB a_posX, FLTNB a_posY, FLTNB a_posZ, int a_headID, int a_cryID );
347 
348 
349  // -------------------------------------------------------------------
350  // Data members
351  private:
353  int m_nbHeads;
355  uint16_t mp_nbOfBins[2];
356  uint16_t m_nbOfProjections;
362  uint32_t m_nbPixelsTrans;
366  uint32_t m_nbPixelsAxial;
372  uint32_t m_vNbPixelsTrans;
373  uint32_t m_vNbPixelsAxial;
399 };
400 
401 
402 // 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)
403 CLASS_SCANNER(SPECT_CONVERGENT,iScannerSPECTConv)
404 
405 #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:81
FLTNB * mp_crystalCentralPositionX
int GetSPECTSpecificParameters(uint16_t *ap_nbOfProjections, uint16_t *ap_nbHeads, FLTNB *ap_acquisitionZoom, 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 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:458
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...
void DescribeSpecific()
Implementation of the pure virtual eponym function that simply prints info about the scanner...
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...
FLTNB GetDetectionElementSizeTrans()
void ShowHelp()
Display help.
int GetGeometricInfoFromDataFile(string a_pathToDF)
Recover geometric informations specific to the scanner class from the datafile header.
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 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:454
int GetEdgesCenterPositions(int a_index1, int a_index2, FLTNB ap_pos_line_point1[3], FLTNB ap_pos_line_point2[3], FLTNB ap_pos_point1_x[4], FLTNB ap_pos_point1_y[4], FLTNB ap_pos_point1_z[4], FLTNB ap_pos_point2_x[4], FLTNB ap_pos_point2_y[4], FLTNB ap_pos_point2_z[4])
Implementation of the pure virtual function from vScanner. Not yet implemented for the SPECT conver...
uint16_t PROJ_GetSPECTNbProjections()
FLTNB GetDetectionElementSizeAxial()
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 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:62
int LoadLUT()
Load a precomputed scanner LUT.