STIR
6.2.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) 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 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. More... | |
Public Member Functions inherited from stir::ParsingObject | |
ParsingObject (const ParsingObject &) | |
ParsingObject & | operator= (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 ProjDataInfo > | proj_data_info_sptr |
Protected Attributes inherited from stir::ParsingObject | |
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. More... | |
static BinNormalisation * | ask_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_less > | RegistryType |
The type of the registry. | |
Static Protected Member Functions inherited from stir::RegisteredObject< BinNormalisation > | |
static RegistryType & | registry () |
Static function returning the registry. More... | |
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
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.
|
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().
|
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.
|
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::ecat::BinNormalisationFromECAT8, stir::BinNormalisationPETFromComponents, stir::ecat::ecat7::BinNormalisationFromECAT7, stir::GE::RDF_HDF5::BinNormalisationFromGEHDF5, stir::ChainedBinNormalisation, stir::BinNormalisationFromAttenuationImage, stir::BinNormalisationFromProjData, and stir::BinNormalisationWithCalibration.
Referenced by stir::BinNormalisationFromProjData::set_up(), stir::BinNormalisationFromAttenuationImage::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::ChainedBinNormalisation, stir::BinNormalisationPETFromComponents, stir::BinNormalisationFromAttenuationImage, stir::BinNormalisationFromProjData, stir::BinNormalisationWithCalibration, stir::BinNormalisationSinogramRescaling, 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::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().
|
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::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().
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 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().
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 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().
|
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().