CASToR  2.0
Tomographic Reconstruction (PET/SPECT/CT)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
iScannerCT Class Reference

This class is used to represent any CT camera with either a CBCT ascii description or a LUT file for any style of detector. More...

#include <iScannerCT.hh>

Inheritance diagram for iScannerCT:
Inheritance graph
Collaboration diagram for iScannerCT:
Collaboration graph

Public Member Functions

 iScannerCT ()
 iScannerCT constructor. Initialize the member variables to their default values. More...
 
 ~iScannerCT ()
 iScannerCT 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 that 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)
 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. 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 the focal point and random positions on the crystal surface and its orientations from the event 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 element and the source.
It is typically used for the Distance Driven projector. More...
 
int GetGeometricInfoFromDataFile (string a_pathToDF)
 Recover geometric informations specific to the scanner class from the datafile header. More...
 
int GetSystemNbElts ()
 Get the number of elements in the system. For a CT system, returns the number of pixels in the detector. More...
 
void ShowHelp ()
 Display help. More...
 
FLTNB GetDetectionElementSizeTrans ()
 
FLTNB GetDetectionElementSizeAxial ()
 
int GetCTSpecificParameters (uint16_t *ap_nbOfProjections, FLTNB *&ap_angles, int *ap_detectorRotDirection)
 Set pointers passed in argument with the related CT 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...
 
virtual int IsAvailableLOR (int a_elt1, int a_elt2)
 This function is implemented in child classes.
Check if the LOR is available according to the scanner restrictions. 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 SetPETMaxAxialDiffmm (FLTNB a_maxAxialDiffmm)
 Set the maximal axial difference in mm between 2 crystals forming a lor. More...
 
virtual int SetRotDirection (string a_rotDirection)
 Set rotation direction of the system. More...
 
virtual int PROJ_GetPETSpecificParameters (FLTNB *ap_maxRingDiff)
 Get geometric PET specific parameters to initialize the datafile. 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 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 ()
 Computes the LUT of the scanner from a generic (.geom) file. More...
 

Private Attributes

int m_nbPixels
 
uint16_t m_nbOfProjections
 
FLTNBmp_projectionAngles
 
FLTNB m_CORtoDetectorDistance
 
FLTNB m_CORtoSourceDistance
 
uint32_t m_nbPixelsTrans
 
FLTNB m_pixelsSizeTrans
 
FLTNB m_gapSizeTrans
 
uint32_t m_nbPixelsAxial
 
FLTNB m_pixelsSizeAxial
 
FLTNB m_gapSizeAxial
 
FLTNB m_detectorDepth
 
FLTNB m_spotSizeWidth
 
FLTNB m_spotSizeDepth
 
FLTNBmp_crystalCentralPositionX
 
FLTNBmp_crystalCentralPositionY
 
FLTNBmp_crystalCentralPositionZ
 
FLTNBmp_crystalOrientationX
 
FLTNBmp_crystalOrientationY
 
FLTNBmp_crystalOrientationZ
 
FLTNBmp_sourcePositionX
 
FLTNBmp_sourcePositionY
 
FLTNBmp_sourcePositionZ
 

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 CT camera with either a CBCT ascii description or a LUT file for any style of detector.

Inherits from vScanner

Definition at line 45 of file iScannerCT.hh.

Constructor & Destructor Documentation

iScannerCT::iScannerCT ( )

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

Definition at line 40 of file iScannerCT.cc.

iScannerCT::~iScannerCT ( )

iScannerCT destructor.

Definition at line 75 of file iScannerCT.cc.

Member Function Documentation

int iScannerCT::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 CT camera is a generic file (0) or custom Look-up-table (1)
Returns
0 if success, positive value otherwise

Implements vScanner.

Definition at line 231 of file iScannerCT.cc.

Here is the call graph for this function:

int iScannerCT::CheckParameters ( )
virtual

Check that all parameters have been correctly initialized.

Returns
0 if success, positive value otherwise

Implements vScanner.

Definition at line 279 of file iScannerCT.cc.

int iScannerCT::ComputeLUT ( )
privatevirtual

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

Reimplemented from vScanner.

Definition at line 398 of file iScannerCT.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void iScannerCT::DescribeSpecific ( )
virtual

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

Implements vScanner.

Definition at line 100 of file iScannerCT.cc.

int iScannerCT::GetCTSpecificParameters ( uint16_t *  ap_nbOfProjections,
FLTNB *&  ap_angles,
int *  ap_detectorRotDirection 
)
virtual

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

Parameters
ap_nbOfProjections: total number of views
ap_angles: Array containing angles of each projection view
ap_detectorRotDirection: detector rotation direction
Returns
0 if success, positive value otherwise

Reimplemented from vScanner.

Definition at line 843 of file iScannerCT.cc.

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

Implements vScanner.

Definition at line 222 of file iScannerCT.hh.

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

Implements vScanner.

Definition at line 216 of file iScannerCT.hh.

int iScannerCT::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 element and the source.
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 668 of file iScannerCT.cc.

int iScannerCT::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 743 of file iScannerCT.cc.

Here is the call graph for this function:

int iScannerCT::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 548 of file iScannerCT.cc.

int iScannerCT::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

Implements vScanner.

Definition at line 641 of file iScannerCT.cc.

int iScannerCT::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.

Implements vScanner.

Definition at line 625 of file iScannerCT.cc.

int iScannerCT::GetSystemNbElts ( )
inlinevirtual

Get the number of elements in the system. For a CT system, returns the number of pixels in the detector.

Returns
a number of crystals

Implements vScanner.

Definition at line 204 of file iScannerCT.hh.

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

Implements vScanner.

Definition at line 654 of file iScannerCT.cc.

int iScannerCT::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 361 of file iScannerCT.cc.

int iScannerCT::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 157 of file iScannerCT.cc.

Here is the call graph for this function:

int iScannerCT::LoadLUT ( )
privatevirtual

Load a precomputed scanner LUT.

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

Reimplemented from vScanner.

Definition at line 385 of file iScannerCT.cc.

Here is the caller graph for this function:

void iScannerCT::ShowHelp ( )
virtual

Display help.

Implements vScanner.

Definition at line 870 of file iScannerCT.cc.

Member Data Documentation

FLTNB iScannerCT::m_CORtoDetectorDistance
private

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

Definition at line 265 of file iScannerCT.hh.

FLTNB iScannerCT::m_CORtoSourceDistance
private

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

Definition at line 266 of file iScannerCT.hh.

FLTNB iScannerCT::m_detectorDepth
private

Depth of detection pixels

Definition at line 276 of file iScannerCT.hh.

FLTNB iScannerCT::m_gapSizeAxial
private

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

Definition at line 274 of file iScannerCT.hh.

FLTNB iScannerCT::m_gapSizeTrans
private

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

Definition at line 270 of file iScannerCT.hh.

uint16_t iScannerCT::m_nbOfProjections
private

Total number of projection angles

Definition at line 263 of file iScannerCT.hh.

int iScannerCT::m_nbPixels
private

Total number of pixels in the detector

Definition at line 261 of file iScannerCT.hh.

uint32_t iScannerCT::m_nbPixelsAxial
private

Total number of axial pixels as defined in the system file

Definition at line 272 of file iScannerCT.hh.

uint32_t iScannerCT::m_nbPixelsTrans
private

Total number of transaxial pixels as defined in the system file

Definition at line 268 of file iScannerCT.hh.

FLTNB iScannerCT::m_pixelsSizeAxial
private

Size of axial pixels as defined in the system file

Definition at line 273 of file iScannerCT.hh.

FLTNB iScannerCT::m_pixelsSizeTrans
private

Size of transaxial pixels as defined in the system file

Definition at line 269 of file iScannerCT.hh.

FLTNB iScannerCT::m_spotSizeDepth
private

Depth of the source, along the direction of the scanner radius

Definition at line 278 of file iScannerCT.hh.

FLTNB iScannerCT::m_spotSizeWidth
private

Width of the source, along the direction tangential to the scanner radius

Definition at line 277 of file iScannerCT.hh.

FLTNB* iScannerCT::mp_crystalCentralPositionX
private

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

Definition at line 281 of file iScannerCT.hh.

FLTNB* iScannerCT::mp_crystalCentralPositionY
private

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

Definition at line 282 of file iScannerCT.hh.

FLTNB* iScannerCT::mp_crystalCentralPositionZ
private

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

Definition at line 283 of file iScannerCT.hh.

FLTNB* iScannerCT::mp_crystalOrientationX
private

X-axis orientation of each crystal, at each projection

Definition at line 285 of file iScannerCT.hh.

FLTNB* iScannerCT::mp_crystalOrientationY
private

Y-axis orientation of each crystal, at each projection

Definition at line 286 of file iScannerCT.hh.

FLTNB* iScannerCT::mp_crystalOrientationZ
private

Z-axis orientation of each crystal, at each projection

Definition at line 287 of file iScannerCT.hh.

FLTNB* iScannerCT::mp_projectionAngles
private

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

Definition at line 264 of file iScannerCT.hh.

FLTNB* iScannerCT::mp_sourcePositionX
private

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

Definition at line 289 of file iScannerCT.hh.

FLTNB* iScannerCT::mp_sourcePositionY
private

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

Definition at line 290 of file iScannerCT.hh.

FLTNB* iScannerCT::mp_sourcePositionZ
private

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

Definition at line 291 of file iScannerCT.hh.


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