STIR  6.2.0
Segment.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2000 PARAPET partners
3  Copyright (C) 2000-2012 Hammersmith Imanet Ltd
4  Copyright (C) 2023, University College London
5  This file is part of STIR.
6 
7  SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
8 
9  See STIR/LICENSE.txt for details
10 */
20 #ifndef __Segment_H__
21 #define __Segment_H__
22 
23 #include "stir/ProjDataInfo.h"
24 #include "stir/SegmentIndices.h"
25 #include "stir/SinogramIndices.h"
26 #include "stir/ViewgramIndices.h"
27 #include "stir/shared_ptr.h"
28 
29 START_NAMESPACE_STIR
30 template <typename elemT>
31 class Sinogram;
32 template <typename elemT>
33 class Viewgram;
34 
49 template <typename elemT>
50 class Segment
51 {
52 #ifdef SWIG
53  // need to make typedef public for swig
54  public:
55 #endif
56  typedef Segment<elemT> self_type;
57 
58 public:
59  enum StorageOrder
60  {
61  StorageByView,
62  StorageBySino
63  };
64 
65  virtual ~Segment()
66  {}
68  inline shared_ptr<const ProjDataInfo> get_proj_data_info_sptr() const;
69 
70  virtual StorageOrder get_storage_order() const = 0;
71  inline SegmentIndices get_segment_indices() const;
73  inline int get_segment_num() const;
75  inline int get_timing_pos_num() const;
76  virtual int get_min_axial_pos_num() const = 0;
77  virtual int get_max_axial_pos_num() const = 0;
78  virtual int get_min_view_num() const = 0;
79  virtual int get_max_view_num() const = 0;
80  virtual int get_min_tangential_pos_num() const = 0;
81  virtual int get_max_tangential_pos_num() const = 0;
82  virtual int get_num_axial_poss() const = 0;
83 
84  virtual int get_num_views() const = 0;
85  virtual int get_num_tangential_poss() const = 0;
86 
88  virtual Sinogram<elemT> get_sinogram(int axial_pos_num) const = 0;
90  virtual Viewgram<elemT> get_viewgram(int view_num) const = 0;
91 
93  inline Sinogram<elemT> get_sinogram(const SinogramIndices& s) const;
95  inline Viewgram<elemT> get_viewgram(const ViewgramIndices&) const;
96 
98  virtual void set_sinogram(const Sinogram<elemT>& s) = 0;
100  virtual void set_sinogram(const Sinogram<elemT>& s, int axial_pos_num) = 0;
102  virtual void set_viewgram(const Viewgram<elemT>& v) = 0;
103 
105 
106 
110  bool has_same_characteristics(self_type const&, std::string& explanation) const;
111 
113 
115  bool has_same_characteristics(self_type const&) const;
116 
118 
122  virtual bool operator==(const self_type&) const = 0;
123 
125  bool operator!=(const self_type&) const;
127 
128 protected:
129  shared_ptr<const ProjDataInfo> proj_data_info_sptr;
130  SegmentIndices _indices;
131 
132  inline Segment(const shared_ptr<const ProjDataInfo>& proj_data_info_sptr_v, const SegmentIndices&);
133 };
134 
135 END_NAMESPACE_STIR
136 
137 #include "stir/Segment.inl"
138 
139 #endif
A class for 2d projection data.
Definition: FBP3DRPReconstruction.h:39
A very simple class to store segment numbers and any other indices that define a segment.
Definition: SegmentIndices.h:33
Declaration of class stir::ProjDataInfo.
Definition of class stir::SegmentIndices.
Definition of class stir::SinogramIndices.
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
implementation of inline functions of class stir::Segment
Definition of class stir::ViewgramIndices.
An (abstract base) class for storing 3d projection dataThis stores a subset of the data accessible vi...
Definition: Segment.h:50
A very simple class to store all dincies to get a (2D) Sinogram.
Definition: SinogramIndices.h:33
A very simple class to store all dincies to get a (2D) Viewgram.
Definition: ViewgramIndices.h:32
A class for 2d projection data.
Definition: ArcCorrection.h:34