CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
iScannerPET.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 ISCANNERPET_HH
31 #define ISCANNERPET_HH 1
32 
33 #include "gVariables.hh"
34 #include "vScanner.hh"
35 #include "sAddonManager.hh"
36 
42 class iScannerPET : public vScanner
43 {
44  // Constructor & Destructor
45  public:
50  iScannerPET();
51 
55  ~iScannerPET();
56 
57 
58  // -------------------------------------------------------------------
59  // Public member functions
60  public:
61  // Function for automatic insertion (put the class name as the parameters and do not add semi-colon at the end of the line)
67  void DescribeSpecific();
76  int Instantiate(bool a_scannerFileIsLUT);
82  int CheckParameters();
88  int Initialize();
97  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 );
137  int GetRdmPositionsAndOrientations( int a_index1, int a_index2,
138  FLTNB ap_Position1[3], FLTNB ap_Position2[3],
139  FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3] );
150  int GetPositionWithRandomDepth( int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3] );
163  int GetTwoCorners( int a_index1, int a_index2,
164  FLTNB ap_CornerInf1[3], FLTNB ap_CornerSup1[3],
165  FLTNB ap_CornerInf2[3], FLTNB ap_CornerSup2[3] );
183  int GetEdgesCenterPositions( int a_index1, int a_index2,
184  FLTNB ap_pos_line_point1[3], FLTNB ap_pos_line_point2[3],
185  FLTNB ap_pos_point1_x[4], FLTNB ap_pos_point1_y[4], FLTNB ap_pos_point1_z[4],
186  FLTNB ap_pos_point2_x[4], FLTNB ap_pos_point2_y[4], FLTNB ap_pos_point2_z[4] );
191  inline int GetSystemNbElts()
192  {return m_nbCrystals;};
193 
208  int IsAvailableLOR(int a_elt1, int a_elt2);
215  int GetGeometricInfoFromDataFile(string a_pathToDataFilename);
221  inline int SetPETMaxAxialDiffmm(FLTNB a_maxAxialDiffmm)
222  {m_maxAxialDiffmm = a_maxAxialDiffmm; return 0;}
228  void ShowHelp();
235  {return mp_sizeCrystalTrans[0];}
242  {return mp_sizeCrystalAxial[0];}
243 
244  // -------------------------------------------------------------------
245  // Functions dedicated to Analytic Projection
253  int PROJ_GetPETSpecificParameters(FLTNB* ap_maxAxialDiffmm);
254 
255 
256  // -------------------------------------------------------------------
257  // Private member functions
258  private:
266  int LoadLUT();
276  int ComputeLUT();
283  int GetLayer(int a_idx);
284 
285 
286  // -------------------------------------------------------------------
287  // Data members
288  private:
309 };
310 
311 
312 // 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)
314 
315 #endif
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...
This header file is mainly used to declare some macro definitions and all includes needed from the st...
int CheckParameters()
Check if all parameters have been correctly initialized.
Definition: iScannerPET.cc:306
FLTNB * mp_sizeCrystalAxial
Definition: iScannerPET.hh:302
int Instantiate(bool a_scannerFileIsLUT)
Get mandatory informations from the scanner file and allocate memory for the member variables...
Definition: iScannerPET.cc:144
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...
Definition: iScannerPET.hh:192
#define FLTNB
Definition: gVariables.hh:81
FLTNB * mp_crystalOrientationX
Definition: iScannerPET.hh:297
int Initialize()
Check general initialization and set several parameters to their default value.
Definition: iScannerPET.cc:385
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.
int SetPETMaxAxialDiffmm(FLTNB a_maxAxialDiffmm)
Set the maximal axial difference in mm between 2 crystals forming a lor.
Definition: iScannerPET.hh:221
FLTNB m_minAngleDifference
Definition: iScannerPET.hh:306
FLTNB * mp_crystalOrientationY
Definition: iScannerPET.hh:298
int GetSystemNbElts()
Definition: iScannerPET.hh:191
#define CLASS_SCANNER(NAME, CLASS)
Definition: vScanner.hh:457
FLTNB GetDetectionElementSizeAxial()
Definition: iScannerPET.hh:241
FLTNB * mp_meanDepthOfInteraction
Definition: iScannerPET.hh:304
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 random positions of the scanner elements and their orientations from their indices.
FLTNB * mp_crystalOrientationZ
Definition: iScannerPET.hh:299
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. Get the cartesian coordinaters of the ce...
FLTNB * mp_crystalCentralPositionZ
Definition: iScannerPET.hh:295
int GetGeometricInfoFromDataFile(string a_pathToDataFilename)
Retrieve PET geometric informations from the datafile.
Declaration of class vScanner.
int GetLayer(int a_idx)
Get the layer from which the &#39;a_index&#39; crystal belongs to.
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)
Get the central positions and orientations of the scanner elements from their indices.
FLTNB * mp_sizeCrystalDepth
Definition: iScannerPET.hh:303
int PROJ_GetPETSpecificParameters(FLTNB *ap_maxAxialDiffmm)
Set pointers passed in argument with the related PET specific variables This function is used to reco...
This class is used to represent any cylindrical PET scanner.
Definition: iScannerPET.hh:42
FLTNB * mp_crystalCentralPositionY
Definition: iScannerPET.hh:294
#define FUNCTION_SCANNER(CLASS)
Definition: vScanner.hh:453
int LoadLUT()
Load a precomputed scanner LUT.
Definition: iScannerPET.cc:420
iScannerPET()
iScannerPET constructor. Initialize the member variables to their default values. ...
Definition: iScannerPET.cc:39
void ShowHelp()
Display help.
FLTNB * mp_crystalCentralPositionX
Definition: iScannerPET.hh:293
FLTNB * mp_sizeCrystalTrans
Definition: iScannerPET.hh:301
~iScannerPET()
iScannerPET destructor.
Definition: iScannerPET.cc:70
int BuildLUT(bool a_scannerFileIsLUT)
Call the functions to generate the LUT or read the user-made LUT depending on the user choice...
Definition: iScannerPET.cc:268
void DescribeSpecific()
Implementation of the pure virtual eponym function that simply prints info about the scanner...
Definition: iScannerPET.cc:99
FLTNB m_maxAxialDiffmm
Definition: iScannerPET.hh:308
Declaration of class sAddonManager.
Generic class for scanner objects.
Definition: vScanner.hh:61
int * mp_nbCrystalsInLayer
Definition: iScannerPET.hh:291
FLTNB GetDetectionElementSizeTrans()
Definition: iScannerPET.hh:234
int ComputeLUT()
Compute the LUT of the scanner from a generic (.geom) file.
Definition: iScannerPET.cc:500