STIR 6.4.0
ProjMatrixByDensel.h
Go to the documentation of this file.
1//
2//
3
4#ifndef __stir_recon_buildblock_ProjMatrixByDensel_H__
5#define __stir_recon_buildblock_ProjMatrixByDensel_H__
6
16/*
17 Copyright (C) 2000- 2011, Hammersmith Imanet Ltd
18 See STIR/LICENSE.txt for details
19*/
20
24#include "stir/Densel.h"
25#include "stir/ProjDataInfo.h" // todo replace by forward declaration
26#include <map>
27#include "stir/shared_ptr.h"
28
29START_NAMESPACE_STIR
30
31// template <typename elemT> class RelatedViewgrams;
32// class Densel;
33template <int num_dimensions, typename elemT>
34class DiscretisedDensity;
48class ProjMatrixByDensel : public RegisteredObject<ProjMatrixByDensel>
49{
50public:
51 ~ProjMatrixByDensel() override {}
52
54
57 virtual void set_up(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
58 const shared_ptr<const DiscretisedDensity<3, float>>& density_info_ptr // TODO should be Info only
59 )
60 = 0;
61
63 virtual const DataSymmetriesForDensels* get_symmetries_ptr() const = 0;
64
66
74
75#if 0
76 // TODO
82 virtual void write_to_file_by_densel(
83 const char * const file_name_without_extension) const;
84#endif
85 // TODO implement this one at some point ?
86 /*
87 virtual void write_to_file_by_bin(
88 const char * const file_name_without_extension);
89 */
90
91 // void set_maximum_cache_size(const unsigned long size){;}
92 void enable_cache(bool v)
93 {
94 cache_disabled = !v;
95 }
96 /* TODO
97 void set_subset_usage(const SubsetInfo&, const int num_access_times);
98 */
99
100protected:
103
111
113
114 bool cache_disabled;
115
123
126
127private:
128 typedef unsigned int CacheKey;
129
130 typedef std::map<CacheKey, ProjMatrixElemsForOneDensel> MapProjMatrixElemsForOneDensel;
131 typedef MapProjMatrixElemsForOneDensel::iterator MapProjMatrixElemsForOneDenselIterator;
132 typedef MapProjMatrixElemsForOneDensel::const_iterator const_MapProjMatrixElemsForOneDenselIterator;
133
135 mutable MapProjMatrixElemsForOneDensel cache_collection;
136
138 inline static CacheKey cache_key(const Densel& Densel);
139};
140
141END_NAMESPACE_STIR
142
144
145#endif // __ProjMatrixByDensel_H__
Declaration of class stir::DataSymmetriesForDensels.
Declaration of typedef stir::Densel.
Declaration of class stir::ProjDataInfo.
Implementations of inline functions for class ProjMatrixByDensel.
Declaration of class stir::ProjMatrixElemsForOneDensel.
Declaration of class stiir::RegisteredObject.
A class for encoding/finding symmetries common to the geometry of the projection data and the discret...
Definition DataSymmetriesForDensels.h:51
This abstract class is the basis for all image representations.
Definition DiscretisedDensity.h:99
This is the (abstract) base class for all projection matrices which are organised by 'Densel'.
Definition ProjMatrixByDensel.h:49
ProjMatrixByDensel()
default ctor (enables caching)
Definition ProjMatrixByDensel.cxx:25
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.
Succeeded get_cached_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel &) const
The method that tries to get data from the cache.
Definition ProjMatrixByDensel.cxx:31
void cache_proj_matrix_elems_for_one_densel(const ProjMatrixElemsForOneDensel &) const
The method to store data in the cache.
Definition ProjMatrixByDensel.inl:76
virtual const DataSymmetriesForDensels * get_symmetries_ptr() const =0
get a pointer to an object encoding all symmetries that are used by this ProjMatrixByDensel
virtual void calculate_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel &) const =0
This method needs to be implemented in the derived class.
void get_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel &, const Densel &) const
The main method for getting a column of the matrix.
Definition ProjMatrixByDensel.inl:24
This stores the non-zero projection matrix elements for every 'voxel'.
Definition ProjMatrixElemsForOneDensel.h:60
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition Succeeded.h:44
Coordinate3D< int > Densel
a typedef used for an element of a DiscretisedDensity
Definition Densel.h:36
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...