|
STIR 6.4.0
|
Abstract base class for implementing bin-wise normalisation of data. More...
#include "stir/recon_buildblock/BinNormalisation.h"

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 ExamInfo > | get_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 &) | |
| ParsingObject & | operator= (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 ProjDataInfo > | proj_data_info_sptr |
| KeyParser | parser |
Additional Inherited Members | |
Static Public Member Functions inherited from stir::RegisteredObject< BinNormalisation > | |
| static BinNormalisation * | read_registered_object (std::istream *in, const std::string ®istered_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 BinNormalisation * | ask_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_less > | RegistryType |
| The type of the registry. | |
Static Protected Member Functions inherited from stir::RegisteredObject< BinNormalisation > | |
| static RegistryType & | registry () |
| Static function returning the registry. | |
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} \]](form_60.png)
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.
|
overridevirtual |
sets _already_setup to false
Reimplemented from stir::ParsingObject.
Reimplemented in stir::BinNormalisationPETFromComponents, and stir::BinNormalisationWithCalibration.
References set_defaults().
Referenced by set_defaults(), stir::BinNormalisationPETFromComponents::set_defaults(), and stir::BinNormalisationWithCalibration::set_defaults().
|
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().
|
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.
|
virtual |
initialises the object and checks if it can handle such projection data
Default version sets _already_set_up and stores the shared pointers.
Reimplemented in stir::BinNormalisationFromAttenuationImage, stir::BinNormalisationFromProjData, stir::BinNormalisationPETFromComponents, stir::BinNormalisationWithCalibration, stir::ChainedBinNormalisation, stir::ecat::BinNormalisationFromECAT8, stir::ecat::ecat7::BinNormalisationFromECAT7, and stir::GE::RDF_HDF5::BinNormalisationFromGEHDF5.
References set_up().
Referenced by set_up(), stir::BinNormalisationFromAttenuationImage::set_up(), stir::BinNormalisationFromProjData::set_up(), stir::BinNormalisationPETFromComponents::set_up(), stir::BinNormalisationWithCalibration::set_up(), stir::ChainedBinNormalisation::set_up(), and stir::ScatterEstimation::upsample_and_fit_scatter_estimate().
|
pure virtual |
Return the 'efficiency' factor for a single bin.
With the notation of the class documentation, this returns the factor 
Implemented in stir::BinNormalisationFromAttenuationImage, stir::BinNormalisationFromProjData, stir::BinNormalisationPETFromComponents, stir::BinNormalisationSinogramRescaling, stir::BinNormalisationWithCalibration, stir::ChainedBinNormalisation, and stir::TrivialBinNormalisation.
|
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 
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().
|
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 
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().
| 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 
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().
| 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 
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().
|
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 check(), stir::error(), and stir::ProjDataInfo::parameter_info().
Referenced by apply(), apply(), stir::BinNormalisationFromAttenuationImage::apply(), stir::BinNormalisationFromProjData::apply(), stir::BinNormalisationPETFromComponents::apply(), check(), get_bin_efficiency(), undo(), undo(), stir::BinNormalisationFromAttenuationImage::undo(), stir::BinNormalisationFromProjData::undo(), and stir::BinNormalisationPETFromComponents::undo().