STIR 6.4.0
stir::ProjDataRebinning Class Referenceabstract

base class for all rebinning algorithms for 3D PET data More...

#include "stir/recon_buildblock/ProjDataRebinning.h"

Inheritance diagram for stir::ProjDataRebinning:

Public Member Functions

 ~ProjDataRebinning () override
 virtual destructor
 
virtual std::string method_info () const =0
 gives method information
 
virtual Succeeded rebin ()=0
 executes the rebinning
 
- 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 ()
 

get/set the number of segments to process

See also
max_segment_num_to_process
std::string output_filename_prefix
 file name for output projdata (should be without extension)
 
std::string input_filename
 file name for input projdata
 
int max_segment_num_to_process
 the maximum absolute segment number to use in the reconstruction
 
shared_ptr< ProjDataproj_data_sptr
 
void set_max_segment_num_to_process (int ns)
 
int get_max_segment_num_to_process () const
 
void set_output_filename_prefix (const std::string &s)
 
std::string get_output_filename_prefix () const
 
void set_input_proj_data_sptr (const shared_ptr< ProjData > &)
 set projection data that will be rebinned
 
shared_ptr< ProjDataget_proj_data_sptr ()
 
virtual Succeeded set_up ()
 operations prior to the rebinning
 
bool post_processing () override
 used to check acceptable parameter ranges, etc...
 
void set_defaults () override
 Set defaults before parsing.
 
void initialise_keymap () override
 Initialise all keywords.
 

Additional Inherited Members

- Static Public Member Functions inherited from stir::RegisteredObject< ProjDataRebinning >
static ProjDataRebinningread_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 ProjDataRebinningask_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< ProjDataRebinning >
typedef ProjDataRebinning *(* 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.
 
virtual void set_key_values ()
 This will be called before parsing or parameter_info is called.
 
- Static Protected Member Functions inherited from stir::RegisteredObject< ProjDataRebinning >
static RegistryTyperegistry ()
 Static function returning the registry.
 
KeyParser parser
 

Detailed Description

base class for all rebinning algorithms for 3D PET data

TODO describe what rebinning is and why you need it

Usage

The utility rebin_projdata provides the user interface to this class. What follows is for developers.

Parameters need to be initialised somehow. This is usually done using the parse() member functions (see ParsingObject). For some parameters, set_some_parameter() methods are provided.

Normal usage is for example as follows

shared_ptr<ProjDataRebinning> rebinning_sptr;
// set parameters somehow
if (rebinning_sptr->set_up()!= Succeeded::yes)
error("Disaster. Presumably data are inconsistent")
if (rebinning_sptr->rebin()!= Succeeded::yes)
error("Disaster. Presumably run-time error or so");
virtual Succeeded rebin()=0
executes the rebinning
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition Succeeded.h:44
void error(const char *const s,...)
Print error with format string a la printf and throw exception.
Definition error.cxx:42
Info for developers

For convenience, the class is derived from TimedObject. It is the responsibility of the derived class to run these timers though.

Todo
there should be a method to rebin the data without writing the result to disk

Member Function Documentation

◆ method_info()

virtual std::string stir::ProjDataRebinning::method_info ( ) const
pure virtual

gives method information

Implemented in stir::FourierRebinning.

◆ rebin()

virtual Succeeded stir::ProjDataRebinning::rebin ( )
pure virtual

executes the rebinning

At the end of the rebinning, the final 2D projection data are saved to file as given in output_filename_prefix.

Returns
Succeeded::yes if everything was alright.

Implemented in stir::FourierRebinning.

References set_input_proj_data_sptr(), set_output_filename_prefix(), and set_up().

◆ set_output_filename_prefix()

void stir::ProjDataRebinning::set_output_filename_prefix ( const std::string & s)

get/set file name for output projdata (should be without extension)

References output_filename_prefix, and set_output_filename_prefix().

Referenced by rebin(), and set_output_filename_prefix().

◆ set_input_proj_data_sptr()

void stir::ProjDataRebinning::set_input_proj_data_sptr ( const shared_ptr< ProjData > & new_proj_data_sptr)

set projection data that will be rebinned

Usually this will be set via a call to parse()

References set_input_proj_data_sptr().

Referenced by rebin(), and set_input_proj_data_sptr().

◆ post_processing()

bool stir::ProjDataRebinning::post_processing ( )
overrideprotectedvirtual

used to check acceptable parameter ranges, etc...

Reimplemented from stir::ParsingObject.

References input_filename, output_filename_prefix, post_processing(), stir::ProjData::read_from_file(), and stir::warning().

Referenced by stir::FourierRebinning::post_processing(), and post_processing().

◆ set_defaults()

void stir::ProjDataRebinning::set_defaults ( )
overrideprotectedvirtual

◆ initialise_keymap()

void stir::ProjDataRebinning::initialise_keymap ( )
overrideprotectedvirtual

Member Data Documentation

◆ max_segment_num_to_process

int stir::ProjDataRebinning::max_segment_num_to_process
protected

the maximum absolute segment number to use in the reconstruction

convention: if -1, use get_max_segment_num()

Referenced by initialise_keymap(), stir::FourierRebinning::rebin(), set_defaults(), and set_up().


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