STIR 6.4.0
SegmentBySinogram.h
Go to the documentation of this file.
1//
2//
3/*
4 Copyright (C) 2000 PARAPET partners
5 Copyright (C) 2000- 2012, 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*/
27#ifndef __SegmentBySinogram_H__
28#define __SegmentBySinogram_H__
29
30#include "stir/Segment.h"
31#include "stir/Array.h"
32#include "stir/Sinogram.h"
33
34START_NAMESPACE_STIR
35
36// forward declaration for use in convertion
37template <typename elemT>
38class SegmentByView;
39
49template <typename elemT>
50class SegmentBySinogram : public Segment<elemT>, public Array<3, elemT>
51{
52private:
53 typedef SegmentBySinogram<elemT> self_type;
54
55public:
57 typedef typename Segment<elemT>::StorageOrder StorageOrder;
58
60 SegmentBySinogram(const Array<3, elemT>& v,
61 const shared_ptr<const ProjDataInfo>& proj_data_info_ptr_v,
62 const SegmentIndices& ind);
63
65 SegmentBySinogram(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr_v, const SegmentIndices& ind);
66
68
71 SegmentBySinogram(const Array<3, elemT>& v,
72 const shared_ptr<const ProjDataInfo>& proj_data_info_ptr_v,
73 const int segment_num,
74 const int timing_pos_num = 0);
75
77
80 SegmentBySinogram(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr_v,
81 const int segment_num,
82 const int timing_pos_num = 0);
83
87 inline StorageOrder get_storage_order() const override;
88 using Segment<elemT>::get_sinogram;
89 using Segment<elemT>::get_viewgram;
91 inline Sinogram<elemT> get_sinogram(int axial_pos_num) const override;
93 Viewgram<elemT> get_viewgram(int view_num) const override;
95 void set_viewgram(const Viewgram<elemT>&) override;
97 inline void set_sinogram(Sinogram<elemT> const& s, int axial_pos_num) override;
98 inline void set_sinogram(const Sinogram<elemT>& s) override;
99
101 void grow(const IndexRange<3>& range) override;
103 void resize(const IndexRange<3>& range) override;
104
105 bool operator==(const Segment<elemT>&) const override;
106
107private:
109
112 void check_state() const;
113};
114
115END_NAMESPACE_STIR
116
118#endif
defines the stir::Array class for multi-dimensional (numeric) arrays
Implementations of inline functions of class stir::SegmentBySinogram.
Declaration of class stir::Segment.
Declaration of class stir::Sinogram.
This class defines ranges which can be 'irregular'.
Definition IndexRange.h:69
StorageOrder get_storage_order() const override
Get storage order.
Definition SegmentBySinogram.inl:32
Sinogram< elemT > get_sinogram(int axial_pos_num) const override
Get sinogram.
Definition SegmentBySinogram.inl:39
Viewgram< elemT > get_viewgram(int view_num) const override
Get viewgram.
Definition SegmentBySinogram.cxx:105
SegmentBySinogram(const Array< 3, elemT > &v, const shared_ptr< const ProjDataInfo > &proj_data_info_ptr_v, const SegmentIndices &ind)
Constructor that sets the data to a given 3d Array.
Definition SegmentBySinogram.cxx:34
void resize(const IndexRange< 3 > &range) override
Overloading Array::resize.
Definition SegmentBySinogram.cxx:133
void grow(const IndexRange< 3 > &range) override
Overloading Array::grow.
Definition SegmentBySinogram.cxx:163
Segment< elemT >::StorageOrder StorageOrder
typedef such that we do not need to have typename wherever we StorageOrder
Definition SegmentBySinogram.h:57
void set_viewgram(const Viewgram< elemT > &) override
Set viewgram.
Definition SegmentBySinogram.cxx:121
void set_sinogram(Sinogram< elemT > const &s, int axial_pos_num) override
Set sinogram.
Definition SegmentBySinogram.inl:50
A class for storing (3d) projection data with fixed SegmentIndices.
Definition SegmentByView.h:52
A very simple class to store segment numbers and any other indices that define a segment.
Definition SegmentIndices.h:34
A class for 2d projection data.
Definition Sinogram.h:47
A class for 2d projection data.
Definition Viewgram.h:49