STIR  6.2.0
Public Types | Public Member Functions | Protected Member Functions | List of all members
stir::DetectorCoordinateMap Class Reference

#include "stir/DetectorCoordinateMap.h"

Inheritance diagram for stir::DetectorCoordinateMap:
Inheritance graph
[legend]

Public Types

typedef boost::unordered_map< stir::DetectionPosition<>, stir::CartesianCoordinate3D< float >, ihash > det_pos_to_coord_type
 
typedef boost::unordered_map< stir::DetectionPosition<>, stir::DetectionPosition<>, ihash > unordered_to_ordered_det_pos_type
 

Public Member Functions

 DetectorCoordinateMap (const std::string &filename, double sigma=0.0)
 Constructor calls read_detectormap_from_file( filename ).
 
 DetectorCoordinateMap (const det_pos_to_coord_type &coord_map, double sigma=0.0)
 Constructor calls set_detector_map(coord_map).
 
void read_detectormap_from_file (const std::string &filename)
 Reads map from file and stores it.
 
void set_detector_map (const det_pos_to_coord_type &coord_map)
 stores the map More...
 
stir::DetectionPosition get_det_pos_for_index (const stir::DetectionPosition<> &index) const
 
stir::CartesianCoordinate3D< float > get_coordinate_for_det_pos (const stir::DetectionPosition<> &det_pos) const
 Returns a cartesian coordinate given a detection position.
 
stir::CartesianCoordinate3D< float > get_coordinate_for_index (const stir::DetectionPosition<> &index) const
 Returns a cartesian coordinate given an (unsorted) index.
 
Succeeded find_detection_position_given_cartesian_coordinate (DetectionPosition<> &det_pos, const CartesianCoordinate3D< float > &cart_coord) const
 
unsigned get_num_tangential_coords () const
 
unsigned get_num_axial_coords () const
 
unsigned get_num_radial_coords () const
 

Protected Member Functions

 DetectorCoordinateMap (double sigma=0.0)
 

Detailed Description

Class providing map functionality to convert detector indices to spatial coordinates. Map files can have 5 or 6 tab- or comma-separated columns. Lines beginning with '#' are ignored. The layer column is optional

Format: ring,detector,(layer,)x,y,z An empty line will terminate the reading at that line.

Optionally LOR end-points can be randomly displaced using a Gaussian distribution with standard deviation sigma (in mm).

Member Function Documentation

◆ set_detector_map()

void stir::DetectorCoordinateMap::set_detector_map ( const det_pos_to_coord_type &  coord_map)

stores the map

applies sorting to standard STIR order

References stir::error(), stir::from_min_pi_plus_pi_to_0_2pi(), and stir::round().

◆ find_detection_position_given_cartesian_coordinate()

Succeeded stir::DetectorCoordinateMap::find_detection_position_given_cartesian_coordinate ( DetectionPosition<> &  det_pos,
const CartesianCoordinate3D< float > &  cart_coord 
) const

first round the cartesian coordinates, it might happen that the cart_coord is not precisely pointing to the center of the crystal and then the det_pos cannot be found using the map

References stir::round(), and stir::warning().


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