STIR 6.4.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
29#include "stir/TimedObject.h"
30#include "stir/shared_ptr.h"
31#include "stir/Bin.h"
33
34START_NAMESPACE_STIR
35
36template <typename elemT>
37class RelatedViewgrams;
38template <int num_dimensions, class elemT>
39class DiscretisedDensity;
40class ProjDataInfo;
41class ProjData;
42class DataSymmetriesForViewSegmentNumbers;
43template <typename DataT>
44class DataProcessor;
45
50class BackProjectorByBin : public TimedObject, public RegisteredObject<BackProjectorByBin>
51{
52public:
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
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
92
97 const int min_axial_pos_num,
98 const int max_axial_pos_num);
99
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
111 virtual void back_project(const ProjData&, int subset_num = 0, int num_subsets = 1);
112
116
119 void back_project(const RelatedViewgrams<float>&, const int min_axial_pos_num, const int max_axial_pos_num);
120
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
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
145protected:
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
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
201protected:
203 shared_ptr<const ProjDataInfo> _proj_data_info_sptr;
204
205private:
206#ifdef STIR_OPENMP
208 std::vector<shared_ptr<DiscretisedDensity<3, float>>> _local_output_image_sptrs;
209#endif
210};
211
212END_NAMESPACE_STIR
213
214#endif // __BackProjectorByBin_h_
Declaration of class stir::Bin.
Declaration of class stir::ProjMatrixElemsForOneBin.
Declaration of class stiir::RegisteredObject.
declares the stir::TimedObject class
shared_ptr< DiscretisedDensity< 3, float > > _density_sptr
Clone of the density sptr set with set_up()
Definition BackProjectorByBin.h:195
void back_project(DiscretisedDensity< 3, float > &, const ProjData &, int subset_num=0, int num_subsets=1)
project whole proj_data into the volume
Definition BackProjectorByBin.cxx:112
void set_post_data_processor(shared_ptr< DataProcessor< DiscretisedDensity< 3, float > > > post_data_processor_sptr)
Set data processor to use after back projection.
Definition BackProjectorByBin.cxx:349
virtual void start_accumulating_in_new_target()
tell the back projector to start accumulating into a new target. This function has to be called befor...
Definition BackProjectorByBin.cxx:296
BackProjectorByBin()
Default constructor calls reset_timers()
Definition BackProjectorByBin.cxx:44
virtual void set_up(const shared_ptr< const ProjDataInfo > &proj_data_info_ptr, const shared_ptr< const DiscretisedDensity< 3, float > > &density_info_sptr)=0
Stores all necessary geometric info.
Definition BackProjectorByBin.cxx:68
shared_ptr< const ProjDataInfo > _proj_data_info_sptr
ProjDataInfo set by set_up()
Definition BackProjectorByBin.h:203
void set_defaults() override
Set defaults before parsing.
Definition BackProjectorByBin.cxx:54
virtual const DataSymmetriesForViewSegmentNumbers * get_symmetries_used() const =0
Informs on which symmetries the projector handles It should get data related by at least those symmet...
virtual void actual_back_project(DiscretisedDensity< 3, float > &, const RelatedViewgrams< float > &, const int min_axial_pos_num, const int max_axial_pos_num, const int min_tangential_pos_num, const int max_tangential_pos_num)
This actually does the back projection. There are two versions of this code to enable backwards compa...
Definition BackProjectorByBin.cxx:355
virtual void check(const ProjDataInfo &proj_data_info) const
check if the argument is the same as what was used for set_up()
Definition BackProjectorByBin.cxx:93
virtual void get_output(DiscretisedDensity< 3, float > &) const
Get output This will overwrite the array-content of the argument with the result of all backprojectio...
Definition BackProjectorByBin.cxx:317
void initialise_keymap() override
Initialise all keywords.
Definition BackProjectorByBin.cxx:60
Base class that defines an interface for classes that do data processing.
Definition DataProcessor.h:47
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
An (abstract base) class that contains information on the projection data.
Definition ProjDataInfo.h:70
The (abstract) base class for the projection data.
Definition ProjData.h:105
A class for storing viewgrams which are related by symmetry.
Definition RelatedViewgrams.h:41
base class for all objects which need timers. At the moment, there's only a CPU timer.
Definition TimedObject.h:36
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...