CASToR  1.0
Tomographic Reconstruction (PET/SPECT)
Public Member Functions | Private Member Functions | Private Attributes
iScannerSPECTConv Class Reference

This class is used to represent any SPECT camera with parallel/convergent collimator. More...

#include <iScannerSPECTConv.hh>

Inheritance diagram for iScannerSPECTConv:
Inheritance graph
[legend]
Collaboration diagram for iScannerSPECTConv:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 iScannerSPECTConv ()
 iScannerSPECTConv constructor. Initialize the member variables to their default values.
 ~iScannerSPECTConv ()
 iScannerSPECTConv destructor.
int Instantiate (bool a_scannerFileIsLUT)
 Get mandatory informations from the scanner file and allocate memory for the member variables.
int CheckParameters ()
 Check that all parameters have been correctly initialized.
int Initialize ()
 Check general initialization and set several parameters to their default value.
int BuildLUT (bool a_scannerFileIsLUT)
 Call the functions to generate the LUT or read the user-made LUT depending on the user choice.
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 orientations of the scanner elements from their indices.
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 indices.
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.
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 GetGeometricInfoFromDatafile (string a_pathToDF)
 Recover geometric informations specific to the scanner class from the datafile header.
int GetSystemNbElts ()
 Get the number of elements in the system. For a SPECT system, returns the number of crystal in one gamma camera head.
void ShowHelp ()
 Display help.
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
It is dedicated to PET and return 1 by default for SPECT.
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 recover these values in the datafile object.
int PROJ_SetSPECTAngles (FLTNB *ap_projectionAngles)
 Set the projection angles with the array provided in parameter.
int PROJ_SetSPECTCORtoDetectorDistance (FLTNB a_distance)
 Set distance between the center of rotation and SPECT detectors if arg value>0,
Set with the geometric information in the scanner configuration file otherwise.
uint16_t PROJ_GetSPECTNbProjections ()
uint16_t PROJ_GetSPECTNbPixels ()
int PROJ_GetSPECTNbBins (uint16_t *ap_nbOfBins)
 Get the number of SPECT heads in the pointer provided in parameter.
int PROJ_SetSPECTNbBins (uint16_t *ap_nbOfBins)
 Set number of bins.
int PROJ_SetSPECTNbProjections (uint32_t a_nbOfProjections)
 Set number of projections.
int PROJ_SetSPECTRotDirection (string a_rotDirection)
 Set head rotation direction.

Private Member Functions

int LoadLUT ()
 Load a precomputed scanner LUT.
int ComputeLUT ()
 Computes the LUT of the scanner from a generic (.geom) file.
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.

Private Attributes

int m_nbCrystals
int m_nbHeads
uint16_t mp_nbOfBins [2]
uint16_t m_nbOfProjections
FLTNBmp_projectionAngles
FLTNBmp_CORtoDetectorDistance
FLTNBmp_radius
int m_rotDirection
uint32_t m_nbPixelsTrans
FLTNB m_pixelsSizeTrans
FLTNB m_gapSizeTrans
uint32_t m_nbPixelsAxial
FLTNB m_pixelsSizeAxial
FLTNB m_gapSizeAxial
uint32_t m_vNbPixelsTrans
uint32_t m_vNbPixelsAxial
FLTNB m_vPixelsSizeTrans
FLTNB m_vPixelsSizeAxial
FLTNB m_crystalDepth
string * mp_focalModelTrans
uint8_t * mp_nbCoefModelTrans
FLTNB ** m2p_transFocalParameters
string * mp_focalModelAxial
uint8_t * mp_nbCoefModelAxial
FLTNB ** m2p_axialFocalParameters
FLTNBmp_crystalCentralPositionX
FLTNBmp_crystalCentralPositionY
FLTNBmp_crystalCentralPositionZ
FLTNBmp_crystalOrientationX
FLTNBmp_crystalOrientationY
FLTNBmp_crystalOrientationZ
FLTNBmp_crystalFocalPositionX
FLTNBmp_crystalFocalPositionY
FLTNBmp_crystalFocalPositionZ

Detailed Description

This class is used to represent any SPECT camera with parallel/convergent collimator.

Inherits from vScanner

Definition at line 22 of file iScannerSPECTConv.hh.


Constructor & Destructor Documentation

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

Definition at line 34 of file iScannerSPECTConv.cc.

iScannerSPECTConv destructor.

Definition at line 100 of file iScannerSPECTConv.cc.


Member Function Documentation

int iScannerSPECTConv::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 305 of file iScannerSPECTConv.cc.

Here is the call graph for this function:

Check that all parameters have been correctly initialized.

Returns:
0 if success, positive value otherwise

Implements vScanner.

Definition at line 371 of file iScannerSPECTConv.cc.

int iScannerSPECTConv::ComputeFocalPositions ( FLTNB  a_posX,
FLTNB  a_posY,
FLTNB  a_posZ,
int  a_headID,
int  a_cryID 
) [private]

Compute focal positions for a specific crystal ID.

Parameters:
a_posX: cartesian position of the crystal on the x-axis
a_posY: cartesian position of the crystal on the y-axis
a_posZ: cartesian position of the crystal on the z-axis
a_headID: head index of the crystal (required to select the related focal model parameters and distance to center of rotation)
a_cryID: crystal index in the LUT

Compute the focal positions using the implemented "constant", "polynomial", "slanthole" focal models related to the gamma cameras
The "custom" focal model is dedicated to user-made focal model and should be implemented by the user

Returns:
0 if success, positive value otherwise

Definition at line 822 of file iScannerSPECTConv.cc.

Here is the caller graph for this function:

int iScannerSPECTConv::ComputeLUT ( ) [private, virtual]

Computes 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 564 of file iScannerSPECTConv.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int iScannerSPECTConv::GetGeometricInfoFromDatafile ( string  a_pathToDF) [virtual]

Recover geometric informations specific to the scanner class from the datafile header.

Parameters:
a_pathToDF: string containing the path to datafile header

-Recover nb of bins and projections
-Recover the projection angles from the header (directly read from the datafile, or extrapolated from a first and last angle)
-Recover the distance between the gamma camera detector surfaces and the center of rotation
(directly read from the datafile, or extracted from the gamma camera configuratino file)

Returns:
0 if success, positive value otherwise

Implements vScanner.

Definition at line 1258 of file iScannerSPECTConv.cc.

Here is the call graph for this function:

int iScannerSPECTConv::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]

This is a pure virtual method that must be implemented by children.
Get the central positions and orientations of the scanner elements from their indices.

Parameters:
a_index1: 1st index of the event
a_index2: 2nd index of the event
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)
ap_Orientation1[3]: x,y,z components of the orientation vector related to the 1st index (see child function for more details)
ap_Orientation2[3]: x,y,z components of the orientation vector related to the 2nd index (see child function for more details)
ap_POI1: x,y,z components of the Point Of Interation related to the 1st index (see child function for more details)
ap_POI2: x,y,z components of the Point Of Interation related to the 2nd index (see child function for more details)
Returns:
0 if success, positive value otherwise

Implements vScanner.

Definition at line 1013 of file iScannerSPECTConv.cc.

int iScannerSPECTConv::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:
a_index2: index of the crystal
ap_Position1[3]:
ap_Position2[3]: x,y,z cartesian position of the point related to the crystal
Returns:
0 if success, positive value otherwise

Implements vScanner.

Definition at line 1185 of file iScannerSPECTConv.cc.

int iScannerSPECTConv::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 the focal point and random positions on the crystal surface and its orientations from the event indices.

Parameters:
a_index1: 1st index of the event (projection angle)
a_index2: 2nd index of the event (crystal index in the gamma camera)
ap_Position1[3]: x,y,z cartesian position of the focal point
ap_Position2[3]: x,y,z cartesian position of the crystal
ap_Orientation1[3]: return -1 by default (no orientation components required for the focal point)
ap_Orientation2[3]: x,y,z components of the orientation vector related to the crystal
  • Computed the LUT index described by the projection angle and crystal index passed in parameters.
    • Compute random positions on the surface of the crystal
    • Write the corresponding random cartesian coordinates in the positions parameters.
      Returns:
      0 if success, positive value otherwise

Implements vScanner.

Definition at line 1113 of file iScannerSPECTConv.cc.

Here is the call graph for this function:

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

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

Parameters:
ap_nbOfProjections: total number of views
ap_nbHeads: number of heads in the system
ap_nbOfBins: 2 elements array containing transaxial/axial number of pixels
ap_pixSizeXY: 2 elements array containing transaxial/axial pixel sizes
ap_angles: Array containing angles of each projection view
ap_CORtoDetectorDistance: Radius (distance between FOV center and detector)
ap_headRotDirection: head rotation direction
Returns:
0 if success, positive value otherwise

Reimplemented from vScanner.

Definition at line 178 of file iScannerSPECTConv.hh.

int iScannerSPECTConv::GetSystemNbElts ( ) [inline, virtual]

Get the number of elements in the system. For a SPECT system, returns the number of crystal in one gamma camera head.

Returns:
a number of crystals

Implements vScanner.

Definition at line 155 of file iScannerSPECTConv.hh.

int iScannerSPECTConv::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 projection angle
a_index2: index of the 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 1214 of file iScannerSPECTConv.cc.

int iScannerSPECTConv::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 513 of file iScannerSPECTConv.cc.

int iScannerSPECTConv::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 155 of file iScannerSPECTConv.cc.

Here is the call graph for this function:

int iScannerSPECTConv::IsAvailableLOR ( int  a_elt1,
int  a_elt2 
) [inline, virtual]

Check if the LOR formed by the crystalf whose indices are passed in parameters is available according to the scanner restrictions
It is dedicated to PET and return 1 by default for SPECT.

Parameters:
a_elt1: index of the 1st crystal
a_elt2: index of the 2nd crystal
Returns:
1 if the LOR is available, 0 otherwise

Reimplemented from vScanner.

Definition at line 177 of file iScannerSPECTConv.hh.

int iScannerSPECTConv::LoadLUT ( ) [private, virtual]

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 541 of file iScannerSPECTConv.cc.

Here is the caller graph for this function:

int iScannerSPECTConv::PROJ_GetSPECTNbBins ( uint16_t *  ap_nbOfBins)

Get the number of SPECT heads in the pointer provided in parameter.

Returns:
0 by default (no error)

Definition at line 1526 of file iScannerSPECTConv.cc.

uint16_t iScannerSPECTConv::PROJ_GetSPECTNbPixels ( ) [inline, virtual]
Returns:
the total number of pixels in a projection

Reimplemented from vScanner.

Definition at line 224 of file iScannerSPECTConv.hh.

uint16_t iScannerSPECTConv::PROJ_GetSPECTNbProjections ( ) [inline, virtual]
Returns:
the number of projection angles

Reimplemented from vScanner.

Definition at line 218 of file iScannerSPECTConv.hh.

int iScannerSPECTConv::PROJ_SetSPECTAngles ( FLTNB ap_projectionAngles) [virtual]

Set the projection angles with the array provided in parameter.

Parameters:
ap_projectionAngles: an array containing the projection angles
Returns:
0 if success, positive value otherwise

Reimplemented from vScanner.

Definition at line 1449 of file iScannerSPECTConv.cc.

Set distance between the center of rotation and SPECT detectors if arg value>0,
Set with the geometric information in the scanner configuration file otherwise.

Parameters:
a_distance
Returns:
0 if success, positive value otherwise

Reimplemented from vScanner.

Definition at line 1483 of file iScannerSPECTConv.cc.

int iScannerSPECTConv::PROJ_SetSPECTNbBins ( uint16_t *  ap_nbOfBins) [virtual]

Set number of bins.

Parameters:
ap_nbOfBins
Returns:
0 by default (no error)

Reimplemented from vScanner.

Definition at line 1544 of file iScannerSPECTConv.cc.

int iScannerSPECTConv::PROJ_SetSPECTNbProjections ( uint32_t  a_nbOfProjections) [virtual]

Set number of projections.

Parameters:
a_nbOfProjections
Returns:
0 by default (no error)

Reimplemented from vScanner.

Definition at line 1564 of file iScannerSPECTConv.cc.

int iScannerSPECTConv::PROJ_SetSPECTRotDirection ( string  a_rotDirection) [virtual]

Set head rotation direction.

Parameters:
a_rotDirection

This function is surcharged by the SPECT scanner daughter classes
Returns an error by default.

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

Reimplemented from vScanner.

Definition at line 1585 of file iScannerSPECTConv.cc.

Here is the caller graph for this function:

void iScannerSPECTConv::ShowHelp ( ) [virtual]

Display help.

Implements vScanner.

Definition at line 1620 of file iScannerSPECTConv.cc.


Member Data Documentation

Parameters of the axial focal model. Specific to each head

Definition at line 329 of file iScannerSPECTConv.hh.

Parameters of the transaxial focal model. Specific to each head

Definition at line 325 of file iScannerSPECTConv.hh.

Depth of crystals

Definition at line 321 of file iScannerSPECTConv.hh.

Gap size between each axial pixel as defined in the system file

Definition at line 313 of file iScannerSPECTConv.hh.

Gap size between each transaxial pixe as defined in the system filel

Definition at line 309 of file iScannerSPECTConv.hh.

Total number of crystal in the scanner

Definition at line 296 of file iScannerSPECTConv.hh.

Total number of SPECT heads

Definition at line 297 of file iScannerSPECTConv.hh.

Total number of projection angles

Definition at line 300 of file iScannerSPECTConv.hh.

Total number of axial pixels as defined in the system file

Definition at line 311 of file iScannerSPECTConv.hh.

Total number of transaxial pixels as defined in the system file

Definition at line 307 of file iScannerSPECTConv.hh.

Size of axial pixels as defined in the system file

Definition at line 312 of file iScannerSPECTConv.hh.

Size of transaxial pixels as defined in the system file

Definition at line 308 of file iScannerSPECTConv.hh.

Rotation Direction for the SPECT head (clockwise by default)

Definition at line 305 of file iScannerSPECTConv.hh.

Number of axial virtual pixels (pixels actually used in reconstruction)

Definition at line 316 of file iScannerSPECTConv.hh.

Number of trans virtual pixels (pixels actually used in reconstruction)

Definition at line 315 of file iScannerSPECTConv.hh.

Axial size of virtual pixels (pixels actually used in reconstruction)

Definition at line 319 of file iScannerSPECTConv.hh.

Trans size of virtual pixels (pixels actually used in reconstruction)

Definition at line 318 of file iScannerSPECTConv.hh.

Distance between the center of rotation and the detector surface of each head. One value for each projection angle.

Definition at line 303 of file iScannerSPECTConv.hh.

Cartesian coordinate on X-axis of the center of each crystal, at each projection

Definition at line 331 of file iScannerSPECTConv.hh.

Cartesian coordinate on Y-axis of the center of each crystal, at each projection

Definition at line 332 of file iScannerSPECTConv.hh.

Cartesian coordinate on Z-axis of the center of each crystal, at each projection

Definition at line 333 of file iScannerSPECTConv.hh.

X-axis position of the focal point for each crystal, at each projection

Definition at line 339 of file iScannerSPECTConv.hh.

Y-axis position of the focal point for each crystal, at each projection

Definition at line 340 of file iScannerSPECTConv.hh.

Z-axis position of the focal point for each crystal, at each projection

Definition at line 341 of file iScannerSPECTConv.hh.

X-axis orientation of each crystal, at each projection

Definition at line 335 of file iScannerSPECTConv.hh.

Y-axis orientation of each crystal, at each projection

Definition at line 336 of file iScannerSPECTConv.hh.

Z-axis orientation of each crystal, at each projection

Definition at line 337 of file iScannerSPECTConv.hh.

Axial focal model (should be 'constant', 'polynomial', 'slanthole', or 'custom'). Specific to each head

Definition at line 327 of file iScannerSPECTConv.hh.

Transaxial focal model (should be 'constant', 'polynomial', 'slanthole', or 'custom'). Specific to each head

Definition at line 323 of file iScannerSPECTConv.hh.

Number of coefficients of the axial focal model. Specific to each head

Definition at line 328 of file iScannerSPECTConv.hh.

Number of coefficients of the transaxial focal model. Specific to each head

Definition at line 324 of file iScannerSPECTConv.hh.

uint16_t iScannerSPECTConv::mp_nbOfBins[2] [private]

2 dimensionnal array containing the number of transaxial bins (X,Y). Default values : 2,2

Definition at line 299 of file iScannerSPECTConv.hh.

Array containing all the projection angles ('m_nbOfProjections' elements)

Definition at line 302 of file iScannerSPECTConv.hh.

Default radius (distance between the center of rotation and detector surface) for each head for the system

Definition at line 304 of file iScannerSPECTConv.hh.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Defines