STIR  6.2.0
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
stir::Scanner Class Reference

A class for storing some info on the scanner. More...

#include "stir/Scanner.h"

Public Types

enum  Type {
  E931, E951, E953, E921,
  E925, E961, E962, E966,
  E1080, test_scanner, Siemens_mMR, Siemens_mCT,
  Siemens_Vision_600, RPT, HiDAC, Advance,
  DiscoveryLS, DiscoveryST, DiscoverySTE, DiscoveryRX,
  Discovery600, PETMR_Signa, Discovery690, DiscoveryMI3ring,
  DiscoveryMI4ring, DiscoveryMI5ring, HZLR, RATPET,
  PANDA, HYPERimage, nanoPET, HRRT,
  Allegro, GeminiTF, SAFIRDualRingPrototype, UPENN_5rings,
  UPENN_5rings_no_gaps, UPENN_6rings, UPENN_6rings_no_gaps, User_defined_scanner,
  Unknown_scanner
}
 enum for all predefined scanners
 

Public Member Functions

 Scanner (Type scanner_type)
 constructor that takes scanner type as an input argument
 
 Scanner (Type type_v, const std::list< std::string > &list_of_names_v, int num_detectors_per_ring_v, int num_rings_v, int max_num_non_arccorrected_bins_v, int default_num_arccorrected_bins_v, float inner_ring_radius_v, float average_depth_of_interaction_v, float ring_spacing_v, float bin_size_v, float intrinsic_tilt_v, int num_axial_blocks_per_bucket_v, int num_transaxial_blocks_per_bucket_v, int num_axial_crystals_per_block_v, int num_transaxial_crystals_per_block_v, int num_axial_crystals_per_singles_unit_v, int num_transaxial_crystals_per_singles_unit_v, int num_detector_layers_v, float energy_resolution_v=-1.0f, float reference_energy_v=-1.0f, short int max_num_of_timing_poss=-1, float size_timing_pos=-1.0f, float timing_resolution=-1.0f, const std::string &scanner_geometry_v="Cylindrical", float axial_crystal_spacing_v=-1.0f, float transaxial_crystal_spacing_v=-1.0f, float axial_block_spacing_v=-1.0f, float transaxial_block_spacing_v=-1.0f, const std::string &crystal_map_file_name="")
 constructor -(list of names) More...
 
 Scanner (Type type_v, const std::string &name, int num_detectors_per_ring_v, int num_rings_v, int max_num_non_arccorrected_bins_v, int default_num_arccorrected_bins_v, float inner_ring_radius_v, float average_depth_of_interaction_v, float ring_spacing_v, float bin_size_v, float intrinsic_tilt_v, int num_axial_blocks_per_bucket_v, int num_transaxial_blocks_per_bucket_v, int num_axial_crystals_per_block_v, int num_transaxial_crystals_per_block_v, int num_axial_crystals_per_singles_unit_v, int num_transaxial_crystals_per_singles_unit_v, int num_detector_layers_v, float energy_resolution_v=-1.0f, float reference_energy_v=-1.0f, short int max_num_of_timing_poss=-1, float size_timing_pos=-1.0f, float timing_resolution=-1.0f, const std::string &scanner_geometry_v="Cylindrical", float axial_crystal_spacing_v=-1.0f, float transaxial_crystal_spacing_v=-1.0f, float axial_block_spacing_v=-1.0f, float transaxial_block_spacing_v=-1.0f, const std::string &crystal_map_file_name="")
 constructor ( a single name) More...
 
virtual void set_up ()
 Initialise internal geometry. More...
 
std::string parameter_info () const
 get scanner parameters as a std::string
 
const std::string & get_name () const
 get the scanner name
 
const std::list< std::string > & get_all_names () const
 get all scanner names as a list of strings
 
std::string list_names () const
 get all scanner names as a string
 
bool operator== (const Scanner &scanner) const
 comparison operator
 
bool operator!= (const Scanner &scanner) const
 
Type get_type () const
 get scanner type
 
Succeeded check_consistency () const
 checks consistency More...
 
void set_energy_resolution (const float new_num)
 set the energy resolution of the system More...
 
void set_reference_energy (const float new_num)
 set the reference energy (in keV) of the energy resolution More...
 
void set_max_num_timing_poss (int new_num)
 Set the maximum number of TOF bins.
 
void set_size_of_timing_poss (float new_num)
 Set the delta t which correspnds to the max number of TOF bins.
 
void set_timing_resolution (float new_num_in_ps)
 Set timing resolution.
 
int get_singles_bin_index (int axial_index, int transaxial_index) const
 Calculate a singles bin index from axial and transaxial singles bin coordinates.
 
int get_singles_bin_index (const DetectionPosition<> &det_pos) const
 Method used to calculate a singles bin index from a detection position.
 
int get_axial_singles_unit (int singles_bin_index) const
 Get the axial singles bin coordinate from a singles bin.
 
int get_transaxial_singles_unit (int singles_bin_index) const
 Get the transaxial singles bin coordinate from a singles bin.
 
bool is_tof_ready () const
 True if it is TOF compatible.
 
stir::DetectionPosition get_det_pos_for_index (const stir::DetectionPosition<> &det_pos) const
 Get the STIR detection position (det#, ring#, layer#) given the detection position id in the input crystal map.
 
stir::CartesianCoordinate3D< float > get_coordinate_for_det_pos (const stir::DetectionPosition<> &det_pos) const
 Get the Cartesian coordinates (x,y,z) given the STIR detection position (det#, ring#, layer#)
 
stir::CartesianCoordinate3D< float > get_coordinate_for_index (const stir::DetectionPosition<> &det_pos) const
 Get the Cartesian coordinates (x,y,z) given the detection position id in the input crystal map.
 
Succeeded find_detection_position_given_cartesian_coordinate (DetectionPosition<> &det_pos, const CartesianCoordinate3D< float > &cart_coord) const
 Find detection position at a coordinate.
 
shared_ptr< const DetectorCoordinateMapget_detector_map_sptr () const
 
Functions returning geometrical info
int get_num_rings () const
 get number of rings
 
int get_num_detectors_per_ring () const
 get the number of detectors per ring
 
int get_max_num_non_arccorrected_bins () const
 get the maximum number of arccorrected tangential positions More...
 
int get_default_num_arccorrected_bins () const
 get the default number of arccorrected tangential positions More...
 
int get_max_num_views () const
 get maximum number of views More...
 
float get_inner_ring_radius () const
 get inner ring radius
 
float get_max_FOV_radius () const
 get maximum field of view radius
 
float get_effective_ring_radius () const
 get effective ring radius
 
float get_average_depth_of_interaction () const
 get average depth of interaction
 
float get_ring_spacing () const
 get ring spacing
 
float get_default_bin_size () const
 get default arc-corrected bin size
 
float get_intrinsic_azimuthal_tilt () const
 get intrinsic tilt in raw sinogram data (in radians) More...
 
Info on crystals per block etc.
int get_num_transaxial_blocks_per_bucket () const
 get number of transaxial blocks per bucket
 
int get_num_axial_blocks_per_bucket () const
 get number of axial blocks per bucket
 
int get_num_axial_crystals_per_block () const
 get number of crystals in the axial direction
 
int get_num_transaxial_crystals_per_block () const
 get number of transaxial crystals
 
int get_num_transaxial_crystals_per_bucket () const
 get crystals in a bucket
 
int get_num_axial_crystals_per_bucket () const
 get crystals in a bucket
 
int get_num_detector_layers () const
 get number of crystal layers (for DOI)
 
int get_num_axial_blocks () const
 get number of axial blocks
 
int get_num_transaxial_blocks () const
 get number of axial blocks
 
int get_num_axial_buckets () const
 get number of axial buckets
 
int get_num_transaxial_buckets () const
 get number of axial buckets
 
int get_num_axial_crystals_per_singles_unit () const
 get number of axial crystals per singles unit
 
int get_num_transaxial_crystals_per_singles_unit () const
 get number of transaxial crystals per singles unit.
 
int get_num_axial_singles_units () const
 get number of axial singles units
 
int get_num_transaxial_singles_units () const
 get number of transaxial singles unit
 
int get_num_singles_units () const
 
int get_max_num_timing_poss () const
 Get the maximum number of TOF bins. More...
 
float get_size_of_timing_pos () const
 Get the size for one (unmashed) TOF bin in picoseconds. More...
 
float get_timing_resolution () const
 Get the timing resolution of the scanner in picoseconds. More...
 
float get_coincidence_window_width_in_ps () const
 Get the full width of the coincidence window in picoseconds. More...
 
float get_coincidence_window_width_in_mm () const
 Get the full width of the coincidence window in millimeter. More...
 
void set_num_transaxial_blocks_per_bucket (const int &new_num)
 set number of transaxial blocks per bucket
 
void set_num_axial_blocks_per_bucket (const int &new_num)
 set number of axial blocks per bucket
 
void set_num_axial_crystals_per_block (const int &new_num)
 set number of crystals in the axial direction
 
void set_num_transaxial_crystals_per_block (const int &new_num)
 set number of transaxial crystals
 
void set_num_detector_layers (const int &new_num)
 set number of crystal layers (for DOI)
 
void set_num_axial_crystals_per_singles_unit (const int &new_num)
 set number of axial crystals per singles unit
 
void set_num_transaxial_crystals_per_singles_unit (const int &new_num)
 set number of transaxial crystals per singles unit
 
void set_scanner_geometry (const std::string &new_scanner_geometry)
 name functions to set block geometry info set scanner geometry More...
 
void set_axial_crystal_spacing (const float &new_spacing)
 set crystal spacing in axial direction
 
void set_transaxial_crystal_spacing (const float &new_spacing)
 set crystal spacing in transaxial direction
 
void set_axial_block_spacing (const float &new_spacing)
 set block spacing in axial direction
 
void set_transaxial_block_spacing (const float &new_spacing)
 set block spacing in transaxial direction
 
void set_crystal_map_file_name (const std::string &new_crystal_map_file_name)
 set crystal map file name for the generic geometry More...
 
number of "fake" crystals per block, inserted by the scanner
int get_num_virtual_axial_crystals_per_block () const
 
int get_num_virtual_transaxial_crystals_per_block () const
 
void set_num_virtual_axial_crystals_per_block (int)
 
void set_num_virtual_transaxial_crystals_per_block (int)
 
functions to get block geometry info
std::string get_scanner_geometry () const
 get scanner geometry More...
 
float get_axial_crystal_spacing () const
 get crystal spacing in axial direction
 
float get_transaxial_crystal_spacing () const
 get crystal spacing in transaxial direction
 
float get_axial_block_spacing () const
 get block spacing in axial direction
 
float get_transaxial_block_spacing () const
 get block spacing in transaxial direction
 
float get_axial_length () const
 
functions to get generic geometry info

get crystal map file name

std::string get_crystal_map_file_name () const
 
Functions to get detector response info
float get_energy_resolution () const
 get the energy resolution as a fraction at the reference energy More...
 
float get_reference_energy () const
 get the reference energy in keV of the energy resolution More...
 
bool has_energy_information () const
 true if energy_resolution and reference_energy are set
 
Functions setting info
void set_type (const Type &new_type)
 set scanner type More...
 
void set_num_rings (const int &new_num)
 set number of rings
 
void set_num_detectors_per_ring (const int &new_num)
 set the namber of detectors per ring
 
void set_max_num_non_arccorrected_bins (const int &new_num)
 set the maximum number of arccorrected bins
 
void set_default_num_arccorrected_bins (const int &new_num)
 set the default number of arccorrected_bins
 
void set_inner_ring_radius (const float &new_radius)
 set inner ring radius
 
void set_average_depth_of_interaction (const float &new_depth_of_interaction)
 set average depth of interaction
 
void set_ring_spacing (const float &new_spacing)
 set ring spacing
 
void set_default_bin_size (const float &new_size)
 set default arc-corrected bin size
 
void set_intrinsic_azimuthal_tilt (const float new_tilt)
 in degrees
 

Static Public Member Functions

static Scannerask_parameters ()
 
static Scannerget_scanner_from_name (const std::string &name)
 get the scanner pointer from the name
 
static std::string list_all_names ()
 get a string listing names for all predefined scanners
 
static std::list< std::string > get_names_of_predefined_scanners ()
 get a list with the names for each predefined scanner
 

Friends

class BlocksTests
 

Detailed Description

A class for storing some info on the scanner.

This class stores geometrical info etc on the scanner.

Warning
Currently really only appropriate for cylindrical PET scanners
information on blocks, buckets etc
This class gives some informations on crystals, blocks etc. However, this is currently (i.e. at least up to STIR 2.1) used in very few places. For ECAT scanners, this information is used to read the normalisation .n files and computed dead-time correction etc. For all other scanners, STIR currently ignores this info. This might change in the future of course.

At present, these functions follow CTI terminology, but the concepts are similar for other scanners.

A further complication is that some scanners (including many Siemens scanners) insert virtual crystals in the sinogram data (corresponding to gaps between detector blocks). We currently define the blocks as the "virtual" ones, but provide extra members to find out how many of these virtual crystals there are.

Warning
This information is only sensible for discrete detector-based scanners.
Currently, in a TOF compatible scanner template, the last three types have to be explicitly defined to avoid ambiguity.
The energy resolution has to be specified but it is used only for scatter correction.
In order to define a nonTOF scanner the timing resolution has to be set to 0 or 1. Anything else will trigger a TOF reconstruction.
Todo:

Some scanners do not have all info filled in at present. Values are then set to 0.

derive from ParsingObject

\warning You have to call set_up() after using the \c set_* functions (except set_params()).
Todo:
a hierarchy distinguishing between different types of scanners

Constructor & Destructor Documentation

◆ Scanner() [1/2]

stir::Scanner::Scanner ( Type  type_v,
const std::list< std::string > &  list_of_names_v,
int  num_detectors_per_ring_v,
int  num_rings_v,
int  max_num_non_arccorrected_bins_v,
int  default_num_arccorrected_bins_v,
float  inner_ring_radius_v,
float  average_depth_of_interaction_v,
float  ring_spacing_v,
float  bin_size_v,
float  intrinsic_tilt_v,
int  num_axial_blocks_per_bucket_v,
int  num_transaxial_blocks_per_bucket_v,
int  num_axial_crystals_per_block_v,
int  num_transaxial_crystals_per_block_v,
int  num_axial_crystals_per_singles_unit_v,
int  num_transaxial_crystals_per_singles_unit_v,
int  num_detector_layers_v,
float  energy_resolution_v = -1.0f,
float  reference_energy_v = -1.0f,
short int  max_num_of_timing_poss = -1,
float  size_timing_pos = -1.0f,
float  timing_resolution = -1.0f,
const std::string &  scanner_geometry_v = "Cylindrical",
float  axial_crystal_spacing_v = -1.0f,
float  transaxial_crystal_spacing_v = -1.0f,
float  axial_block_spacing_v = -1.0f,
float  transaxial_block_spacing_v = -1.0f,
const std::string &  crystal_map_file_name = "" 
)

constructor -(list of names)

size info is in mm

Parameters
intrinsic_tilt_vvalue in radians,
See also
get_intrinsic_azimuthal_tilt()
Parameters
scanner_geometry_v
See also
set_scanner_geometry()
Warning
calls error() when block/bucket info are inconsistent

◆ Scanner() [2/2]

stir::Scanner::Scanner ( Type  type_v,
const std::string &  name,
int  num_detectors_per_ring_v,
int  num_rings_v,
int  max_num_non_arccorrected_bins_v,
int  default_num_arccorrected_bins_v,
float  inner_ring_radius_v,
float  average_depth_of_interaction_v,
float  ring_spacing_v,
float  bin_size_v,
float  intrinsic_tilt_v,
int  num_axial_blocks_per_bucket_v,
int  num_transaxial_blocks_per_bucket_v,
int  num_axial_crystals_per_block_v,
int  num_transaxial_crystals_per_block_v,
int  num_axial_crystals_per_singles_unit_v,
int  num_transaxial_crystals_per_singles_unit_v,
int  num_detector_layers_v,
float  energy_resolution_v = -1.0f,
float  reference_energy_v = -1.0f,
short int  max_num_of_timing_poss = -1,
float  size_timing_pos = -1.0f,
float  timing_resolution = -1.0f,
const std::string &  scanner_geometry_v = "Cylindrical",
float  axial_crystal_spacing_v = -1.0f,
float  transaxial_crystal_spacing_v = -1.0f,
float  axial_block_spacing_v = -1.0f,
float  transaxial_block_spacing_v = -1.0f,
const std::string &  crystal_map_file_name = "" 
)

constructor ( a single name)

size info is in mm

Parameters
intrinsic_tiltvalue in radians,
See also
get_intrinsic_azimuthal_tilt()
Parameters
scanner_geometry_v
See also
set_scanner_geometry()
Warning
calls error() when block/bucket info are inconsistent

References set_scanner_geometry(), and set_up().

Member Function Documentation

◆ set_up()

void stir::Scanner::set_up ( )
virtual

Initialise internal geometry.

Currently called in the set_params() functions, but needs to be called explicitly when afterwards using any of the other set_ functions

References stir::error().

Referenced by Scanner().

◆ check_consistency()

Succeeded stir::Scanner::check_consistency ( ) const

◆ get_max_num_non_arccorrected_bins()

int stir::Scanner::get_max_num_non_arccorrected_bins ( ) const
inline

get the maximum number of arccorrected tangential positions

Warning
name is not in standard STIR terminology. Should be get_max_num_non_arccorrected_tangential_poss() or so. Even better would be to replace it by a name relating to the number of detectors that are in coincidence with a a single detector in the ring, as that is the physical reason why there is a maximum number anyway.
Todo:
change name

Referenced by parameter_info(), and stir::ScannerTests::run_tests().

◆ get_default_num_arccorrected_bins()

int stir::Scanner::get_default_num_arccorrected_bins ( ) const
inline

get the default number of arccorrected tangential positions

Warning
name is not in standard STIR terminology. Should be get_max_default_num_arccorrected_tangential_poss() or so.
Todo:
change name, mabe refering to the fan of detectors in coincidence or so

Referenced by parameter_info().

◆ get_max_num_views()

int stir::Scanner::get_max_num_views ( ) const
inline

get maximum number of views

This is simply get_num_detectors_per_ring()/2

◆ get_intrinsic_azimuthal_tilt()

float stir::Scanner::get_intrinsic_azimuthal_tilt ( ) const
inline

get intrinsic tilt in raw sinogram data (in radians)

Some scanners construct sinograms where the first view does not correspond to the vertical. This angle tells you how much the image will be rotated when this tilt is ignored in the reconstruction algorithm. It uses the same coordinate system as ProjDataInfo::get_phi().

Referenced by stir::ProjDataInfoCylindricalNoArcCorr::parameter_info(), and parameter_info().

◆ get_max_num_timing_poss()

int stir::Scanner::get_max_num_timing_poss ( ) const
inline

Get the maximum number of TOF bins.

Returns
will be 0 or negative if not known

Referenced by check_consistency(), get_coincidence_window_width_in_ps(), and parameter_info().

◆ get_size_of_timing_pos()

float stir::Scanner::get_size_of_timing_pos ( ) const
inline

Get the size for one (unmashed) TOF bin in picoseconds.

Returns
will be 0 or negative if not known
Todo:
change name to get_size_of_timing_pos_in_ps

Referenced by get_coincidence_window_width_in_ps(), and parameter_info().

◆ get_timing_resolution()

float stir::Scanner::get_timing_resolution ( ) const
inline

Get the timing resolution of the scanner in picoseconds.

Returns
will be 0 or negative if not known
Todo:
change name to get_size_of_timing_pos_in_ps

Referenced by check_consistency(), and parameter_info().

◆ get_coincidence_window_width_in_ps()

float stir::Scanner::get_coincidence_window_width_in_ps ( ) const

Get the full width of the coincidence window in picoseconds.

This is often written as $2\tau$ and is usually around 4000ps. It is determined from get_max_num_timing_poss() and get_size_of_timing_pos().

Warning
This is currently not known yet for many non-TOF scanners. The function will then throw an error.

References stir::error(), get_max_num_timing_poss(), get_size_of_timing_pos(), and is_tof_ready().

Referenced by check_consistency(), and get_coincidence_window_width_in_mm().

◆ get_coincidence_window_width_in_mm()

float stir::Scanner::get_coincidence_window_width_in_mm ( ) const

Get the full width of the coincidence window in millimeter.

Calls get_coincidence_window_width_in_ps()

References get_coincidence_window_width_in_ps().

Referenced by check_consistency().

◆ get_num_virtual_axial_crystals_per_block()

int stir::Scanner::get_num_virtual_axial_crystals_per_block ( ) const

Some scanners (including many Siemens scanners) insert virtual crystals in the sinogram data. The other members of the class return the size of the "virtual" block. With these functions you can find its true size (or set it).

You have to call set_up() after using the set_* functions.

Todo:
The current list is bound to be incomplete. would be better to stick it in set_params().

References get_type().

Referenced by check_consistency(), and set_num_virtual_axial_crystals_per_block().

◆ get_num_virtual_transaxial_crystals_per_block()

int stir::Scanner::get_num_virtual_transaxial_crystals_per_block ( ) const
Todo:
The current list is bound to be incomplete. would be better to stick it in set_params().

References get_type().

Referenced by set_num_virtual_transaxial_crystals_per_block().

◆ set_num_virtual_axial_crystals_per_block()

void stir::Scanner::set_num_virtual_axial_crystals_per_block ( int  val)
Todo:
Can currently only set to hard-wired values. Otherwise calls error()

References stir::error(), and get_num_virtual_axial_crystals_per_block().

◆ set_num_virtual_transaxial_crystals_per_block()

void stir::Scanner::set_num_virtual_transaxial_crystals_per_block ( int  val)
Todo:
Can currently only set to hard-wired values. Otherwise calls error()

References stir::error(), and get_num_virtual_transaxial_crystals_per_block().

◆ get_scanner_geometry()

std::string stir::Scanner::get_scanner_geometry ( ) const
inline

get scanner geometry

See also
set_scanner_geometry

Referenced by check_consistency(), stir::make_det_pair_data(), and parameter_info().

◆ get_axial_length()

float stir::Scanner::get_axial_length ( ) const
inline

get total axial length covered by the detectors (incl. any gaps between blocks etc.)

Todo:
Need to update this function when enabling different spacing between blocks and buckets etc.

Referenced by stir::ScatterSimulation::downsample_scanner().

◆ get_energy_resolution()

float stir::Scanner::get_energy_resolution ( ) const
inline

get the energy resolution as a fraction at the reference energy

Values for PET scanners are around 0.1 at 511 keV, depending on the scanner of course.

If less than or equal to 0, it is assumed to be unknown.

Referenced by parameter_info().

◆ get_reference_energy()

float stir::Scanner::get_reference_energy ( ) const
inline

get the reference energy in keV of the energy resolution

For PET, normally set to 511

Referenced by parameter_info().

◆ set_type()

void stir::Scanner::set_type ( const Type new_type)
inline

set scanner type

Be careful to keep consistency by setting all relevant parameters.

You have to call set_up() after using any of these.

◆ set_scanner_geometry()

void stir::Scanner::set_scanner_geometry ( const std::string &  new_scanner_geometry)

name functions to set block geometry info set scanner geometry

Parameters
new_scanner_geometry"Cylindrical", "BlocksOnCylindrical" or "Generic"

Will also read the detector map from file if the geometry is "Generic".

Warning
you need to call set_up() after calling this function.
See also
set_scanner_geometry

Referenced by list_names(), and Scanner().

◆ set_crystal_map_file_name()

void stir::Scanner::set_crystal_map_file_name ( const std::string &  new_crystal_map_file_name)
inline

set crystal map file name for the generic geometry

Warning
, data is not read yet. use set_scanner_geometry() after calling this function

Referenced by list_names().

◆ set_energy_resolution()

void stir::Scanner::set_energy_resolution ( const float  new_num)
inline

set the energy resolution of the system

See also
get_energy_resolution()

◆ set_reference_energy()

void stir::Scanner::set_reference_energy ( const float  new_num)
inline

set the reference energy (in keV) of the energy resolution

See also
get_reference_energy()

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