STIR 6.4.0
Bin.h
Go to the documentation of this file.
1//
2//
3
17/*
18 Copyright (C) 2000 PARAPET partners
19 Copyright (C) 2000- 2009, Hammersmith Imanet Ltd
20 Copyright (C) 2016, University of Hull
21 Copyright (C) 2023, University College London
22 This file is part of STIR.
23
24 SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
25
26 See STIR/LICENSE.txt for details
27*/
28#ifndef __stir_Bin_H__
29#define __stir_Bin_H__
30
32
33START_NAMESPACE_STIR
47
48class Bin : public ViewgramIndices
49{
50 typedef ViewgramIndices base_type;
51
52public:
54 inline Bin();
55
57 inline Bin(int segment_num, int view_num, int axial_pos_num, int tangential_pos_num, float bin_value);
58
60 inline Bin(int segment_num, int view_num, int axial_pos_num, int tangential_pos_num);
61
62 inline Bin(int segment_num, int view_num, int axial_pos_num, int tangential_pos_num, int timing_pos_num, float bin_value);
63
66
68 inline int axial_pos_num() const;
70 inline int tangential_pos_num() const;
72 inline int time_frame_num() const;
73
74 inline int& axial_pos_num();
75 inline int& tangential_pos_num();
76 inline int& time_frame_num();
77
79 inline Bin get_empty_copy() const;
80
82 inline float get_bin_value() const;
84 inline void set_bin_value(float v);
85
87 inline Bin& operator+=(const float dx);
89 inline Bin& operator*=(const float dx);
93 inline Bin& operator/=(const float dx);
94
96 inline bool operator==(const Bin&) const;
97 inline bool operator!=(const Bin&) const;
98
99private:
100 // shared_ptr<ProjDataInfo> proj_data_info_ptr;
101
102 int axial_pos;
103 int tangential_pos;
104 float bin_value;
105 int time_frame;
106};
107
111{
112 Bin my_bin;
113 float my_corr;
114};
115
116END_NAMESPACE_STIR
117
118#include "stir/Bin.inl"
119
120#endif //__Bin_H__
Implementations of inline functions of class stir::Bin.
Definition of class stir::ViewgramIndices.
A class for storing coordinates and value of a single projection bin.
Definition Bin.h:49
int time_frame_num() const
get time-frame number (1-based)
Definition Bin.inl:82
bool operator==(const Bin &) const
comparison operators
Definition Bin.inl:142
Bin get_empty_copy() const
get an empty copy
Definition Bin.inl:114
float get_bin_value() const
get the value after forward projection
Definition Bin.inl:123
Bin & operator/=(const float dx)
divide bin values
Definition Bin.inl:162
int tangential_pos_num() const
get tangential position number
Definition Bin.inl:76
Bin & operator*=(const float dx)
multiply bin values
Definition Bin.inl:155
int axial_pos_num() const
get axial position number
Definition Bin.inl:70
Bin()
default constructor (leaves most members uninitialised)
Definition Bin.inl:30
Bin & operator+=(const float dx)
accumulate voxel's contribution during forward projection
Definition Bin.inl:135
void set_bin_value(float v)
set the value to be back projected
Definition Bin.inl:129
int segment_num() const
get segment number for const objects
Definition SegmentIndices.inl:32
int timing_pos_num() const
get TOF index for const objects
Definition SegmentIndices.inl:44
ViewgramIndices()
an empty constructor (sets everything to 0)
Definition ViewgramIndices.inl:25
int view_num() const
get view number for const objects
Definition ViewgramIndices.inl:36
A small bundle of a Bin and its additive correction value.
Definition Bin.h:111