STIR  6.2.0
Classes | Namespaces | Functions
BasicCoordinate.h File Reference

This file declares class stir::BasicCoordinate and some functions acting on stir::BasicCoordinate objects. More...

#include "stir/common.h"
#include <boost/operators.hpp>
#include <iterator>
#include "stir/BasicCoordinate.inl"

Go to the source code of this file.

Classes

class  stir::BasicCoordinate< num_dimensions, coordT >
 class BasicCoordinate<int num_dimensions, typename coordT> defines num_dimensions -dimensional coordinates. More...
 

Namespaces

 stir
 Namespace for the STIR library (and some/most of its applications)
 

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...
 
Utility functions to make BasicCoordinate objects.
Warning
Because of template rules of C++, all arguments of the make_coordinate function have to have exactly the same type. For instance,
const BasicCoordinate<3,float> a = make_coordinate(1.F,2.F,0.F);
template<class T >
BasicCoordinate< 1, T > stir::make_coordinate (const T &a1)
 
template<class T >
BasicCoordinate< 2, T > stir::make_coordinate (const T &a1, const T &a2)
 
template<class T >
BasicCoordinate< 3, T > stir::make_coordinate (const T &a1, const T &a2, const T &a3)
 
template<class T >
BasicCoordinate< 4, T > stir::make_coordinate (const T &a1, const T &a2, const T &a3, const T &a4)
 
template<class T >
BasicCoordinate< 5, T > stir::make_coordinate (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5)
 
template<class T >
BasicCoordinate< 6, T > stir::make_coordinate (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6)
 

Detailed Description

This file declares class stir::BasicCoordinate and some functions acting on stir::BasicCoordinate objects.

Author
Kris Thielemans
Alexey Zverovich
PARAPET project
Todo:
The arithmetic operations might at some point be moved to a derived class stir::CartesianCoordinate.