1#ifndef __stir_recon_buildblock_ProjMatrixByBin_H__
2#define __stir_recon_buildblock_ProjMatrixByBin_H__
40#include <unordered_map>
90 virtual void set_up(
const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
119 virtual void write_to_file_by_bin(
120 const char *
const file_name_without_extension)
const;
132 void enable_cache(
const bool v =
true);
133 void store_only_basic_bins_in_cache(
const bool v =
true);
135 bool is_cache_enabled()
const;
136 bool does_cache_store_only_basic_bins()
const;
143 shared_ptr<DataSymmetriesForBins> symmetries_sptr;
175 bool cache_stores_only_basic_bins;
198 typedef std::uint64_t CacheKey;
202 const CacheKey tang_pos_bits = 12;
203 const CacheKey axial_pos_bits = 28;
204 const CacheKey timing_pos_bits = 20;
207 typedef std::unordered_map<CacheKey, ProjMatrixElemsForOneBin> MapProjMatrixElemsForOneBin;
208 typedef MapProjMatrixElemsForOneBin::iterator MapProjMatrixElemsForOneBinIterator;
209 typedef MapProjMatrixElemsForOneBin::const_iterator const_MapProjMatrixElemsForOneBinIterator;
219 CacheKey cache_key(
const Bin& bin)
const;
224 void enable_tof(
const shared_ptr<const ProjDataInfo>&
proj_data_info_sptr,
const bool v =
true);
227 float gauss_sigma_in_mm;
229 float r_sqrt2_gauss_sigma;
235 inline float get_tof_value(
const float d1,
const float d2)
const;
238 FastErf erf_interpolation;
Declaration of class stir::DataSymmetriesForBins.
Implementation of an erf interpolation.
Declaration of class stir::ParsingObject.
Implementations of inline functions for class stir::ProjMatrixByBin.
Declaration of class stir::ProjMatrixElemsForOneBin.
Declaration of class stiir::RegisteredObject.
declares the stir::TimedObject class
defines the stir::VectorWithOffset class
defines the stir::VoxelsOnCartesianGrid class
A class for storing coordinates and value of a single projection bin.
Definition Bin.h:49
A class for encoding/finding symmetries common to the geometry of the projection data and the discret...
Definition DataSymmetriesForBins.h:68
This abstract class is the basis for all image representations.
Definition DiscretisedDensity.h:99
const DataSymmetriesForBins * get_symmetries_ptr() const
get a pointer to an object encoding all symmetries that are used by this ProjMatrixByBin
Definition ProjMatrixByBin.inl:37
const shared_ptr< DataSymmetriesForBins > get_symmetries_sptr() const
get a shared_ptr to an object encoding all symmetries that are used by this ProjMatrixByBin
Definition ProjMatrixByBin.inl:43
bool post_processing() override
Checks if parameters have sensible values.
Definition ProjMatrixByBin.cxx:50
void set_defaults() override
sets value for caching configuration (enables caching, but for 'basic' bins only)
Definition ProjMatrixByBin.cxx:34
void cache_proj_matrix_elems_for_one_bin(const ProjMatrixElemsForOneBin &) const
The method to store data in the cache.
Definition ProjMatrixByBin.cxx:202
shared_ptr< const VoxelsOnCartesianGrid< float > > image_info_sptr
We need a local copy of the discretised density in order to find the cartesian coordinates of each vo...
Definition ProjMatrixByBin.h:189
ProjMatrixByBin()
default ctor (calls set_defaults())
Definition ProjMatrixByBin.cxx:55
virtual void set_up(const shared_ptr< const ProjDataInfo > &proj_data_info_ptr, const shared_ptr< const DiscretisedDensity< 3, float > > &density_info_ptr)=0
To be called before any calculation is performed.
Definition ProjMatrixByBin.cxx:122
virtual void calculate_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin &) const =0
This method needs to be implemented in the derived class.
void initialise_keymap() override
sets keys for caching configuration
Definition ProjMatrixByBin.cxx:43
bool tof_enabled
If activated TOF reconstruction will be performed.
Definition ProjMatrixByBin.h:177
void get_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin &, const Bin &) const
The main method for getting a row of the matrix.
Definition ProjMatrixByBin.inl:49
void clear_cache() const
Remove all elements from the cache.
Definition ProjMatrixByBin.cxx:96
Succeeded get_cached_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin &) const
The method that tries to get data from the cache.
Definition ProjMatrixByBin.cxx:221
shared_ptr< const ProjDataInfo > proj_data_info_sptr
We need a local copy of the proj_data_info to get the integration boundaries and RayTracing.
Definition ProjMatrixByBin.h:192
This stores the non-zero projection matrix elements for every 'densel' that contributes to a given bi...
Definition ProjMatrixElemsForOneBin.h:69
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition Succeeded.h:44
base class for all objects which need timers. At the moment, there's only a CPU timer.
Definition TimedObject.h:36
A templated class for vectors, but with indices starting not from 0.
Definition VectorWithOffset.h:65
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...