STIR  6.2.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
stir::Segment< elemT > Class Template Referenceabstract

An (abstract base) class for storing 3d projection dataThis stores a subset of the data accessible via a ProjData object, where the SegmentIndices are fixed. More...

#include "stir/Segment.h"

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

Public Types

enum  StorageOrder { StorageByView, StorageBySino }
 

Public Member Functions

shared_ptr< const ProjDataInfoget_proj_data_info_sptr () const
 Get shared pointer to proj data info.
 
virtual StorageOrder get_storage_order () const =0
 
SegmentIndices get_segment_indices () const
 
int get_segment_num () const
 Get the segment number.
 
int get_timing_pos_num () const
 Get the timing position index.
 
virtual int get_min_axial_pos_num () const =0
 
virtual int get_max_axial_pos_num () const =0
 
virtual int get_min_view_num () const =0
 
virtual int get_max_view_num () const =0
 
virtual int get_min_tangential_pos_num () const =0
 
virtual int get_max_tangential_pos_num () const =0
 
virtual int get_num_axial_poss () const =0
 
virtual int get_num_views () const =0
 
virtual int get_num_tangential_poss () const =0
 
virtual Sinogram< elemT > get_sinogram (int axial_pos_num) const =0
 return a new sinogram, with data set as in the segment
 
virtual Viewgram< elemT > get_viewgram (int view_num) const =0
 return a new viewgram, with data set as in the segment
 
Sinogram< elemT > get_sinogram (const SinogramIndices &s) const
 return a new sinogram, with data set as in the segment
 
Viewgram< elemT > get_viewgram (const ViewgramIndices &) const
 return a new viewgram, with data set as in the segment
 
virtual void set_sinogram (const Sinogram< elemT > &s)=0
 set data in segment according to sinogram s
 
virtual void set_sinogram (const Sinogram< elemT > &s, int axial_pos_num)=0
 set sinogram at a different axial_pos_num
 
virtual void set_viewgram (const Viewgram< elemT > &v)=0
 set data in segment according to viewgram v
 
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...
 
virtual bool operator== (const self_type &) const =0
 check equality (data has to be identical) More...
 
bool operator!= (const self_type &) const
 negation of operator==
 

Protected Member Functions

 Segment (const shared_ptr< const ProjDataInfo > &proj_data_info_sptr_v, const SegmentIndices &)
 

Protected Attributes

shared_ptr< const ProjDataInfoproj_data_info_sptr
 
SegmentIndices _indices
 

Detailed Description

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

An (abstract base) class for storing 3d projection data

This stores a subset of the data accessible via a ProjData object, where the SegmentIndices are fixed.

At the moment, 2 'storage modes' are supported (and implemented as derived classes).

The template argument elemT is used to specify the data-type of the elements of the 3d object.

Member Function Documentation

◆ has_same_characteristics() [1/2]

template<typename elemT >
bool stir::Segment< 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 stir::Segment< elemT >::get_proj_data_info_sptr(), stir::Segment< elemT >::get_segment_num(), and stir::Segment< elemT >::get_timing_pos_num().

Referenced by stir::SegmentBySinogram< elemT >::SegmentBySinogram().

◆ has_same_characteristics() [2/2]

template<typename elemT >
bool stir::Segment< 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>
virtual bool stir::Segment< elemT >::operator== ( const self_type ) const
pure virtual

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: