STIR 6.4.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, 2026 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"
33#include "stir/IndexRange.h"
34#include "stir/shared_ptr.h"
35
36START_NAMESPACE_STIR
37
46
47template <typename elemT>
48class Viewgram : public Array<2, elemT>, public DataWithProjDataInfo
49{
50 typedef Array<2, elemT> base_type;
51#ifdef STIR_COMPILING_SWIG_WRAPPER
52 // SWIG needs the next typedef to be public
53public:
54#endif
55 typedef Viewgram<elemT> self_type;
56
57public:
59 Viewgram(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr, const ViewgramIndices& ind);
60
62 Viewgram(const Array<2, elemT>& p, const shared_ptr<const ProjDataInfo>& proj_data_info_sptr, const ViewgramIndices& ind);
63
65
68 Viewgram(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr, const int v_num, const int s_num, const int t_num = 0);
69
71
74 Viewgram(const Array<2, elemT>& p,
75 const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
76 const int v_num,
77 const int s_num,
78 const int t_num = 0);
79
83 inline int get_segment_num() const;
85 inline int get_view_num() const;
87 inline int get_timing_pos_num() const;
89 inline int get_min_axial_pos_num() const;
91 inline int get_max_axial_pos_num() const;
93 inline int get_num_axial_poss() const;
94
96 Viewgram get_empty_copy(void) const;
97
99 void grow(const IndexRange<2>& range) override;
101 void resize(const IndexRange<2>& range) override;
102
104
105
109 bool has_same_characteristics(self_type const&, std::string& explanation) const;
110
112
114 bool has_same_characteristics(self_type const&) const;
115
117
121 bool operator==(const self_type&) const;
122
124 bool operator!=(const self_type&) const;
126
127private:
128 ViewgramIndices _indices;
129};
130
131END_NAMESPACE_STIR
132
133#include "stir/Viewgram.inl"
134
135#endif
defines the stir::Array class for multi-dimensional (numeric) arrays
declaration of stir::DataWithProjDataInfo
This file defines the stir::IndexRange class.
Definition of class stir::ViewgramIndices.
Inline implementations of class stir::Viewgram.
DataWithProjDataInfo()
Default constructor sets internal member to 0.
Definition DataWithProjDataInfo.cxx:20
This class defines ranges which can be 'irregular'.
Definition IndexRange.h:69
A very simple class to store all dincies to get a (2D) Viewgram.
Definition ViewgramIndices.h:33
Viewgram(const shared_ptr< const ProjDataInfo > &proj_data_info_ptr, const ViewgramIndices &ind)
Construct from proj_data_info pointer and indices. Data are set to 0.
Definition Viewgram.cxx:68
int get_min_axial_pos_num() const
Get minimum number of axial positions.
Definition Viewgram.inl:53
bool operator!=(const self_type &) const
negation of operator==
Definition Viewgram.cxx:134
ViewgramIndices get_viewgram_indices() const
Get indices.
Definition Viewgram.inl:25
bool operator==(const self_type &) const
check equality (data has to be identical)
Definition Viewgram.cxx:127
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 Viewgram.cxx:90
void resize(const IndexRange< 2 > &range) override
Overloading Array::resize.
Definition Viewgram.cxx:145
Viewgram get_empty_copy(void) const
Get an empty viewgram of the same dimensions, segment_num etc.
Definition Viewgram.cxx:41
int get_segment_num() const
Get segment number.
Definition Viewgram.inl:32
int get_timing_pos_num() const
Get timing position index.
Definition Viewgram.inl:46
void grow(const IndexRange< 2 > &range) override
Overloading Array::grow.
Definition Viewgram.cxx:173
int get_num_axial_poss() const
Get number of axial positions.
Definition Viewgram.inl:67
int get_view_num() const
Get number of views.
Definition Viewgram.inl:39
int get_max_axial_pos_num() const
Get maximum number of axial positions.
Definition Viewgram.inl:60
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...