STIR 6.4.0
SegmentIndices.inl
Go to the documentation of this file.
1
13/*
14 Copyright (C) 2000 PARAPET partners
15 Copyright (C) 2000- 2009, Hammersmith Imanet Ltd
16 Copyright (C) 2023, University College London
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
24START_NAMESPACE_STIR
25
27 : _segment(segment_num),
28 _timing_pos(timing_pos_num)
29{}
30
31int
33{
34 return _segment;
35}
36
37int&
39{
40 return _segment;
41}
42
43int
45{
46 return _timing_pos;
47}
48
49int&
51{
52 return _timing_pos;
53}
54
55bool
57{
58 return (_segment < other._segment) || ((_segment == other._segment) && (_timing_pos < other._timing_pos));
59}
60
61bool
63{
64 return (_segment == other._segment) && (_timing_pos == other._timing_pos);
65}
66
67bool
68SegmentIndices::operator!=(const SegmentIndices& other) const
69{
70 return !(*this == other);
71}
72END_NAMESPACE_STIR
A very simple class to store segment numbers and any other indices that define a segment.
Definition SegmentIndices.h:34
int segment_num() const
get segment number for const objects
Definition SegmentIndices.inl:32
bool operator<(const SegmentIndices &other) const
comparison operator, only useful for sorting
Definition SegmentIndices.inl:56
SegmentIndices(const int segment_num=0, const int timing_pos_num=0)
constructor segment number as arguments
Definition SegmentIndices.inl:26
bool operator==(const SegmentIndices &other) const
test for equality
Definition SegmentIndices.inl:62
int timing_pos_num() const
get TOF index for const objects
Definition SegmentIndices.inl:44