STIR 6.4.0
ProjMatrixElemsForOneBinValue.h
Go to the documentation of this file.
1//
2//
14/*
15 Copyright (C) 2000 PARAPET partners
16 Copyright (C) 2000- 2009, Hammersmith Imanet Ltd
17 This file is part of STIR.
18
19 SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
20
21 See STIR/LICENSE.txt for details
22*/
23
24#ifndef __ProjMatrixElemsForOneBinValue_H__
25#define __ProjMatrixElemsForOneBinValue_H__
26
27#include "stir/common.h"
28
29START_NAMESPACE_STIR
30
31template <int num_dimensions, typename coordT>
32class BasicCoordinate;
33
46class ProjMatrixElemsForOneBinValue
47{
48public:
49 explicit inline ProjMatrixElemsForOneBinValue(const BasicCoordinate<3, int>& coords, const float ivalue = 0);
50
51 inline ProjMatrixElemsForOneBinValue();
52
55
57 inline int coord1() const;
59 inline int coord2() const;
61 inline int coord3() const;
62
64 inline float get_value() const;
65
67 inline ProjMatrixElemsForOneBinValue& operator+=(const ProjMatrixElemsForOneBinValue& el2);
69 inline ProjMatrixElemsForOneBinValue& operator*=(const float d);
71 inline ProjMatrixElemsForOneBinValue& operator+=(const float d);
73 inline ProjMatrixElemsForOneBinValue& operator/=(const float d);
74
76
78
81 static inline bool coordinates_equal(const ProjMatrixElemsForOneBinValue& el1, const ProjMatrixElemsForOneBinValue& el2);
82
84 static inline bool coordinates_less(const ProjMatrixElemsForOneBinValue& el1, const ProjMatrixElemsForOneBinValue& el2);
85
87 friend inline bool operator==(const ProjMatrixElemsForOneBinValue& el1, const ProjMatrixElemsForOneBinValue& el2);
88
90 friend inline bool operator<(const ProjMatrixElemsForOneBinValue& el1, const ProjMatrixElemsForOneBinValue& el2);
91
92private:
93 short c3, c2, c1;
94 float value;
95};
96
97END_NAMESPACE_STIR
98
100
101#endif // __ProjMatrixElemsForOneBinValue_H__
Inline implementations for class stir::ProjMatrixElemsForOneBinValue.
class BasicCoordinate<int num_dimensions, typename coordT> defines num_dimensions -dimensional coordi...
Definition BasicCoordinate.h:57
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
basic configuration include file