STIR 6.4.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
24#include "stir/SegmentIndices.h"
27#include "stir/shared_ptr.h"
28
29START_NAMESPACE_STIR
30template <typename elemT>
31class Sinogram;
32template <typename elemT>
33class Viewgram;
34
48
49template <typename elemT>
50class Segment : public DataWithProjDataInfo
51{
52#ifdef STIR_COMPILING_SWIG_WRAPPER
53 // need to make typedef public for swig
54public:
55#endif
56 typedef Segment<elemT> self_type;
57
58public:
59 enum StorageOrder
60 {
61 StorageByView,
62 StorageBySino
63 };
64
65 virtual StorageOrder get_storage_order() const = 0;
66 inline SegmentIndices get_segment_indices() const;
68 inline int get_segment_num() const;
70 inline int get_timing_pos_num() const;
71
72 int get_min_axial_pos_num() const;
73 int get_max_axial_pos_num() const;
74 int get_num_axial_poss() const;
76 virtual Sinogram<elemT> get_sinogram(int axial_pos_num) const = 0;
78 virtual Viewgram<elemT> get_viewgram(int view_num) const = 0;
79
84
86 virtual void set_sinogram(const Sinogram<elemT>& s) = 0;
88 virtual void set_sinogram(const Sinogram<elemT>& s, int axial_pos_num) = 0;
90 virtual void set_viewgram(const Viewgram<elemT>& v) = 0;
91
93
94
98 bool has_same_characteristics(self_type const&, std::string& explanation) const;
99
101
103 bool has_same_characteristics(self_type const&) const;
104
106
110 virtual bool operator==(const self_type&) const = 0;
111
113 bool operator!=(const self_type&) const;
115
116protected:
117 SegmentIndices _indices;
118
119 inline Segment(const shared_ptr<const ProjDataInfo>& proj_data_info_sptr_v, const SegmentIndices&);
120};
121
122END_NAMESPACE_STIR
123
124#include "stir/Segment.inl"
125
126#endif
declaration of stir::DataWithProjDataInfo
Definition of class stir::SegmentIndices.
implementation of inline functions of class stir::Segment
Definition of class stir::SinogramIndices.
Definition of class stir::ViewgramIndices.
DataWithProjDataInfo()
Default constructor sets internal member to 0.
Definition DataWithProjDataInfo.cxx:20
A very simple class to store segment numbers and any other indices that define a segment.
Definition SegmentIndices.h:34
virtual void set_viewgram(const Viewgram< elemT > &v)=0
set data in segment according to viewgram v
virtual Viewgram< elemT > get_viewgram(int view_num) const =0
return a new viewgram, with data set as in the segment
bool operator!=(const self_type &) const
negation of operator==
Definition Segment.cxx:72
int get_segment_num() const
Get the segment number.
Definition Segment.inl:42
Viewgram< elemT > get_viewgram(const ViewgramIndices &) const
return a new viewgram, with data set as in the segment
Definition Segment.inl:84
bool has_same_characteristics(self_type const &) const
Checks if the 2 objects have the proj_data_info, segment_num etc.
Definition Segment.cxx:64
virtual Sinogram< elemT > get_sinogram(int axial_pos_num) const =0
return a new sinogram, with data set as in the segment
virtual bool operator==(const self_type &) const =0
check equality (data has to be identical)
bool has_same_characteristics(self_type const &, std::string &explanation) const
Checks if the 2 objects have the proj_data_info, segment_num etc.
Definition Segment.cxx:35
Sinogram< elemT > get_sinogram(const SinogramIndices &s) const
return a new sinogram, with data set as in the segment
Definition Segment.inl:77
int get_timing_pos_num() const
Get the timing position index.
Definition Segment.inl:49
virtual void set_sinogram(const Sinogram< elemT > &s)=0
set data in segment according to sinogram s
virtual void set_sinogram(const Sinogram< elemT > &s, int axial_pos_num)=0
set sinogram at a different axial_pos_num
A very simple class to store all dincies to get a (2D) Sinogram.
Definition SinogramIndices.h:34
A class for 2d projection data.
Definition Sinogram.h:47
A very simple class to store all dincies to get a (2D) Viewgram.
Definition ViewgramIndices.h:33
A class for 2d projection data.
Definition Viewgram.h:49
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...