STIR  6.2.0
ForwardProjectorByBinParallelproj.h
Go to the documentation of this file.
1 //
2 //
3 
4 #ifndef __stir_gpu_ForwardProjectorByBinParallelproj_h__
5 #define __stir_gpu_ForwardProjectorByBinParallelproj_h__
6 
16 /*
17  Copyright (C) 2019, 2021 University College London
18  This file is part of STIR.
19 
20  SPDX-License-Identifier: Apache-2.0
21 
22  See STIR/LICENSE.txt for details
23 */
24 
27 
28 START_NAMESPACE_STIR
29 
30 class ProjDataInMemory;
31 class DataSymmetriesForViewSegmentNumbers;
32 namespace detail
33 {
34 class ParallelprojHelper;
35 }
36 
41 class ForwardProjectorByBinParallelproj : public RegisteredParsingObject<ForwardProjectorByBinParallelproj, ForwardProjectorByBin>
42 {
43 public:
45  static const char* const registered_name;
46 
48  // inline
50 
53 
55  void initialise_keymap() override;
56 
58 
67  void set_up(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
68  const shared_ptr<const DiscretisedDensity<3, float>>& density_info_sptr // TODO should be Info only
69  ) override;
70 
72  const DataSymmetriesForViewSegmentNumbers* get_symmetries_used() const override;
73 
75  void set_input(const DiscretisedDensity<3, float>&) override;
76 
78  void set_defaults() override;
79 
81  void set_verbosity(const bool verbosity) { _cuda_verbosity = verbosity; }
82 
85  void set_use_truncation(const bool use_truncation) { _use_truncation = use_truncation; }
86 
87  // set/get number of gpu chunks to use
88  void set_num_gpu_chunks(int num_gpu_chunks) { _num_gpu_chunks = num_gpu_chunks; }
89  int get_num_gpu_chunks() { return _num_gpu_chunks; }
90 
91 protected:
92  void actual_forward_project(RelatedViewgrams<float>& viewgrams,
93  const int min_axial_pos_num,
94  const int max_axial_pos_num,
95  const int min_tangential_pos_num,
96  const int max_tangential_pos_num) override;
97 
98 private:
99  shared_ptr<DataSymmetriesForViewSegmentNumbers> _symmetries_sptr;
100  shared_ptr<ProjDataInMemory> _projected_data_sptr;
101  shared_ptr<detail::ParallelprojHelper> _helper;
102  bool _do_not_setup_helper;
104  void set_helper(shared_ptr<detail::ParallelprojHelper>);
105  bool _cuda_verbosity;
106  bool _use_truncation;
107  int _num_gpu_chunks;
108 };
109 
110 END_NAMESPACE_STIR
111 
112 #endif // __stir_gpu_ForwardProjectorByBinParallelproj_h__
void set_use_truncation(const bool use_truncation)
Set use truncation - truncate before forward projection and after back projection.
Definition: ForwardProjectorByBinParallelproj.h:85
void set_verbosity(const bool verbosity)
Set verbosity.
Definition: ForwardProjectorByBinParallelproj.h:81
static const char *const registered_name
Name which will be used when parsing a ForwardProjectorByBin object.
Definition: ForwardProjectorByBinParallelproj.h:45
A class for encoding/finding symmetries. Works only on ViewSegmentNumbers (instead of Bin)...
Definition: DataSymmetriesForViewSegmentNumbers.h:49
Class for Parallelproj&#39;s forward projector.
Definition: ForwardProjectorByBinParallelproj.h:41
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
Base class for forward projectors which work on &#39;large&#39; collections of bins: given the whole image...
A projector pair based on Parallelproj projectors.
Definition: ProjectorByBinPairUsingParallelproj.h:38
Declaration of class stir::RegisteredParsingObject.