STIR  6.2.0
Public Member Functions | List of all members
stir::ecat::ecat7::CListModeDataECAT< CListRecordT > Class Template Reference

A class that reads the listmode data for ECAT scanners. More...

#include "stir/listmode/CListModeDataECAT.h"

Inheritance diagram for stir::ecat::ecat7::CListModeDataECAT< CListRecordT >:
Inheritance graph
[legend]

Public Member Functions

 CListModeDataECAT (const std::string &listmode_filename_prefix)
 Constructor taking a prefix for the filename. More...
 
virtual std::string get_name () const
 Returns the name of the list mode data. More...
 
virtual shared_ptr< CListRecordget_empty_record_sptr () const
 Get a pointer to an empty record. More...
 
virtual Succeeded get_next_record (CListRecord &record) const
 
virtual Succeeded reset ()
 Call this function if you want to re-start reading at the beginning.
 
virtual SavedPosition save_get_position ()
 Save the current reading position. More...
 
virtual Succeeded set_get_position (const SavedPosition &)
 Set the position for reading to a previously saved point.
 
virtual bool has_delayeds () const
 returns true, as ECAT listmode data stores delayed events (and prompts) More...
 
- Public Member Functions inherited from stir::ListModeData
 ListModeData ()
 Default constructor.
 
shared_ptr< ListRecordget_empty_record_sptr () const
 Get a pointer to an empty record. More...
 
virtual Succeeded get_next_record (ListRecord &event) const
 Gets the next record in the listmode sequence.
 
const Scannerget_scanner () const
 Get reference to scanner. More...
 
virtual unsigned long int get_total_number_of_events () const
 Returns the total number of events in the listmode file. More...
 
virtual shared_ptr< const ProjDataInfoget_proj_data_info_sptr () const
 
- Public Member Functions inherited from stir::ExamData
 ExamData ()
 ExamData. More...
 
 ExamData (const shared_ptr< const ExamInfo > &_this_exam)
 
virtual const ExamInfoget_exam_info () const
 
virtual shared_ptr< const ExamInfoget_exam_info_sptr () const
 Get shared pointer to exam info.
 
virtual void set_exam_info (ExamInfo const &)
 change exam info More...
 
void set_exam_info_sptr (shared_ptr< const ExamInfo > new_exam_info_sptr)
 

Additional Inherited Members

- Public Types inherited from stir::ListModeData
typedef ListModeData hierarchy_base_type
 typedef used by read_from_file
 
typedef unsigned int SavedPosition
 Use this typedef for save/set_get_position.
 
- Protected Member Functions inherited from stir::CListModeData
shared_ptr< ListRecordget_empty_record_helper_sptr () const override
 
Succeeded get_next (ListRecord &event) const override
 
- Protected Member Functions inherited from stir::ListModeData
virtual void set_proj_data_info_sptr (shared_ptr< const ProjDataInfo >)
 
- Protected Attributes inherited from stir::ListModeData
shared_ptr< const ProjDataInfoproj_data_info_sptr
 Has to be set by the derived class. More...
 
- Protected Attributes inherited from stir::ExamData
shared_ptr< const ExamInfoexam_info_sptr
 

Detailed Description

template<class CListRecordT>
class stir::ecat::ecat7::CListModeDataECAT< CListRecordT >

A class that reads the listmode data for ECAT scanners.

This file format is currently used by the HR+ and HR++. It stores the coincidence data in multiple .lm files, with a maximum filesize of about 2 GB (to avoid problems with OS limits on filesize). In addition, there is a .sgl file with the singles rate per 'bucket'-per-ring (roughly every 2 seconds). The .sgl also contains a 'main_header' with some scanner and patient info.

Todo:
This class currently relies in the fact that vector<>::size_type == SavedPosition

Constructor & Destructor Documentation

◆ CListModeDataECAT()

template<class CListRecordT >
stir::ecat::ecat7::CListModeDataECAT< CListRecordT >::CListModeDataECAT ( const std::string &  listmode_filename_prefix)

Constructor taking a prefix for the filename.

If the listmode files are called something_1.lm, something_2.lm etc. Then this constructor should be called with the argument "something"

Todo:
Maybe allow for passing e.g. something_2.lm in case the first lm file is missing.

References stir::ProjDataInfo::construct_proj_data_info(), stir::error(), stir::PatientPosition::FFDL, stir::PatientPosition::FFDR, stir::PatientPosition::FFP, stir::PatientPosition::FFS, stir::ecat::ecat7::find_scanner(), stir::PatientPosition::HFDL, stir::PatientPosition::HFDR, stir::PatientPosition::HFP, stir::PatientPosition::HFS, stir::ExamData::set_exam_info(), and stir::warning().

Member Function Documentation

◆ get_name()

template<class CListRecordT >
std::string stir::ecat::ecat7::CListModeDataECAT< CListRecordT >::get_name ( ) const
virtual

Returns the name of the list mode data.

This name is not necessarily unique, and might be empty. However, it is expected (but not guaranteed) that ListModeData::read_from_file(lm_data_ptr->get_name()) would read the same list mode data.

The reason this cannot be guaranteed is largely in case the list mode data is not really on disk, but the object corresponds for instance to a Monte Carlo simulator.

Implements stir::ListModeData.

◆ get_empty_record_sptr()

template<class CListRecordT >
shared_ptr< CListRecord > stir::ecat::ecat7::CListModeDataECAT< CListRecordT >::get_empty_record_sptr ( ) const
virtual

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.

Referenced by stir::ecat::ecat7::CListModeDataECAT< CListRecordT >::set_get_position().

◆ get_next_record()

template<class CListRecordT >
Succeeded stir::ecat::ecat7::CListModeDataECAT< CListRecordT >::get_next_record ( CListRecord record_of_general_type) const
virtual
Todo:
Currently switches over to the next .lm file whenever get_next_record() on the current file fails. This even happens when it failed not because of EOF, or if the listmode file is shorter than 2 GB.

Implements stir::CListModeData.

Referenced by stir::ecat::ecat7::CListModeDataECAT< CListRecordT >::set_get_position().

◆ save_get_position()

template<class CListRecordT >
CListModeData::SavedPosition stir::ecat::ecat7::CListModeDataECAT< CListRecordT >::save_get_position ( )
virtual

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.

Referenced by stir::ecat::ecat7::CListModeDataECAT< CListRecordT >::set_get_position().

◆ has_delayeds()

template<class CListRecordT>
virtual bool stir::ecat::ecat7::CListModeDataECAT< CListRecordT >::has_delayeds ( ) const
inlinevirtual

returns true, as ECAT listmode data stores delayed events (and prompts)

Todo:
this might depend on the acquisition parameters

Implements stir::CListModeData.


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