STIR
6.2.0
|
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 DetectorCoordinateMap > | get_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 Scanner * | ask_parameters () |
static Scanner * | get_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 |
A class for storing some info on the scanner.
This class stores geometrical info etc on the scanner.
At present, these functions follow CTI terminology, but the concepts are similar for other scanners.
crystal
the smallest detection unit block
several crystals are grouped in a block, this can be in 3 dimensions (see layer). This information could be useful for finding the geometry of the scanner, but we would plenty more size info presumably. layer
Some scanners have multiple layers of detectors to give Depth Of Interaction information bucket
several blocks
send detected events to one bucket
. This has consequences for the dead-time modelling. For instance, one bucket could have much more singles than another, and hence presumably higher singles-dead-time. singles_unit
(non-standard terminology) Most scanners report the singles detected during the acquisition. Some scanners (such as GE scanners) report singles for every crystal, while others (such as CTI scanners) give only singles for a collection of blocks. A singles_unit
is then a set of crystals for which we can get singles rates.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.
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()).
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
intrinsic_tilt_v | value in radians, |
scanner_geometry_v |
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
intrinsic_tilt | value in radians, |
scanner_geometry_v |
References set_scanner_geometry(), and 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().
Succeeded stir::Scanner::check_consistency | ( | ) | const |
checks consistency
Calls warning() with diagnostics when there are problems N.E: Should something check be added for TOF information?
Check consistency of axial and transaxial spacing for block geometry
Check if the crystal map is correct and given
References _PI, get_axial_block_spacing(), get_axial_crystal_spacing(), get_coincidence_window_width_in_mm(), get_coincidence_window_width_in_ps(), get_inner_ring_radius(), get_max_FOV_radius(), get_max_num_timing_poss(), get_name(), get_num_axial_blocks(), get_num_axial_blocks_per_bucket(), get_num_axial_buckets(), get_num_axial_crystals_per_block(), get_num_axial_crystals_per_bucket(), get_num_axial_crystals_per_singles_unit(), get_num_detectors_per_ring(), get_num_rings(), get_num_transaxial_blocks(), get_num_transaxial_blocks_per_bucket(), get_num_transaxial_buckets(), get_num_transaxial_crystals_per_block(), get_num_transaxial_crystals_per_bucket(), get_num_transaxial_crystals_per_singles_unit(), get_num_virtual_axial_crystals_per_block(), get_scanner_geometry(), get_timing_resolution(), get_transaxial_block_spacing(), get_transaxial_crystal_spacing(), is_tof_ready(), stir::round(), and stir::warning().
Referenced by list_names(), and stir::ScannerTests::run_tests().
|
inline |
get the maximum number of arccorrected tangential positions
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. Referenced by parameter_info(), and stir::ScannerTests::run_tests().
|
inline |
get the default number of arccorrected tangential positions
get_max_default_num_arccorrected_tangential_poss()
or so. Referenced by parameter_info().
|
inline |
get maximum number of views
This is simply get_num_detectors_per_ring()/2
|
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().
|
inline |
Get the maximum number of TOF bins.
Referenced by check_consistency(), get_coincidence_window_width_in_ps(), and parameter_info().
|
inline |
Get the size for one (unmashed) TOF bin in picoseconds.
get_size_of_timing_pos_in_ps
Referenced by get_coincidence_window_width_in_ps(), and parameter_info().
|
inline |
Get the timing resolution of the scanner in picoseconds.
get_size_of_timing_pos_in_ps
Referenced by check_consistency(), and parameter_info().
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 and is usually around 4000ps. It is determined from get_max_num_timing_poss()
and get_size_of_timing_pos()
.
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().
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().
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.
References get_type().
Referenced by check_consistency(), and set_num_virtual_axial_crystals_per_block().
int stir::Scanner::get_num_virtual_transaxial_crystals_per_block | ( | ) | const |
References get_type().
Referenced by set_num_virtual_transaxial_crystals_per_block().
void stir::Scanner::set_num_virtual_axial_crystals_per_block | ( | int | val | ) |
References stir::error(), and get_num_virtual_axial_crystals_per_block().
void stir::Scanner::set_num_virtual_transaxial_crystals_per_block | ( | int | val | ) |
References stir::error(), and get_num_virtual_transaxial_crystals_per_block().
|
inline |
get scanner geometry
Referenced by check_consistency(), stir::make_det_pair_data(), and parameter_info().
|
inline |
get total axial length covered by the detectors (incl. any gaps between blocks etc.)
Referenced by stir::ScatterSimulation::downsample_scanner().
|
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().
|
inline |
get the reference energy in keV of the energy resolution
For PET, normally set to 511
Referenced by parameter_info().
|
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.
void stir::Scanner::set_scanner_geometry | ( | const std::string & | new_scanner_geometry | ) |
name functions to set block geometry info set scanner geometry
new_scanner_geometry | "Cylindrical", "BlocksOnCylindrical" or "Generic" |
Will also read the detector map from file if the geometry is "Generic"
.
Referenced by list_names(), and Scanner().
|
inline |
set crystal map file name for the generic geometry
Referenced by list_names().
|
inline |
set the energy resolution of the system
|
inline |
set the reference energy (in keV) of the energy resolution