STIR 6.5.0
stir::DetectorCoordinateMap Class Reference

#include "stir/DetectorCoordinateMap.h"

Inheritance diagram for stir::DetectorCoordinateMap:

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
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).

Constructor & Destructor Documentation

◆ DetectorCoordinateMap() [1/2]

stir::DetectorCoordinateMap::DetectorCoordinateMap ( const std::string & filename,
double sigma = 0.0 )
inline

Constructor calls read_detectormap_from_file( filename ).

References DetectorCoordinateMap(), and read_detectormap_from_file().

Referenced by DetectorCoordinateMap(), and DetectorCoordinateMap().

◆ DetectorCoordinateMap() [2/2]

stir::DetectorCoordinateMap::DetectorCoordinateMap ( const det_pos_to_coord_type & coord_map,
double sigma = 0.0 )
inline

Constructor calls set_detector_map(coord_map).

References DetectorCoordinateMap(), and set_detector_map().

Member Function Documentation

◆ read_detectormap_from_file()

void stir::DetectorCoordinateMap::read_detectormap_from_file ( const std::string & filename)

Reads map from file and stores it.

References read_detectormap_from_file(), and set_detector_map().

Referenced by DetectorCoordinateMap(), and read_detectormap_from_file().

◆ 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(), stir::round(), and set_detector_map().

Referenced by DetectorCoordinateMap(), read_detectormap_from_file(), and set_detector_map().

◆ get_coordinate_for_det_pos()

stir::CartesianCoordinate3D< float > stir::DetectorCoordinateMap::get_coordinate_for_det_pos ( const stir::DetectionPosition<> & det_pos) const
inline

Returns a cartesian coordinate given a detection position.

References stir::BasicCoordinate< num_dimensions, coordT >::at().

Referenced by get_coordinate_for_index().

◆ get_coordinate_for_index()

stir::CartesianCoordinate3D< float > stir::DetectorCoordinateMap::get_coordinate_for_index ( const stir::DetectionPosition<> & index) const
inline

Returns a cartesian coordinate given an (unsorted) index.

References get_coordinate_for_det_pos().

◆ 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 find_detection_position_given_cartesian_coordinate(), stir::round(), and stir::warning().

Referenced by find_detection_position_given_cartesian_coordinate().


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