CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
Public Member Functions | Private Member Functions | Private Attributes | List of all members
iScannerPET Class Reference

This class is used to represent any cylindrical PET scanner. More...

#include <iScannerPET.hh>

Inheritance diagram for iScannerPET:
Inheritance graph
Collaboration diagram for iScannerPET:
Collaboration graph

Public Member Functions

 iScannerPET ()
 iScannerPET constructor. Initialize the member variables to their default values. More...
 
 ~iScannerPET ()
 iScannerPET destructor. More...
 
void DescribeSpecific ()
 Implementation of the pure virtual eponym function that simply prints info about the scanner. More...
 
int Instantiate (bool a_scannerFileIsLUT)
 Get mandatory informations from the scanner file and allocate memory for the member variables. More...
 
int CheckParameters ()
 Check if all parameters have been correctly initialized. More...
 
int Initialize ()
 Check general initialization and set several parameters to their default value. More...
 
int BuildLUT (bool a_scannerFileIsLUT)
 Call the functions to generate the LUT or read the user-made LUT depending on the user choice. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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 center of the 4 edges of the detection elements.
It is typically used for the Distance Driven projector. More...
 
int GetSystemNbElts ()
 
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 to the scanner restrictions. More...
 
int GetGeometricInfoFromDataFile (string a_pathToDataFilename)
 Retrieve PET geometric informations from the datafile. More...
 
int SetPETMaxAxialDiffmm (FLTNB a_maxAxialDiffmm)
 Set the maximal axial difference in mm between 2 crystals forming a lor. More...
 
void ShowHelp ()
 Display help. More...
 
FLTNB GetDetectionElementSizeTrans ()
 
FLTNB GetDetectionElementSizeAxial ()
 
int PROJ_GetPETSpecificParameters (FLTNB *ap_maxAxialDiffmm)
 Set pointers passed in argument with the related PET specific variables This function is used to recover these values in the datafile object. More...
 
- Public Member Functions inherited from vScanner
 vScanner ()
 vScanner constructor. Initialize the member variables to their default values. More...
 
virtual ~vScanner ()
 vScanner destructor. More...
 
void Describe ()
 A function used to describe the generic parts of the datafile. More...
 
int GetScannerType ()
 
string GetScannerTypeString ()
 
void SetVerbose (int a_verboseLevel)
 Set verbosity. More...
 
void SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ID)
 Set the pointer to the image dimensions and quantification object. More...
 
FLTNB GetDefaultBedDisplacementInMm ()
 
virtual int SetRotDirection (string a_rotDirection)
 Set rotation direction of the system. More...
 
virtual 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)
 Recover geometric SPECT specific parameters from the scanner to initialize the datafile. More...
 
virtual int GetCTSpecificParameters (uint16_t *ap_nbOfProjections, FLTNB *&ap_angles, int *ap_detectorRotDirection)
 Recover geometric CT specific parameters from the scanner to initialize the datafile. More...
 
virtual int PROJ_SetSPECTNbBins (uint16_t *ap_nbOfBins)
 Set SPECT number of Bins. More...
 
virtual int PROJ_SetSPECTNbProjections (uint32_t a_nbOfProjections)
 Set SPECT number of views. More...
 
virtual int PROJ_SetSPECTAngles (FLTNB *ap_projectionAngles)
 Set SPECT projection angles. More...
 
virtual int PROJ_SetSPECTCORtoDetectorDistance (FLTNB a_CORtoDetectorDistance)
 Set distance between center of rotation and SPECT detectors. More...
 
virtual uint16_t PROJ_GetSPECTNbProjections ()
 return the total number of projections for a SPECT acquisition More...
 
virtual uint16_t PROJ_GetSPECTNbPixels ()
 return the total number of pixels for a SPECT reconstruction More...
 

Private Member Functions

int LoadLUT ()
 Load a precomputed scanner LUT. More...
 
int ComputeLUT ()
 Compute the LUT of the scanner from a generic (.geom) file. More...
 
int GetLayer (int a_idx)
 Get the layer from which the 'a_index' crystal belongs to. More...
 

Private Attributes

int m_nbLayers
 
int m_nbCrystals
 
int * mp_nbCrystalsInLayer
 
FLTNBmp_crystalCentralPositionX
 
FLTNBmp_crystalCentralPositionY
 
FLTNBmp_crystalCentralPositionZ
 
FLTNBmp_crystalOrientationX
 
FLTNBmp_crystalOrientationY
 
FLTNBmp_crystalOrientationZ
 
FLTNBmp_sizeCrystalTrans
 
FLTNBmp_sizeCrystalAxial
 
FLTNBmp_sizeCrystalDepth
 
FLTNBmp_meanDepthOfInteraction
 
FLTNB m_minAngleDifference
 
FLTNB m_maxAxialDiffmm
 

Additional Inherited Members

- Protected Attributes inherited from vScanner
int m_scannerType
 
int m_verbose
 
oImageDimensionsAndQuantificationmp_ID
 
bool m_allParametersChecked
 
oMatrixmp_rotationMatrix
 
oMatrixmp_positionMatrix_ref
 
oMatrixmp_positionMatrix_out
 
int m_rotDirection
 
FLTNB m_defaultBedDisplacementInMm
 

Detailed Description

This class is used to represent any cylindrical PET scanner.

Inherits from vScanner

Definition at line 42 of file iScannerPET.hh.

Constructor & Destructor Documentation

◆ iScannerPET()

iScannerPET::iScannerPET ( )

iScannerPET constructor. Initialize the member variables to their default values.

Definition at line 39 of file iScannerPET.cc.

◆ ~iScannerPET()

iScannerPET::~iScannerPET ( )

iScannerPET destructor.

Definition at line 70 of file iScannerPET.cc.

Member Function Documentation

◆ BuildLUT()

int iScannerPET::BuildLUT ( bool  a_scannerFileIsLUT)
virtual

Call the functions to generate the LUT or read the user-made LUT depending on the user choice.

Parameters
a_scannerFileIsLUT: boolean indicating if the file describing the SPECT camera is a generic file (0) or custom Look-up-table (1)
Returns
0 if success, positive value otherwise

Implements vScanner.

Definition at line 268 of file iScannerPET.cc.

Here is the call graph for this function:

◆ CheckParameters()

int iScannerPET::CheckParameters ( )
virtual

Check if all parameters have been correctly initialized.

Returns
0 if success, positive value otherwise

Implements vScanner.

Definition at line 306 of file iScannerPET.cc.

◆ ComputeLUT()

int iScannerPET::ComputeLUT ( )
privatevirtual

Compute the LUT of the scanner from a generic (.geom) file.

Read mandatory data from the geom file. Then compute the LUT elements for each crystal from the geometry described in the file

Compute the look-up-tables of the system containing the locations of the scanner elements center in space and their orientations

Returns
0 if success, positive value otherwise

Reimplemented from vScanner.

Definition at line 500 of file iScannerPET.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DescribeSpecific()

void iScannerPET::DescribeSpecific ( )
virtual

Implementation of the pure virtual eponym function that simply prints info about the scanner.

Implements vScanner.

Definition at line 99 of file iScannerPET.cc.

◆ GetDetectionElementSizeAxial()

FLTNB iScannerPET::GetDetectionElementSizeAxial ( )
inlinevirtual
Returns
return the axial size of the detection element

Implements vScanner.

Definition at line 241 of file iScannerPET.hh.

Here is the call graph for this function:

◆ GetDetectionElementSizeTrans()

FLTNB iScannerPET::GetDetectionElementSizeTrans ( )
inlinevirtual
Returns
return the transaxial size of the detection element

Implements vScanner.

Definition at line 234 of file iScannerPET.hh.

◆ GetEdgesCenterPositions()

int iScannerPET::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] 
)
virtual

Implementation of the pure virtual function from vScanner.
Get the cartesian coordinaters of the center of the 4 edges of the detection elements.
It is typically used for the Distance Driven projector.

Parameters
inta_index1 : 1st index of the event
inta_index2 : 2nd index of the event
FLTNBap_pos_line_point1[3] : current position of point 1 of the ray (supposed to be centered in the section of the detection element and at the desired depth of interaction)
FLTNBap_pos_line_point2[3] : current position of point 1 of the ray (supposed to be centered in the section of the detection element and at the desired depth of interaction)
FLTNBap_pos_point1_x[4] : the resulting X position of the 4 edges of point 1
FLTNBap_pos_point1_y[4] : the resulting Y position of the 4 edges of point 1
FLTNBap_pos_point1_z[4] : the resulting Z position of the 4 edges of point 1
FLTNBap_pos_point2_x[4] : the resulting X position of the 4 edges of point 1
FLTNBap_pos_point2_y[4] : the resulting Y position of the 4 edges of point 1
FLTNBap_pos_point2_z[4] : the resulting Z position of the 4 edges of point 1
Returns
0 if success, positive value otherwise

Implements vScanner.

Definition at line 1416 of file iScannerPET.cc.

Here is the call graph for this function:

◆ GetGeometricInfoFromDataFile()

int iScannerPET::GetGeometricInfoFromDataFile ( string  a_pathToDataFilename)
virtual

Retrieve PET geometric informations from the datafile.

Recover the (axial) max ring difference

Returns
0 if success, positive value otherwise

Implements vScanner.

Definition at line 1562 of file iScannerPET.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLayer()

int iScannerPET::GetLayer ( int  a_idx)
private

Get the layer from which the 'a_index' crystal belongs to.

Parameters
a_idx: index of the crystal in the loaded LUT
Returns
layer index

Definition at line 1491 of file iScannerPET.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPositionsAndOrientations()

int iScannerPET::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 
)
virtual

Get the central positions and orientations of the scanner elements from their indices.

Parameters
a_index1: index of the 1st crystal
a_index2: index of the 2nd crystal
ap_Position1[3]: x,y,z cartesian position of center of the 1st crystal
ap_Position2[3]: x,y,z cartesian position of center of the 2nd crystal
ap_Orientation1[3]: x,y,z components of the orientation vector related to the 1st crystal
ap_Orientation2[3]: x,y,z components of the orientation vector related to the 2nd crystal
ap_POI1: x,y,z components of the Point Of Interation related to the 1st crystal
ap_POI2: x,y,z components of the Point Of Interation related to the 2nd crystal

This method is very general and is used by the vProjector. From these positions and orientations, other methods can be used by specific projectors to get specific positions. Position calculations include POI and mean depth of interaction

Returns
0 if success, positive value otherwise

Implements vScanner.

Definition at line 1049 of file iScannerPET.cc.

Here is the call graph for this function:

◆ GetPositionWithRandomDepth()

int iScannerPET::GetPositionWithRandomDepth ( int  a_index1,
int  a_index2,
FLTNB  ap_Position1[3],
FLTNB  ap_Position2[3] 
)
virtual

Get the positions and orientations of scanner elements from their indices, with a random depth.

Parameters
a_index1: index of the 1st crystal
a_index2: index of the 2nd crystal
ap_Position1[3]: x,y,z cartesian position of the point related to the 1st index (see child function for more details)
ap_Position2[3]: x,y,z cartesian position of the point related to the 2st index (see child function for more details)

Method for testing purposes. Does not include POI and mean depth of interaction

Returns
0 if success, positive value otherwise

Implements vScanner.

Definition at line 1343 of file iScannerPET.cc.

Here is the call graph for this function:

◆ GetRdmPositionsAndOrientations()

int iScannerPET::GetRdmPositionsAndOrientations ( int  a_index1,
int  a_index2,
FLTNB  ap_Position1[3],
FLTNB  ap_Position2[3],
FLTNB  ap_Orientation1[3],
FLTNB  ap_Orientation2[3] 
)
virtual

Get random positions of the scanner elements and their orientations from their indices.

Parameters
a_index1: index of the 1st crystal
a_index2: index of the 2nd crystal
ap_Position1[3]: x,y,z cartesian position of center of the 1st crystal
ap_Position2[3]: x,y,z cartesian position of center of the 2nd crystal
ap_Orientation1[3]: x,y,z components of the orientation vector related to the 1st crystal
ap_Orientation2[3]: x,y,z components of the orientation vector related to the 2nd crystal
  • Find the scanner elements described by the two indexes passed in parameters.
  • Compute random positions inside the elements described by the indexes passed in parameters
  • Find the scanner elements described by the two indexes passed in parameters.
  • Write the corresponding random cartesian coordinates in the positions parameters.

Position calculations include POI and mean depth of interaction

Returns
0 if success, positive value otherwise

Implements vScanner.

Definition at line 1166 of file iScannerPET.cc.

Here is the call graph for this function:

◆ GetSystemNbElts()

int iScannerPET::GetSystemNbElts ( )
inlinevirtual
Returns
the number of crystals in the PET system

Implements vScanner.

Definition at line 191 of file iScannerPET.hh.

◆ GetTwoCorners()

int iScannerPET::GetTwoCorners ( int  a_index1,
int  a_index2,
FLTNB  ap_CornerInf1[3],
FLTNB  ap_CornerSup1[3],
FLTNB  ap_CornerInf2[3],
FLTNB  ap_CornerSup2[3] 
)
virtual

Get the cartesian coordinaters of the two opposite corners of a scanner element.

Parameters
a_index1: index of the 1st crystal
a_index2: index of the 2nd crystal
ap_CornerInf1[3]
ap_CornerSup1[3]
ap_CornerInf2[3]
ap_CornerSup2[3]
Returns
0 if success, positive value otherwise

Implements vScanner.

Definition at line 1388 of file iScannerPET.cc.

Here is the call graph for this function:

◆ Initialize()

int iScannerPET::Initialize ( )
virtual

Check general initialization and set several parameters to their default value.

Returns
0 if success, positive value otherwise

Implements vScanner.

Definition at line 385 of file iScannerPET.cc.

◆ Instantiate()

int iScannerPET::Instantiate ( bool  a_scannerFileIsLUT)
virtual

Get mandatory informations from the scanner file and allocate memory for the member variables.

Parameters
a_scannerFileIsLUT: boolean indicating if the file describing the system is a generic file (0) or custom Look-up-table (1)
Returns
0 if success, positive value otherwise

Implements vScanner.

Definition at line 144 of file iScannerPET.cc.

Here is the call graph for this function:

◆ IsAvailableLOR()

int iScannerPET::IsAvailableLOR ( int  a_elt1,
int  a_elt2 
)
virtual

Check if the LOR formed by the crystalf whose indices are passed in parameters is available according to the scanner restrictions.

Parameters
a_elt1: index of the 1st crystal
a_elt2: index of the 2nd crystal

This function is dedicated to analytic projection and list-mode sensitivity image generation
The PET implementation checks the LOR availability according to the minimal (transaxial) angle difference and the maximal ring difference between two crystals

Returns
1 if the LOR is available, 0 otherwise

Reimplemented from vScanner.

Definition at line 192 of file iScannerPET.hh.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadLUT()

int iScannerPET::LoadLUT ( )
privatevirtual

Load a precomputed scanner LUT.

Read mandatory data from the header of the LUT.
Then load the LUT elements for each crystal

Returns
0 if success, positive value otherwise

Reimplemented from vScanner.

Definition at line 420 of file iScannerPET.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PROJ_GetPETSpecificParameters()

int iScannerPET::PROJ_GetPETSpecificParameters ( FLTNB ap_maxAxialDiffmm)
virtual

Set pointers passed in argument with the related PET specific variables This function is used to recover these values in the datafile object.

Parameters
ap_maxAxialDiffmm
Returns
0 if success, positive value otherwise

Reimplemented from vScanner.

Definition at line 1592 of file iScannerPET.cc.

Here is the caller graph for this function:

◆ SetPETMaxAxialDiffmm()

int iScannerPET::SetPETMaxAxialDiffmm ( FLTNB  a_maxAxialDiffmm)
inlinevirtual

Set the maximal axial difference in mm between 2 crystals forming a lor.

Parameters
a_maxAxialDiffmm

This function is surcharged by the PET scanner daughter class
Returns an error by default.

Returns
1 (error) if not surcharged by a daughter class

Reimplemented from vScanner.

Definition at line 221 of file iScannerPET.hh.

Here is the call graph for this function:

◆ ShowHelp()

void iScannerPET::ShowHelp ( )
virtual

Display help.

Implements vScanner.

Definition at line 1618 of file iScannerPET.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ m_maxAxialDiffmm

FLTNB iScannerPET::m_maxAxialDiffmm
private

Maximal axial difference in mm for a specific acquisition

Definition at line 308 of file iScannerPET.hh.

◆ m_minAngleDifference

FLTNB iScannerPET::m_minAngleDifference
private

Minimal transaxial angle difference for the system

Definition at line 306 of file iScannerPET.hh.

◆ m_nbCrystals

int iScannerPET::m_nbCrystals
private

Total number of crystal in the scanner

Definition at line 290 of file iScannerPET.hh.

◆ m_nbLayers

int iScannerPET::m_nbLayers
private

Number of crystal layers in the scanner

Definition at line 289 of file iScannerPET.hh.

◆ mp_crystalCentralPositionX

FLTNB* iScannerPET::mp_crystalCentralPositionX
private

Cartesian coordinate on X-axis of the center of each crystal

Definition at line 293 of file iScannerPET.hh.

◆ mp_crystalCentralPositionY

FLTNB* iScannerPET::mp_crystalCentralPositionY
private

Cartesian coordinate on Y-axis of the center of each crystal

Definition at line 294 of file iScannerPET.hh.

◆ mp_crystalCentralPositionZ

FLTNB* iScannerPET::mp_crystalCentralPositionZ
private

Cartesian coordinate on Z-axis of the center of each crystal

Definition at line 295 of file iScannerPET.hh.

◆ mp_crystalOrientationX

FLTNB* iScannerPET::mp_crystalOrientationX
private

X-axis orientation of each crystal

Definition at line 297 of file iScannerPET.hh.

◆ mp_crystalOrientationY

FLTNB* iScannerPET::mp_crystalOrientationY
private

Y-axis orientation of each crystal

Definition at line 298 of file iScannerPET.hh.

◆ mp_crystalOrientationZ

FLTNB* iScannerPET::mp_crystalOrientationZ
private

Z-axis orientation of each crystal

Definition at line 299 of file iScannerPET.hh.

◆ mp_meanDepthOfInteraction

FLTNB* iScannerPET::mp_meanDepthOfInteraction
private

Mean depth of interaction in a crystal (for each layer)

Definition at line 304 of file iScannerPET.hh.

◆ mp_nbCrystalsInLayer

int* iScannerPET::mp_nbCrystalsInLayer
private

Number of crystals (for each layer)

Definition at line 291 of file iScannerPET.hh.

◆ mp_sizeCrystalAxial

FLTNB* iScannerPET::mp_sizeCrystalAxial
private

Axial size of a crystal (for each layer)

Definition at line 302 of file iScannerPET.hh.

◆ mp_sizeCrystalDepth

FLTNB* iScannerPET::mp_sizeCrystalDepth
private

Depth of a crystal (for each layer)

Definition at line 303 of file iScannerPET.hh.

◆ mp_sizeCrystalTrans

FLTNB* iScannerPET::mp_sizeCrystalTrans
private

Transaxial size of a crystal (for each layer)

Definition at line 301 of file iScannerPET.hh.


The documentation for this class was generated from the following files: