STIR 6.5.0
stir::CListModeDataSAFIR< CListRecordT > Class Template Reference

Class for reading SAFIR listmode data with variable geometry. More...

#include "stir/listmode/CListModeDataSAFIR.h"

Public Member Functions

 CListModeDataSAFIR (const std::string &listmode_filename, const std::string &crystal_map_filename, const std::string &template_proj_data_filename, const double lor_randomization_sigma=0.0)
 CListModeDataSAFIR (const std::string &listmode_filename, const shared_ptr< const ProjDataInfo > &proj_data_info_sptr)
shared_ptr< CListRecord > get_empty_record_sptr () const override
 Get a pointer to an empty record.
Succeeded get_next_record (CListRecord &record_of_general_type) const override
 Gets the next record in the listmode sequence.
bool has_delayeds () const override
 Return if the file stores delayed events as well (as opposed to prompts).
Succeeded reset () override
 Call this function if you want to re-start reading at the beginning.
SavedPosition save_get_position () override
 Save the current reading position.
Succeeded set_get_position (const SavedPosition &pos) override
 Set the position for reading to a previously saved point.

Protected Member Functions

virtual Succeeded open_lm_file () const override

Protected Attributes

shared_ptr< InputStreamWithRecords< CListRecordT, bool > > current_lm_data_ptr

Detailed Description

template<class CListRecordT>
class stir::CListModeDataSAFIR< CListRecordT >

Class for reading SAFIR listmode data with variable geometry.

By providing crystal map and template projection data files, the coordinates are read from files and used defining the LOR coordinates.

Constructor & Destructor Documentation

◆ CListModeDataSAFIR()

template<class CListRecordT>
stir::CListModeDataSAFIR< CListRecordT >::CListModeDataSAFIR ( const std::string & listmode_filename,
const std::string & crystal_map_filename,
const std::string & template_proj_data_filename,
const double lor_randomization_sigma = 0.0 )

Constructor

Takes as arguments the filenames of the coicidence listmode file, the crystal map (text) file, and the template projection data file

References CListModeDataSAFIR(), stir::error(), MAKE_SHARED, and stir::ProjData::read_from_file().

Referenced by CListModeDataSAFIR().

Member Function Documentation

◆ get_empty_record_sptr()

template<class CListRecordT>
shared_ptr< CListRecord > stir::CListModeDataSAFIR< CListRecordT >::get_empty_record_sptr ( ) const
overridevirtual

Get a pointer to an empty record.

This is mainly/only useful to get a record of the correct type, that can then be passed to get_next_record().

Implements stir::CListModeData.

References get_empty_record_sptr(), and stir::DataWithProjDataInfo::get_proj_data_info_sptr().

Referenced by get_empty_record_sptr().

◆ get_next_record()

template<class CListRecordT>
Succeeded stir::CListModeDataSAFIR< CListRecordT >::get_next_record ( CListRecord & event) const
overridevirtual

Gets the next record in the listmode sequence.

Implements stir::CListModeData.

References get_next_record().

Referenced by get_next_record().

◆ has_delayeds()

template<class CListRecordT>
bool stir::CListModeDataSAFIR< CListRecordT >::has_delayeds ( ) const
inlineoverridevirtual

Return if the file stores delayed events as well (as opposed to prompts).

Implements stir::CListModeData.

◆ reset()

template<class CListRecordT>
Succeeded stir::CListModeDataSAFIR< CListRecordT >::reset ( )
overridevirtual

Call this function if you want to re-start reading at the beginning.

Implements stir::ListModeData.

References reset().

Referenced by reset().

◆ save_get_position()

template<class CListRecordT>
SavedPosition stir::CListModeDataSAFIR< CListRecordT >::save_get_position ( )
inlineoverridevirtual

Save the current reading position.

Note that the return value is not related to the number of events already read. In particular, you cannot do any arithmetic on it to skip a few events. This is different from e.g. std::streampos.

Warning
There is a maximum number of times this function can be called. This is determined by the SavedPosition type. Once you save more positions, the first positions will be overwritten. There is currently no way of finding out after how many times this will happen (but it's a large number...).
These saved positions are only valid for the lifetime of the ListModeData object.
A derived class might disable this facility. It will/should then always return Succeeded::no when calling set_get_position().

Implements stir::ListModeData.

◆ set_get_position()

template<class CListRecordT>
Succeeded stir::CListModeDataSAFIR< CListRecordT >::set_get_position ( const SavedPosition & pos)
inlineoverridevirtual

Set the position for reading to a previously saved point.

Implements stir::ListModeData.


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