STIR  6.2.0
Public Member Functions | Static Public Attributes | List of all members
stir::ProjMatrixByBinUsingRayTracing Class Reference

Computes projection matrix elements for VoxelsOnCartesianGrid images by using a Length of Intersection (LOI) model. More...

#include "stir/recon_buildblock/ProjMatrixByBinUsingRayTracing.h"

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

Public Member Functions

 ProjMatrixByBinUsingRayTracing ()
 Default constructor (calls set_defaults())
 
void set_up (const shared_ptr< const ProjDataInfo > &proj_data_info_ptr, const shared_ptr< const DiscretisedDensity< 3, float >> &density_info_ptr) override
 Stores all necessary geometric info. More...
 
ProjMatrixByBinUsingRayTracingclone () const override
 
If a cylindrical FOV or the whole image will be handled
bool get_restrict_to_cylindrical_FOV () const
 
void set_restrict_to_cylindrical_FOV (bool)
 
How many rays will be traced in tangential direction for one bin
int get_num_tangential_LORs () const
 
void set_num_tangential_LORs (int)
 
If interleaved sinogram coordinates are used or not.
bool get_use_actual_detector_boundaries () const
 
void set_use_actual_detector_boundaries (bool)
 
Which symmetries will be used
bool get_do_symmetry_90degrees_min_phi () const
 
void set_do_symmetry_90degrees_min_phi (bool)
 
bool get_do_symmetry_180degrees_min_phi () const
 
void set_do_symmetry_180degrees_min_phi (bool)
 
bool get_do_symmetry_swap_segment () const
 
void set_do_symmetry_swap_segment (bool)
 
bool get_do_symmetry_swap_s () const
 
void set_do_symmetry_swap_s (bool)
 
bool get_do_symmetry_shift_z () const
 
void set_do_symmetry_shift_z (bool)
 
- Public Member Functions inherited from stir::RegisteredParsingObject< ProjMatrixByBinUsingRayTracing, ProjMatrixByBin, ProjMatrixByBin >
std::string get_registered_name () const override
 Returns Derived::registered_name.
 
std::string parameter_info () override
 Returns a string with all parameters and their values, in a form suitable for parsing again.
 
- Public Member Functions inherited from stir::ProjMatrixByBin
const DataSymmetriesForBinsget_symmetries_ptr () const
 get a pointer to an object encoding all symmetries that are used by this ProjMatrixByBin
 
const shared_ptr< DataSymmetriesForBinsget_symmetries_sptr () const
 get a shared_ptr to an object encoding all symmetries that are used by this ProjMatrixByBin
 
void get_proj_matrix_elems_for_one_bin (ProjMatrixElemsForOneBin &, const Bin &) const
 The main method for getting a row of the matrix. More...
 
void enable_cache (const bool v=true)
 
void store_only_basic_bins_in_cache (const bool v=true)
 
bool is_cache_enabled () const
 
bool does_cache_store_only_basic_bins () const
 
void clear_cache () const
 Remove all elements from the cache.
 
- Public Member Functions inherited from stir::ParsingObject
 ParsingObject (const ParsingObject &)
 
ParsingObjectoperator= (const ParsingObject &)
 
void ask_parameters ()
 
bool parse (std::istream &f)
 
bool parse (const char *const filename)
 
- Public Member Functions inherited from stir::TimedObject
void reset_timers ()
 reset all timers kept by this object
 
void stop_timers () const
 stop all timers kept by this object More...
 
void start_timers (bool do_reset=false) const
 start all timers kept by this object More...
 
double get_CPU_timer_value () const
 get current value of the CPU timer (since first use or last reset)
 
double get_wall_clock_timer_value () const
 get current value of the wall-clock timer (since first use or last reset)
 

Static Public Attributes

static const char *const registered_name = "Ray Tracing"
 Name which will be used when parsing a ProjMatrixByBin object.
 

Additional Inherited Members

- Static Public Member Functions inherited from stir::RegisteredParsingObject< ProjMatrixByBinUsingRayTracing, ProjMatrixByBin, ProjMatrixByBin >
static ProjMatrixByBinread_from_stream (std::istream *)
 Construct a new object (of type Derived) by parsing the istream. More...
 
- Static Public Member Functions inherited from stir::RegisteredObject< ProjMatrixByBin >
static ProjMatrixByBinread_registered_object (std::istream *in, const std::string &registered_name)
 Construct a new object (of a type derived from Root, its actual type determined by the registered_name parameter) by parsing the istream. More...
 
static ProjMatrixByBinask_type_and_parameters ()
 ask the user for the type, and then calls read_registered_object(0, type) More...
 
static void list_registered_names (std::ostream &stream)
 List all possible registered names to the stream. More...
 
- Protected Types inherited from stir::RegisteredObject< ProjMatrixByBin >
typedef ProjMatrixByBin *(* RootFactory) (std::istream *)
 The type of a root factory is a function, taking an istream* as argument, and returning a Root*.
 
typedef FactoryRegistry< std::string, RootFactory, interfile_lessRegistryType
 The type of the registry.
 
- Protected Member Functions inherited from stir::ProjMatrixByBin
 ProjMatrixByBin ()
 default ctor (calls set_defaults()) More...
 
Succeeded get_cached_proj_matrix_elems_for_one_bin (ProjMatrixElemsForOneBin &) const
 The method that tries to get data from the cache. More...
 
void cache_proj_matrix_elems_for_one_bin (const ProjMatrixElemsForOneBin &) const
 The method to store data in the cache.
 
- Protected Member Functions inherited from stir::ParsingObject
virtual void set_key_values ()
 This will be called before parsing or parameter_info is called. More...
 
- Static Protected Member Functions inherited from stir::RegisteredObject< ProjMatrixByBin >
static RegistryTyperegistry ()
 Static function returning the registry. More...
 
- Protected Attributes inherited from stir::ProjMatrixByBin
shared_ptr< DataSymmetriesForBinssymmetries_sptr
 
bool cache_disabled
 
bool cache_stores_only_basic_bins
 
bool tof_enabled
 If activated TOF reconstruction will be performed.
 
shared_ptr< const VoxelsOnCartesianGrid< float > > image_info_sptr
 We need a local copy of the discretised density in order to find the cartesian coordinates of each voxel.
 
shared_ptr< const ProjDataInfoproj_data_info_sptr
 We need a local copy of the proj_data_info to get the integration boundaries and RayTracing.
 
- Protected Attributes inherited from stir::ParsingObject
KeyParser parser
 

Detailed Description

Computes projection matrix elements for VoxelsOnCartesianGrid images by using a Length of Intersection (LOI) model.

Currently, the LOIs are divided by voxel_size.x(), unless NEWSCALE is #defined during compilation time of ProjMatrixByBinUsingRayTracing.cxx.

It is possible to use multiple LORs in tangential direction. The result will then be the average of the various contributions. Currently all these LORs are parallel. For a very high number of LORs, the result approximates a strip integral (in tangential direction).

If the z voxel size is exactly twice the sampling in axial direction, 2 or 3 LORs are used, to avoid missing voxels. (TODOdoc describe how).

If use_actual_detector_boundaries is set (currently only possible for non-arccorrected data, without mashing and/or axial compression), the detectors are assumed to be on a cylinder. If only a single LOR in tangential direction is used for ray tracing, the centre of those detectors is used, which is slightly different from the 'usual' LOR (due to interleaving of the sinogram). When multiple LORs are used, the actual detector sizes are used, such that the resulting strip is twice as wide.

It is possible to use a cylindrical or cuboid FOV (in the latter case it is going to be square in transaxial direction). In both cases, the FOV is slightly 'inside' the image (i.e. it is about 1 voxel at each side smaller than the maximum possible).

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 "do symmetry 90degrees min phi", "do symmetry 180degrees min phi" allow to select if all 4 angles should be considered as related.

Enabling more symmetries (from DataSymmetriesForBins_PET_CartesianGrid) means that less memory is needed to store the matrix (when caching), less time to compute it, but using the matrix might be slightly slower. By default, as many symmetries as possible are enabled.

Parsing parameters

The following parameters can be set (default values are indicated):

Ray Tracing Matrix Parameters :=
; any parameters appropriate for class ProjMatrixByBin
restrict to cylindrical FOV := 1
number of rays in tangential direction to trace for each bin := 1
use actual detector boundaries := 0
do symmetry 90degrees min phi := 1
do symmetry 180degrees min phi := 1
do_symmetry_swap_segment := 1
do_symmetry_swap_s := 1
do_symmetry_shift_z := 1
End Ray Tracing Matrix Parameters :=
Implementation details

The implementation uses RayTraceVoxelsOnCartesianGrid().

Warning
After calling any of the set functions or parsing, you have to call setup(), otherwise using the matrix will result in a call to error().
Only appropriate for VoxelsOnCartesianGrid type of images (otherwise error() will be called).
Care should be taken to select the number of rays in tangential direction such that the sampling is at least as small as the x,y voxel sizes.
Current implementation assumes that z voxel size is either smaller than or exactly twice the sampling in axial direction of the segments.
Bug:
Currently, strange things happen if the z voxel size is not exactly equal to half the ring spacing of the scanner.

Member Function Documentation

◆ set_up()

void stir::ProjMatrixByBinUsingRayTracing::set_up ( const shared_ptr< const ProjDataInfo > &  proj_data_info_ptr,
const shared_ptr< const DiscretisedDensity< 3, float >> &  density_info_ptr 
)
overridevirtual

Stores all necessary geometric info.

Note that the density_info_ptr is not stored in this object. It's only used to get some info on sizes etc.

Implements stir::ProjMatrixByBin.

References stir::error(), stir::info(), and stir::warning().


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