STIR 6.4.0
stir::CListModeDataROOT Class Reference

class that reads ROOT files, generated by GATE, as listmode data. More...

#include "stir/listmode/CListModeDataROOT.h"

Inheritance diagram for stir::CListModeDataROOT:

Public Member Functions

 CListModeDataROOT (const std::string &hroot_filename_prefix)
 construct from the filename of the Interfile header
 
std::string get_name () const override
 returns the header filename
 
void set_defaults ()
 Set private members default values;.
 
shared_ptr< CListRecordget_empty_record_sptr () const override
 Get a pointer to an empty record.
 
Succeeded get_next_record (CListRecord &record) const override
 Gets the next record in the listmode sequence.
 
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 &) 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)
 
unsigned long int get_total_number_of_events () const override
 Returns the total number of events in the listmode file.
 
- Public Member Functions inherited from stir::ListModeData
 ListModeData ()
 Default constructor.
 
 ListModeData (shared_ptr< const ExamInfo > exam_info_sptr, shared_ptr< const ProjDataInfo > proj_data_info_sptr)
 
shared_ptr< ListRecordget_empty_record_sptr () const
 Get a pointer to an empty record.
 
virtual Succeeded get_next_record (ListRecord &event) const
 Gets the next record in the listmode sequence.
 
const Scannerget_scanner () const
 Get reference to scanner.
 
- Public Member Functions inherited from stir::ExamData
 ExamData ()
 ExamData.
 
 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
 
void set_exam_info_sptr (shared_ptr< const ExamInfo > new_exam_info_sptr)
 
- Public Member Functions inherited from stir::DataWithProjDataInfo
 DataWithProjDataInfo ()
 Default constructor sets internal member to 0.
 
 DataWithProjDataInfo (const shared_ptr< const ProjDataInfo > &proj_data_info_sptr_v)
 
virtual const ProjDataInfoget_proj_data_info () const
 
virtual shared_ptr< const ProjDataInfoget_proj_data_info_sptr () const
 Get shared pointer to ProjData info.
 
int get_num_segments () const
 Get number of segments.
 
int get_num_axial_poss (const int segment_num) const
 Get number of axial positions per segment.
 
int get_num_views () const
 Get number of views.
 
int get_num_tangential_poss () const
 Get number of tangential positions.
 
int get_num_tof_poss () const
 Get number of TOF positions.
 
int get_min_tof_pos_num () const
 Get the index of the first timing position.
 
int get_max_tof_pos_num () const
 Get the index of the last timing position.
 
int get_tof_mash_factor () const
 Get TOG mash factor.
 
int get_min_segment_num () const
 Get minimum segment number.
 
int get_max_segment_num () const
 Get maximum segment number.
 
int get_min_axial_pos_num (const int segment_num) const
 Get mininum axial position per segmnet.
 
int get_max_axial_pos_num (const int segment_num) const
 Get maximum axial position per segment.
 
int get_min_view_num () const
 Get minimum view number.
 
int get_max_view_num () const
 Get maximum view number.
 
int get_min_tangential_pos_num () const
 Get minimum tangential position number.
 
int get_max_tangential_pos_num () const
 Get maximum tangential position number.
 

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::ExamData
shared_ptr< const ExamInfoexam_info_sptr
 
- Protected Attributes inherited from stir::DataWithProjDataInfo
shared_ptr< const ProjDataInfoproj_data_info_sptr
 

Detailed Description

class that reads ROOT files, generated by GATE, as listmode data.

Author
Nikos Efthimiou
Kris Thielemans

This class does not directly read the ROOT file but instead needs an Interfile-type header to specify the scanner (as this information is not stored in the ROOT file). We tend to name this header something.hroot but this is not mandatory.

Warning
There is currently no check if the scanner information is correct. This is dangerous for the geometry, but can also lead to crashes if the actual number of blocks/crystals etc is larger than what is specified in the scanner info.

We currently support only ROOT output using the 'Cylindrical PET' and 'ECAT' systems from GATE.

The Scanner geometry is set in multiple places. In hroot there is the option to use the Scanner name to pull a Scanner from the library. Another option is to use Scanner::User_defined_scanner and set the members: num_rings, num_detectors_per_ring, max_num_non_arccorrected_bins, inner_ring_diameter, average_depth_of_interaction, ring_spacing and bin_size, manually.

In any case this scanner must checkout the geometry created by the repeaters section (which will initialise the InputStreamFromROOTFile. And of course, match the Scanner used by other parts of STIR (e.g. ProjDataInfo e.t.c).

Finally, in the case that Scanner::Unknown_scanner the algorithm will try to create the scanner from the members. Subject to concistency checks, of course.

Example headers
If the scanner is known to stir::Scanner, you can use this
ROOT header :=
Originating system := Siemens mMR

; specify GATE output format (could be GATE_ECAT_PET as well)
GATE scanner type := GATE_Cylindrical_PET
GATE_Cylindrical_PET Parameters :=
  ; name of the actual ROOT file
  name of data file := mysim.root

  ; See elsewhere for other parameters
End GATE_Cylindrical_PET Parameters :=

end ROOT header :=
Below is an example using a user-defined scanner.
ROOT header :=
Originating system := User_defined_scanner
Number of rings                          := 4
Number of detectors per ring             := 504
Inner ring diameter (cm)                 := 65.6
Average depth of interaction (cm)        := 0.7
Distance between rings (cm)              := 0.40625
Default bin size (cm)                    := 0.208626
Maximum number of non-arc-corrected bins := 344
; optional keywords to create "virtual" crystals to accomodate for gaps between blocks
; if you do not specify these, the STIR defaults (determined by the "originating system")
; will be used (which are zero for a User_defined_scanner)
Number of virtual axial crystals per block := 0
Number of virtual transaxial crystals per block:= 0

GATE scanner type := GATE_Cylindrical_PET
GATE_Cylindrical_PET Parameters :=
  ; name of the actual ROOT file
  name of data file := mysim.root

  ; See elsewhere for other parameters
End GATE_Cylindrical_PET Parameters :=

end ROOT header :=

Member Function Documentation

◆ get_name()

std::string stir::CListModeDataROOT::get_name ( ) const
overridevirtual

returns the header filename

Implements stir::ListModeData.

◆ get_empty_record_sptr()

shared_ptr< CListRecord > stir::CListModeDataROOT::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 stir::DataWithProjDataInfo::get_proj_data_info_sptr().

◆ get_next_record()

Succeeded stir::CListModeDataROOT::get_next_record ( CListRecord & event) const
overridevirtual

Gets the next record in the listmode sequence.

Implements stir::CListModeData.

◆ reset()

Succeeded stir::CListModeDataROOT::reset ( )
overridevirtual

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

Implements stir::ListModeData.

◆ save_get_position()

CListModeData::SavedPosition stir::CListModeDataROOT::save_get_position ( )
overridevirtual

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

Succeeded stir::CListModeDataROOT::set_get_position ( const SavedPosition & )
overridevirtual

Set the position for reading to a previously saved point.

Implements stir::ListModeData.

◆ has_delayeds()

bool stir::CListModeDataROOT::has_delayeds ( ) const
inlineoverridevirtual

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

Implements stir::CListModeData.

◆ get_total_number_of_events()

unsigned long stir::CListModeDataROOT::get_total_number_of_events ( ) const
inlineoverridevirtual

Returns the total number of events in the listmode file.

Warning
This function currently works only a limited number of input types (including ROOT). By default it will throw an error.

Reimplemented from stir::ListModeData.


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