STIR  6.2.0
Public Member Functions | Static Public Attributes | List of all members
stir::ChainedBinNormalisation Class Reference

A BinNormalisation class that simply multiplies the factors given by 2 BinNormalisation objects. More...

#include "stir/recon_buildblock/ChainedBinNormalisation.h"

Inheritance diagram for stir::ChainedBinNormalisation:
Inheritance graph
[legend]

Public Member Functions

 ChainedBinNormalisation ()
 Default constructor. More...
 
 ChainedBinNormalisation (shared_ptr< BinNormalisation > const &apply_first, shared_ptr< BinNormalisation > const &apply_second)
 
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...
 
virtual void apply_only_first (RelatedViewgrams< float > &viewgrams) const
 
virtual void apply_only_first (ProjData &) const
 
virtual void apply_only_second (RelatedViewgrams< float > &viewgrams) const
 
virtual void apply_only_second (ProjData &) const
 
void undo (RelatedViewgrams< float > &viewgrams) const override
 Undo the normalisation of some data. More...
 
virtual void undo_only_first (RelatedViewgrams< float > &viewgrams) const
 
virtual void undo_only_first (ProjData &) const
 
virtual void undo_only_second (RelatedViewgrams< float > &viewgrams) const
 
virtual void undo_only_second (ProjData &) const
 
float get_bin_efficiency (const Bin &bin) const override
 Return the 'efficiency' factor for a single bin. More...
 
virtual bool is_first_trivial () const
 Returns the is_trivial() status of the first normalisation object. More...
 
virtual bool is_second_trivial () const
 Returns the is_trivial() status of the second normalisation object. More...
 
virtual bool is_TOF_only_norm () const override
 returns if the object can only handle TOF data More...
 
virtual shared_ptr< BinNormalisationget_first_norm () const
 
virtual shared_ptr< BinNormalisationget_second_norm () const
 
- Public Member Functions inherited from stir::RegisteredParsingObject< ChainedBinNormalisation, 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
 
virtual bool is_trivial () const
 check if we would be multiplying with 1 (i.e. do nothing) 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::ParsingObject
 ParsingObject (const ParsingObject &)
 
ParsingObjectoperator= (const ParsingObject &)
 
void ask_parameters ()
 
bool parse (std::istream &f)
 
bool parse (const char *const filename)
 

Static Public Attributes

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

Additional Inherited Members

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

Detailed Description

A BinNormalisation class that simply multiplies the factors given by 2 BinNormalisation objects.

This is especially useful to combine the 'usual' normalisation factors and attenuation factors in PET. As both are multiplicative corrections, they both belong in the BinNormalisation hierarchy.

Parsing details
Chained Bin Normalisation Parameters:=
; type of one of the bin normalisations, followed by its parameters
Bin Normalisation to apply first := <ASCII>

; type of the other, and its parameters
Bin Normalisation to apply second := <ASCII>
END Chained Bin Normalisation Parameters :=
Example
This example shows how to construct the parameter file for the case that there are normalisation factors in a file norm.hs and an attenuation image in a file atten.hv.
See also
BinNormalisationFromProjData, BinNormalisationFromAttenuationImage.
Bin Normalisation type := Chained
Chained Bin Normalisation Parameters:=
  Bin Normalisation to apply first := from projdata
    Bin Normalisation From ProjData :=
      normalisation projdata filename:= norm.hs
    End Bin Normalisation From ProjData:=
  Bin Normalisation to apply second := From Attenuation Image
    Bin Normalisation From Attenuation Image:=
      attenuation_image_filename := atten.hv
      forward projector type := ray tracing
        Forward Projector Using Ray Tracing Parameters :=
        End Forward Projector Using Ray Tracing Parameters :=
    End Bin Normalisation From Attenuation Image :=
END Chained Bin Normalisation Parameters :=

Constructor & Destructor Documentation

◆ ChainedBinNormalisation()

stir::ChainedBinNormalisation::ChainedBinNormalisation ( )

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.

Member Function Documentation

◆ set_up()

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

Checks if we can handle certain projection data.

Calls set_up for the BinNormalisation members.

Reimplemented from stir::BinNormalisation.

◆ apply()

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

Normalise some data.

This calls apply() of the 2 BinNormalisation members

Reimplemented from stir::BinNormalisation.

◆ undo()

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

Undo the normalisation of some data.

This calls undo() of the 2 BinNormalisation members.

Reimplemented from stir::BinNormalisation.

◆ get_bin_efficiency()

float stir::ChainedBinNormalisation::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.

◆ is_first_trivial()

bool stir::ChainedBinNormalisation::is_first_trivial ( ) const
virtual

Returns the is_trivial() status of the first normalisation object.

Warning
Currently, if the object has not been set the function throws an error.

◆ is_second_trivial()

bool stir::ChainedBinNormalisation::is_second_trivial ( ) const
virtual

Returns the is_trivial() status of the second normalisation object.

Warning
Currently, if the object has not been set the function throws an error.

◆ is_TOF_only_norm()

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

returns if the object can only handle TOF data

Checks if either of the normalisation objects can only handle TOF.

Reimplemented from stir::BinNormalisation.


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