STIR  6.2.0
Public Member Functions | Protected Member Functions | List of all members
stir::ListModeData_dummy Class Reference

A class to trick the Objective function that we have list mode data, when we only have cache. More...

#include "stir/listmode/ListModeData_dummy.h"

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

Public Member Functions

 ListModeData_dummy (shared_ptr< const ExamInfo > exam_info, shared_ptr< const ProjDataInfo > proj_data_info)
 
std::string get_name () const override
 Returns the name of the list mode data. More...
 
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. More...
 
Succeeded set_get_position (const SavedPosition &) override
 Set the position for reading to a previously saved point.
 
bool has_delayeds () const override
 Return if the file stores delayed events as well (as opposed to prompts)
 
- 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)
 

Protected Member Functions

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 >)
 

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

A class to trick the Objective function that we have list mode data, when we only have cache.

Author
Nikos Efthimiou

This class was created only to hold an ExamInfo and be returned by ListModeData& get_input_data() during set_up() when calling STIR from SIRF.

This can happen when a private (not open-source) IO is required to read the listmode files. However, the owner of that library shared a cache (see PoissonLogLikelihoodWithLinearModelForMeanAndListModeData) listmode file with a third party.

Todo:

Currently, it can only be used in combination with SIRF.

A possibility is to complete this as a class for cache files.

!

Member Function Documentation

◆ get_name()

std::string stir::ListModeData_dummy::get_name ( ) const
inlineoverridevirtual

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.

◆ save_get_position()

SavedPosition stir::ListModeData_dummy::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.

References stir::error().


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