STIR 6.4.0
ProjMatrixElemsForOneDenselValue.inl
Go to the documentation of this file.
1//
2//
12/*
13 Copyright (C) 2000- 2009, Hammersmith Imanet Ltd
14 This file is part of STIR.
15
16 SPDX-License-Identifier: Apache-2.0
17
18 See STIR/LICENSE.txt for details
19*/
20
21START_NAMESPACE_STIR
22
23ProjMatrixElemsForOneDenselValue::ProjMatrixElemsForOneDenselValue(const Bin& bin)
24 : Bin(bin)
25{}
26
27ProjMatrixElemsForOneDenselValue::ProjMatrixElemsForOneDenselValue()
28 : Bin()
29{}
30
31ProjMatrixElemsForOneDenselValue&
32ProjMatrixElemsForOneDenselValue::operator+=(const ProjMatrixElemsForOneDenselValue& el2)
33{
34 // TODO assert(get_coords() == el2.get_coords());
35 //*this += static_cast<const Bin&>(el2);
37 return *this;
38}
39
42{
43 static_cast<Bin&>(*this) += d;
44 return *this;
45}
46
49{
51 return *this;
52}
53
56{
58 return *this;
59}
60
61bool
62ProjMatrixElemsForOneDenselValue::coordinates_equal(const ProjMatrixElemsForOneDenselValue& el1,
63 const ProjMatrixElemsForOneDenselValue& el2)
64{
65 return el1.segment_num() == el2.segment_num() && el1.view_num() == el2.view_num() && el1.axial_pos_num() == el2.axial_pos_num()
66 && el1.tangential_pos_num() == el2.tangential_pos_num();
67}
68
69bool
70ProjMatrixElemsForOneDenselValue::coordinates_less(const ProjMatrixElemsForOneDenselValue& el1,
71 const ProjMatrixElemsForOneDenselValue& el2)
72{
73 return el1.segment_num() < el2.segment_num()
74 || (el1.segment_num() == el2.segment_num()
75 && (el1.view_num() < el2.view_num()
76 || (el1.view_num() == el2.view_num()
77 && (el1.axial_pos_num() < el2.axial_pos_num()
78 || (el1.axial_pos_num() == el2.axial_pos_num()
79 && el1.tangential_pos_num() < el2.tangential_pos_num())))));
80}
81
82bool
83operator==(const ProjMatrixElemsForOneDenselValue& el1, const ProjMatrixElemsForOneDenselValue& el2)
84{
85 return static_cast<const Bin&>(el1) == static_cast<const Bin&>(el2);
86}
87
88bool
89operator<(const ProjMatrixElemsForOneDenselValue& el1, const ProjMatrixElemsForOneDenselValue& el2)
90{
91 return el1.segment_num() < el2.segment_num()
92 || (el1.segment_num() == el2.segment_num()
93 && (el1.view_num() < el2.view_num()
94 || (el1.view_num() == el2.view_num()
95 && (el1.axial_pos_num() < el2.axial_pos_num()
96 || (el1.axial_pos_num() == el2.axial_pos_num()
99 && el1.get_bin_value() < el2.get_bin_value())))))));
100}
101
102END_NAMESPACE_STIR
float get_bin_value() const
get the value after forward projection
Definition Bin.inl:123
int tangential_pos_num() const
get tangential position number
Definition Bin.inl:76
int axial_pos_num() const
get axial position number
Definition Bin.inl:70
Bin()
default constructor (leaves most members uninitialised)
Definition Bin.inl:30
void set_bin_value(float v)
set the value to be back projected
Definition Bin.inl:129
Stores voxel coordinates and the value of the matrix element.
Definition ProjMatrixElemsForOneDenselValue.h:42
friend bool operator==(const ProjMatrixElemsForOneDenselValue &el1, const ProjMatrixElemsForOneDenselValue &el2)
Checks coordinates and value are equal.
Definition ProjMatrixElemsForOneDenselValue.inl:83
static bool coordinates_less(const ProjMatrixElemsForOneDenselValue &el1, const ProjMatrixElemsForOneDenselValue &el2)
Checks lexicographical order of the coordinates.
Definition ProjMatrixElemsForOneDenselValue.inl:70
ProjMatrixElemsForOneDenselValue & operator/=(const float d)
Divides the value of with a float.
Definition ProjMatrixElemsForOneDenselValue.inl:55
friend bool operator<(const ProjMatrixElemsForOneDenselValue &el1, const ProjMatrixElemsForOneDenselValue &el2)
Checks lexicographical order of the coordinates and the value.
Definition ProjMatrixElemsForOneDenselValue.inl:89
ProjMatrixElemsForOneDenselValue & operator*=(const float d)
Multiplies the value of with a float.
Definition ProjMatrixElemsForOneDenselValue.inl:48
ProjMatrixElemsForOneDenselValue & operator+=(const ProjMatrixElemsForOneDenselValue &el2)
Adds el2.get_value() to the value of the current object.
Definition ProjMatrixElemsForOneDenselValue.inl:32
static bool coordinates_equal(const ProjMatrixElemsForOneDenselValue &el1, const ProjMatrixElemsForOneDenselValue &el2)
Checks if the coordinates are equal.
Definition ProjMatrixElemsForOneDenselValue.inl:62
int segment_num() const
get segment number for const objects
Definition SegmentIndices.inl:32
int view_num() const
get view number for const objects
Definition ViewgramIndices.inl:36