STIR 6.4.0
ProjDataInfoSubsetByView.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2021-2022, Commonwealth Scientific and Industrial Research Organisation
3 Copyright (C) 2021-2022, University College London
4 This file is part of STIR.
5
6 SPDX-License-Identifier: Apache-2.0
7
8 See STIR/LICENSE.txt for details
9*/
19#ifndef __stir_ProjDataInfoSubsetByView__H__
20#define __stir_ProjDataInfoSubsetByView__H__
21
22#include "stir/ProjDataInfo.h"
23#include <utility>
24#include <vector>
25
26START_NAMESPACE_STIR
27
28class Succeeded;
29
38{
39private:
40 typedef ProjDataInfo base_type;
41 typedef ProjDataInfoSubsetByView self_type;
42
43public:
45
48 ProjDataInfoSubsetByView(const shared_ptr<const ProjDataInfo> org_proj_data_info_sptr, const std::vector<int>& views);
49
51 self_type* clone() const override;
52
54 bool contains_full_data() const;
55
57 std::vector<int> get_original_view_nums() const override;
58
60 Bin get_original_bin(const Bin& bin) const;
61
63 Bin get_bin_from_original(const Bin& org_bin) const;
64
66
67 void reduce_segment_range(const int min_segment_num, const int max_segment_num) override;
68
70 void set_num_views(const int new_num_views) override;
71
73
75 void set_num_tangential_poss(const int num_tang_poss) override;
76
78
80 void set_num_axial_poss_per_segment(const VectorWithOffset<int>& num_axial_poss_per_segment) override;
81
83
85 void set_min_axial_pos_num(const int min_ax_pos_num, const int segment_num) override;
86
88
90 void set_max_axial_pos_num(const int max_ax_pos_num, const int segment_num) override;
91
93
95 void set_min_tangential_pos_num(const int min_tang_poss) override;
96
98
100 void set_max_tangential_pos_num(const int max_tang_poss) override;
101
102 //| \name Functions that return geometrical info for a Bin
104
106
108 float get_tantheta(const Bin&) const override;
109
111
114 float get_phi(const Bin&) const override;
115
117
119 float get_t(const Bin&) const override;
120
122
124 float get_m(const Bin&) const override;
125
127
129 float get_s(const Bin&) const override;
130
132
136
138
140
141
143
145 float get_sampling_in_t(const Bin&) const override;
146
148
150 float get_sampling_in_m(const Bin&) const override;
151
153
155 float get_sampling_in_s(const Bin&) const override;
156
158
160
162 Bin get_bin(const LOR<float>&, const double delta_time = 0.0) const override;
163
165
170 bool operator>=(const ProjDataInfo& proj) const override;
171
172 std::string parameter_info() const override;
173
175 shared_ptr<const ProjDataInfo> get_original_proj_data_info_sptr() const;
176
177protected:
178 bool blindly_equals(const root_type* const) const override;
179
180private:
181 shared_ptr<ProjDataInfo> org_proj_data_info_sptr;
183 std::vector<int> view_to_org_view_num;
185 std::vector<int> org_view_to_view_num;
186};
187
188END_NAMESPACE_STIR
189
190#endif
Declaration of class stir::ProjDataInfo.
A class for storing coordinates and value of a single projection bin.
Definition Bin.h:49
A class for LORs.
Definition LORCoordinates.h:511
A base class for specifying an LOR with geometric coordinates.
Definition LORCoordinates.h:59
void set_num_views(const int new_num_views) override
Invalid for a subset! This will call error()
Definition ProjDataInfoSubsetByView.cxx:121
void get_LOR(LORInAxialAndNoArcCorrSinogramCoordinates< float > &, const Bin &) const override
Get LOR corresponding to a given bin.
Definition ProjDataInfoSubsetByView.cxx:205
float get_sampling_in_s(const Bin &) const override
Get sampling distance in the s coordinate.
Definition ProjDataInfoSubsetByView.cxx:223
void set_min_tangential_pos_num(const int min_tang_poss) override
Set minimum tangential position number.
Definition ProjDataInfoSubsetByView.cxx:159
void set_max_tangential_pos_num(const int max_tang_poss) override
Set maximum tangential position number.
Definition ProjDataInfoSubsetByView.cxx:167
std::vector< int > get_original_view_nums() const override
Get the view numbers of the original ProjDataInfo.
Definition ProjDataInfoSubsetByView.cxx:100
float get_m(const Bin &) const override
Return z-coordinate of the middle of the LOR (in mm)
Definition ProjDataInfoSubsetByView.cxx:193
bool operator>=(const ProjDataInfo &proj) const override
Check if *this contains proj.
Definition ProjDataInfoSubsetByView.cxx:242
bool contains_full_data() const
true if the subset is actually all of the data
Definition ProjDataInfoSubsetByView.cxx:235
std::string parameter_info() const override
Return a string describing the object.
Definition ProjDataInfoSubsetByView.cxx:273
Bin get_bin_from_original(const Bin &org_bin) const
Get the Bin for this subset corresponding to a Bin of the original ProjDataInfo.
Definition ProjDataInfoSubsetByView.cxx:106
Bin get_bin(const LOR< float > &, const double delta_time=0.0) const override
Find the bin in the projection data that 'contains' an LOR.
Definition ProjDataInfoSubsetByView.cxx:229
float get_sampling_in_t(const Bin &) const override
Get sampling distance in the t coordinate.
Definition ProjDataInfoSubsetByView.cxx:211
void set_min_axial_pos_num(const int min_ax_pos_num, const int segment_num) override
Set minimum axial position number for 1 segment.
Definition ProjDataInfoSubsetByView.cxx:143
ProjDataInfoSubsetByView(const shared_ptr< const ProjDataInfo > org_proj_data_info_sptr, const std::vector< int > &views)
Constructor setting relevant info for a ProjDataInfoSubsetByView.
Definition ProjDataInfoSubsetByView.cxx:27
float get_sampling_in_m(const Bin &) const override
Get sampling distance in the m coordinate.
Definition ProjDataInfoSubsetByView.cxx:217
void reduce_segment_range(const int min_segment_num, const int max_segment_num) override
Set a new range of segment numbers for both this object and the original ProjDataInfo.
Definition ProjDataInfoSubsetByView.cxx:114
float get_s(const Bin &) const override
Get value of the tangential coordinate in the projection plane (in mm)
Definition ProjDataInfoSubsetByView.cxx:199
void set_num_axial_poss_per_segment(const VectorWithOffset< int > &num_axial_poss_per_segment) override
Set number of axial positions per segment.
Definition ProjDataInfoSubsetByView.cxx:135
Bin get_original_bin(const Bin &bin) const
Get the Bin of the original ProjDataInfo corresponding to a Bin for this subset.
Definition ProjDataInfoSubsetByView.cxx:92
void set_num_tangential_poss(const int num_tang_poss) override
Set number of tangential positions.
Definition ProjDataInfoSubsetByView.cxx:127
float get_tantheta(const Bin &) const override
Get tangent of the co-polar angle of the normal to the projection plane.
Definition ProjDataInfoSubsetByView.cxx:175
float get_phi(const Bin &) const override
Get azimuthal angle phi of the normal to the projection plane.
Definition ProjDataInfoSubsetByView.cxx:181
void set_max_axial_pos_num(const int max_ax_pos_num, const int segment_num) override
Set maximum axial position number for 1 segment.
Definition ProjDataInfoSubsetByView.cxx:151
self_type * clone() const override
Clone the object.
Definition ProjDataInfoSubsetByView.cxx:86
shared_ptr< const ProjDataInfo > get_original_proj_data_info_sptr() const
Get a shared pointer to the original, fully sampled ProjDataInfo.
Definition ProjDataInfoSubsetByView.cxx:291
float get_t(const Bin &) const override
Get value of the (roughly) axial coordinate in the projection plane (in mm)
Definition ProjDataInfoSubsetByView.cxx:187
bool blindly_equals(const root_type *const) const override
Definition ProjDataInfoSubsetByView.cxx:280
ProjDataInfo()
Construct an empty object.
Definition ProjDataInfo.cxx:274
A templated class for vectors, but with indices starting not from 0.
Definition VectorWithOffset.h:65