CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
vScanner Class Referenceabstract

Generic class for scanner objects. More...

#include <vScanner.hh>

Inheritance diagram for vScanner:
Inheritance graph
Collaboration diagram for vScanner:
Collaboration graph

Public Member Functions

 vScanner ()
 vScanner constructor. Initialize the member variables to their default values. More...
 
virtual ~vScanner ()
 vScanner destructor. More...
 
virtual int Instantiate (bool a_scannerFileIsLUT)=0
 This function is implemented in child classes. Read the mandatory fields from the scanner file and allocate memory for the member variables. More...
 
virtual int BuildLUT (bool a_scannerFileIsLUT)=0
 This function is implemented in child classes.
Instantiate the scanner look-up-table (LUT) More...
 
virtual int CheckParameters ()=0
 This function is implemented in child classes.
Check that all parameters have been correctly initialized. More...
 
virtual int Initialize ()=0
 This function is implemented in child classes.
Check initialization and set several parameters to their default value. More...
 
virtual 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)=0
 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...
 
virtual int GetRdmPositionsAndOrientations (int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3], FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3])=0
 This is a pure virtual method that must be implemented by children.
Get random positions of the scanner elements and their orientations from their indices. More...
 
virtual int GetPositionWithRandomDepth (int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3])=0
 This is a pure virtual method that must be implemented by children.
Get the positions of scanner elements from their indices, with a random depth. More...
 
virtual int GetTwoCorners (int a_index1, int a_index2, FLTNB ap_CornerInf1[3], FLTNB ap_CornerSup1[3], FLTNB ap_CornerInf2[3], FLTNB ap_CornerSup2[3])=0
 This is a pure virtual method that must be implemented by children.
Get the cartesian coordinaters of the two opposite corners of a scanner element. More...
 
virtual int ComputeLUT ()
 Virtual function which should be implemented by the child classes.
It computes the LUT of the scanner from a generic (.geom) file.
The vScanner implementation throws error by default as it should be implemented by the child class. More...
 
virtual int LoadLUT ()
 Virtual function which should be implemented by the child classes.
Load a precomputed scanner LUT.
The vScanner implementation throws error by default as it should be implemented by the child class. More...
 
virtual int GetSystemNbElts ()=0
 This is a pure virtual method that must be implemented by children. 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...
 
virtual void ShowHelp ()=0
 This function is implemented in child classes
Display help specific to the scanner class. More...
 
virtual int GetGeometricInfoFromDatafile (string a_path)=0
 This function is implemented in child classes
Recover geometric informations specific to the scanner class from the datafile header. More...
 
int GetScannerType ()
 
void SetVerbose (int a_verboseLevel)
 Set verbosity. More...
 
FLTNB GetMultiBedDisplacementInMm ()
 
virtual int SetPETMaxRingDiff (int a_maxRingDiff)
 Set the maximal ring difference. More...
 
virtual int GetScannerLayerNbRings (int a_layer)
 Return an error by default. More...
 
virtual int SetRotDirection (string a_rotDirection)
 Set rotation direction of the system. More...
 
virtual int PROJ_GetPETSpecificParameters (int *ap_maxRingDiff)
 Get geometric PET specific parameters to initialize the datafile. More...
 
virtual 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)
 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...
 

Protected Attributes

int m_scannerType
 
int m_verbose
 
bool m_allParametersChecked
 
oMatrixmp_rotationMatrix
 
oMatrixmp_positionMatrix_ref
 
oMatrixmp_positionMatrix_out
 
int m_rotDirection
 
FLTNB m_multiBedDisplacementInMm
 

Detailed Description

Generic class for scanner objects.

This class is designed to be a mother virtual class that should not be used on its own; only its children are used.
It has a pure virtual function that is used to get the cartesian coordinates of any line described by two indices.
Although new scanner classes are not supposed to be added, it uses the same auto-declaration class system than other reconstruction classes for the initialization of its children.

Definition at line 48 of file vScanner.hh.

Constructor & Destructor Documentation

vScanner::vScanner ( )

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

Definition at line 28 of file vScanner.cc.

vScanner::~vScanner ( )
virtual

vScanner destructor.

Definition at line 46 of file vScanner.cc.

Member Function Documentation

int vScanner::BuildLUT ( bool  a_scannerFileIsLUT)
pure virtual

This function is implemented in child classes.
Instantiate the scanner look-up-table (LUT)

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

Implemented in iScannerPET, and iScannerSPECTConv.

Here is the caller graph for this function:

int vScanner::CheckParameters ( )
pure virtual

This function is implemented in child classes.
Check that all parameters have been correctly initialized.

Returns
0 if success, positive value otherwise

Implemented in iScannerSPECTConv, and iScannerPET.

Here is the caller graph for this function:

int vScanner::ComputeLUT ( )
virtual

Virtual function which should be implemented by the child classes.
It computes the LUT of the scanner from a generic (.geom) file.
The vScanner implementation throws error by default as it should be implemented by the child class.

Reimplemented in iScannerSPECTConv, and iScannerPET.

Definition at line 70 of file vScanner.cc.

int vScanner::GetGeometricInfoFromDatafile ( string  a_path)
pure virtual

This function is implemented in child classes
Recover geometric informations specific to the scanner class from the datafile header.

Parameters
a_path: string containing the path to datafile header
Returns
0 if success. Positive value otherwise

Implemented in iScannerPET, and iScannerSPECTConv.

Here is the caller graph for this function:

FLTNB vScanner::GetMultiBedDisplacementInMm ( )
inline
Returns
the bed displacement between two successive bed positions

Definition at line 231 of file vScanner.hh.

Here is the caller graph for this function:

int vScanner::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 
)
pure 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

Implemented in iScannerPET, and iScannerSPECTConv.

Here is the caller graph for this function:

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

This is a pure virtual method that must be implemented by children.
Get the positions of scanner elements from their indices, with a random depth.

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 event (see child function for more details)
ap_Position2[3]: x,y,z cartesian position of the point related to the 2st event (see child function for more details)
Returns
0 if success, positive value otherwise

Implemented in iScannerPET, and iScannerSPECTConv.

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

This is a pure virtual method that must be implemented by children.
Get random positions of the scanner elements and their orientations 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)
Returns
0 if success, positive value otherwise

Implemented in iScannerPET, and iScannerSPECTConv.

Here is the caller graph for this function:

int vScanner::GetScannerLayerNbRings ( int  a_layer)
virtual

Return an error by default.

Parameters
a_layer

This function is surcharged by the PET scanner daughter class

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

Reimplemented in iScannerPET.

Definition at line 155 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::GetScannerType ( )
inline
Returns
the type (modality) of the system as defined by macro SCANNER_TYPE in sScannerManager.hh

Definition at line 218 of file vScanner.hh.

Here is the caller graph for this function:

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

Recover geometric SPECT specific parameters from the scanner to initialize the datafile.

Parameters
ap_nbOfProjections
ap_nbHeads
ap_nbOfBins
ap_pixSizeXY
ap_angles
ap_CORtoDetectorDistance
ap_headRotDirection

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 in iScannerSPECTConv.

Definition at line 204 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::GetSystemNbElts ( )
pure virtual

This is a pure virtual method that must be implemented by children.

Returns
the number of elements in the system

Implemented in iScannerSPECTConv, and iScannerPET.

Here is the caller graph for this function:

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

This is a pure virtual method that must be implemented by children.
Get the cartesian coordinaters of the two opposite corners of a scanner element.

Parameters
a_index1: 1st index of the event
a_index2: 2nd index of the event
ap_CornerInf1[3]
ap_CornerSup1[3]
ap_CornerInf2[3]
ap_CornerSup2[3]

Implemented in iScannerPET, and iScannerSPECTConv.

int vScanner::Initialize ( )
pure virtual

This function is implemented in child classes.
Check initialization and set several parameters to their default value.

Returns
0 if success, positive value otherwise

Implemented in iScannerSPECTConv, and iScannerPET.

Here is the caller graph for this function:

int vScanner::Instantiate ( bool  a_scannerFileIsLUT)
pure virtual

This function is implemented in child classes. Read the mandatory fields 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

Implemented in iScannerPET, and iScannerSPECTConv.

Here is the caller graph for this function:

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

This function is implemented in child classes.
Check if the LOR is available according to the scanner restrictions.

Parameters
a_elt1: index of the 1st scanner element
a_elt2: index of the 2nd scanner element

This function is related to analytic projection and list-mode sensitivity image generation

Returns
1 if the LOR is available, 0 otherwise

Reimplemented in iScannerSPECTConv, and iScannerPET.

Definition at line 115 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::LoadLUT ( )
virtual

Virtual function which should be implemented by the child classes.
Load a precomputed scanner LUT.
The vScanner implementation throws error by default as it should be implemented by the child class.

Reimplemented in iScannerSPECTConv, and iScannerPET.

Definition at line 93 of file vScanner.cc.

int vScanner::PROJ_GetPETSpecificParameters ( int *  ap_maxRingDiff)
virtual

Get geometric PET specific parameters to initialize the datafile.

Parameters
ap_maxRingDiff

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

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

Reimplemented in iScannerPET.

Definition at line 176 of file vScanner.cc.

Here is the caller graph for this function:

uint16_t vScanner::PROJ_GetSPECTNbPixels ( )
virtual

return the total number of pixels for a SPECT reconstruction

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 in iScannerSPECTConv.

Definition at line 374 of file vScanner.cc.

Here is the caller graph for this function:

uint16_t vScanner::PROJ_GetSPECTNbProjections ( )
virtual

return the total number of projections for a SPECT acquisition

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 in iScannerSPECTConv.

Definition at line 354 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::PROJ_SetSPECTAngles ( FLTNB ap_projectionAngles)
virtual

Set SPECT projection angles.

Parameters
ap_projectionAngles

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 in iScannerSPECTConv.

Definition at line 313 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::PROJ_SetSPECTCORtoDetectorDistance ( FLTNB  a_CORtoDetectorDistance)
virtual

Set distance between center of rotation and SPECT detectors.

Parameters
a_CORtoDetectorDistance

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 in iScannerSPECTConv.

Definition at line 334 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::PROJ_SetSPECTNbBins ( uint16_t *  ap_nbOfBins)
virtual

Set SPECT number of Bins.

Parameters
ap_nbOfBins

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 in iScannerSPECTConv.

Definition at line 268 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::PROJ_SetSPECTNbProjections ( uint32_t  a_nbOfProjections)
virtual

Set SPECT number of views.

Parameters
a_nbOfProjections

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 in iScannerSPECTConv.

Definition at line 289 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::SetPETMaxRingDiff ( int  a_maxRingDiff)
virtual

Set the maximal ring difference.

Parameters
a_maxRingDiff

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 in iScannerPET.

Definition at line 137 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::SetRotDirection ( string  a_rotDirection)
virtual

Set rotation direction of the system.

Parameters
a_rotDirection

Set rotation direction of the scanner elements (head for SPECT, rsector/modules for PET) for the generation of the geometry

Returns
0 if success, positive value otherwise (unknown key)

Definition at line 232 of file vScanner.cc.

Here is the caller graph for this function:

void vScanner::SetVerbose ( int  a_verboseLevel)
inline

Set verbosity.

Parameters
a_verboseLevel

Definition at line 225 of file vScanner.hh.

Here is the caller graph for this function:

void vScanner::ShowHelp ( )
pure virtual

This function is implemented in child classes
Display help specific to the scanner class.

Implemented in iScannerPET, and iScannerSPECTConv.

Here is the caller graph for this function:

Member Data Documentation

bool vScanner::m_allParametersChecked
protected

Boolean indicating if all variables of the class have been checked. Default =false

Definition at line 365 of file vScanner.hh.

FLTNB vScanner::m_multiBedDisplacementInMm
protected

The displacement of the scanner between two successive bed positions. Default = 0.

Definition at line 370 of file vScanner.hh.

int vScanner::m_rotDirection
protected

Rotation Direction for the generation of the geometry (clockwise by default)

Definition at line 369 of file vScanner.hh.

int vScanner::m_scannerType
protected

System type. Default =-1 (unknown)

Definition at line 363 of file vScanner.hh.

int vScanner::m_verbose
protected

Verbosity. Default =-1

Definition at line 364 of file vScanner.hh.

oMatrix* vScanner::mp_positionMatrix_out
protected

Matrix strucure for rotation computations

Definition at line 368 of file vScanner.hh.

oMatrix* vScanner::mp_positionMatrix_ref
protected

Matrix strucure for rotation computations

Definition at line 367 of file vScanner.hh.

oMatrix* vScanner::mp_rotationMatrix
protected

Matrix strucure for rotation computations

Definition at line 366 of file vScanner.hh.


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