STIR  6.2.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
stir::DataSymmetriesForBins Class Referenceabstract

A class for encoding/finding symmetries common to the geometry of the projection data and the discretised density. More...

#include "stir/recon_buildblock/DataSymmetriesForBins.h"

Inheritance diagram for stir::DataSymmetriesForBins:
Inheritance graph
[legend]

Public Member Functions

 DataSymmetriesForBins (const shared_ptr< const ProjDataInfo > &proj_data_info_ptr)
 
DataSymmetriesForBinsclone () const override=0
 
void get_related_bins (std::vector< Bin > &, const Bin &b) const
 fills in a vector with all the bins that are related to 'b' (including itself) More...
 
virtual void get_related_bins (std::vector< Bin > &, const Bin &b, const int min_axial_pos_num, const int max_axial_pos_num, const int min_tangential_pos_num, const int max_tangential_pos_num, const int min_timing_pos_num, const int max_timing_pos_num) const
 fills in a vector with all the bins (within the range) that are related to 'b' More...
 
void get_related_bins_factorised (std::vector< AxTangPosNumbers > &, const Bin &b) const
 fills in a vector with the axial and tangential position numbers related to this bin More...
 
virtual void get_related_bins_factorised (std::vector< AxTangPosNumbers > &, const Bin &b, const int min_axial_pos_num, const int max_axial_pos_num, const int min_tangential_pos_num, const int max_tangential_pos_num) const =0
 fills in a vector with the axial and tangential position numbers related to this bin More...
 
virtual int num_related_bins (const Bin &b) const
 returns the number of bins related to 'b' More...
 
virtual unique_ptr< SymmetryOperationfind_symmetry_operation_from_basic_bin (Bin &) const =0
 given an arbitrary bin 'b', find the basic bin and the corresponding symmetry operation More...
 
virtual bool find_basic_bin (Bin &b) const
 given an arbitrary bin 'b', find the basic bin More...
 
virtual bool is_basic (const Bin &v_s) const
 test if a bin is 'basic' More...
 
virtual unique_ptr< SymmetryOperationfind_symmetry_operation_from_basic_view_segment_numbers (ViewSegmentNumbers &) const
 default implementation in terms of find_symmetry_operation_from_basic_bin
 
- Public Member Functions inherited from stir::DataSymmetriesForViewSegmentNumbers
bool operator== (const DataSymmetriesForViewSegmentNumbers &) const
 Check equality. More...
 
bool operator!= (const DataSymmetriesForViewSegmentNumbers &) const
 Check inequality. More...
 
virtual void get_related_view_segment_numbers (std::vector< ViewSegmentNumbers > &, const ViewSegmentNumbers &v_s) const =0
 fills in a vector with all the view/segments that are related to 'v_s' (including itself)
 
virtual int num_related_view_segment_numbers (const ViewSegmentNumbers &v_s) const
 returns the number of view_segment_numbers related to 'v_s' More...
 
std::size_t num_related_viewgram_indices (const ViewgramIndices &ind) const
 
virtual bool find_basic_view_segment_numbers (ViewSegmentNumbers &v_s) const =0
 given an arbitrary view/segment, find the basic view/segment More...
 
virtual bool is_basic (const ViewSegmentNumbers &v_s) const
 test if a view/segment is 'basic' More...
 

Protected Member Functions

bool blindly_equals (const root_type *const) const override=0
 Check equality.
 

Protected Attributes

const shared_ptr< const ProjDataInfoproj_data_info_ptr
 Member storing the info needed by get_related_bins() et al.
 

Additional Inherited Members

- Protected Types inherited from stir::DataSymmetriesForViewSegmentNumbers
typedef DataSymmetriesForViewSegmentNumbers root_type
 

Detailed Description

A class for encoding/finding symmetries common to the geometry of the projection data and the discretised density.

This class is mainly (only?) useful for ProjMatrixByBin classes and their 'users'. Together with SymmetryOperation, it provides the basic way to be able to write generic code without knowing which particular symmetries the data have.

Todo:
I have used Bin here to have the 4 coordinates, but Bin has data as well which is not really necessary here.

Member Function Documentation

◆ get_related_bins() [1/2]

void stir::DataSymmetriesForBins::get_related_bins ( std::vector< Bin > &  rel_b,
const Bin b 
) const
inline

fills in a vector with all the bins that are related to 'b' (including itself)

range for axial_pos_num and tangential_pos_num is taken from the ProjDataInfo object passed in the constructor

Warning
b has to be a 'basic' bin

References stir::SegmentIndices::segment_num().

◆ get_related_bins() [2/2]

void stir::DataSymmetriesForBins::get_related_bins ( std::vector< Bin > &  rel_b,
const Bin b,
const int  min_axial_pos_num,
const int  max_axial_pos_num,
const int  min_tangential_pos_num,
const int  max_tangential_pos_num,
const int  min_timing_pos_num,
const int  max_timing_pos_num 
) const
virtual

fills in a vector with all the bins (within the range) that are related to 'b'

Warning
b has to be a 'basic' bin

default implementation in terms of get_related_bins_factorised

Reimplemented in stir::TrivialDataSymmetriesForBins.

References stir::SegmentIndices::segment_num(), and stir::ViewgramIndices::view_num().

◆ get_related_bins_factorised() [1/2]

void stir::DataSymmetriesForBins::get_related_bins_factorised ( std::vector< AxTangPosNumbers > &  ax_tang_poss,
const Bin b 
) const
inline

fills in a vector with the axial and tangential position numbers related to this bin

range for axial_pos_num and tangential_pos_num is taken from the ProjDataInfo object passed in the constructor

Warning
b has to be a 'basic' bin
See also
6 argument version of get_related_bins_factorised()

References stir::SegmentIndices::segment_num().

Referenced by stir::BackProjectorByBinUsingProjMatrixByBin::actual_back_project(), and stir::ForwardProjectorByBinUsingProjMatrixByBin::get_symmetries_used().

◆ get_related_bins_factorised() [2/2]

virtual void stir::DataSymmetriesForBins::get_related_bins_factorised ( std::vector< AxTangPosNumbers > &  ,
const Bin b,
const int  min_axial_pos_num,
const int  max_axial_pos_num,
const int  min_tangential_pos_num,
const int  max_tangential_pos_num 
) const
pure virtual

fills in a vector with the axial and tangential position numbers related to this bin

It is guaranteed (or at least, it should be by the implementation of the derived class) that these AxTangPosNumbers are related for all related ViewSegmentNumbers for this bin.

So, you can find all related bins by calling get_related_ViewSegmentNumbers() and get_related_bins_factorised(), which is what the default implementation does. (A derived class might do this in a more optimal way.)

Warning
b has to be a 'basic' bin

Implemented in stir::DataSymmetriesForBins_PET_CartesianGrid, and stir::TrivialDataSymmetriesForBins.

◆ num_related_bins()

int stir::DataSymmetriesForBins::num_related_bins ( const Bin b) const
virtual

returns the number of bins related to 'b'

default implementation in terms of get_related_bins, will be slow of course

Reimplemented in stir::DataSymmetriesForBins_PET_CartesianGrid, and stir::TrivialDataSymmetriesForBins.

Referenced by stir::PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin< TargetT >::actual_subsets_are_approximately_balanced().

◆ find_symmetry_operation_from_basic_bin()

virtual unique_ptr<SymmetryOperation> stir::DataSymmetriesForBins::find_symmetry_operation_from_basic_bin ( Bin ) const
pure virtual

given an arbitrary bin 'b', find the basic bin and the corresponding symmetry operation

sets 'b' to the corresponding 'basic' bin and returns the symmetry transformation from 'basic' to 'b'.

Implemented in stir::DataSymmetriesForBins_PET_CartesianGrid, and stir::TrivialDataSymmetriesForBins.

Referenced by stir::BackProjectorByBinUsingProjMatrixByBin::actual_back_project(), stir::ProjMatrixElemsForOneBin::back_project(), stir::ProjMatrixElemsForOneBin::forward_project(), and stir::ForwardProjectorByBinUsingProjMatrixByBin::get_symmetries_used().

◆ find_basic_bin()

bool stir::DataSymmetriesForBins::find_basic_bin ( Bin b) const
virtual

given an arbitrary bin 'b', find the basic bin

sets 'b' to the corresponding 'basic' bin and returns true if 'b' is changed (i.e. it was NOT a basic bin).

default implementation in terms of find_symmetry_operation_from_basic_bin

Reimplemented in stir::DataSymmetriesForBins_PET_CartesianGrid, and stir::TrivialDataSymmetriesForBins.

Referenced by stir::BackProjectorByBinUsingProjMatrixByBin::actual_back_project(), and stir::ForwardProjectorByBinUsingProjMatrixByBin::get_symmetries_used().

◆ is_basic()

bool stir::DataSymmetriesForBins::is_basic ( const Bin v_s) const
virtual

test if a bin is 'basic'

The default implementation uses find_basic_bin

Reimplemented in stir::TrivialDataSymmetriesForBins.


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