STIR  6.2.0
Public Types | Public Member Functions | List of all members
stir::ProjMatrixElemsForOneDensel Class Reference

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. More...
 
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_typereference
 
typedef const value_typeconst_reference
 

Public Member Functions

 ProjMatrixElemsForOneDensel ()
 constructor
 
 ProjMatrixElemsForOneDensel (const Densel &Densel, const int default_capacity=300)
 
Succeeded check_state () const
 check if each voxel occurs only once
 
const Denselget_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 More...
 
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
 
ProjMatrixElemsForOneDenseloperator*= (const float d)
 Multiplies all values with a constant.
 
ProjMatrixElemsForOneDenseloperator/= (const float d)
 Divides all values with a constant.
 
void sort ()
 Sort the elements on coordinates of the voxels. More...
 
void merge (ProjMatrixElemsForOneDensel &lor)
 merge 2nd lor into current object More...
 
float square_sum () const
 Return sum of squares of all values. More...
 

Detailed Description

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?).

Member Typedef Documentation

◆ value_type

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.

Constructor & Destructor Documentation

◆ ProjMatrixElemsForOneDensel()

stir::ProjMatrixElemsForOneDensel::ProjMatrixElemsForOneDensel ( const Densel Densel,
const int  default_capacity = 300 
)
explicit
Parameters
Denseleffectively calls set_densel(Densel)
default_capacityeffectively calls reserve(default_capacity)

Member Function Documentation

◆ push_back()

void stir::ProjMatrixElemsForOneDensel::push_back ( const value_type el)
inline

add a new value_type object at the end

Warning
For future compatibility, it is required (but not checked) that the elements are added such that calling sort() after the push_back() would not change the order of the elements. Otherwise, schemes for 'incremental' storing of coordinates would require too much overhead.

Referenced by stir::ProjMatrixByDenselOnCartesianGridUsingElement::calculate_proj_matrix_elems_for_one_densel(), and merge().

◆ sort()

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().

◆ merge()

void stir::ProjMatrixElemsForOneDensel::merge ( ProjMatrixElemsForOneDensel lor)

merge 2nd lor into current object

This makes sure that in the result, no duplicate coordinates occur.

Warning
This currently modifies the argument lor.

References begin(), check_state(), stir::ProjMatrixElemsForOneDenselValue::coordinates_equal(), erase(), push_back(), and size().

◆ square_sum()

float stir::ProjMatrixElemsForOneDensel::square_sum ( ) const

Return sum of squares of all values.

Warning
This sums over all elements in the LOR, irrespective if they are inside the FOV or not

References begin(), and stir::square().


The documentation for this class was generated from the following files: