STIR  6.2.0
Files | Classes | Functions
Items relating to coordinates
Collaboration diagram for Items relating to coordinates:

Files

file  BasicCoordinate.h
 This file declares class stir::BasicCoordinate and some functions acting on stir::BasicCoordinate objects.
 
file  BasicCoordinate.inl
 (inline) implementations for stir::BasicCoordinate
 
file  CartesianCoordinate2D.h
 defines the stir::CartesianCoordinate2D<coordT> class
 
file  CartesianCoordinate2D.inl
 inline implementations for the stir::CartesianCoordinate2D<coordT> class
 
file  CartesianCoordinate3D.h
 defines the stir::CartesianCoordinate3D<coordT> class
 
file  CartesianCoordinate3D.inl
 inline implementations for the stir::CartesianCoordinate3D<coordT> class
 
file  Coordinate2D.h
 defines the stir::Coordinate2D<coordT> class
 
file  Coordinate3D.h
 defines the stir::Coordinate3D<coordT> class
 
file  Coordinate3D.inl
 inline implementations for the stir::Coordinate3D class
 
file  Coordinate4D.h
 defines the stir::Coordinate4D<coordT> class
 
file  Coordinate4D.inl
 inline implementations for the stir::Coordinate4D class
 

Classes

class  stir::BasicCoordinate< num_dimensions, coordT >
 class BasicCoordinate<int num_dimensions, typename coordT> defines num_dimensions -dimensional coordinates. More...
 
class  stir::CartesianCoordinate2D< coordT >
 a templated class for 2-dimensional coordinates. More...
 
class  stir::CartesianCoordinate3D< coordT >
 a templated class for 3-dimensional coordinates. More...
 
class  stir::Coordinate2D< coordT >
 a templated class for 2-dimensional coordinates. More...
 
class  stir::Coordinate3D< coordT >
 a templated class for 3-dimensional coordinates. More...
 
class  stir::Coordinate4D< coordT >
 a templated class for 4-dimensional coordinates. More...
 

Functions

template<int num_dimensions, typename coordT >
coordT stir::inner_product (const BasicCoordinate< num_dimensions, coordT > &p1, const BasicCoordinate< num_dimensions, coordT > &p2)
 compute sum_i p1[i] * p2[i] More...
 
template<int num_dimensions, typename coordT >
double stir::norm_squared (const BasicCoordinate< num_dimensions, coordT > &p1)
 compute (inner_product(p1,p1)) More...
 
template<int num_dimensions, typename coordT >
double stir::norm (const BasicCoordinate< num_dimensions, coordT > &p1)
 compute sqrt(inner_product(p1,p1)) More...
 
template<int num_dimensions, typename coordT >
double stir::angle (const BasicCoordinate< num_dimensions, coordT > &p1, const BasicCoordinate< num_dimensions, coordT > &p2)
 compute angle between 2 directions More...
 
template<int num_dimensions, typename coordT >
double stir::cos_angle (const BasicCoordinate< num_dimensions, coordT > &p1, const BasicCoordinate< num_dimensions, coordT > &p2)
 compute cos of the angle between 2 directions More...
 
template<int num_dimensions, typename coordT >
BasicCoordinate< num_dimensions+1, coordT > stir::join (const coordT &a, const BasicCoordinate< num_dimensions, coordT > &c)
 make a longer BasicCoordinate, by prepending c with the single coordT More...
 
template<int num_dimensions, class coordT >
BasicCoordinate< num_dimensions+1, coordT > stir::join (const BasicCoordinate< num_dimensions, coordT > &c, const coordT &a)
 make a longer BasicCoordinate, by appending the coordT to c More...
 
template<int num_dimensions, class coordT >
BasicCoordinate< num_dimensions - 1, coordT > stir::cut_last_dimension (const BasicCoordinate< num_dimensions, coordT > &c)
 make a shorter BasicCoordinate, by cutting the last element from c More...
 
template<int num_dimensions, typename coordT >
BasicCoordinate< num_dimensions - 1, coordT > stir::cut_first_dimension (const BasicCoordinate< num_dimensions, coordT > &c)
 make a shorter BasicCoordinate, by cutting the first element from c More...
 
template<int num_dimensions>
BasicCoordinate< num_dimensions, float > stir::convert_int_to_float (const BasicCoordinate< num_dimensions, int > &cint)
 converts a BasicCoordinate<int> to BasicCoordinate<float> More...
 

Detailed Description

Function Documentation

◆ inner_product()

template<int num_dimensions, typename coordT >
coordT stir::inner_product ( const BasicCoordinate< num_dimensions, coordT > &  p1,
const BasicCoordinate< num_dimensions, coordT > &  p2 
)
inline

◆ norm_squared()

template<int num_dimensions, typename coordT >
double stir::norm_squared ( const BasicCoordinate< num_dimensions, coordT > &  p1)
inline

◆ norm()

template<int num_dimensions, typename coordT >
double stir::norm ( const BasicCoordinate< num_dimensions, coordT > &  p1)
inline

◆ angle()

template<int num_dimensions, typename coordT >
double stir::angle ( const BasicCoordinate< num_dimensions, coordT > &  p1,
const BasicCoordinate< num_dimensions, coordT > &  p2 
)
inline

compute angle between 2 directions

Implemented in terms of acos(cos_angle(p1,p2)).

Todo:
move to a new CartesianCoordinate class

References stir::cos_angle().

◆ cos_angle()

template<int num_dimensions, typename coordT >
double stir::cos_angle ( const BasicCoordinate< num_dimensions, coordT > &  p1,
const BasicCoordinate< num_dimensions, coordT > &  p2 
)
inline

compute cos of the angle between 2 directions

Todo:
move to a new CartesianCoordinate class

References stir::inner_product(), and stir::norm_squared().

Referenced by stir::angle(), stir::ScatterSimulation::detection_efficiency_no_scatter(), and stir::SingleScatterSimulation::simulate_for_one_scatter_point().

◆ join() [1/2]

template<int num_dimensions, typename coordT >
BasicCoordinate< num_dimensions+1, coordT > stir::join ( const coordT &  a,
const BasicCoordinate< num_dimensions, coordT > &  c 
)
inline

make a longer BasicCoordinate, by prepending c with the single coordT

Referenced by stir::coordinateTests::run_tests().

◆ join() [2/2]

template<int num_dimensions, class coordT >
BasicCoordinate< num_dimensions+1, coordT > stir::join ( const BasicCoordinate< num_dimensions, coordT > &  c,
const coordT &  a 
)
inline

make a longer BasicCoordinate, by appending the coordT to c

◆ cut_last_dimension()

template<int num_dimensions, class coordT >
BasicCoordinate< num_dimensions - 1, coordT > stir::cut_last_dimension ( const BasicCoordinate< num_dimensions, coordT > &  c)
inline

make a shorter BasicCoordinate, by cutting the last element from c

Referenced by stir::coordinateTests::run_tests().

◆ cut_first_dimension()

template<int num_dimensions, typename coordT >
BasicCoordinate< num_dimensions - 1, coordT > stir::cut_first_dimension ( const BasicCoordinate< num_dimensions, coordT > &  c)
inline

make a shorter BasicCoordinate, by cutting the first element from c

Referenced by stir::get(), stir::Array< 2, float >::operator[](), and stir::coordinateTests::run_tests().

◆ convert_int_to_float()

template<int num_dimensions>
BasicCoordinate< num_dimensions, float > stir::convert_int_to_float ( const BasicCoordinate< num_dimensions, int > &  cint)
inline

converts a BasicCoordinate<int> to BasicCoordinate<float>

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