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

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

#include "stir_experimental/recon_buildblock/ProjMatrixByDenselOnCartesianGridUsingElement.h"

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

Public Member Functions

void set_up (const shared_ptr< const ProjDataInfo > &proj_data_info_ptr, const shared_ptr< const DiscretisedDensity< 3, float >> &density_info_ptr) override
 Stores necessary geometric info. More...
 
virtual float get_element (const Bin &bin, const CartesianCoordinate3D< float > &densel_ctr) const =0
 this member computes a single element of the projection matrix More...
 
- Public Member Functions inherited from stir::ProjMatrixByDensel
virtual const DataSymmetriesForDenselsget_symmetries_ptr () const =0
 get a pointer to an object encoding all symmetries that are used by this ProjMatrixByDensel
 
void get_proj_matrix_elems_for_one_densel (ProjMatrixElemsForOneDensel &, const Densel &) const
 The main method for getting a column of the matrix. More...
 
void enable_cache (bool v)
 
- Public Member Functions inherited from stir::RegisteredObjectBase
virtual std::string get_registered_name () const =0
 Returns the name of the type of the object. More...
 
- Public Member Functions inherited from stir::ParsingObject
 ParsingObject (const ParsingObject &)
 
ParsingObjectoperator= (const ParsingObject &)
 
void ask_parameters ()
 
virtual std::string parameter_info ()
 
bool parse (std::istream &f)
 
bool parse (const char *const filename)
 

Protected Member Functions

void calculate_proj_matrix_elems_for_one_densel (ProjMatrixElemsForOneDensel &) const override
 Calculates all non-zero elements for a particular densel. More...
 
- Protected Member Functions inherited from stir::ProjMatrixByDensel
 ProjMatrixByDensel ()
 default ctor (enables caching)
 
Succeeded get_cached_proj_matrix_elems_for_one_densel (ProjMatrixElemsForOneDensel &) const
 The method that tries to get data from the cache. More...
 
void cache_proj_matrix_elems_for_one_densel (const ProjMatrixElemsForOneDensel &) const
 The method to store data in the cache. More...
 
- Protected Member Functions inherited from stir::ParsingObject
virtual void set_defaults ()
 Set defaults before parsing.
 
virtual void initialise_keymap ()
 Initialise all keywords.
 
virtual bool post_processing ()
 This will be called at the end of the parsing. More...
 
virtual void set_key_values ()
 This will be called before parsing or parameter_info is called. More...
 

Protected Attributes

shared_ptr< const ProjDataInfoproj_data_info_ptr
 
CartesianCoordinate3D< float > grid_spacing
 
CartesianCoordinate3D< float > origin
 
float min_z_index
 
float max_z_index
 
- Protected Attributes inherited from stir::ProjMatrixByDensel
bool cache_disabled
 
- Protected Attributes inherited from stir::ParsingObject
KeyParser parser
 

Additional Inherited Members

- Static Public Member Functions inherited from stir::RegisteredObject< ProjMatrixByDensel >
static ProjMatrixByDenselread_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 ProjMatrixByDenselask_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< ProjMatrixByDensel >
typedef ProjMatrixByDensel *(* 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.
 
- Static Protected Member Functions inherited from stir::RegisteredObject< ProjMatrixByDensel >
static RegistryTyperegistry ()
 Static function returning the registry. More...
 

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 ProjMatrixByDenselOnCartesianGridUsingElement.cxx.

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

Currently, a FOV is used which is circular, and is slightly 'inside' the image (i.e. the radius is about 1 voxel smaller than the maximum possible).

The implementation uses RayTraceVoxelsOnCartesianGrid().

Warning
Only appropriate for VoxelsOnCartesianGrid type of images (otherwise a run-time error occurs).
Current implementation assumes that x,y voxel sizes are at least as large as the sampling in tangential direction, and that z voxel size is either smaller than or exactly twice the sampling in axial direction of the segments.

Member Function Documentation

◆ set_up()

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

Stores necessary geometric info.

This function hsd to be called by any derived class.

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

Currently, the proj_data_info_ptr argument is not used.

Implements stir::ProjMatrixByDensel.

Reimplemented in stir::ProjMatrixByDenselUsingRayTracing.

References stir::error(), stir::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing(), stir::VectorWithOffset< Array< num_dimensions - 1, elemT > >::get_max_index(), stir::VectorWithOffset< Array< num_dimensions - 1, elemT > >::get_min_index(), and stir::DiscretisedDensity< num_dimensions, elemT >::get_origin().

◆ get_element()

virtual float stir::ProjMatrixByDenselOnCartesianGridUsingElement::get_element ( const Bin bin,
const CartesianCoordinate3D< float > &  densel_ctr 
) const
pure virtual

this member computes a single element of the projection matrix

Parameters
binThe bin-coordinates specifying the row of the projection matrix
densel_ctrThe densel coordinates specifying the column of the projection matrix
Returns
returns the value of the element

Ideally, get_element should be implemented such that tiny elements are truncated to 0, to avoid storing (and using) elements that not really contribute to the result.

Warning
Currently, the densel_ctr has to be in mm and w.r.t. the centre of the scanner. This is a bad idea (it should use dicrete coordinates) and so will change in the future. It's there now for the RT projector to avoid recomputing the coordinates per mm fo revery bin.

Implemented in stir::ProjMatrixByDenselUsingRayTracing.

◆ calculate_proj_matrix_elems_for_one_densel()

void stir::ProjMatrixByDenselOnCartesianGridUsingElement::calculate_proj_matrix_elems_for_one_densel ( ProjMatrixElemsForOneDensel probs) const
overrideprotectedvirtual

Calculates all non-zero elements for a particular densel.

This implementation uses the get_element() member. It uses a generic way of finding non-zero elements, which is slow but makes only a few assumptions. TODO more doc.

Implements stir::ProjMatrixByDensel.

References stir::ProjMatrixElemsForOneDensel::get_densel(), stir::ProjMatrixElemsForOneDensel::push_back(), stir::Bin::set_bin_value(), stir::ProjMatrixElemsForOneDensel::size(), stir::square(), and stir::Bin::tangential_pos_num().


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