STIR 6.4.0
stir::BackProjectorByBin Class Referenceabstract

Abstract base class for all back projectors. More...

#include "stir/recon_buildblock/BackProjectorByBin.h"

Inheritance diagram for stir::BackProjectorByBin:

Public Member Functions

 BackProjectorByBin ()
 Default constructor calls reset_timers()
 
virtual void set_up (const shared_ptr< const ProjDataInfo > &proj_data_info_ptr, const shared_ptr< const DiscretisedDensity< 3, float > > &density_info_sptr)=0
 Stores all necessary geometric info.
 
virtual const DataSymmetriesForViewSegmentNumbersget_symmetries_used () const =0
 Informs on which symmetries the projector handles It should get data related by at least those symmetries. Otherwise, a run-time error will occur (unless the derived class has other behaviour).
 
void back_project (DiscretisedDensity< 3, float > &, const ProjData &, int subset_num=0, int num_subsets=1)
 project whole proj_data into the volume
 
virtual void back_project (const ProjData &, int subset_num=0, int num_subsets=1)
 projects the viewgrams into the volume it adds to the data backprojected since start_accumulating_in_new_target() was last called.
 
void back_project (const RelatedViewgrams< float > &)
 projects the viewgrams into the volume it adds to the data backprojected since start_accumulating_in_new_target() was last called.
 
void back_project (const RelatedViewgrams< float > &, const int min_axial_pos_num, const int max_axial_pos_num)
 projects the specified range of the viewgrams and axial positions into the volume it adds to the data backprojected since start_accumulating_in_new_target() was last called.
 
void back_project (const RelatedViewgrams< float > &, const int min_axial_pos_num, const int max_axial_pos_num, const int min_tangential_pos_num, const int max_tangential_pos_num)
 projects the specified range of the viewgrams, axial positions and tangential positions into the volume it adds to the data backprojected since start_accumulating_in_new_target() was last called.
 
virtual void start_accumulating_in_new_target ()
 tell the back projector to start accumulating into a new target. This function has to be called before any back-projection is initiated.
 
virtual void get_output (DiscretisedDensity< 3, float > &) const
 Get output This will overwrite the array-content of the argument with the result of all backprojections since calling start_accumulating_in_new_target(). Note that the argument has to have the same characteristics as what was used when calling set_up().
 
void set_post_data_processor (shared_ptr< DataProcessor< DiscretisedDensity< 3, float > > > post_data_processor_sptr)
 Set data processor to use after back projection.
 
virtual BackProjectorByBinclone () const =0
 
- 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
 
void start_timers (bool do_reset=false) const
 start all timers kept by this object
 
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)
 
- Public Member Functions inherited from stir::RegisteredObjectBase
virtual std::string get_registered_name () const =0
 Returns the name of the type of the object.
 
- Public Member Functions inherited from stir::ParsingObject
 ParsingObject (const ParsingObject &)
 
ParsingObjectoperator= (const ParsingObject &)
 
bool parse (std::istream &f)
 
bool parse (const char *const filename)
 
void ask_parameters ()
 
virtual std::string parameter_info ()
 

Protected Member Functions

virtual void actual_back_project (DiscretisedDensity< 3, float > &, const RelatedViewgrams< float > &, const int min_axial_pos_num, const int max_axial_pos_num, const int min_tangential_pos_num, const int max_tangential_pos_num)
 This actually does the back projection. There are two versions of this code to enable backwards compatibility.
 
virtual void actual_back_project (const RelatedViewgrams< float > &, const int min_axial_pos_num, const int max_axial_pos_num, const int min_tangential_pos_num, const int max_tangential_pos_num)
 This actually does the back projection. There are two versions of this code to enable backwards compatibility.
 
virtual void check (const ProjDataInfo &proj_data_info) const
 check if the argument is the same as what was used for set_up()
 
virtual void check (const ProjDataInfo &proj_data_info, const DiscretisedDensity< 3, float > &density_info) const
 check if the arguments are the same as what was used for set_up()
 
void set_defaults () override
 Set defaults before parsing.
 
void initialise_keymap () override
 Initialise all keywords.
 
virtual bool post_processing ()
 This will be called at the end of the parsing.
 
virtual void set_key_values ()
 This will be called before parsing or parameter_info is called.
 

Protected Attributes

bool _already_set_up
 
shared_ptr< DiscretisedDensity< 3, float > > _density_sptr
 Clone of the density sptr set with set_up()
 
shared_ptr< DataProcessor< DiscretisedDensity< 3, float > > > _post_data_processor_sptr
 
shared_ptr< const ProjDataInfo_proj_data_info_sptr
 ProjDataInfo set by set_up()
 
KeyParser parser
 

Additional Inherited Members

- Static Public Member Functions inherited from stir::RegisteredObject< BackProjectorByBin >
static BackProjectorByBinread_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.
 
static BackProjectorByBinask_type_and_parameters ()
 ask the user for the type, and then calls read_registered_object(0, type)
 
static void list_registered_names (std::ostream &stream)
 List all possible registered names to the stream.
 
- Protected Types inherited from stir::RegisteredObject< BackProjectorByBin >
typedef BackProjectorByBin *(* 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< BackProjectorByBin >
static RegistryTyperegistry ()
 Static function returning the registry.
 

Detailed Description

Abstract base class for all back projectors.

Member Function Documentation

◆ set_up()

void stir::BackProjectorByBin::set_up ( const shared_ptr< const ProjDataInfo > & proj_data_info_ptr,
const shared_ptr< const DiscretisedDensity< 3, float > > & density_info_sptr )
pure virtual

◆ get_symmetries_used()

virtual const DataSymmetriesForViewSegmentNumbers * stir::BackProjectorByBin::get_symmetries_used ( ) const
pure virtual

Informs on which symmetries the projector handles It should get data related by at least those symmetries. Otherwise, a run-time error will occur (unless the derived class has other behaviour).

Implemented in stir::BackProjectorByBinNiftyPET, stir::BackProjectorByBinParallelproj, stir::BackProjectorByBinUsingInterpolation, stir::BackProjectorByBinUsingProjMatrixByBin, stir::BackProjectorByBinUsingSquareProjMatrixByBin, and stir::PostsmoothingBackProjectorByBin.

References actual_back_project(), back_project(), BackProjectorByBin(), check(), get_output(), set_post_data_processor(), and start_accumulating_in_new_target().

Referenced by back_project(), and back_project().

◆ back_project() [1/2]

void stir::BackProjectorByBin::back_project ( DiscretisedDensity< 3, float > & image,
const ProjData & proj_data,
int subset_num = 0,
int num_subsets = 1 )

project whole proj_data into the volume

it overwrites the data already present in the volume.

The optional arguments can be used to back-project only a subset of the data. Subsets are determined as per detail::find_basic_vs_nums_in_subset(). However, this usage will likely be phased out at later stage.

References back_project(), get_output(), and start_accumulating_in_new_target().

Referenced by back_project(), back_project(), back_project(), back_project(), and get_symmetries_used().

◆ back_project() [2/2]

◆ start_accumulating_in_new_target()

void stir::BackProjectorByBin::start_accumulating_in_new_target ( )
virtual

tell the back projector to start accumulating into a new target. This function has to be called before any back-projection is initiated.

Reimplemented in stir::BackProjectorByBinNiftyPET, and stir::BackProjectorByBinParallelproj.

References _density_sptr, and stir::error().

Referenced by back_project(), get_symmetries_used(), stir::BackProjectorByBinNiftyPET::start_accumulating_in_new_target(), and stir::BackProjectorByBinParallelproj::start_accumulating_in_new_target().

◆ get_output()

void stir::BackProjectorByBin::get_output ( DiscretisedDensity< 3, float > & density) const
virtual

Get output This will overwrite the array-content of the argument with the result of all backprojections since calling start_accumulating_in_new_target(). Note that the argument has to have the same characteristics as what was used when calling set_up().

Reimplemented in stir::BackProjectorByBinNiftyPET, and stir::BackProjectorByBinParallelproj.

References _density_sptr, stir::Array< num_dimensions, elemT >::begin_all(), stir::error(), stir::Array< num_dimensions, elemT >::fill(), and stir::DiscretisedDensity< num_dimensions, elemT >::has_same_characteristics().

Referenced by back_project(), and get_symmetries_used().

◆ actual_back_project() [1/2]

void stir::BackProjectorByBin::actual_back_project ( DiscretisedDensity< 3, float > & ,
const RelatedViewgrams< float > & ,
const int min_axial_pos_num,
const int max_axial_pos_num,
const int min_tangential_pos_num,
const int max_tangential_pos_num )
protectedvirtual

This actually does the back projection. There are two versions of this code to enable backwards compatibility.

This is the older version (in which the backprojected image is not a member variable). In most cases, the new version (in which the backprojected image is a member variable) calls the old version.

If you are developing your own projector, one of these two needs to be overloaded. It doesn't matter which, but it might as well be the new one in case we one day decide to remove the old ones.

Reimplemented in stir::BackProjectorByBinUsingProjMatrixByBin, and stir::BackProjectorByBinUsingSquareProjMatrixByBin.

References stir::error().

Referenced by actual_back_project(), back_project(), and get_symmetries_used().

◆ actual_back_project() [2/2]

void stir::BackProjectorByBin::actual_back_project ( const RelatedViewgrams< float > & viewgrams,
const int min_axial_pos_num,
const int max_axial_pos_num,
const int min_tangential_pos_num,
const int max_tangential_pos_num )
protectedvirtual

This actually does the back projection. There are two versions of this code to enable backwards compatibility.

This is the newer version (in which the backprojected image is a member variable). In most cases, the new version calls the old version (in which the backprojected image is not a member variable).

If you are developing your own projector, one of these two needs to be overloaded. It doesn't matter which, but it might as well be the new one in case we one day decide to remove the old ones.

Reimplemented in stir::BackProjectorByBinNiftyPET, and stir::BackProjectorByBinParallelproj.

References _density_sptr, and actual_back_project().

◆ check() [1/2]

void stir::BackProjectorByBin::check ( const ProjDataInfo & proj_data_info) const
protectedvirtual

check if the argument is the same as what was used for set_up()

calls error() if anything is wrong.

If overriding this function in a derived class, you need to call this one.

References _proj_data_info_sptr, stir::error(), and stir::ProjDataInfo::parameter_info().

Referenced by back_project(), back_project(), check(), get_symmetries_used(), stir::BackProjectorByBinNiftyPET::set_up(), and stir::BackProjectorByBinParallelproj::set_up().

◆ check() [2/2]

void stir::BackProjectorByBin::check ( const ProjDataInfo & proj_data_info,
const DiscretisedDensity< 3, float > & density_info ) const
protectedvirtual

check if the arguments are the same as what was used for set_up()

calls error() if anything is wrong.

If overriding this function in a derived class, you need to call this one.

Calls check(const ProjDataInfo&)

References _density_sptr, check(), and stir::error().

◆ set_defaults()

void stir::BackProjectorByBin::set_defaults ( )
overrideprotectedvirtual

Set defaults before parsing.

Reimplemented from stir::ParsingObject.

Reimplemented in stir::BackProjectorByBinParallelproj.

Referenced by BackProjectorByBin().

◆ initialise_keymap()

void stir::BackProjectorByBin::initialise_keymap ( )
overrideprotectedvirtual

Initialise all keywords.

Reimplemented from stir::ParsingObject.

Reimplemented in stir::BackProjectorByBinNiftyPET, and stir::BackProjectorByBinParallelproj.


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