STIR 6.4.0
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 >:

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
 
 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
 
int get_basic_view_num () const
 get 'basic' view_num
 
int get_basic_segment_num () const
 get 'basic' segment_num
 
int get_basic_timing_pos_num () const
 get 'basic' timing_pos_num
 
ViewgramIndices get_basic_view_segment_num () const
 get 'basic' view_segment_num
 
ViewgramIndices get_basic_viewgram_indices () const
 get 'basic' viewgram indices
 
int get_num_viewgrams () const
 returns the number of viewgrams in this object
 
int get_num_axial_poss () const
 
int get_min_axial_pos_num () const
 
int get_max_axial_pos_num () const
 
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.
 
void grow (const IndexRange< 2 > &range)
 Grow each viewgram.
 
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.
 
RelatedViewgramsoperator/= (const elemT)
 Division of all data elements by a constant.
 
RelatedViewgramsoperator+= (const elemT)
 Addition of all data elements by a constant.
 
RelatedViewgramsoperator-= (const elemT)
 Subtraction of all data elements by a constant.
 
RelatedViewgramsoperator*= (const RelatedViewgrams< elemT > &)
 Element-wise multiplication with another RelatedViewgram object.
 
RelatedViewgramsoperator/= (const RelatedViewgrams< elemT > &)
 Element-wise division by another RelatedViewgram object.
 
RelatedViewgramsoperator+= (const RelatedViewgrams< elemT > &)
 Element-wise addition by another RelatedViewgram object.
 
RelatedViewgramsoperator-= (const RelatedViewgrams< elemT > &)
 Element-wise subtraction by another RelatedViewgram object.
 
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

class ProjData
 
class ProjDataInfo
 
bool has_same_characteristics (self_type const &, std::string &explanation) const
 Checks if the 2 objects have the proj_data_info, segment_num etc.
 
bool has_same_characteristics (self_type const &) const
 Checks if the 2 objects have the proj_data_info, segment_num etc.
 
bool operator== (const self_type &) const
 check equality (data has to be identical)
 
bool operator!= (const self_type &) const
 negation of operator==
 

Additional Inherited Members

- Public Member Functions inherited from stir::DataWithProjDataInfo
 DataWithProjDataInfo ()
 Default constructor sets internal member to 0.
 
 DataWithProjDataInfo (const shared_ptr< const ProjDataInfo > &proj_data_info_sptr_v)
 
virtual const ProjDataInfoget_proj_data_info () const
 
virtual shared_ptr< const ProjDataInfoget_proj_data_info_sptr () const
 Get shared pointer to ProjData info.
 
int get_num_segments () const
 Get number of segments.
 
int get_num_axial_poss (const int segment_num) const
 Get number of axial positions per segment.
 
int get_num_views () const
 Get number of views.
 
int get_num_tangential_poss () const
 Get number of tangential positions.
 
int get_num_tof_poss () const
 Get number of TOF positions.
 
int get_min_tof_pos_num () const
 Get the index of the first timing position.
 
int get_max_tof_pos_num () const
 Get the index of the last timing position.
 
int get_tof_mash_factor () const
 Get TOG mash factor.
 
int get_min_segment_num () const
 Get minimum segment number.
 
int get_max_segment_num () const
 Get maximum segment number.
 
int get_min_axial_pos_num (const int segment_num) const
 Get mininum axial position per segmnet.
 
int get_max_axial_pos_num (const int segment_num) const
 Get maximum axial position per segment.
 
int get_min_view_num () const
 Get minimum view number.
 
int get_max_view_num () const
 Get maximum view number.
 
int get_min_tangential_pos_num () const
 Get minimum tangential position number.
 
int get_max_tangential_pos_num () const
 Get maximum tangential position number.
 
- Protected Attributes inherited from stir::DataWithProjDataInfo
shared_ptr< const ProjDataInfoproj_data_info_sptr
 

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

◆ get_basic_timing_pos_num()

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

◆ get_basic_view_segment_num()

◆ 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'

Referenced by get_basic_view_segment_num().

◆ 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

◆ 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.

References begin(), end(), stir::VectorWithOffset< T >::get_max_index(), stir::VectorWithOffset< T >::get_min_index(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), grow(), and stir::IndexRange< num_dimensions >::is_regular().

Referenced by stir::FBP3DRPReconstruction::do_grow3D_viewgram(), and grow().

◆ 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!)

References begin(), end(), and operator*=().

Referenced by operator*=(), and operator*=().

◆ 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)

References operator/=().

Referenced by operator/=(), and operator/=().

◆ 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!)

References begin(), end(), and operator+=().

Referenced by operator+=(), and operator+=().

◆ 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!)

References operator-=().

Referenced by operator-=(), and operator-=().

◆ 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!)

References begin(), end(), get_num_viewgrams(), operator*=(), and RelatedViewgrams().

◆ 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)

References begin(), end(), get_num_viewgrams(), operator/=(), and RelatedViewgrams().

◆ 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!)

References begin(), end(), get_num_viewgrams(), operator+=(), and RelatedViewgrams().

◆ 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!)

References begin(), end(), get_num_viewgrams(), operator-=(), and RelatedViewgrams().

◆ 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.

References get_basic_segment_num(), get_basic_view_num(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), get_symmetries_ptr(), and has_same_characteristics().

Referenced by has_same_characteristics(), and has_same_characteristics().

◆ 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.

References has_same_characteristics().

◆ 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.

References operator==().

Referenced by operator==().


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