STIR 6.4.0
stir::BinNormalisation Class Referenceabstract

Abstract base class for implementing bin-wise normalisation of data. More...

#include "stir/recon_buildblock/BinNormalisation.h"

Inheritance diagram for stir::BinNormalisation:

Public Member Functions

void set_defaults () override
 
virtual float get_calibration_factor () const
 
virtual bool is_trivial () const
 check if we would be multiplying with 1 (i.e. do nothing)
 
virtual bool is_TOF_only_norm () const
 returns if the object can only handle TOF data
 
virtual Succeeded set_up (const shared_ptr< const ExamInfo > &exam_info_sptr, const shared_ptr< const ProjDataInfo > &)
 initialises the object and checks if it can handle such projection data
 
virtual float get_bin_efficiency (const Bin &bin) const =0
 Return the 'efficiency' factor for a single bin.
 
virtual void apply (RelatedViewgrams< float > &) const
 normalise some data
 
virtual void undo (RelatedViewgrams< float > &) const
 undo the normalisation of some data
 
void apply (ProjData &, shared_ptr< DataSymmetriesForViewSegmentNumbers >=shared_ptr< DataSymmetriesForViewSegmentNumbers >()) const
 normalise some data
 
void undo (ProjData &, shared_ptr< DataSymmetriesForViewSegmentNumbers >=shared_ptr< DataSymmetriesForViewSegmentNumbers >()) const
 undo the normalisation of some data
 
void set_exam_info_sptr (const shared_ptr< const ExamInfo > _exam_info_sptr)
 
shared_ptr< const ExamInfoget_exam_info_sptr () const
 
- 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 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 ExamInfo &exam_info) const
 
virtual void initialise_keymap ()
 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< const ProjDataInfoproj_data_info_sptr
 
KeyParser parser
 

Additional Inherited Members

- Static Public Member Functions inherited from stir::RegisteredObject< BinNormalisation >
static BinNormalisationread_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 BinNormalisationask_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< BinNormalisation >
typedef BinNormalisation *(* 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< BinNormalisation >
static RegistryTyperegistry ()
 Static function returning the registry.
 

Detailed Description

Abstract base class for implementing bin-wise normalisation of data.

As part of the measurement model in PET, there usually is some multiplicative correction for every bin, as in

\[ P^\mathrm{full}_{bv} = \mathrm{norm}_b P^\mathrm{normalised}_{bv} \]

This multiplicative correction is usually split in the normalisation factors (which are scanner dependent) and the attenuation factors (which are object dependent).

The present class can be used for both of these factors.

Member Function Documentation

◆ set_defaults()

void stir::BinNormalisation::set_defaults ( )
overridevirtual

◆ is_trivial()

virtual bool stir::BinNormalisation::is_trivial ( ) const
inlinevirtual

check if we would be multiplying with 1 (i.e. do nothing)

This function can be used to check if the operations are guaranteed to do nothing (while potentially taking time and effort). The base-class sets this to always return false. It is up to the derived class to change this.

Reimplemented in stir::BinNormalisationFromProjData, stir::BinNormalisationPETFromComponents, and stir::TrivialBinNormalisation.

Referenced by stir::ScatterEstimation::upsample_and_fit_scatter_estimate().

◆ is_TOF_only_norm()

virtual bool stir::BinNormalisation::is_TOF_only_norm ( ) const
inlinevirtual

returns if the object can only handle TOF data

In PET, many types of normalisation classes can handle both time-of-flight (TOF) and non-TOF data. However, some classes cannot (e.g. BinNormalisationFromProjData if the "projection data" is TOF. The Poisson objective functions can adapt accordingly.

Reimplemented in stir::BinNormalisationFromProjData, and stir::ChainedBinNormalisation.

◆ set_up()

◆ get_bin_efficiency()

virtual float stir::BinNormalisation::get_bin_efficiency ( const Bin & bin) const
pure virtual

Return the 'efficiency' factor for a single bin.

With the notation of the class documentation, this returns the factor $\mathrm{norm}_b $.

Warning
Some derived classes might implement this very inefficiently.

Implemented in stir::BinNormalisationFromAttenuationImage, stir::BinNormalisationFromProjData, stir::BinNormalisationPETFromComponents, stir::BinNormalisationSinogramRescaling, stir::BinNormalisationWithCalibration, stir::ChainedBinNormalisation, and stir::TrivialBinNormalisation.

References apply(), check(), and undo().

Referenced by apply(), and undo().

◆ apply() [1/2]

void stir::BinNormalisation::apply ( RelatedViewgrams< float > & viewgrams) const
virtual

normalise some data

This would be used for instance to precorrect unnormalised data. With the notation of the class documentation, this would divide by the factors $\mathrm{norm}_b $.

Default implementation divides with the factors returned by get_bin_efficiency() (after applying a threshold to avoid division by 0).

Reimplemented in stir::BinNormalisationFromAttenuationImage, stir::BinNormalisationFromML2D, stir::BinNormalisationFromProjData, stir::BinNormalisationPETFromComponents, stir::BinNormalisationSinogramRescaling, stir::ChainedBinNormalisation, and stir::TrivialBinNormalisation.

References apply(), stir::Bin::axial_pos_num(), stir::RelatedViewgrams< elemT >::begin(), check(), stir::RelatedViewgrams< elemT >::end(), get_bin_efficiency(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), and stir::Bin::tangential_pos_num().

Referenced by apply(), apply(), and get_bin_efficiency().

◆ undo() [1/2]

void stir::BinNormalisation::undo ( RelatedViewgrams< float > & viewgrams) const
virtual

undo the normalisation of some data

This would be used for instance to bring geometrically forward projected data to the mean of the measured data. With the notation of the class documentation, this would multiply by the factors $\mathrm{norm}_b $.

Default implementation multiplies with the factors returned by get_bin_efficiency().

Reimplemented in stir::BinNormalisationFromAttenuationImage, stir::BinNormalisationFromML2D, stir::BinNormalisationFromProjData, stir::BinNormalisationPETFromComponents, stir::BinNormalisationSinogramRescaling, stir::ChainedBinNormalisation, and stir::TrivialBinNormalisation.

References stir::Bin::axial_pos_num(), stir::RelatedViewgrams< elemT >::begin(), check(), stir::RelatedViewgrams< elemT >::end(), get_bin_efficiency(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), stir::Bin::tangential_pos_num(), and undo().

Referenced by get_bin_efficiency(), undo(), undo(), and stir::ScatterEstimation::upsample_and_fit_scatter_estimate().

◆ apply() [2/2]

void stir::BinNormalisation::apply ( ProjData & proj_data,
shared_ptr< DataSymmetriesForViewSegmentNumbers > symmetries_sptr = shared_ptr<DataSymmetriesForViewSegmentNumbers>() ) const

normalise some data

This would be used for instance to precorrect unnormalised data. With the notation of the class documentation, this would divide by the factors $\mathrm{norm}_b $.

This just loops over all RelatedViewgrams.

The default value for the symmetries means that TrivialDataSymmetriesForBins will be used.

References apply(), check(), stir::detail::find_basic_vs_nums_in_subset(), and stir::DataWithProjDataInfo::get_proj_data_info_sptr().

◆ undo() [2/2]

void stir::BinNormalisation::undo ( ProjData & proj_data,
shared_ptr< DataSymmetriesForViewSegmentNumbers > symmetries_sptr = shared_ptr<DataSymmetriesForViewSegmentNumbers>() ) const

undo the normalisation of some data

This would be used for instance to bring geometrically forward projected data to the mean of the measured data. With the notation of the class documentation, this would multiply by the factors $\mathrm{norm}_b $.

This just loops over all RelatedViewgrams.

The default value for the symmetries means that TrivialDataSymmetriesForBins will be used.

References check(), stir::detail::find_basic_vs_nums_in_subset(), stir::DataWithProjDataInfo::get_max_segment_num(), stir::DataWithProjDataInfo::get_min_segment_num(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), stir::ProjData::get_related_viewgrams(), stir::ProjData::set_related_viewgrams(), and undo().

◆ check()

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

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