STIR  6.2.0
BackProjectorByBin.h
Go to the documentation of this file.
1 //
2 //
15 /*
16  Copyright (C) 2000 PARAPET partners
17  Copyright (C) 2000- 2011, Hammersmith Imanet Ltd
18  Copyright (C) 2018-2019, University College London
19  This file is part of STIR.
20 
21  SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
22 
23  See STIR/LICENSE.txt for details
24 */
25 #ifndef __stir_recon_buildblock_BackProjectorByBin_h_
26 #define __stir_recon_buildblock_BackProjectorByBin_h_
27 
28 #include "stir/RegisteredObject.h"
29 #include "stir/TimedObject.h"
30 #include "stir/shared_ptr.h"
31 #include "stir/Bin.h"
33 
34 START_NAMESPACE_STIR
35 
36 template <typename elemT>
37 class RelatedViewgrams;
38 template <int num_dimensions, class elemT>
39 class DiscretisedDensity;
40 class ProjDataInfo;
41 class ProjData;
42 class DataSymmetriesForViewSegmentNumbers;
43 template <typename DataT>
44 class DataProcessor;
45 
50 class BackProjectorByBin : public TimedObject, public RegisteredObject<BackProjectorByBin>
51 {
52 public:
55 
56  ~BackProjectorByBin() override;
57 
59 
68  virtual void set_up(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
69  const shared_ptr<const DiscretisedDensity<3, float>>& density_info_sptr // TODO should be Info only
70  )
71  = 0;
72 
78  virtual const DataSymmetriesForViewSegmentNumbers* get_symmetries_used() const = 0;
79 
81 
87  void back_project(DiscretisedDensity<3, float>&, const ProjData&, int subset_num = 0, int num_subsets = 1);
88 #ifdef STIR_PROJECTORS_AS_V3
89 
91  void back_project(DiscretisedDensity<3, float>&, const RelatedViewgrams<float>&);
92 
95  void back_project(DiscretisedDensity<3, float>&,
97  const int min_axial_pos_num,
98  const int max_axial_pos_num);
99 
102  void back_project(DiscretisedDensity<3, float>&,
104  const int min_axial_pos_num,
105  const int max_axial_pos_num,
106  const int min_tangential_pos_num,
107  const int max_tangential_pos_num);
108 #endif
109 
111  virtual void back_project(const ProjData&, int subset_num = 0, int num_subsets = 1);
112 
115  void back_project(const RelatedViewgrams<float>&);
116 
119  void back_project(const RelatedViewgrams<float>&, const int min_axial_pos_num, const int max_axial_pos_num);
120 
123  void back_project(const RelatedViewgrams<float>&,
124  const int min_axial_pos_num,
125  const int max_axial_pos_num,
126  const int min_tangential_pos_num,
127  const int max_tangential_pos_num);
128 
131  virtual void start_accumulating_in_new_target();
132 
138  virtual void get_output(DiscretisedDensity<3, float>&) const;
139 
141  void set_post_data_processor(shared_ptr<DataProcessor<DiscretisedDensity<3, float>>> post_data_processor_sptr);
142 
143  virtual BackProjectorByBin* clone() const = 0;
144 
145 protected:
155  virtual void actual_back_project(DiscretisedDensity<3, float>&,
157  const int min_axial_pos_num,
158  const int max_axial_pos_num,
159  const int min_tangential_pos_num,
160  const int max_tangential_pos_num);
161 
171  virtual void actual_back_project(const RelatedViewgrams<float>&,
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);
177 
181  virtual void check(const ProjDataInfo& proj_data_info) const;
182 
184 
190  virtual void check(const ProjDataInfo& proj_data_info, const DiscretisedDensity<3, float>& density_info) const;
191 
192  bool _already_set_up;
193 
195  shared_ptr<DiscretisedDensity<3, float>> _density_sptr;
196  shared_ptr<DataProcessor<DiscretisedDensity<3, float>>> _post_data_processor_sptr;
197 
198  void set_defaults() override;
199  void initialise_keymap() override;
200 
201 protected:
203  shared_ptr<const ProjDataInfo> _proj_data_info_sptr;
204 
205 private:
206 #ifdef STIR_OPENMP
207  std::vector<shared_ptr<DiscretisedDensity<3, float>>> _local_output_image_sptrs;
209 #endif
210 };
211 
212 END_NAMESPACE_STIR
213 
214 #endif // __BackProjectorByBin_h_
Abstract base class for all back projectors.
Definition: BackProjectorByBin.h:50
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
Declaration of class stiir::RegisteredObject.
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.
An (abstract base) class that contains information on the projection data.
Definition: ProjDataInfo.h:69
shared_ptr< DiscretisedDensity< 3, float > > _density_sptr
Clone of the density sptr set with set_up()
Definition: BackProjectorByBin.h:195
The (abstract) base class for the projection data.
Definition: ProjData.h:103
shared_ptr< const ProjDataInfo > _proj_data_info_sptr
ProjDataInfo set by set_up()
Definition: BackProjectorByBin.h:203