STIR 6.4.0
ProjMatrixElemsForOneDensel.h
Go to the documentation of this file.
1//
2//
3
4#ifndef __stir_recon_buildblock_ProjMatrixElemsForOneDensel__
5#define __stir_recon_buildblock_ProjMatrixElemsForOneDensel__
6
17/*
18 Copyright (C) 2000- 2009, Hammersmith Imanet Ltd
19 This file is part of STIR.
20
21 SPDX-License-Identifier: Apache-2.0
22
23 See STIR/LICENSE.txt for details
24*/
25
27#include "stir/Densel.h"
28#include <vector>
29
30START_NAMESPACE_STIR
31
32class RelatedDensels;
33template <int num_dimensions, typename elemT>
34class DiscretisedDensity;
35class Succeeded;
36
52
53/*
54 it might be a bit faster to derive this (privately) from
55 std::vector<value_type> as opposed to having a member of
56 that type.
57 TODO: check
58*/
60{
61public:
70
71private:
73 typedef std::vector<value_type> Element_vector;
74
75public:
77 typedef Element_vector::iterator iterator;
78 typedef Element_vector::const_iterator const_iterator;
79 typedef Element_vector::size_type size_type;
80 typedef Element_vector::difference_type difference_type;
81 typedef std::random_access_iterator_tag iterator_category;
82
83 typedef value_type& reference;
84 typedef const value_type& const_reference;
85
92 explicit ProjMatrixElemsForOneDensel(const Densel& Densel, const int default_capacity = 300);
93
94 /* rely on compiler-generated versions
95 ProjMatrixElemsForOneDensel( const ProjMatrixElemsForOneDensel&);
96 ProjMatrixElemsForOneDensel& operator=(const ProjMatrixElemsForOneDensel&) ;
97 */
98
100 Succeeded check_state() const;
101
103 inline const Densel& get_densel() const;
105 inline void set_densel(const Densel&);
106
108 inline iterator begin();
109 inline const_iterator begin() const;
110 inline iterator end();
111 inline const_iterator end() const;
112
114 void erase();
116
124 inline void push_back(const value_type&);
126 void reserve(size_type max_number);
128 inline size_type size() const;
129
134
136
138 void sort();
139
141
144 // TODO make sure we can have a const argument
146
147#if 0
148 void write(fstream&fst) const;
149 void read(fstream&fst );
150#endif
151
153
156 float square_sum() const;
157
158 //******************** projection operations ********************//
159#if 0
161 void back_project(DiscretisedDensity<3,float>&,
162 const Densel&) const;
163
165 void forward_project(Densel&,
166 const DiscretisedDensity<3,float>&) const;
168 void back_project(DiscretisedDensity<3,float>&,
169 const RelatedDensels&) const;
171 void forward_project(RelatedDensels&,
172 const DiscretisedDensity<3,float>&) const;
173
174#endif
175
176private:
177 std::vector<value_type> elements;
178 Densel densel;
179
181 inline iterator erase(iterator it);
182};
183
184END_NAMESPACE_STIR
185
187
188#endif
Declaration of typedef stir::Densel.
Declaration of class stir::ProjMatrixElemsForOneDenselValue.
Inline implementations for class stir::ProjMatrixElemsForOneDensel.
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 ProjMatrixElemsForOneDenselValue.h:42
ProjMatrixElemsForOneDensel()
constructor
Definition ProjMatrixElemsForOneDensel.cxx:38
void erase()
reset lor to 0 length
Definition ProjMatrixElemsForOneDensel.cxx:50
void reserve(size_type max_number)
reserve enough space for max_number elements (but don't fill them in)
Definition ProjMatrixElemsForOneDensel.cxx:44
ProjMatrixElemsForOneDensel & operator/=(const float d)
Divides all values with a constant.
Definition ProjMatrixElemsForOneDensel.cxx:72
void push_back(const value_type &)
add a new value_type object at the end
Definition ProjMatrixElemsForOneDensel.inl:38
void sort()
Sort the elements on coordinates of the voxels.
Definition ProjMatrixElemsForOneDensel.cxx:115
size_type size() const
number of non-zero elements
Definition ProjMatrixElemsForOneDensel.inl:44
Succeeded check_state() const
check if each voxel occurs only once
Definition ProjMatrixElemsForOneDensel.cxx:89
Element_vector::iterator iterator
typedefs for iterator support
Definition ProjMatrixElemsForOneDensel.h:77
iterator begin()
functions for allowing iterator access
Definition ProjMatrixElemsForOneDensel.inl:50
ProjMatrixElemsForOneDenselValue value_type
Recommended way to call the type of the elements, instead of referring to the actual classname.
Definition ProjMatrixElemsForOneDensel.h:69
ProjMatrixElemsForOneDensel & operator*=(const float d)
Multiplies all values with a constant.
Definition ProjMatrixElemsForOneDensel.cxx:56
void set_densel(const Densel &)
and set the Densel coordinates
Definition ProjMatrixElemsForOneDensel.inl:32
void merge(ProjMatrixElemsForOneDensel &lor)
merge 2nd lor into current object
Definition ProjMatrixElemsForOneDensel.cxx:136
float square_sum() const
Return sum of squares of all values.
Definition ProjMatrixElemsForOneDensel.cxx:121
const Densel & get_densel() const
get the Densel coordinates corresponding to this row
Definition ProjMatrixElemsForOneDensel.inl:26
This class contains all information about a set of densels related by symmetry.
Definition RelatedDensels.h:41
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