33ProjMatrixElemsForOneBinValue::ProjMatrixElemsForOneBinValue(
const BasicCoordinate<3, int>& coords,
const float ivalue)
34 : c3(static_cast<short>(coords[3])),
35 c2(static_cast<short>(coords[2])),
36 c1(static_cast<short>(coords[1])),
39 assert(coords[3] <= SHRT_MAX);
40 assert(coords[3] >= SHRT_MIN);
41 assert(coords[2] <= SHRT_MAX);
42 assert(coords[2] >= SHRT_MIN);
43 assert(coords[1] <= SHRT_MAX);
44 assert(coords[1] >= SHRT_MIN);
47ProjMatrixElemsForOneBinValue::ProjMatrixElemsForOneBinValue()
54BasicCoordinate<3, int>
63 return static_cast<int>(c1);
69 return static_cast<int>(c2);
75 return static_cast<int>(c3);
115 const ProjMatrixElemsForOneBinValue& el2)
117 return el1.c3 == el2.c3 && el1.c2 == el2.c2 && el1.c1 == el2.c1;
122 const ProjMatrixElemsForOneBinValue& el2)
124 return el1.c1 < el2.c1 || (el1.c1 == el2.c1 && (el1.c2 < el2.c2 || (el1.c2 == el2.c2 && el1.c3 < el2.c3)));
128operator==(
const ProjMatrixElemsForOneBinValue& el1,
const ProjMatrixElemsForOneBinValue& el2)
130 return el1.c3 == el2.c3 && el1.c2 == el2.c2 && el1.c1 == el2.c1 && el1.value == el2.value;
134operator<(
const ProjMatrixElemsForOneBinValue& el1,
const ProjMatrixElemsForOneBinValue& el2)
136 return el1.c1 < el2.c1
138 && (el1.c2 < el2.c2 || (el1.c2 == el2.c2 && (el1.c3 < el2.c3 || (el1.c3 == el2.c3 && el1.value < el2.value)))));
defines the stir::Coordinate3D<coordT> class
a templated class for 3-dimensional coordinates.
Definition Coordinate3D.h:43
Stores voxel coordinates and the value of the matrix element.
Definition ProjMatrixElemsForOneBinValue.h:47
float get_value() const
Get the value of the matrix element.
Definition ProjMatrixElemsForOneBinValue.inl:79
ProjMatrixElemsForOneBinValue & operator/=(const float d)
Divides the value of with a float.
Definition ProjMatrixElemsForOneBinValue.inl:107
ProjMatrixElemsForOneBinValue & operator*=(const float d)
Multiplies the value of with a float.
Definition ProjMatrixElemsForOneBinValue.inl:100
BasicCoordinate< 3, int > get_coords() const
get the coordinates
Definition ProjMatrixElemsForOneBinValue.inl:55
friend bool operator<(const ProjMatrixElemsForOneBinValue &el1, const ProjMatrixElemsForOneBinValue &el2)
Checks lexicographical order of the coordinates and the value.
Definition ProjMatrixElemsForOneBinValue.inl:134
ProjMatrixElemsForOneBinValue & operator+=(const ProjMatrixElemsForOneBinValue &el2)
Adds el2.get_value() to the value of the current object.
Definition ProjMatrixElemsForOneBinValue.inl:85
static bool coordinates_equal(const ProjMatrixElemsForOneBinValue &el1, const ProjMatrixElemsForOneBinValue &el2)
Checks if the coordinates are equal.
Definition ProjMatrixElemsForOneBinValue.inl:114
int coord3() const
In effect the same as get_coords()[3] (but faster)
Definition ProjMatrixElemsForOneBinValue.inl:73
int coord1() const
In effect the same as get_coords()[1] (but faster)
Definition ProjMatrixElemsForOneBinValue.inl:61
friend bool operator==(const ProjMatrixElemsForOneBinValue &el1, const ProjMatrixElemsForOneBinValue &el2)
Checks coordinates and value are equal.
Definition ProjMatrixElemsForOneBinValue.inl:128
static bool coordinates_less(const ProjMatrixElemsForOneBinValue &el1, const ProjMatrixElemsForOneBinValue &el2)
Checks lexicographical order of the coordinates.
Definition ProjMatrixElemsForOneBinValue.inl:121
int coord2() const
In effect the same as get_coords()[2] (but faster)
Definition ProjMatrixElemsForOneBinValue.inl:67