STIR 6.4.0
stir::ForwardProjectorByBin Class Referenceabstract

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

#include "stir/recon_buildblock/ForwardProjectorByBin.h"

Inheritance diagram for stir::ForwardProjectorByBin:

Public Member Functions

 ForwardProjectorByBin ()
 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.
 
void forward_project (ProjData &, const DiscretisedDensity< 3, float > &, int subset_num=0, int num_subsets=1, bool zero=true)
 project the volume into the whole or a subset of proj_data, optionally zeroing the rest
 
virtual void forward_project (ProjData &, int subset_num=0, int num_subsets=1, bool zero=true)
 project the volume into the whole proj_data
 
void forward_project (RelatedViewgrams< float > &)
 project the volume into the viewgrams
 
void forward_project (RelatedViewgrams< float > &, const int min_axial_pos_num, const int max_axial_pos_num)
 
void forward_project (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)
 
virtual void set_input (const DiscretisedDensity< 3, float > &)
 Set input.
 
void set_pre_data_processor (shared_ptr< DataProcessor< DiscretisedDensity< 3, float > > > pre_data_processor_sptr)
 Set data processor to use before forward projection. MUST BE CALLED BEFORE SET_INPUT.
 
- 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_forward_project (RelatedViewgrams< float > &, const DiscretisedDensity< 3, 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 virtual function has to be implemented by the derived class.
 
virtual void actual_forward_project (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)
 
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
 The density ptr set with set_up()
 
shared_ptr< DataProcessor< DiscretisedDensity< 3, float > > > _pre_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< ForwardProjectorByBin >
static ForwardProjectorByBinread_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 ForwardProjectorByBinask_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< ForwardProjectorByBin >
typedef ForwardProjectorByBin *(* 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< ForwardProjectorByBin >
static RegistryTyperegistry ()
 Static function returning the registry.
 

Detailed Description

Abstract base class for all forward projectors.

Member Function Documentation

◆ set_up()

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

Stores all necessary geometric info.

If necessary, set_up() can be called more than once.

Derived classes can assume that forward_project() will be called with input corresponding to the arguments of the last call to set_up().

Warning
there is currently no check on this.
Derived classes have to call set_up from the base class.

Implemented in stir::ForwardProjectorByBinNiftyPET, stir::ForwardProjectorByBinParallelproj, stir::ForwardProjectorByBinUsingProjMatrixByBin, stir::ForwardProjectorByBinUsingRayTracing, stir::PostsmoothingForwardProjectorByBin, and stir::PresmoothingForwardProjectorByBin.

References _density_sptr, and _proj_data_info_sptr.

Referenced by stir::ForwardProjectorByBinNiftyPET::set_up(), stir::ForwardProjectorByBinParallelproj::set_up(), stir::ForwardProjectorByBinUsingProjMatrixByBin::set_up(), stir::ForwardProjectorByBinUsingRayTracing::set_up(), and stir::PresmoothingForwardProjectorByBin::set_up().

◆ get_symmetries_used()

virtual const DataSymmetriesForViewSegmentNumbers * stir::ForwardProjectorByBin::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::ForwardProjectorByBinNiftyPET, stir::ForwardProjectorByBinParallelproj, stir::ForwardProjectorByBinUsingProjMatrixByBin, stir::ForwardProjectorByBinUsingRayTracing, stir::PostsmoothingForwardProjectorByBin, and stir::PresmoothingForwardProjectorByBin.

References actual_forward_project(), check(), forward_project(), ForwardProjectorByBin(), set_input(), and set_pre_data_processor().

Referenced by forward_project().

◆ forward_project() [1/3]

void stir::ForwardProjectorByBin::forward_project ( ProjData & proj_data,
const DiscretisedDensity< 3, float > & image,
int subset_num = 0,
int num_subsets = 1,
bool zero = true )

project the volume into the whole or a subset of proj_data, optionally zeroing the rest

it overwrites the data already present in the projection data.

The optional arguments can be used to 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 forward_project(), and set_input().

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

◆ forward_project() [2/3]

◆ forward_project() [3/3]

void stir::ForwardProjectorByBin::forward_project ( RelatedViewgrams< float > & viewgrams)

project the volume into the viewgrams

it overwrites the data already present in the viewgram

References forward_project(), stir::DataWithProjDataInfo::get_max_tangential_pos_num(), and stir::DataWithProjDataInfo::get_min_tangential_pos_num().

◆ set_input()

◆ actual_forward_project()

void stir::ForwardProjectorByBin::actual_forward_project ( RelatedViewgrams< float > & ,
const DiscretisedDensity< 3, 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 virtual function has to be implemented by the derived class.

Reimplemented in stir::ForwardProjectorByBinNiftyPET.

References stir::error().

Referenced by get_symmetries_used().

◆ check() [1/2]

void stir::ForwardProjectorByBin::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 check(), forward_project(), get_symmetries_used(), stir::ForwardProjectorByBinNiftyPET::set_up(), and stir::ForwardProjectorByBinParallelproj::set_up().

◆ check() [2/2]

void stir::ForwardProjectorByBin::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::ForwardProjectorByBin::set_defaults ( )
overrideprotectedvirtual

Set defaults before parsing.

Reimplemented from stir::ParsingObject.

Reimplemented in stir::ForwardProjectorByBinParallelproj.

Referenced by ForwardProjectorByBin().

◆ initialise_keymap()

void stir::ForwardProjectorByBin::initialise_keymap ( )
overrideprotectedvirtual

Initialise all keywords.

Reimplemented from stir::ParsingObject.

Reimplemented in stir::ForwardProjectorByBinNiftyPET, and stir::ForwardProjectorByBinParallelproj.


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