STIR  6.2.0
Public Member Functions | Static Public Member Functions | Friends | List of all members
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.
 
ProjMatrixElemsForOneBinValueoperator+= (const ProjMatrixElemsForOneBinValue &el2)
 Adds el2.get_value() to the value of the current object.
 
ProjMatrixElemsForOneBinValueoperator*= (const float d)
 Multiplies the value of with a float.
 
ProjMatrixElemsForOneBinValueoperator+= (const float d)
 Adds a float to the value.
 
ProjMatrixElemsForOneBinValueoperator/= (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. More...
 
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

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

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


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