STIR  6.2.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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:
Inheritance graph
[legend]

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) More...
 
virtual bool is_TOF_only_norm () const
 returns if the object can only handle TOF data More...
 
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 More...
 
virtual float get_bin_efficiency (const Bin &bin) const =0
 Return the 'efficiency' factor for a single bin. More...
 
virtual void apply (RelatedViewgrams< float > &) const
 normalise some data More...
 
virtual void undo (RelatedViewgrams< float > &) const
 undo the normalisation of some data More...
 
void apply (ProjData &, shared_ptr< DataSymmetriesForViewSegmentNumbers >=shared_ptr< DataSymmetriesForViewSegmentNumbers >()) const
 normalise some data More...
 
void undo (ProjData &, shared_ptr< DataSymmetriesForViewSegmentNumbers >=shared_ptr< DataSymmetriesForViewSegmentNumbers >()) const
 undo the normalisation of some data More...
 
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. 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

virtual void check (const ProjDataInfo &proj_data_info) const
 check if the argument is the same as what was used for set_up() More...
 
virtual void check (const ExamInfo &exam_info) const
 
- Protected Member Functions inherited from stir::ParsingObject
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

bool _already_set_up
 
shared_ptr< const ProjDataInfoproj_data_info_sptr
 
- Protected Attributes inherited from stir::ParsingObject
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. More...
 
static BinNormalisationask_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< 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. More...
 

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

sets _already_setup to false

Reimplemented from stir::ParsingObject.

Reimplemented in stir::BinNormalisationPETFromComponents, and stir::BinNormalisationWithCalibration.

◆ 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::BinNormalisationPETFromComponents, stir::BinNormalisationFromProjData, 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::ChainedBinNormalisation, and stir::BinNormalisationFromProjData.

◆ set_up()

Succeeded stir::BinNormalisation::set_up ( const shared_ptr< const ExamInfo > &  exam_info_sptr,
const shared_ptr< const ProjDataInfo > &  proj_data_info_sptr_v 
)
virtual

◆ 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::ChainedBinNormalisation, stir::BinNormalisationPETFromComponents, stir::BinNormalisationFromAttenuationImage, stir::BinNormalisationFromProjData, stir::BinNormalisationWithCalibration, stir::BinNormalisationSinogramRescaling, and stir::TrivialBinNormalisation.

◆ 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::BinNormalisationPETFromComponents, stir::BinNormalisationFromAttenuationImage, stir::ChainedBinNormalisation, stir::BinNormalisationFromProjData, stir::BinNormalisationFromML2D, stir::BinNormalisationSinogramRescaling, and stir::TrivialBinNormalisation.

References stir::RelatedViewgrams< elemT >::begin(), stir::BackProjectorByBin::check(), stir::RelatedViewgrams< elemT >::end(), and stir::RelatedViewgrams< elemT >::get_proj_data_info_sptr().

◆ 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::ChainedBinNormalisation, stir::BinNormalisationPETFromComponents, stir::BinNormalisationFromAttenuationImage, stir::BinNormalisationFromProjData, stir::BinNormalisationFromML2D, stir::BinNormalisationSinogramRescaling, and stir::TrivialBinNormalisation.

References stir::RelatedViewgrams< elemT >::begin(), stir::BackProjectorByBin::check(), stir::RelatedViewgrams< elemT >::end(), and stir::RelatedViewgrams< elemT >::get_proj_data_info_sptr().

Referenced by 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 stir::BackProjectorByBin::check(), stir::detail::find_basic_vs_nums_in_subset(), stir::ProjData::get_max_segment_num(), stir::ProjData::get_min_segment_num(), stir::ProjData::get_proj_data_info_sptr(), stir::ProjData::get_related_viewgrams(), and stir::ProjData::set_related_viewgrams().

◆ 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 stir::BackProjectorByBin::check(), stir::detail::find_basic_vs_nums_in_subset(), stir::ProjData::get_max_segment_num(), stir::ProjData::get_min_segment_num(), stir::ProjData::get_proj_data_info_sptr(), stir::ProjData::get_related_viewgrams(), and stir::ProjData::set_related_viewgrams().

◆ check()

void stir::BinNormalisation::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 stir::error(), stir::ExamInfo::parameter_info(), and stir::ProjDataInfo::parameter_info().

Referenced by stir::BinNormalisationFromProjData::apply(), stir::BinNormalisationFromAttenuationImage::apply(), stir::BinNormalisationFromProjData::undo(), and stir::BinNormalisationFromAttenuationImage::undo().


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