STIR  6.2.0
BackProjectorByBinParallelproj.h
Go to the documentation of this file.
1 //
2 //
13 /*
14  Copyright (C) 2019, 2021 University College London
15  This file is part of STIR.
16 
17  SPDX-License-Identifier: Apache-2.0
18 
19  See STIR/LICENSE.txt for details
20 */
21 #ifndef __stir_gpu_BackProjectorByBinParallelproj_h__
22 #define __stir_gpu_BackProjectorByBinParallelproj_h__
23 
26 //#include "stir/recon_buildblock/Parallelproj_projector/ParallelprojHelper.h"
27 
28 START_NAMESPACE_STIR
29 
30 class DataSymmetriesForViewSegmentNumbers;
31 class ProjDataInMemory;
32 namespace detail
33 {
34 class ParallelprojHelper;
35 }
36 
41 class BackProjectorByBinParallelproj : public RegisteredParsingObject<BackProjectorByBinParallelproj, BackProjectorByBin>
42 {
43 public:
45  static const char* const registered_name;
46 
49 
51 
53  void initialise_keymap() override;
54 
56 
59  void set_up(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
60  const shared_ptr<const DiscretisedDensity<3, float>>& density_info_sptr // TODO should be Info only
61  ) override;
62 
64  const DataSymmetriesForViewSegmentNumbers* get_symmetries_used() const override;
65 
66 #if 0
67  void back_project(const ProjData&, int subset_num = 0, int num_subsets = 1);
69 #endif
70  void get_output(DiscretisedDensity<3, float>&) const override;
72 
75  void start_accumulating_in_new_target() override;
76 
78  void set_defaults() override;
79 
81  void set_verbosity(const bool verbosity)
82  {
83  _cuda_verbosity = verbosity;
84  }
85 
86  // set/get number of gpu chunks to use
87  void set_num_gpu_chunks(int num_gpu_chunks)
88  {
89  _num_gpu_chunks = num_gpu_chunks;
90  }
91  int get_num_gpu_chunks()
92  {
93  return _num_gpu_chunks;
94  }
95 
96  BackProjectorByBinParallelproj* clone() const override;
97 
98 protected:
99  void actual_back_project(const RelatedViewgrams<float>&,
100  const int min_axial_pos_num,
101  const int max_axial_pos_num,
102  const int min_tangential_pos_num,
103  const int max_tangential_pos_num) override;
104 
105 private:
106  shared_ptr<DataSymmetriesForViewSegmentNumbers> _symmetries_sptr;
107  shared_ptr<ProjDataInMemory> _proj_data_to_backproject_sptr;
108  shared_ptr<detail::ParallelprojHelper> _helper;
109  bool _do_not_setup_helper;
111  void set_helper(shared_ptr<detail::ParallelprojHelper>);
112  bool _cuda_verbosity;
113  int _num_gpu_chunks;
114 };
115 
116 END_NAMESPACE_STIR
117 
118 #endif // __stir_gpu_BackProjectorByBinParallelproj_h__
Class for Parallelproj&#39;s back projector.
Definition: BackProjectorByBinParallelproj.h:41
A class for encoding/finding symmetries. Works only on ViewSegmentNumbers (instead of Bin)...
Definition: DataSymmetriesForViewSegmentNumbers.h:49
static const char *const registered_name
Name which will be used when parsing a BackProjectorByBin object.
Definition: BackProjectorByBinParallelproj.h:45
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
A projector pair based on Parallelproj projectors.
Definition: ProjectorByBinPairUsingParallelproj.h:38
Declares class stir::BackProjectorByBin.
Declaration of class stir::RegisteredParsingObject.
void set_verbosity(const bool verbosity)
Set verbosity.
Definition: BackProjectorByBinParallelproj.h:81
The (abstract) base class for the projection data.
Definition: ProjData.h:103