STIR 6.4.0
ForwardProjectorByBinUsingRayTracing.h
Go to the documentation of this file.
1//
2//
14/*
15 Copyright (C) 2000 PARAPET partners
16 Copyright (C) 2000- 2011, Hammersmith Imanet Ltd
17 This file is part of STIR.
18
19 SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
20
21 See STIR/LICENSE.txt for details
22*/
23
24#ifndef __stir_recon_buildblock_ForwardProjectorByBinUsingRayTracing__H__
25#define __stir_recon_buildblock_ForwardProjectorByBinUsingRayTracing__H__
26
29#include "stir/shared_ptr.h"
31#include "stir/ArrayFwd.h"
32
33START_NAMESPACE_STIR
34
35template <typename elemT>
36class Viewgram;
37template <typename elemT>
38class RelatedViewgrams;
39template <typename elemT>
40class VoxelsOnCartesianGrid;
41class ProjDataInfo;
42class ProjDataInfoCylindrical;
43
72
73class ForwardProjectorByBinUsingRayTracing
74 : public RegisteredParsingObject<ForwardProjectorByBinUsingRayTracing, ForwardProjectorByBin>
75{
76public:
78 static const char* const registered_name;
79
80 ForwardProjectorByBinUsingRayTracing();
81
83
84 ForwardProjectorByBinUsingRayTracing(const shared_ptr<const ProjDataInfo>&,
85 const shared_ptr<const DiscretisedDensity<3, float>>&);
87
89 void set_up(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
90 const shared_ptr<const DiscretisedDensity<3, float>>& density_info_ptr // TODO should be Info only
91 ) override;
92
94
95protected:
98
99private:
100 void actual_forward_project(RelatedViewgrams<float>&,
102 const int min_axial_pos_num,
103 const int max_axial_pos_num,
104 const int min_tangential_pos_num,
105 const int max_tangential_pos_num) override;
106#if 0 // disabled as currently not used. needs to be written in the new style anyway
107 void actual_forward_project(Bin&,
109#endif
110
111 // KT 20/06/2001 changed type from 'const DataSymmetriesForViewSegmentNumbers *'
112 shared_ptr<DataSymmetriesForBins_PET_CartesianGrid> symmetries_ptr;
113 /*
114 The version which uses all possible symmetries.
115 Here 0<=view < num_views/4 (= 45 degrees)
116 */
117
118 void forward_project_all_symmetries(Viewgram<float>& pos_view,
119 Viewgram<float>& neg_view,
120 Viewgram<float>& pos_plus90,
121 Viewgram<float>& neg_plus90,
122 Viewgram<float>& pos_min180,
123 Viewgram<float>& neg_min180,
124 Viewgram<float>& pos_min90,
125 Viewgram<float>& neg_min90,
126 const VoxelsOnCartesianGrid<float>& image,
127 const int min_axial_pos_num,
128 const int max_axial_pos_num,
129 const int min_tangential_pos_num,
130 const int max_tangential_pos_num) const;
131
132 /*
133 This function projects 4 viewgrams related by symmetry.
134 It will be used for view=0 or 45 degrees
135 (or others if the number of views is not a multiple of 4)
136 Here 0<=view < num_views/2 (= 90 degrees)
137 */
138 void forward_project_view_plus_90_and_delta(Viewgram<float>& pos_view,
139 Viewgram<float>& neg_view,
140 Viewgram<float>& pos_plus90,
141 Viewgram<float>& neg_plus90,
142 const VoxelsOnCartesianGrid<float>& image,
143 const int min_axial_pos_num,
144 const int max_axial_pos_num,
145 const int min_tangential_pos_num,
146 const int max_tangential_pos_num) const;
147 /*
148 This function projects 4 viewgrams related by symmetry.
149 It will be used for view=0 or 45 degrees
150 (or others if the number of views is not a multiple of 4)
151 Here 0<=view < num_views/2 (= 90 degrees)
152 */
153 void forward_project_view_min_180_and_delta(Viewgram<float>& pos_view,
154 Viewgram<float>& neg_view,
155 Viewgram<float>& pos_min180,
156 Viewgram<float>& neg_min180,
157 const VoxelsOnCartesianGrid<float>& image,
158 const int min_axial_pos_num,
159 const int max_axial_pos_num,
160 const int min_tangential_pos_num,
161 const int max_tangential_pos_num) const;
162
163 /*
164 This function projects 4 viewgrams related by symmetry.
165 It will be used for view=0 or 45 degrees
166 (or others if the number of views is not a multiple of 4)
167 Here 0<=view < num_views/2 (= 90 degrees)
168 */
169 void forward_project_delta(Viewgram<float>& pos_view,
170 Viewgram<float>& neg_view,
171 const VoxelsOnCartesianGrid<float>& image,
172 const int min_axial_pos_num,
173 const int max_axial_pos_num,
174 const int min_tangential_pos_num,
175 const int max_tangential_pos_num) const;
176
178 void forward_project_all_symmetries_2D(Viewgram<float>& pos_view,
179 Viewgram<float>& pos_plus90,
180 Viewgram<float>& pos_min180,
181 Viewgram<float>& pos_min90,
182 const VoxelsOnCartesianGrid<float>& image,
183 const int min_axial_pos_num,
184 const int max_axial_pos_num,
185 const int min_tangential_pos_num,
186 const int max_tangential_pos_num) const;
187 void forward_project_view_plus_90_2D(Viewgram<float>& pos_view,
188 Viewgram<float>& pos_plus90,
189 const VoxelsOnCartesianGrid<float>& image,
190 const int min_axial_pos_num,
191 const int max_axial_pos_num,
192 const int min_tangential_pos_num,
193 const int max_tangential_pos_num) const;
194 void forward_project_view_min_180_2D(Viewgram<float>& pos_view,
195 Viewgram<float>& pos_min180,
196 const VoxelsOnCartesianGrid<float>& image,
197 const int min_axial_pos_num,
198 const int max_axial_pos_num,
199 const int min_tangential_pos_num,
200 const int max_tangential_pos_num) const;
201 // no symmetries
202 void forward_project_view_2D(Viewgram<float>& pos_view,
203 const VoxelsOnCartesianGrid<float>& image,
204 const int min_axial_pos_num,
205 const int max_axial_pos_num,
206 const int min_tangential_pos_num,
207 const int max_tangential_pos_num) const;
209
210 template <int symmetry_type>
211 static bool proj_Siddon(Array<4, float>& Projptr,
213 const shared_ptr<const ProjDataInfoCylindrical> proj_data_info_sptr,
214 const float cphi,
215 const float sphi,
216 const float delta,
217 const float s_in_mm,
218 const float R,
219 const int min_ax_pos_num,
220 const int max_ax_pos_num,
221 const float offset,
222 const int num_planes_per_axial_pos,
223 const float axial_pos_to_z_offset,
224 const float norm_factor,
225 const bool restrict_to_cylindrical_FOV);
226
227 void set_defaults() override;
228 void initialise_keymap() override;
229};
230END_NAMESPACE_STIR
231#endif
forward declaration of stir::Array class for multi-dimensional (numeric) arrays
Declaration of class stir::DataSymmetriesForBins_PET_CartesianGrid.
Base class for forward projectors which work on 'large' collections of bins: given the whole image,...
Declaration of class stir::RegisteredParsingObject.
This class defines multi-dimensional (numeric) arrays.
Definition Array.h:78
A class for storing coordinates and value of a single projection bin.
Definition Bin.h:49
A class for encoding/finding symmetries. Works only on ViewSegmentNumbers (instead of Bin).
Definition DataSymmetriesForViewSegmentNumbers.h:50
This abstract class is the basis for all image representations.
Definition DiscretisedDensity.h:99
static const char *const registered_name
Name which will be used when parsing a ForwardProjectorByBin object.
Definition ForwardProjectorByBinUsingRayTracing.h:78
bool restrict_to_cylindrical_FOV
variable that determines if a cylindrical FOV or the whole image will be handled
Definition ForwardProjectorByBinUsingRayTracing.h:97
void set_up(const shared_ptr< const ProjDataInfo > &proj_data_info_ptr, const shared_ptr< const DiscretisedDensity< 3, float > > &density_info_ptr) override
Stores all necessary geometric info.
Definition ForwardProjectorByBinUsingRayTracing.cxx:103
const DataSymmetriesForViewSegmentNumbers * get_symmetries_used() const override
Informs on which symmetries the projector handles.
Definition ForwardProjectorByBinUsingRayTracing.cxx:164
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files.
Definition RegisteredParsingObject.h:78
A class for storing viewgrams which are related by symmetry.
Definition RelatedViewgrams.h:41
A class for 2d projection data.
Definition Viewgram.h:49
This class is used to represent voxelised densities on a cuboid grid (3D).
Definition VoxelsOnCartesianGrid.h:46
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...