STIR 6.4.0
stir::BinNormalisationFromProjData Class Reference

A BinNormalisation class that gets the normalisation factors from a ProjData object. More...

#include "stir/recon_buildblock/BinNormalisationFromProjData.h"

Inheritance diagram for stir::BinNormalisationFromProjData:

Public Member Functions

 BinNormalisationFromProjData ()
 Default constructor.
 
 BinNormalisationFromProjData (const std::string &filename)
 Constructor that reads the projdata from a file.
 
 BinNormalisationFromProjData (const shared_ptr< ProjData > &norm_proj_data_ptr)
 Constructor that takes the projdata from a shared_pointer.
 
bool is_trivial () const override
 check if we could be multiplying with 1 (i.e. do nothing)
 
virtual bool is_TOF_only_norm () const override
 returns if the object can only handle TOF data
 
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.
 
void apply (RelatedViewgrams< float > &viewgrams) const override
 Normalise some data.
 
void undo (RelatedViewgrams< float > &viewgrams) const override
 Undo the normalisation of some data.
 
float get_bin_efficiency (const Bin &bin) const override
 Return the 'efficiency' factor for a single bin.
 
virtual shared_ptr< ProjDataget_norm_proj_data_sptr () const
 Get a shared_ptr to the normalisation proj_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
 
- Public Member Functions inherited from stir::RegisteredParsingObject< BinNormalisationFromProjData, BinNormalisation >
std::string get_registered_name () const override
 Returns Derived::registered_name.
 
std::string parameter_info () override
 Returns a string with all parameters and their values, in a form suitable for parsing again.
 
- Public Member Functions inherited from stir::BinNormalisation
virtual float get_calibration_factor () const
 
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::ParsingObject
 ParsingObject (const ParsingObject &)
 
ParsingObjectoperator= (const ParsingObject &)
 
bool parse (std::istream &f)
 
bool parse (const char *const filename)
 
void ask_parameters ()
 

Static Public Attributes

static const char *const registered_name = "From ProjData"
 Name which will be used when parsing a BinNormalisation object.
 

Additional Inherited Members

- Static Public Member Functions inherited from stir::RegisteredParsingObject< BinNormalisationFromProjData, BinNormalisation >
static BinNormalisationread_from_stream (std::istream *)
 Construct a new object (of type Derived) by parsing the istream.
 
- 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.
 
- 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()
 
virtual void check (const ExamInfo &exam_info) const
 
virtual void set_key_values ()
 This will be called before parsing or parameter_info is called.
 
- Static Protected Member Functions inherited from stir::RegisteredObject< BinNormalisation >
static RegistryTyperegistry ()
 Static function returning the registry.
 
- Protected Attributes inherited from stir::BinNormalisation
bool _already_set_up
 
shared_ptr< const ProjDataInfoproj_data_info_sptr
 
KeyParser parser
 

Detailed Description

A BinNormalisation class that gets the normalisation factors from a ProjData object.

Warning
the ProjData object containing the normalisation factors should currently have exactly the same dimensions as the data it is applied on.
Parsing details
Bin Normalisation From ProjData:=
normalisation projdata filename := <ASCII>
End Bin Normalisation From ProjData:=

Constructor & Destructor Documentation

◆ BinNormalisationFromProjData() [1/2]

stir::BinNormalisationFromProjData::BinNormalisationFromProjData ( )

Default constructor.

Warning
You should not call any member functions for any object just constructed with this constructor. Initialise the object properly first by parsing.

References BinNormalisationFromProjData().

Referenced by BinNormalisationFromProjData(), and BinNormalisationFromProjData().

◆ BinNormalisationFromProjData() [2/2]

stir::BinNormalisationFromProjData::BinNormalisationFromProjData ( const shared_ptr< ProjData > & norm_proj_data_ptr)

Constructor that takes the projdata from a shared_pointer.

The projdata object pointed to will not be modified.

Member Function Documentation

◆ is_trivial()

bool stir::BinNormalisationFromProjData::is_trivial ( ) const
overridevirtual

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

always return false, as the case where the whole ProjData is set to 1 will never occur in "real life", so we save ourselves some time/complications by returning false

Reimplemented from stir::BinNormalisation.

◆ is_TOF_only_norm()

bool stir::BinNormalisationFromProjData::is_TOF_only_norm ( ) const
overridevirtual

returns if the object can only handle TOF data

Checks if the underlying "projection data" are TOF or not.

Reimplemented from stir::BinNormalisation.

References stir::error(), and get_norm_proj_data_sptr().

◆ set_up()

Succeeded stir::BinNormalisationFromProjData::set_up ( const shared_ptr< const ExamInfo > & exam_info_sptr,
const shared_ptr< const ProjDataInfo > & proj_data_info_sptr )
overridevirtual

Checks if we can handle certain projection data.

Compares the ProjDataInfo from the ProjData object containing the normalisation factors with the ProjDataInfo supplied.

Reimplemented from stir::BinNormalisation.

References stir::BinNormalisation::set_up(), and stir::warning().

◆ apply() [1/2]

void stir::BinNormalisationFromProjData::apply ( RelatedViewgrams< float > & viewgrams) const
overridevirtual

◆ undo() [1/2]

void stir::BinNormalisationFromProjData::undo ( RelatedViewgrams< float > & viewgrams) const
overridevirtual

◆ get_bin_efficiency()

float stir::BinNormalisationFromProjData::get_bin_efficiency ( const Bin & bin) const
overridevirtual

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.

Implements stir::BinNormalisation.

References stir::error().

◆ 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.

◆ 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.


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