STIR  6.2.0
Viewgram.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2000 PARAPET partners
5  Copyright (C) 2000 - 2007-10-08, Hammersmith Imanet Ltd
6  Copyright (C) 2011-07-01 - 2012, Kris Thielemans
7  Copyright (C) 2023, University College London
8  This file is part of STIR.
9 
10  SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
11 
12  See STIR/LICENSE.txt for details
13 */
27 #ifndef __Viewgram_h__
28 #define __Viewgram_h__
29 
30 #include "stir/Array.h"
31 #include "stir/ProjDataInfo.h"
32 #include "stir/ViewgramIndices.h"
33 #include "stir/IndexRange.h"
34 #include "stir/shared_ptr.h"
35 
36 START_NAMESPACE_STIR
37 
47 template <typename elemT>
48 class Viewgram : public Array<2, elemT>
49 {
50 private:
51  typedef Array<2, elemT> base_type;
52 #ifdef SWIG
53  // SWIG needs the next typedef to be public
54 public:
55 #endif
56  typedef Viewgram<elemT> self_type;
57 #ifdef SWIG
58  // SWIG needs a default constructor
59  inline Viewgram() {}
60 #endif
61 
62 public:
64  inline Viewgram(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr, const ViewgramIndices& ind);
65 
67  inline Viewgram(const Array<2, elemT>& p,
68  const shared_ptr<const ProjDataInfo>& proj_data_info_sptr,
69  const ViewgramIndices& ind);
70 
72 
75  inline Viewgram(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
76  const int v_num,
77  const int s_num,
78  const int t_num = 0);
79 
81 
84  inline Viewgram(const Array<2, elemT>& p,
85  const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
86  const int v_num,
87  const int s_num,
88  const int t_num = 0);
89 
91  inline ViewgramIndices get_viewgram_indices() const;
93  inline int get_segment_num() const;
95  inline int get_view_num() const;
97  inline int get_timing_pos_num() const;
99  inline int get_min_axial_pos_num() const;
101  inline int get_max_axial_pos_num() const;
103  inline int get_num_axial_poss() const;
105  inline int get_min_tangential_pos_num() const;
107  inline int get_max_tangential_pos_num() const;
109  inline int get_num_tangential_poss() const;
110 
112  inline Viewgram get_empty_copy(void) const;
113 
115  void grow(const IndexRange<2>& range) override;
117  void resize(const IndexRange<2>& range) override;
118 
120  inline shared_ptr<const ProjDataInfo> get_proj_data_info_sptr() const;
121 
123 
124 
128  bool has_same_characteristics(self_type const&, std::string& explanation) const;
129 
131 
133  bool has_same_characteristics(self_type const&) const;
134 
136 
140  bool operator==(const self_type&) const;
141 
143  bool operator!=(const self_type&) const;
145 
146 private:
147  shared_ptr<const ProjDataInfo> proj_data_info_sptr;
148  ViewgramIndices _indices;
149 };
150 
151 END_NAMESPACE_STIR
152 
153 #include "stir/Viewgram.inl"
154 
155 #endif
Declaration of class stir::ProjDataInfo.
Inline implementations of class stir::Viewgram.
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
defines the Array class for multi-dimensional (numeric) arrays
Definition of class stir::ViewgramIndices.
This file defines the stir::IndexRange class.