|
STIR 6.5.0
|
This stores the non-zero projection matrix elements for every 'voxel'. More...
#include "stir/recon_buildblock/ProjMatrixElemsForOneDensel.h"
Public Types | |
| typedef ProjMatrixElemsForOneDenselValue | value_type |
| Recommended way to call the type of the elements, instead of referring to the actual classname. | |
| typedef Element_vector::iterator | iterator |
| typedefs for iterator support | |
| typedef Element_vector::const_iterator | const_iterator |
| typedef Element_vector::size_type | size_type |
| typedef Element_vector::difference_type | difference_type |
| typedef std::random_access_iterator_tag | iterator_category |
| typedef value_type & | reference |
| typedef const value_type & | const_reference |
Public Member Functions | |
| ProjMatrixElemsForOneDensel () | |
| constructor | |
| ProjMatrixElemsForOneDensel (const DenselDensel &DenselDensel, const int default_capacity=300) | |
| Succeeded | check_state () const |
| check if each voxel occurs only once | |
| const Densel & | get_densel () const |
| get the Densel coordinates corresponding to this row | |
| void | set_densel (const Densel &) |
| and set the Densel coordinates | |
| iterator | begin () |
| functions for allowing iterator access | |
| const_iterator | begin () const |
| iterator | end () |
| const_iterator | end () const |
| void | erase () |
| reset lor to 0 length | |
| void | push_back (const value_type &) |
| add a new value_type object at the end | |
| void | reserve (size_type max_number) |
| reserve enough space for max_number elements (but don't fill them in) | |
| size_type | size () const |
| number of non-zero elements | |
| ProjMatrixElemsForOneDensel & | operator*= (const float d) |
| Multiplies all values with a constant. | |
| ProjMatrixElemsForOneDensel & | operator/= (const float d) |
| Divides all values with a constant. | |
| void | sort () |
| Sort the elements on coordinates of the voxels. | |
| void | merge (ProjMatrixElemsForOneDensel &lor) |
| merge 2nd lor into current object | |
| float | square_sum () const |
| Return sum of squares of all values. | |
This stores the non-zero projection matrix elements for every 'voxel'.
Most of the members of this class would work just as well for a (not yet existing) class ProjMatrixElemsForOneVoxel. This means that we should derived both from a common base class, templated in the type of element (TODO).
It might be useful to template this class in terms of the element-type as well. That way, we could have 'compact' elements, efficient elements, etc. However, doing this will probably only be useful if all ProjMatrixByDensel classes are then templated as well (TODO?).
Recommended way to call the type of the elements, instead of referring to the actual classname.
Think about this name as 'the type of the value of a ProjMatrixElemsForOneDensel::iterator *'.
This typedef is also required for 'standard' iterators.
| stir::ProjMatrixElemsForOneDensel::ProjMatrixElemsForOneDensel | ( | ) |
constructor
Referenced by check_state(), merge(), and ProjMatrixElemsForOneDensel().
|
explicit |
| Densel | effectively calls set_densel(Densel) |
| default_capacity | effectively calls reserve(default_capacity) |
References ProjMatrixElemsForOneDensel().
| Succeeded stir::ProjMatrixElemsForOneDensel::check_state | ( | ) | const |
check if each voxel occurs only once
References begin(), stir::ProjMatrixElemsForOneDenselValue::coordinates_equal(), ProjMatrixElemsForOneDensel(), size(), sort(), and stir::warning().
Referenced by stir::ProjMatrixByDensel::get_proj_matrix_elems_for_one_densel(), and merge().
|
inline |
get the Densel coordinates corresponding to this row
References get_densel().
Referenced by stir::ProjMatrixByDensel::cache_proj_matrix_elems_for_one_densel(), stir::ProjMatrixByDenselOnCartesianGridUsingElement::calculate_proj_matrix_elems_for_one_densel(), stir::ProjMatrixByDensel::get_cached_proj_matrix_elems_for_one_densel(), and get_densel().
|
inline |
and set the Densel coordinates
References set_densel().
Referenced by stir::ProjMatrixByDensel::get_proj_matrix_elems_for_one_densel(), and set_densel().
|
inline |
functions for allowing iterator access
References begin().
Referenced by begin(), check_state(), merge(), operator*=(), operator/=(), sort(), and square_sum().
| void stir::ProjMatrixElemsForOneDensel::erase | ( | ) |
reset lor to 0 length
Referenced by stir::ProjMatrixByDensel::get_proj_matrix_elems_for_one_densel(), and merge().
|
inline |
add a new value_type object at the end
References push_back().
Referenced by stir::ProjMatrixByDenselOnCartesianGridUsingElement::calculate_proj_matrix_elems_for_one_densel(), merge(), and push_back().
|
inline |
number of non-zero elements
References size().
Referenced by stir::ProjMatrixByDenselOnCartesianGridUsingElement::calculate_proj_matrix_elems_for_one_densel(), check_state(), and size().
| ProjMatrixElemsForOneDensel & stir::ProjMatrixElemsForOneDensel::operator*= | ( | const float | d | ) |
Multiplies all values with a constant.
References begin().
| ProjMatrixElemsForOneDensel & stir::ProjMatrixElemsForOneDensel::operator/= | ( | const float | d | ) |
Divides all values with a constant.
References begin().
| void stir::ProjMatrixElemsForOneDensel::sort | ( | ) |
Sort the elements on coordinates of the voxels.
Uses value_type::coordinates_less as ordering function.
References begin(), and stir::ProjMatrixElemsForOneDenselValue::coordinates_less().
Referenced by check_state().
| void stir::ProjMatrixElemsForOneDensel::merge | ( | ProjMatrixElemsForOneDensel & | lor | ) |
merge 2nd lor into current object
This makes sure that in the result, no duplicate coordinates occur.
lor. References begin(), check_state(), stir::ProjMatrixElemsForOneDenselValue::coordinates_equal(), erase(), ProjMatrixElemsForOneDensel(), and push_back().
| float stir::ProjMatrixElemsForOneDensel::square_sum | ( | ) | const |
Return sum of squares of all values.
References begin(), and stir::square().