4#ifndef __stir_recon_buildblock_ProjMatrixElemsForOneBin__
5#define __stir_recon_buildblock_ProjMatrixElemsForOneBin__
39template <
int num_dimensions,
typename elemT>
40class DiscretisedDensity;
82 typedef std::vector<value_type> Element_vector;
87 typedef Element_vector::const_iterator const_iterator;
88 typedef Element_vector::reverse_iterator reverse_iterator;
89 typedef Element_vector::const_reverse_iterator const_reverse_iterator;
90 typedef Element_vector::size_type size_type;
91 typedef Element_vector::difference_type difference_type;
92 typedef std::random_access_iterator_tag iterator_category;
119 inline const_iterator
begin()
const;
121 inline const_iterator end()
const;
122 inline reverse_iterator rbegin();
123 inline const_reverse_iterator rbegin()
const;
124 inline reverse_iterator rend();
125 inline const_reverse_iterator rend()
const;
142 void reserve(size_type max_number);
144 inline size_type
size()
const;
175 void write(std::fstream&fst)
const;
176 void read(std::fstream&fst );
198 std::vector<value_type> elements;
Declaration of class stir::Bin.
Declaration of class stir::ProjMatrixElemsForOneBinValue.
Inline implementations for class stir::ProjMatrixelemesForOneBin.
A class for storing coordinates and value of a single projection bin.
Definition Bin.h:49
This abstract class is the basis for all image representations.
Definition DiscretisedDensity.h:99
Stores voxel coordinates and the value of the matrix element.
Definition ProjMatrixElemsForOneBinValue.h:47
ProjMatrixElemsForOneBin & operator*=(const float d)
Multiplies all values with a constant.
Definition ProjMatrixElemsForOneBin.cxx:69
bool operator!=(const ProjMatrixElemsForOneBin &) const
Compare 2 lors.
Definition ProjMatrixElemsForOneBin.cxx:477
size_type size() const
number of non-zero elements
Definition ProjMatrixElemsForOneBin.inl:47
void sort()
Sort the elements on coordinates of the voxels.
Definition ProjMatrixElemsForOneBin.cxx:143
Element_vector::iterator iterator
typedefs for iterator support
Definition ProjMatrixElemsForOneBin.h:86
const Bin & get_bin() const
get the bin coordinates corresponding to this row
Definition ProjMatrixElemsForOneBin.inl:29
void push_back(const value_type &)
add a new value_type object at the end
Definition ProjMatrixElemsForOneBin.inl:41
float square_sum() const
Return sum of squares of all values.
Definition ProjMatrixElemsForOneBin.cxx:149
bool operator==(const ProjMatrixElemsForOneBin &) const
Compare 2 lors to see if they are equal.
Definition ProjMatrixElemsForOneBin.cxx:415
void set_bin(const Bin &)
and set the bin coordinates
Definition ProjMatrixElemsForOneBin.inl:35
iterator begin()
functions for allowing iterator access
Definition ProjMatrixElemsForOneBin.inl:53
ProjMatrixElemsForOneBinValue value_type
Recommended way to call the type of the elements, instead of referring to the actual classname.
Definition ProjMatrixElemsForOneBin.h:78
void reserve(size_type max_number)
reserve enough space for max_number elements (but don't fill them in)
Definition ProjMatrixElemsForOneBin.cxx:51
void back_project(DiscretisedDensity< 3, float > &, const Bin &) const
back project a single bin (accumulates)
Definition ProjMatrixElemsForOneBin.cxx:334
Succeeded check_state() const
check if each voxel occurs only once
Definition ProjMatrixElemsForOneBin.cxx:102
ProjMatrixElemsForOneBin(const Bin &bin=Bin(), const int default_capacity=0)
constructor
Definition ProjMatrixElemsForOneBin.cxx:44
ProjMatrixElemsForOneBin & operator/=(const float d)
Divides all values with a constant.
Definition ProjMatrixElemsForOneBin.cxx:85
void forward_project(Bin &, const DiscretisedDensity< 3, float > &) const
forward project into a single bin (accumulates)
Definition ProjMatrixElemsForOneBin.cxx:355
void merge(ProjMatrixElemsForOneBin &lor)
merge 2nd lor into current object
Definition ProjMatrixElemsForOneBin.cxx:163
void erase()
reset lor to 0 length
Definition ProjMatrixElemsForOneBin.cxx:57
size_type capacity() const
number of allocated elements
Definition ProjMatrixElemsForOneBin.cxx:63
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition Succeeded.h:44