STIR  6.2.0
Public Member Functions | Friends | List of all members
stir::RelatedViewgrams< elemT > Class Template Reference

A class for storing viewgrams which are related by symmetry. More...

#include "stir/RelatedViewgrams.h"

Inheritance diagram for stir::RelatedViewgrams< elemT >:
Inheritance graph
[legend]

Public Types

typedefs for iterator support
typedef std::random_access_iterator_tag iterator_category
 
typedef Viewgram< elemT > value_type
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef std::ptrdiff_t difference_type
 
typedef std::size_t size_type
 
typedef std::vector< Viewgram< elemT > >::iterator iterator
 
typedef std::vector< Viewgram< elemT > >::const_iterator const_iterator
 

Public Member Functions

 RelatedViewgrams ()
 default constructor (sets everything empty)
 
 RelatedViewgrams (const std::vector< Viewgram< elemT >> &viewgrams, const shared_ptr< DataSymmetriesForViewSegmentNumbers > &symmetries_used)
 a private constructor which simply sets the members More...
 
int get_basic_view_num () const
 get 'basic' view_num More...
 
int get_basic_segment_num () const
 get 'basic' segment_num More...
 
int get_basic_timing_pos_num () const
 get 'basic' timing_pos_num More...
 
ViewgramIndices get_basic_view_segment_num () const
 get 'basic' view_segment_num More...
 
ViewgramIndices get_basic_viewgram_indices () const
 get 'basic' viewgram indices More...
 
int get_num_viewgrams () const
 returns the number of viewgrams in this object
 
int get_num_axial_poss () const
 
int get_num_tangential_poss () const
 
int get_min_axial_pos_num () const
 
int get_max_axial_pos_num () const
 
int get_min_tangential_pos_num () const
 
int get_max_tangential_pos_num () const
 
shared_ptr< const ProjDataInfoget_proj_data_info_sptr () const
 Get shared pointer to proj data info.
 
const DataSymmetriesForViewSegmentNumbersget_symmetries_ptr () const
 Get a pointer to the symmetries used in constructing this object.
 
shared_ptr< DataSymmetriesForViewSegmentNumbersget_symmetries_sptr () const
 Get a shared pointer to the symmetries used in constructing this object. More...
 
void grow (const IndexRange< 2 > &range)
 Grow each viewgram. More...
 
iterator begin ()
 use to initialise an iterator to the first element of the vector
 
iterator end ()
 iterator 'past' the last element of the vector
 
const_iterator begin () const
 use to initialise an iterator to the first element of the (const) vector
 
const_iterator end () const
 iterator 'past' the last element of the (const) vector
 
RelatedViewgramsoperator*= (const elemT)
 Multiplication of all data elements with a constant. More...
 
RelatedViewgramsoperator/= (const elemT)
 Division of all data elements by a constant. More...
 
RelatedViewgramsoperator+= (const elemT)
 Addition of all data elements by a constant. More...
 
RelatedViewgramsoperator-= (const elemT)
 Subtraction of all data elements by a constant. More...
 
RelatedViewgramsoperator*= (const RelatedViewgrams< elemT > &)
 Element-wise multiplication with another RelatedViewgram object. More...
 
RelatedViewgramsoperator/= (const RelatedViewgrams< elemT > &)
 Element-wise division by another RelatedViewgram object. More...
 
RelatedViewgramsoperator+= (const RelatedViewgrams< elemT > &)
 Element-wise addition by another RelatedViewgram object. More...
 
RelatedViewgramsoperator-= (const RelatedViewgrams< elemT > &)
 Element-wise subtraction by another RelatedViewgram object. More...
 
elemT find_max () const
 Find the maximum of all data elements.
 
elemT find_min () const
 Find the maximum of all data elements.
 
void fill (const elemT &n)
 Set all data elements to n.
 
RelatedViewgrams get_empty_copy () const
 Return a new object with ProjDataInfo etc., but all data elements set to 0.
 
Equality
bool has_same_characteristics (self_type const &, std::string &explanation) const
 Checks if the 2 objects have the proj_data_info, segment_num etc. More...
 
bool has_same_characteristics (self_type const &) const
 Checks if the 2 objects have the proj_data_info, segment_num etc. More...
 
bool operator== (const self_type &) const
 check equality (data has to be identical) More...
 
bool operator!= (const self_type &) const
 negation of operator==
 

Friends

class ProjData
 
class ProjDataInfo
 

Detailed Description

template<typename elemT>
class stir::RelatedViewgrams< elemT >

A class for storing viewgrams which are related by symmetry.

Constructor & Destructor Documentation

◆ RelatedViewgrams()

template<typename elemT>
RelatedViewgrams< elemT >::RelatedViewgrams ( const std::vector< Viewgram< elemT >> &  viewgrams,
const shared_ptr< DataSymmetriesForViewSegmentNumbers > &  symmetries_used 
)
inline

a private constructor which simply sets the members

Todo:
Currently public for the STIR_MPI version

Member Function Documentation

◆ get_basic_view_num()

template<typename elemT >
int RelatedViewgrams< elemT >::get_basic_view_num ( ) const
inline

◆ get_basic_segment_num()

template<typename elemT >
int RelatedViewgrams< elemT >::get_basic_segment_num ( ) const
inline

◆ get_basic_timing_pos_num()

template<typename elemT >
int RelatedViewgrams< elemT >::get_basic_timing_pos_num ( ) const
inline

◆ get_basic_view_segment_num()

template<typename elemT >
ViewgramIndices RelatedViewgrams< elemT >::get_basic_view_segment_num ( ) const
inline

◆ get_basic_viewgram_indices()

template<typename elemT >
ViewgramIndices RelatedViewgrams< elemT >::get_basic_viewgram_indices ( ) const
inline

get 'basic' viewgram indices

see DataSymmetriesForViewSegmentNumbers for definition of 'basic'

◆ get_symmetries_sptr()

template<typename elemT >
shared_ptr< DataSymmetriesForViewSegmentNumbers > RelatedViewgrams< elemT >::get_symmetries_sptr ( ) const
inline

Get a shared pointer to the symmetries used in constructing this object.

Warning
It is dangerous to modify the shared symmetries object

Referenced by stir::ArcCorrection::do_arc_correction().

◆ grow()

template<typename elemT >
void RelatedViewgrams< elemT >::grow ( const IndexRange< 2 > &  range)

Grow each viewgram.

This function is necessary because it modifies the size of each viewgram sequentially. This is not allowed by an external function, and leads to different proj_data_info_ptrs anyway. So, it would be caught by an assert at some point.

Referenced by stir::FBP3DRPReconstruction::do_grow3D_viewgram().

◆ operator*=() [1/2]

template<typename elemT>
RelatedViewgrams< elemT > & RelatedViewgrams< elemT >::operator*= ( const elemT  f)

Multiplication of all data elements with a constant.

Warning
: this uses multiplication according to elemT (careful for overflow for integer types!)

◆ operator/=() [1/2]

template<typename elemT>
RelatedViewgrams< elemT > & RelatedViewgrams< elemT >::operator/= ( const elemT  f)

Division of all data elements by a constant.

Warning
: this uses division according to elemT (i.e. no rounding or so)

◆ operator+=() [1/2]

template<typename elemT>
RelatedViewgrams< elemT > & RelatedViewgrams< elemT >::operator+= ( const elemT  f)

Addition of all data elements by a constant.

Warning
: this uses addition according to elemT (careful with overflow with integer types!)

◆ operator-=() [1/2]

template<typename elemT>
RelatedViewgrams< elemT > & RelatedViewgrams< elemT >::operator-= ( const elemT  f)

Subtraction of all data elements by a constant.

Warning
: this uses subtraction according to elemT (careful with unsigned types!)

◆ operator*=() [2/2]

template<typename elemT>
RelatedViewgrams< elemT > & RelatedViewgrams< elemT >::operator*= ( const RelatedViewgrams< elemT > &  arg)

Element-wise multiplication with another RelatedViewgram object.

Warning
: this uses multiplication according to elemT (careful for overflow for integer types!)

◆ operator/=() [2/2]

template<typename elemT>
RelatedViewgrams< elemT > & RelatedViewgrams< elemT >::operator/= ( const RelatedViewgrams< elemT > &  arg)

Element-wise division by another RelatedViewgram object.

Warning
: this uses division according to elemT (i.e. no rounding or so)

◆ operator+=() [2/2]

template<typename elemT>
RelatedViewgrams< elemT > & RelatedViewgrams< elemT >::operator+= ( const RelatedViewgrams< elemT > &  arg)

Element-wise addition by another RelatedViewgram object.

Warning
: this uses addition according to elemT (careful with overflow with integer types!)

◆ operator-=() [2/2]

template<typename elemT>
RelatedViewgrams< elemT > & RelatedViewgrams< elemT >::operator-= ( const RelatedViewgrams< elemT > &  arg)

Element-wise subtraction by another RelatedViewgram object.

Warning
: this uses subtraction according to elemT (careful with unsigned types!)

◆ has_same_characteristics() [1/2]

template<typename elemT >
bool RelatedViewgrams< elemT >::has_same_characteristics ( self_type const &  other,
std::string &  explanation 
) const

Checks if the 2 objects have the proj_data_info, segment_num etc.

If they do not have the same characteristics, the string explanation explains why.

◆ has_same_characteristics() [2/2]

template<typename elemT >
bool RelatedViewgrams< elemT >::has_same_characteristics ( self_type const &  other) const

Checks if the 2 objects have the proj_data_info, segment_num etc.

Use this version if you do not need to know why they do not match.

◆ operator==()

template<typename elemT >
bool RelatedViewgrams< elemT >::operator== ( const self_type that) const

check equality (data has to be identical)

Uses has_same_characteristics() and Array::operator==.

Warning
This function uses ==, which might not be what you need to check when elemT has data with float or double numbers.

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