STIR
6.2.0
|
This is the (abstract) base class for all projection matrices which are organised by 'bin'. More...
#include "stir/recon_buildblock/ProjMatrixByBin.h"
Public Member Functions | |
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. More... | |
virtual ProjMatrixByBin * | clone () const =0 |
const DataSymmetriesForBins * | get_symmetries_ptr () const |
get a pointer to an object encoding all symmetries that are used by this ProjMatrixByBin | |
const shared_ptr< DataSymmetriesForBins > | get_symmetries_sptr () const |
get a shared_ptr to an object encoding all symmetries that are used by this ProjMatrixByBin | |
void | get_proj_matrix_elems_for_one_bin (ProjMatrixElemsForOneBin &, const Bin &) const |
The main method for getting a row of the matrix. More... | |
void | enable_cache (const bool v=true) |
void | store_only_basic_bins_in_cache (const bool v=true) |
bool | is_cache_enabled () const |
bool | does_cache_store_only_basic_bins () const |
void | clear_cache () const |
Remove all elements from the cache. | |
Public Member Functions inherited from stir::RegisteredObjectBase | |
virtual std::string | get_registered_name () const =0 |
Returns the name of the type of the object. More... | |
Public Member Functions inherited from stir::ParsingObject | |
ParsingObject (const ParsingObject &) | |
ParsingObject & | operator= (const ParsingObject &) |
void | ask_parameters () |
virtual std::string | parameter_info () |
bool | parse (std::istream &f) |
bool | parse (const char *const filename) |
Public Member Functions inherited from stir::TimedObject | |
void | reset_timers () |
reset all timers kept by this object | |
void | stop_timers () const |
stop all timers kept by this object More... | |
void | start_timers (bool do_reset=false) const |
start all timers kept by this object More... | |
double | get_CPU_timer_value () const |
get current value of the CPU timer (since first use or last reset) | |
double | get_wall_clock_timer_value () const |
get current value of the wall-clock timer (since first use or last reset) | |
Protected Member Functions | |
ProjMatrixByBin () | |
default ctor (calls set_defaults()) More... | |
virtual void | calculate_proj_matrix_elems_for_one_bin (ProjMatrixElemsForOneBin &) const =0 |
This method needs to be implemented in the derived class. More... | |
void | set_defaults () override |
sets value for caching configuration (enables caching, but for 'basic' bins only) More... | |
void | initialise_keymap () override |
sets keys for caching configuration More... | |
bool | post_processing () override |
Checks if parameters have sensible values. More... | |
Succeeded | get_cached_proj_matrix_elems_for_one_bin (ProjMatrixElemsForOneBin &) const |
The method that tries to get data from the cache. More... | |
void | cache_proj_matrix_elems_for_one_bin (const ProjMatrixElemsForOneBin &) const |
The method to store data in the cache. | |
Protected Member Functions inherited from stir::ParsingObject | |
virtual void | set_key_values () |
This will be called before parsing or parameter_info is called. More... | |
Protected Attributes | |
shared_ptr< DataSymmetriesForBins > | symmetries_sptr |
bool | cache_disabled |
bool | cache_stores_only_basic_bins |
bool | tof_enabled |
If activated TOF reconstruction will be performed. | |
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 voxel. | |
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. | |
Protected Attributes inherited from stir::ParsingObject | |
KeyParser | parser |
Additional Inherited Members | |
Static Public Member Functions inherited from stir::RegisteredObject< ProjMatrixByBin > | |
static ProjMatrixByBin * | read_registered_object (std::istream *in, const std::string ®istered_name) |
Construct a new object (of a type derived from Root, its actual type determined by the registered_name parameter) by parsing the istream. More... | |
static ProjMatrixByBin * | ask_type_and_parameters () |
ask the user for the type, and then calls read_registered_object(0, type) More... | |
static void | list_registered_names (std::ostream &stream) |
List all possible registered names to the stream. More... | |
Protected Types inherited from stir::RegisteredObject< ProjMatrixByBin > | |
typedef ProjMatrixByBin *(* | RootFactory) (std::istream *) |
The type of a root factory is a function, taking an istream* as argument, and returning a Root*. | |
typedef FactoryRegistry< std::string, RootFactory, interfile_less > | RegistryType |
The type of the registry. | |
Static Protected Member Functions inherited from stir::RegisteredObject< ProjMatrixByBin > | |
static RegistryType & | registry () |
Static function returning the registry. More... | |
This is the (abstract) base class for all projection matrices which are organised by 'bin'.
This class provides essentially only 2 public members: a method to get a 'row' of the matrix, and a method to get information on the symmetries.
Currently, the class provides for some (basic) caching. This functionality will probably be moved to a new class ProjMatrixByBinWithCache. (TODO)
The following parameters can be set (default values are indicated):
disable caching := false store only basic bins in cache := true
The 2nd option allows to cache the whole matrix. This results in the fastest behaviour IF your system does not start swapping. The default choice caches only the 'basic' bins, and computes symmetry related bins from the 'basic' ones.
|
protected |
default ctor (calls set_defaults())
Note that due to the C++ definition (and some good reasons), ProjMatrixByBin::set_defaults() is called, even though this is a virtual function.
|
pure virtual |
To be called before any calculation is performed.
Note that get_proj_matrix_elems_for_one_bin() will expect objects of compatible sizes and other info.
Implemented in stir::ProjMatrixByBinPinholeSPECTUB, stir::ProjMatrixByBinUsingRayTracing, stir::ProjMatrixByBinSPECTUB, stir::ProjMatrixByBinFromFile, stir::ProjMatrixByBinUsingInterpolation, stir::ProjMatrixByBinSinglePhoton, stir::ProjMatrixByBinUsingSolidAngle, and stir::ProjMatrixByBinWithPositronRange.
References stir::error().
Referenced by stir::ProjMatrixByBinUsingInterpolation::set_up().
|
inline |
The main method for getting a row of the matrix.
The ProjMatrixElemsForOneBin argument will be overwritten (i.e. data is NOT appended).
The implementation is inline as it just gets it in terms of the cached_proj_matrix_elems_for_one_bin or calculate_proj_matrix_elems_for_one_bin.
References stir::ProjMatrixElemsForOneBin::begin(), stir::ProjMatrixElemsForOneBin::check_state(), stir::ProjMatrixElemsForOneBin::erase(), stir::ProjMatrixElemsForOneBin::get_bin(), stir::inner_product(), stir::norm(), stir::ProjMatrixElemsForOneBin::set_bin(), and stir::SegmentIndices::timing_pos_num().
|
protectedpure virtual |
This method needs to be implemented in the derived class.
bin-coordinates are obtained via the ProjMatrixElemsForOneBin::get_bin() method.
Note that 'calculate' could just as well mean 'get from file'
|
overrideprotectedvirtual |
sets value for caching configuration (enables caching, but for 'basic' bins only)
Has to be called by set_defaults in the leaf-class
Reimplemented from stir::ParsingObject.
Referenced by stir::ProjMatrixByBinUsingInterpolation::ProjMatrixByBinUsingInterpolation().
|
overrideprotectedvirtual |
sets keys for caching configuration
Has to be called by initialise_keymap in the leaf-class
Reimplemented from stir::ParsingObject.
Referenced by stir::ProjMatrixByBinUsingInterpolation::ProjMatrixByBinUsingInterpolation().
|
overrideprotectedvirtual |
Checks if parameters have sensible values.
Has to be called by post_processing in the leaf-class
Reimplemented from stir::ParsingObject.
Referenced by stir::ProjMatrixByBinUsingInterpolation::ProjMatrixByBinUsingInterpolation().
|
protected |
The method that tries to get data from the cache.
If it succeeds, it overwrites the ProjMatrixElemsForOneBin parameter and returns Succeeded::yes, otherwise it does not touch the ProjMatrixElemsForOneBin and returns Succeeded::false.
References stir::ProjMatrixElemsForOneBin::get_bin(), stir::open_write_binary(), stir::SegmentIndices::segment_num(), and stir::ViewgramIndices::view_num().