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

Symmetries appropriate for a (cylindrical) PET scanner, and a discretised density on a Cartesian grid. More...

#include "stir/recon_buildblock/DataSymmetriesForBins_PET_CartesianGrid.h"

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

Public Member Functions

 DataSymmetriesForBins_PET_CartesianGrid (const shared_ptr< const ProjDataInfo > &proj_data_info_ptr, const shared_ptr< const DiscretisedDensity< 3, float >> &image_info_ptr, const bool do_symmetry_90degrees_min_phi=true, const bool do_symmetry_180degrees_min_phi=true, const bool do_symmetry_swap_segment=true, const bool do_symmetry_swap_s=true, const bool do_symmetry_shift_z=true)
 Constructor with optional selection of symmetries. More...
 
DataSymmetriesForBins_PET_CartesianGridclone () const override
 
virtual bool operator== (const DataSymmetriesForBins_PET_CartesianGrid &) const
 Check equality.
 
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 override
 fills in a vector with the axial and tangential position numbers related to this bin More...
 
int num_related_bins (const Bin &b) const override
 returns the number of bins related to 'b' More...
 
unique_ptr< SymmetryOperationfind_symmetry_operation_from_basic_bin (Bin &) const override
 given an arbitrary bin 'b', find the basic bin and the corresponding symmetry operation More...
 
bool find_basic_bin (Bin &b) const override
 given an arbitrary bin 'b', find the basic bin More...
 
int num_related_view_segment_numbers (const ViewSegmentNumbers &vs) const override
 returns the number of view_segment_numbers related to 'v_s' More...
 
void get_related_view_segment_numbers (std::vector< ViewSegmentNumbers > &rel_vs, const ViewSegmentNumbers &vs) const override
 fills in a vector with all the view/segments that are related to 'v_s' (including itself)
 
bool find_basic_view_segment_numbers (ViewSegmentNumbers &v_s) const override
 given an arbitrary view/segment, find the basic view/segment More...
 
float get_num_planes_per_scanner_ring () const
 find out how many image planes there are for every scanner ring
 
float get_num_planes_per_axial_pos (const int segment_num) const
 find correspondence between axial_pos_num and image coordinates More...
 
float get_axial_pos_to_z_offset (const int segment_num) const
 
Methods to find out which symmetries are used
bool using_symmetry_90degrees_min_phi () const
 
bool using_symmetry_180degrees_min_phi () const
 
bool using_symmetry_swap_segment () const
 
bool using_symmetry_swap_s () const
 
bool using_symmetry_shift_z () const
 
- Public Member Functions inherited from stir::DataSymmetriesForBins
 DataSymmetriesForBins (const shared_ptr< const ProjDataInfo > &proj_data_info_ptr)
 
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 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...
 
std::size_t num_related_viewgram_indices (const ViewgramIndices &ind) const
 
virtual bool is_basic (const ViewSegmentNumbers &v_s) const
 test if a view/segment is 'basic' More...
 

Additional Inherited Members

- Protected Types inherited from stir::DataSymmetriesForViewSegmentNumbers
typedef DataSymmetriesForViewSegmentNumbers root_type
 
- Protected Attributes inherited from stir::DataSymmetriesForBins
const shared_ptr< const ProjDataInfoproj_data_info_ptr
 Member storing the info needed by get_related_bins() et al.
 

Detailed Description

Symmetries appropriate for a (cylindrical) PET scanner, and a discretised density on a Cartesian grid.

Nearly all operations (except the constructor) are inline as timing of the methods of this class is critical.

Constructor & Destructor Documentation

◆ DataSymmetriesForBins_PET_CartesianGrid()

stir::DataSymmetriesForBins_PET_CartesianGrid::DataSymmetriesForBins_PET_CartesianGrid ( const shared_ptr< const ProjDataInfo > &  proj_data_info_ptr,
const shared_ptr< const DiscretisedDensity< 3, float >> &  image_info_ptr,
const bool  do_symmetry_90degrees_min_phi_v = true,
const bool  do_symmetry_180degrees_min_phi_v = true,
const bool  do_symmetry_swap_segment_v = true,
const bool  do_symmetry_swap_s_v = true,
const bool  do_symmetry_shift_z = true 
)

Constructor with optional selection of symmetries.

For the azimuthal angle phi, the following angles are symmetry related for a square grid: {phi, 180-phi, 90-phi, 90+phi}. The boolean parameters allow to select which angles should be considered as related:

  • azimuthal
    • all 4: (do_symmetry_90degrees_min_phi=true)
    • only {phi, 180-phi} : (do_symmetry_90degrees_min_phi=false, do_symmetry_180degrees_min_phi = true)
    • none: (do_symmetry_90degrees_min_phi=false, do_symmetry_180degrees_min_phi = false)
  • axial (i.e. positive vs. negative segment): do_symmetry_swap_segment
  • tangential (i.e. positive vs negative s): do_symmetry_swap_s
  • axial shift do_symmetry_shift_z

Note that when do_symmetry_90degrees_min_phi=true, the value of do_symmetry_180degrees_min_phi is irrelevant. This is because otherwise a non-consecutive range in phi would have to be used.

The symmetry in phi is automatically reduced for non-square grids or when the number of views is not a multiple of 4.

The DiscretisedDensity pointer has to point to an object of type DiscretisedDensityOnCartesianGrid (or a derived type).

We really need only the geometrical info from the image. At the moment we have to use the data itself as well.

References stir::error(), stir::ProjDataInfoCylindrical::get_average_ring_difference(), stir::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing(), stir::ProjDataInfo::get_max_segment_num(), stir::ProjDataInfo::get_min_segment_num(), stir::info(), stir::VectorWithOffset< T >::resize(), stir::round(), and stir::warning().

Member Function Documentation

◆ get_related_bins_factorised()

void stir::DataSymmetriesForBins_PET_CartesianGrid::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
inlineoverridevirtual

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

Implements stir::DataSymmetriesForBins.

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

◆ num_related_bins()

int stir::DataSymmetriesForBins_PET_CartesianGrid::num_related_bins ( const Bin b) const
inlineoverridevirtual

returns the number of bins related to 'b'

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

Reimplemented from stir::DataSymmetriesForBins.

References stir::Bin::axial_pos_num(), stir::ProjDataInfoCylindrical::get_ring_pair_for_segment_axial_pos_num(), stir::SegmentIndices::segment_num(), stir::Bin::tangential_pos_num(), and stir::ViewgramIndices::view_num().

◆ find_symmetry_operation_from_basic_bin()

unique_ptr< SymmetryOperation > stir::DataSymmetriesForBins_PET_CartesianGrid::find_symmetry_operation_from_basic_bin ( Bin ) const
inlineoverridevirtual

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

Implements stir::DataSymmetriesForBins.

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

◆ find_basic_bin()

bool stir::DataSymmetriesForBins_PET_CartesianGrid::find_basic_bin ( Bin b) const
inlineoverridevirtual

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 from stir::DataSymmetriesForBins.

References stir::Bin::axial_pos_num(), stir::SegmentIndices::segment_num(), stir::Bin::tangential_pos_num(), stir::SegmentIndices::timing_pos_num(), and stir::ViewgramIndices::view_num().

◆ num_related_view_segment_numbers()

int stir::DataSymmetriesForBins_PET_CartesianGrid::num_related_view_segment_numbers ( const ViewSegmentNumbers v_s) const
inlineoverridevirtual

returns the number of view_segment_numbers related to 'v_s'

The default implementation is in terms of get_related_view_segment_numbers, which will be slow of course

Reimplemented from stir::DataSymmetriesForViewSegmentNumbers.

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

◆ find_basic_view_segment_numbers()

bool stir::DataSymmetriesForBins_PET_CartesianGrid::find_basic_view_segment_numbers ( ViewSegmentNumbers v_s) const
inlineoverridevirtual

given an arbitrary view/segment, find the basic view/segment

sets 'v_s' to the corresponding 'basic' view/segment and returns true if 'v_s' is changed (i.e. it was NOT a basic view/segment).

Implements stir::DataSymmetriesForViewSegmentNumbers.

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

◆ get_num_planes_per_axial_pos()

float stir::DataSymmetriesForBins_PET_CartesianGrid::get_num_planes_per_axial_pos ( const int  segment_num) const
inline

find correspondence between axial_pos_num and image coordinates

z = num_planes_per_axial_pos * axial_pos_num + axial_pos_to_z_offset

compute the offset by matching up the centre of the scanner in the 2 coordinate systems


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