STIR  6.2.0
ForwardProjectorByBin.h
Go to the documentation of this file.
1 //
2 //
3 
4 #ifndef __stir_recon_buildblock_ForwardProjectorByBin_h__
5 #define __stir_recon_buildblock_ForwardProjectorByBin_h__
6 
19 /*
20  Copyright (C) 2000 PARAPET partners
21  Copyright (C) 2000- 2011, Hammersmith Imanet Ltd
22  Copyright (C) 2018-2019, University College London
23  This file is part of STIR.
24 
25  SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
26 
27  See STIR/LICENSE.txt for details
28 */
29 
30 #include "stir/RegisteredObject.h"
31 #include "stir/TimedObject.h"
33 #include "stir/shared_ptr.h"
34 #include "stir/Bin.h"
36 
37 START_NAMESPACE_STIR
38 
39 template <typename elemT>
40 class RelatedViewgrams;
41 template <int num_dimensions, class elemT>
42 class DiscretisedDensity;
43 class ProjDataInfo;
44 class ProjData;
45 class DataSymmetriesForViewSegmentNumbers;
46 template <typename DataT>
47 class DataProcessor;
48 
53 class ForwardProjectorByBin : public TimedObject, public RegisteredObject<ForwardProjectorByBin>
54 {
55 public:
57  // inline
59 
61 
70  virtual void set_up(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
71  const shared_ptr<const DiscretisedDensity<3, float>>& density_info_sptr // TODO should be Info only
72  )
73  = 0;
74 
76 
80  virtual const DataSymmetriesForViewSegmentNumbers* get_symmetries_used() const = 0;
81 
83 
88  void forward_project(ProjData&, const DiscretisedDensity<3, float>&, int subset_num = 0, int num_subsets = 1, bool zero = true);
89 #ifdef STIR_PROJECTORS_AS_V3
90 
92  void forward_project(RelatedViewgrams<float>&, const DiscretisedDensity<3, float>&);
93 
94  void forward_project(RelatedViewgrams<float>&,
96  const int min_axial_pos_num,
97  const int max_axial_pos_num);
98 
99  void forward_project(RelatedViewgrams<float>&,
101  const int min_axial_pos_num,
102  const int max_axial_pos_num,
103  const int min_tangential_pos_num,
104  const int max_tangential_pos_num);
105 #endif
106 
108  virtual void forward_project(ProjData&, int subset_num = 0, int num_subsets = 1, bool zero = true);
109 
111 
112  void forward_project(RelatedViewgrams<float>&);
113 
114  void forward_project(RelatedViewgrams<float>&, const int min_axial_pos_num, const int max_axial_pos_num);
115 
116  void forward_project(RelatedViewgrams<float>&,
117  const int min_axial_pos_num,
118  const int max_axial_pos_num,
119  const int min_tangential_pos_num,
120  const int max_tangential_pos_num);
121 
122 #if 0 // disabled as currently not used. needs to be written in the new style anyway
123 
125  void forward_project(Bin&,
127 #endif
128  ~ForwardProjectorByBin() override;
129 
131  virtual void set_input(const DiscretisedDensity<3, float>&);
132 
134  void set_pre_data_processor(shared_ptr<DataProcessor<DiscretisedDensity<3, float>>> pre_data_processor_sptr);
135 
136 protected:
138  virtual void actual_forward_project(RelatedViewgrams<float>&,
140  const int min_axial_pos_num,
141  const int max_axial_pos_num,
142  const int min_tangential_pos_num,
143  const int max_tangential_pos_num);
144 
145  virtual void actual_forward_project(RelatedViewgrams<float>& viewgrams,
146  const int min_axial_pos_num,
147  const int max_axial_pos_num,
148  const int min_tangential_pos_num,
149  const int max_tangential_pos_num);
150 
151 #if 0 // disabled as currently not used. needs to be written in the new style anyway
152  virtual void actual_forward_project(Bin&,
154  const DiscretisedDensity<3,float>&) = 0;
155 #endif
156 
158 
162  virtual void check(const ProjDataInfo& proj_data_info) const;
163 
165 
171  virtual void check(const ProjDataInfo& proj_data_info, const DiscretisedDensity<3, float>& density_info) const;
172 
173  bool _already_set_up;
174 
176  shared_ptr<DiscretisedDensity<3, float>> _density_sptr;
177  shared_ptr<DataProcessor<DiscretisedDensity<3, float>>> _pre_data_processor_sptr;
178 
179  void set_defaults() override;
180  void initialise_keymap() override;
181 
182 protected:
184  shared_ptr<const ProjDataInfo> _proj_data_info_sptr;
185 };
186 
187 END_NAMESPACE_STIR
188 
189 #endif // __stir_recon_buildblock_ForwardProjectorByBin_h__
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
Base class that defines an interface for classes that do data processing.
Definition: DataProcessor.h:46
A class for encoding/finding symmetries. Works only on ViewSegmentNumbers (instead of Bin)...
Definition: DataSymmetriesForViewSegmentNumbers.h:49
base class for all objects which need timers. At the moment, there&#39;s only a CPU timer.
Definition: TimedObject.h:35
shared_ptr< DiscretisedDensity< 3, float > > _density_sptr
The density ptr set with set_up()
Definition: ForwardProjectorByBin.h:176
shared_ptr< const ProjDataInfo > _proj_data_info_sptr
ProjDataInfo set by set_up()
Definition: ForwardProjectorByBin.h:184
Abstract base class for all forward projectors.
Definition: ForwardProjectorByBin.h:53
Declaration of class stiir::RegisteredObject.
A class for storing coordinates and value of a single projection bin.
Definition: Bin.h:48
Declaration of class stir::Bin.
declares the stir::TimedObject class
Helper class to provide registry mechanisms to a Base classSuppose you have a hierarchy of classes wi...
Definition: RegisteredObject.h:95
Declaration of class stir::ProjMatrixElemsForOneBin.
defines the stir::VoxelsOnCartesianGrid class
An (abstract base) class that contains information on the projection data.
Definition: ProjDataInfo.h:69
The (abstract) base class for the projection data.
Definition: ProjData.h:103