STIR  6.2.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 
30 START_NAMESPACE_STIR
31 
32 class RelatedDensels;
33 template <int num_dimensions, typename elemT>
34 class DiscretisedDensity;
35 class Succeeded;
36 
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 {
61 public:
70 
71 private:
73  typedef std::vector<value_type> Element_vector;
74 
75 public:
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 
131  ProjMatrixElemsForOneDensel& operator*=(const float d);
133  ProjMatrixElemsForOneDensel& operator/=(const float d);
134 
136 
138  void sort();
139 
141 
144  // TODO make sure we can have a const argument
145  void merge(ProjMatrixElemsForOneDensel& lor);
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
160  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 
176 private:
177  std::vector<value_type> elements;
178  Densel densel;
179 
181  inline iterator erase(iterator it);
182 };
183 
184 END_NAMESPACE_STIR
185 
187 
188 #endif
This stores the non-zero projection matrix elements for every &#39;voxel&#39;.
Definition: ProjMatrixElemsForOneDensel.h:59
ProjMatrixElemsForOneDenselValue value_type
Recommended way to call the type of the elements, instead of referring to the actual classname...
Definition: ProjMatrixElemsForOneDensel.h:69
Element_vector::iterator iterator
typedefs for iterator support
Definition: ProjMatrixElemsForOneDensel.h:77
Declaration of typedef stir::Densel.
Stores voxel coordinates and the value of the matrix element.
Definition: ProjMatrixElemsForOneDenselValue.h:41
Inline implementations for class stir::ProjMatrixElemsForOneDensel.
Declaration of class stir::ProjMatrixElemsForOneDenselValue.
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
This class contains all information about a set of densels related by symmetry.
Definition: RelatedDensels.h:40