STIR 6.4.0
ProjMatrixByBinSPECTUB.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2013, Institute for Bioengineering of Catalonia
3 Copyright (C) 2013, University College London
4 This file is part of STIR.
5
6 SPDX-License-Identifier: Apache-2.0
7
8 See STIR/LICENSE.txt for details
9*/
19#ifndef __stir_recon_buildblock_ProjMatrixByBinSPECTUB__
20#define __stir_recon_buildblock_ProjMatrixByBinSPECTUB__
21
24#include "stir/ProjDataInfo.h"
26#include "stir/IndexRange.h"
27#include "stir/shared_ptr.h"
28#include <iostream>
29
30#include "stir/recon_buildblock/SPECTUB_Tools.h"
31
32START_NAMESPACE_STIR
33
34template <int num_dimensions, typename elemT>
35class DiscretisedDensity;
36class Bin;
78// using namespace SPECTUB;
79class ProjMatrixByBinSPECTUB : public RegisteredParsingObject<ProjMatrixByBinSPECTUB, ProjMatrixByBin, ProjMatrixByBin>
80{
81public:
83 static const char* const registered_name;
84
87
88 // disable copy-constructor as currently unsafe to copy due to bare pointers
90
92 ~ProjMatrixByBinSPECTUB() override;
93
95 void set_up(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
96 const shared_ptr<const DiscretisedDensity<3, float>>& density_info_ptr // TODO should be Info only
97 ) override;
98
99 bool get_keep_all_views_in_cache() const;
101
106 void set_keep_all_views_in_cache(bool value = true);
107 std::string get_attenuation_type() const;
109
113 void set_attenuation_type(const std::string& value);
114 shared_ptr<const DiscretisedDensity<3, float>> get_attenuation_image_sptr() const;
116
123 void set_attenuation_image_sptr(const shared_ptr<const DiscretisedDensity<3, float>> value);
124 void set_attenuation_image_sptr(const std::string& value);
126
140
141 void set_resolution_model(const float collimator_sigma_0_in_mm, const float collimator_slope_in_mm, const bool full_3D = true);
142
143 // Alex
144 // Fix to compile, missing function definition in header
145 ProjMatrixByBinSPECTUB* clone() const override;
146
147private:
148 // parameters that will be parsed
149
150 float minimum_weight;
151 float maximum_number_of_sigmas;
152 float spatial_resolution_PSF;
153 std::string psf_type;
154 float collimator_sigma_0;
155 float collimator_slope;
156 std::string attenuation_type;
157 std::string attenuation_map;
158 std::string mask_type;
159 std::string mask_file;
160 bool keep_all_views_in_cache;
161
162 // explicitly list necessary members for image details (should use an Info object instead)
165 IndexRange<3> densel_range;
166
167 shared_ptr<const ProjDataInfo> proj_data_info_ptr;
168
169 bool already_setup;
170
171 mutable SPECTUB::wm_da_type wm;
172 mutable SPECTUB::wmh_type wmh; // this could be an arry of wmh_type for each index
173 float* Rrad;
174
175 void calculate_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin&) const override;
176
177 void set_defaults() override;
178 void initialise_keymap() override;
179 bool post_processing() override;
180
181 shared_ptr<const DiscretisedDensity<3, float>> attenuation_image_sptr;
182
183 // wm_SPECT starts here ---------------------------------------------------------------------------------------------
184 bool* msk_3d;
185 bool* msk_2d;
186
187 //... variables for estimated sizes of arrays to allocate ................................
188 int** NITEMS;
189
190 //... user defined structures (types defined in SPECTUB_Tools.h) .....................................
191
194
197
199 float* attmap;
200
201 SPECTUB::discrf_type gaussdens;
202
203 int maxszb;
204
205 void compute_one_subset(const int kOS, const float* Rrad) const;
206 void delete_UB_SPECT_arrays();
207 mutable std::vector<bool> subset_already_processed;
208};
209
210END_NAMESPACE_STIR
211
212#endif
defines the stir::CartesianCoordinate3D<coordT> class
This file defines the stir::IndexRange class.
Declaration of class stir::ProjDataInfo.
declaration of stir::ProjMatrixByBin and its helpers classes
Declaration of class stir::RegisteredParsingObject.
a templated class for 3-dimensional coordinates.
Definition CartesianCoordinate3D.h:53
This abstract class is the basis for all image representations.
Definition DiscretisedDensity.h:99
This class defines ranges which can be 'irregular'.
Definition IndexRange.h:69
void set_attenuation_image_sptr(const shared_ptr< const DiscretisedDensity< 3, float > > value)
Sets attenuation image.
Definition ProjMatrixByBinSPECTUB.cxx:173
ProjMatrixByBinSPECTUB()
Default constructor (calls set_defaults())
Definition ProjMatrixByBinSPECTUB.cxx:67
void set_attenuation_type(const std::string &value)
Set type of attenuation modelling.
Definition ProjMatrixByBinSPECTUB.cxx:155
void set_resolution_model(const float collimator_sigma_0_in_mm, const float collimator_slope_in_mm, const bool full_3D=true)
Set the parameters for the depth-dependent resolution model.
Definition ProjMatrixByBinSPECTUB.cxx:194
void set_keep_all_views_in_cache(bool value=true)
Enable keeping the matrix in memory.
Definition ProjMatrixByBinSPECTUB.cxx:139
static const char *const registered_name
Name which will be used when parsing a ProjMatrixByBin object.
Definition ProjMatrixByBinSPECTUB.h:83
void set_up(const shared_ptr< const ProjDataInfo > &proj_data_info_ptr, const shared_ptr< const DiscretisedDensity< 3, float > > &density_info_ptr) override
Checks all necessary geometric info.
Definition ProjMatrixByBinSPECTUB.cxx:217
This stores the non-zero projection matrix elements for every 'densel' that contributes to a given bi...
Definition ProjMatrixElemsForOneBin.h:69
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files.
Definition RegisteredParsingObject.h:78
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...
structure to store angles values, indices and ratios
Definition SPECTUB_Tools.h:231
structure for bin information
Definition SPECTUB_Tools.h:288
structure for distribution function information
Definition SPECTUB_Tools.h:188
structure for projection information
Definition SPECTUB_Tools.h:80
structure for bin information
Definition SPECTUB_Tools.h:49
structure for voxel information
Definition SPECTUB_Tools.h:263
weight_mat_da structure definition. Structure for generating weight matrix
Definition SPECTUB_Tools.h:160
complementary information (matrix header)
Definition SPECTUB_Tools.h:107