STIR
6.2.0
|
A BinNormalisation class that uses component-based normalisation for PET. More...
#include "stir/recon_buildblock/BinNormalisationPETFromComponents.h"
Public Member Functions | |
std::string | get_registered_name () const override |
Returns the name of the type of the object. More... | |
BinNormalisationPETFromComponents () | |
Default constructor. More... | |
bool | is_trivial () const override |
check if we would be multiplying with 1 (i.e. do nothing) More... | |
Succeeded | set_up (const shared_ptr< const ExamInfo > &exam_info_sptr, const shared_ptr< const ProjDataInfo > &) override |
Checks if we can handle certain projection data. More... | |
void | apply (RelatedViewgrams< float > &viewgrams) const override |
Normalise some data. More... | |
void | undo (RelatedViewgrams< float > &viewgrams) const override |
Undo the normalisation of some data. More... | |
float | get_bin_efficiency (const Bin &bin) const override |
Return the 'efficiency' factor for a single bin. More... | |
void | allocate (shared_ptr< const ProjDataInfo >, bool do_eff, bool do_geo, bool do_block=false, bool do_symmetry_per_block=false) |
Allocate the relevant factors. More... | |
DetectorEfficiencies & | crystal_efficiencies () |
GeoData3D & | geometric_factors () |
BlockData3D & | block_factors () |
void | set_defaults () override |
Sets all factors to empty and flags that allocations need to be done. More... | |
Public Member Functions inherited from stir::BinNormalisation | |
virtual float | get_calibration_factor () const |
virtual bool | is_TOF_only_norm () const |
returns if the object can only handle TOF 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::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 | |
checks if factors are initialised | |
bool | has_crystal_efficiencies () const |
bool | has_geometric_factors () const |
bool | has_block_factors () const |
Protected Member Functions inherited from stir::BinNormalisation | |
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 | |
DetectorEfficiencies | efficiencies |
GeoData3D | geo_data |
BlockData3D | block_data |
Protected Attributes inherited from stir::BinNormalisation | |
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... | |
A BinNormalisation class that uses component-based normalisation for PET.
Components currently supported are crystal efficiencies, geometric factors (constrained by symmetry) and block data. The latter were introduced to cope with timing alignment issues between blocks, but are generally not recommended in the current estimation process (by ML_estimate_component_based_normalisation) as the model allows for too much freedom.
The detection efficiency of a crystal pair is modelled as
with crystal indices, and obtained from a GeoData3D object by using symmetries, and from a BlockData3D object by finding which blocks the crystals belong to.
Symmetries for the geometric factors are described in
Niknejad, T., Tavernier, S., Varela, J. and Thielemans, K. Validation of 3D model-based maximum-likelihood estimation of normalisation factors for partial ring positron emission tomography. in 2016 IEEE Nuclear Science Symposium, Medical Imaging Conference and Room-Temperature Semiconductor Detector Workshop (NSS/MIC/RTSD) 1-5 (2016). doi:10.1109/NSSMIC.2016.8069577.
Note however that this describes rotational/translational symmetry per block, while the default is now to use symmetries per bucket ( see the do_symmetry_per_block
argument of allocate()). (The block factors still work per block, not bucket).
This class does not actually set the relevant factors. That is left to external methods via the crystal_efficiencies(), geometric_factors() and block_factors() members. If they are not set, the factor is not applied (i.e. assumed to be 1).
The model is constructed for the "physical" crystals only. The "virtual" crystals are forced to have 0 detection efficiency.
This class should probably be derived from BinNormalisationWithCalibration.
The class currently does not handle "compressed" projection data (i.e. span etc).
stir::BinNormalisationPETFromComponents::BinNormalisationPETFromComponents | ( | ) |
Default constructor.
|
inlineoverridevirtual |
Returns the name of the type of the object.
Each type that can be parsed has a unique (within its hierarchy) name associated with it. This function returns that name. KeyParser::parameter_info() needs to know this name such that it can fill it in.
Implements stir::RegisteredObjectBase.
|
overridevirtual |
check if we would be multiplying with 1 (i.e. do nothing)
Checks if all data is equal to 1 (up to a tolerance of 1e-4). To do this, it checks if all components are 1.
Reimplemented from stir::BinNormalisation.
References stir::error().
|
overridevirtual |
Checks if we can handle certain projection data.
Compares the stored ProjDataInfo with the ProjDataInfo supplied.
Reimplemented from stir::BinNormalisation.
References stir::error(), stir::ProjDataInfo::get_max_axial_pos_num(), stir::ProjDataInfo::get_max_segment_num(), stir::ProjDataInfo::get_max_tangential_pos_num(), stir::ProjDataInfo::get_min_axial_pos_num(), stir::ProjDataInfo::get_min_segment_num(), stir::ProjDataInfo::get_min_tangential_pos_num(), stir::ProjDataInfo::parameter_info(), and stir::warning().
|
overridevirtual |
Normalise some data.
This means divide
with the efficiency model. 0/0 is set to 0.
Reimplemented from stir::BinNormalisation.
References stir::RelatedViewgrams< elemT >::begin(), stir::divide(), stir::RelatedViewgrams< elemT >::end(), stir::RelatedViewgrams< elemT >::get_basic_view_segment_num(), stir::RelatedViewgrams< elemT >::get_proj_data_info_sptr(), and stir::RelatedViewgrams< elemT >::get_symmetries_ptr().
|
overridevirtual |
Undo the normalisation of some data.
This means multiply
with the efficiency model.
Reimplemented from stir::BinNormalisation.
References stir::RelatedViewgrams< elemT >::get_basic_view_segment_num(), stir::RelatedViewgrams< elemT >::get_proj_data_info_sptr(), and stir::RelatedViewgrams< elemT >::get_symmetries_ptr().
|
overridevirtual |
Return the 'efficiency' factor for a single bin.
With the notation of the class documentation, this returns the factor .
Implements stir::BinNormalisation.
void stir::BinNormalisationPETFromComponents::allocate | ( | shared_ptr< const ProjDataInfo > | pdi_sptr, |
bool | do_eff, | ||
bool | do_geo, | ||
bool | do_block = false , |
||
bool | do_symmetry_per_block = false |
||
) |
Allocate the relevant factors.
They are currently probably set to 0, but do not rely on this.
|
overridevirtual |
Sets all factors to empty and flags that allocations need to be done.
Also calls base_type::set_defaults()
Reimplemented from stir::BinNormalisation.