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

A class for reading/writing singles from an ECAT7 .sgl file. More...

#include "stir/data/SinglesRatesFromSglFile.h"

Inheritance diagram for stir::ecat::ecat7::SinglesRatesFromSglFile:
Inheritance graph
[legend]

Public Member Functions

 SinglesRatesFromSglFile ()
 Default constructor.
 
int read_singles_from_sgl_file (const std::string &sgl_filename)
 The function that reads singles from *.sgl file.
 
std::ostream & write (std::ostream &output)
 Write the object to a stream in SGL format. More...
 
- Public Member Functions inherited from stir::RegisteredParsingObject< SinglesRatesFromSglFile, SinglesRates, SinglesRatesForTimeSlices >
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::SinglesRatesForTimeSlices
 SinglesRatesForTimeSlices ()
 Default constructor.
 
float get_singles (const int singles_bin_index, const double start_time, const double end_time) const override
 Get the number of singles for a particular singles unit and a frame with the specified start and end times. More...
 
FrameSinglesRates STIR_DEPRECATED get_rates_for_frame (double start_time, double end_time) const
 Generate a FramesSinglesRate - containing the average rates.
 
virtual int get_end_time_slice_index (double t) const
 
virtual int get_start_time_slice_index (double t) const
 
void set_singles (int singles_bin_index, int time_slice, int new_singles)
 Set a singles by singles bin index and time slice.
 
int rebin (std::vector< double > &new_end_times)
 Rebin the sgl slices into a different set of consecutive slices.
 
std::vector< double > get_times () const
 Get the vector of time values for each time slice index.
 
int get_num_time_slices () const
 Return the number of time slices.
 
double get_singles_time_interval () const
 Return the time interval per slice of singles data.
 
TimeFrameDefinitions get_time_frame_definitions () const
 return time-intervals for every slice
 
- Public Member Functions inherited from stir::SinglesRates
virtual float get_singles_rate (const int singles_bin_index, const double start_time, const double end_time) const
 Get the (average) singles rate for a particular singles unit and a frame with the specified start and end times. More...
 
virtual float get_singles_rate (const DetectionPosition<> &det_pos, const double start_time, const double end_time) const
 Virtual function that returns the average singles rate given the detection positions and time-interval of detection. More...
 
virtual float get_singles (const DetectionPosition<> &det_pos, const double start_time, const double end_time) const
 Virtual function that returns the number of singles given the detection positions and time-interval of detection. More...
 
const Scannerget_scanner_ptr () const
 Get the scanner pointer.
 
- 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 unsigned SIZE_OF_SINGLES_RECORD = 4 * 128
 
static const char *const registered_name = "Singles From Sgl File"
 Name which will be used when parsing a SinglesRatesFromSglFile object.
 

Additional Inherited Members

- Static Public Member Functions inherited from stir::RegisteredParsingObject< SinglesRatesFromSglFile, SinglesRates, SinglesRatesForTimeSlices >
static SinglesRatesread_from_stream (std::istream *)
 Construct a new object (of type Derived) by parsing the istream. More...
 
- Static Public Member Functions inherited from stir::RegisteredObject< SinglesRates >
static SinglesRatesread_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 SinglesRatesask_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< SinglesRates >
typedef SinglesRates *(* 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::SinglesRatesForTimeSlices
void set_time_interval ()
 Calculate and set _singles_time_interval from _times.
 
double get_slice_start_time (int slice_index) const
 get slice start time.
 
- 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< SinglesRates >
static RegistryTyperegistry ()
 Static function returning the registry. More...
 
- Protected Attributes inherited from stir::SinglesRatesForTimeSlices
Array< 2, int > _singles
 total singles per time slice and singles-bin More...
 
std::vector< double > _times
 end times of each time slice (in secs) More...
 
int _num_time_slices
 
double _singles_time_interval
 time interval in secs More...
 
- Protected Attributes inherited from stir::SinglesRates
shared_ptr< Scannerscanner_sptr
 Generate a FramesSinglesRate - containing the average rates.
 
- Protected Attributes inherited from stir::ParsingObject
KeyParser parser
 

Detailed Description

A class for reading/writing singles from an ECAT7 .sgl file.

.sgl files are generated by CTI/Siemens PET scanners ECAT HR+ and HR++ (aka EXACT3D) when doing a list mode scan

Member Function Documentation

◆ write()

std::ostream & stir::ecat::ecat7::SinglesRatesFromSglFile::write ( std::ostream &  output)

Write the object to a stream in SGL format.

Parameters
[in]outputThe ostream to which the object will be written.

References stir::error().


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