STIR  6.2.0
SegmentByView.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2000 PARAPET partners
5  Copyright (C) 2000- 2007, Hammersmith Imanet Ltd
6  Copyright (C) 2023, University College London
7  This file is part of STIR.
8 
9  SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
10 
11  See STIR/LICENSE.txt for details
12 */
26 #ifndef __stir_SegmentByView_H__
27 #define __stir_SegmentByView_H__
28 
29 #include "stir/Segment.h"
30 #include "stir/Array.h"
31 #include "stir/Viewgram.h"
32 
33 START_NAMESPACE_STIR
34 
35 template <typename elemT>
36 class SegmentBySinogram;
37 template <typename elemT>
38 class Sinogram;
39 
50 template <typename elemT>
51 class SegmentByView : public Segment<elemT>, public Array<3, elemT>
52 {
53 private:
54  typedef SegmentByView<elemT> self_type;
55 
56 public:
58  typedef typename Segment<elemT>::StorageOrder StorageOrder;
59 
61  SegmentByView(const Array<3, elemT>& v, const shared_ptr<const ProjDataInfo>& proj_data_info_sptr, const SegmentIndices&);
62 
64  SegmentByView(const shared_ptr<const ProjDataInfo>& proj_data_info_sptr, const SegmentIndices&);
65 
67 
71  const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
72  const int segment_num,
73  const int timing_pos_num = 0);
74 
76 
79  SegmentByView(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr, const int segment_num, const int timing_pos_num = 0);
80 
83 
84  // TODO ? how to declare a conversion routine that works for any Segment ?
86  inline StorageOrder get_storage_order() const override;
88  inline int get_num_views() const override;
90  inline int get_num_axial_poss() const override;
92  inline int get_num_tangential_poss() const override;
94  inline int get_min_view_num() const override;
96  inline int get_max_view_num() const override;
98  inline int get_min_axial_pos_num() const override;
100  inline int get_max_axial_pos_num() const override;
102  inline int get_min_tangential_pos_num() const override;
104  inline int get_max_tangential_pos_num() const override;
105 
109  Sinogram<elemT> get_sinogram(int axial_pos_num) const override;
111  inline Viewgram<elemT> get_viewgram(int view_num) const override;
113  inline void set_sinogram(const Sinogram<elemT>& s) override;
115  void set_sinogram(Sinogram<elemT> const& s, int axial_pos_num) override;
117  inline void set_viewgram(const Viewgram<elemT>& v) override;
118 
120  void grow(const IndexRange<3>& range) override;
122  void resize(const IndexRange<3>& range) override;
123 
124  bool operator==(const Segment<elemT>&) const override;
125 };
126 
127 END_NAMESPACE_STIR
128 
129 #include "stir/SegmentByView.inl"
130 
131 #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
A class for storing (3d) projection data with fixed SegmentIndices.
Definition: FBP3DRPReconstruction.h:41
Declaration of class stir::Segment.
defines the Array class for multi-dimensional (numeric) arrays
A class for storing (3d) projection data with fixed SegmentIndices.
Definition: ArcCorrection.h:40
Segment< elemT >::StorageOrder StorageOrder
typedef such that we do not need to have typename wherever we StorageOrder
Definition: SegmentByView.h:58
Declaration of class stir::Viewgram.
Implementations of inline functions of class stir::SegmentByView.
An (abstract base) class for storing 3d projection dataThis stores a subset of the data accessible vi...
Definition: Segment.h:50
A class for 2d projection data.
Definition: ArcCorrection.h:34