STIR 6.5.0
stir::ProjMatrixElemsForOneBinValue Class Reference

Stores voxel coordinates and the value of the matrix element. More...

#include "stir/recon_buildblock/ProjMatrixElemsForOneBinValue.h"

Public Member Functions

 ProjMatrixElemsForOneBinValue (const BasicCoordinate< 3, int > &coords, const float ivalue=0)
BasicCoordinate< 3, int > get_coords () const
 get the coordinates
int coord1 () const
 In effect the same as get_coords()[1] (but faster).
int coord2 () const
 In effect the same as get_coords()[2] (but faster).
int coord3 () const
 In effect the same as get_coords()[3] (but faster).
float get_value () const
 Get the value of the matrix element.
ProjMatrixElemsForOneBinValue & operator+= (const ProjMatrixElemsForOneBinValue &el2)
 Adds el2.get_value() to the value of the current object.
ProjMatrixElemsForOneBinValue & operator*= (const float d)
 Multiplies the value of with a float.
ProjMatrixElemsForOneBinValue & operator+= (const float d)
 Adds a float to the value.
ProjMatrixElemsForOneBinValue & operator/= (const float d)
 Divides the value of with a float.

Static Public Member Functions

static bool coordinates_equal (const ProjMatrixElemsForOneBinValue &el1, const ProjMatrixElemsForOneBinValue &el2)
 Checks if the coordinates are equal.
static bool coordinates_less (const ProjMatrixElemsForOneBinValue &el1, const ProjMatrixElemsForOneBinValue &el2)
 Checks lexicographical order of the coordinates.

Friends

bool operator== (const ProjMatrixElemsForOneBinValue &el1, const ProjMatrixElemsForOneBinValue &el2)
 Checks coordinates and value are equal.
bool operator< (const ProjMatrixElemsForOneBinValue &el1, const ProjMatrixElemsForOneBinValue &el2)
 Checks lexicographical order of the coordinates and the value.

Detailed Description

Stores voxel coordinates and the value of the matrix element.

(Probably) only useful in class ProjMatrixElemsForOneBin.

Warning
It is recommended never to use this class name directly, but always use the typedef ProjMatrixElemsForOneBin::value_type.
Voxel coordinates are currently stored as shorts for saving memory.

Member Function Documentation

◆ get_coords()

BasicCoordinate< 3, int > stir::ProjMatrixElemsForOneBinValue::get_coords ( ) const
inline

get the coordinates

References get_coords().

Referenced by get_coords(), and operator+=().

◆ coord1()

int stir::ProjMatrixElemsForOneBinValue::coord1 ( ) const
inline

In effect the same as get_coords()[1] (but faster).

References coord1().

Referenced by coord1().

◆ coord2()

int stir::ProjMatrixElemsForOneBinValue::coord2 ( ) const
inline

In effect the same as get_coords()[2] (but faster).

References coord2().

Referenced by coord2().

◆ coord3()

int stir::ProjMatrixElemsForOneBinValue::coord3 ( ) const
inline

In effect the same as get_coords()[3] (but faster).

References coord3().

Referenced by coord3().

◆ get_value()

float stir::ProjMatrixElemsForOneBinValue::get_value ( ) const
inline

Get the value of the matrix element.

References get_value().

Referenced by get_value().

◆ operator+=() [1/2]

ProjMatrixElemsForOneBinValue & stir::ProjMatrixElemsForOneBinValue::operator+= ( const ProjMatrixElemsForOneBinValue & el2)
inline

Adds el2.get_value() to the value of the current object.

References get_coords(), and operator+=().

Referenced by operator+=(), and operator+=().

◆ operator*=()

ProjMatrixElemsForOneBinValue & stir::ProjMatrixElemsForOneBinValue::operator*= ( const float d)
inline

Multiplies the value of with a float.

References operator*=().

Referenced by operator*=().

◆ operator+=() [2/2]

ProjMatrixElemsForOneBinValue & stir::ProjMatrixElemsForOneBinValue::operator+= ( const float d)
inline

Adds a float to the value.

References operator+=().

◆ operator/=()

ProjMatrixElemsForOneBinValue & stir::ProjMatrixElemsForOneBinValue::operator/= ( const float d)
inline

Divides the value of with a float.

References operator/=().

Referenced by operator/=().

◆ coordinates_equal()

bool stir::ProjMatrixElemsForOneBinValue::coordinates_equal ( const ProjMatrixElemsForOneBinValue & el1,
const ProjMatrixElemsForOneBinValue & el2 )
inlinestatic

Checks if the coordinates are equal.

This function and the next one below are implemented as static members, such that you can pass them (as functoon objects) to std::sort.

References coordinates_equal().

Referenced by stir::ProjMatrixElemsForOneBin::check_state(), coordinates_equal(), and stir::ProjMatrixElemsForOneBin::merge().

◆ coordinates_less()

bool stir::ProjMatrixElemsForOneBinValue::coordinates_less ( const ProjMatrixElemsForOneBinValue & el1,
const ProjMatrixElemsForOneBinValue & el2 )
inlinestatic

Checks lexicographical order of the coordinates.

References coordinates_less().

Referenced by coordinates_less(), stir::ProjMatrixElemsForOneBin::merge(), and stir::ProjMatrixElemsForOneBin::sort().

◆ operator==

bool operator== ( const ProjMatrixElemsForOneBinValue & el1,
const ProjMatrixElemsForOneBinValue & el2 )
friend

Checks coordinates and value are equal.

References operator==.

Referenced by operator==.

◆ operator<

bool operator< ( const ProjMatrixElemsForOneBinValue & el1,
const ProjMatrixElemsForOneBinValue & el2 )
friend

Checks lexicographical order of the coordinates and the value.

References operator<.

Referenced by operator<.


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