STIR  6.3.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  typedef Array<2, elemT> base_type;
51 #ifdef STIR_COMPILING_SWIG_WRAPPER
52  // SWIG needs the next typedef to be public
53 public:
54 #endif
55  typedef Viewgram<elemT> self_type;
56 
57 public:
59  inline Viewgram(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr, const ViewgramIndices& ind);
60 
62  inline Viewgram(const Array<2, elemT>& p,
63  const shared_ptr<const ProjDataInfo>& proj_data_info_sptr,
64  const ViewgramIndices& ind);
65 
67 
70  inline Viewgram(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
71  const int v_num,
72  const int s_num,
73  const int t_num = 0);
74 
76 
79  inline Viewgram(const Array<2, elemT>& p,
80  const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
81  const int v_num,
82  const int s_num,
83  const int t_num = 0);
84 
86  inline ViewgramIndices get_viewgram_indices() const;
88  inline int get_segment_num() const;
90  inline int get_view_num() const;
92  inline int get_timing_pos_num() const;
94  inline int get_min_axial_pos_num() const;
96  inline int get_max_axial_pos_num() const;
98  inline int get_num_axial_poss() const;
100  inline int get_min_tangential_pos_num() const;
102  inline int get_max_tangential_pos_num() const;
104  inline int get_num_tangential_poss() const;
105 
107  inline Viewgram get_empty_copy(void) const;
108 
110  void grow(const IndexRange<2>& range) override;
112  void resize(const IndexRange<2>& range) override;
113 
115  inline shared_ptr<const ProjDataInfo> get_proj_data_info_sptr() const;
116 
118 
119 
123  bool has_same_characteristics(self_type const&, std::string& explanation) const;
124 
126 
128  bool has_same_characteristics(self_type const&) const;
129 
131 
135  bool operator==(const self_type&) const;
136 
138  bool operator!=(const self_type&) const;
140 
141 private:
142  shared_ptr<const ProjDataInfo> proj_data_info_sptr;
143  ViewgramIndices _indices;
144 };
145 
146 END_NAMESPACE_STIR
147 
148 #include "stir/Viewgram.inl"
149 
150 #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 into the stir names...
defines the stir::Array class for multi-dimensional (numeric) arrays
Definition of class stir::ViewgramIndices.
This file defines the stir::IndexRange class.