STIR 6.5.0
stir::SAFIRCListmodeInputFileFormat< EventDataType > Class Template Reference

Class for reading SAFIR coincidence listmode data. More...

#include "stir/IO/SAFIRCListmodeInputFileFormat.h"

Inheritance diagram for stir::SAFIRCListmodeInputFileFormat< EventDataType >:

Public Member Functions

const std::string get_name () const override
bool can_read (const FileSignature &signature, std::istream &input) const override
 Checks in binary data file for correct signature.
bool can_read (const FileSignature &signature, const std::string &filename) const override
 Checks in binary data file for correct signature (can be either "SAFIR CListModeData", "NeuroLF CListModeData" or "MUPET CListModeData").
std::unique_ptr< data_type > read_from_file (std::istream &input) const override
 read data from a stream
std::unique_ptr< data_type > read_from_file (const std::string &filename) const override
Public Member Functions inherited from stir::ParsingObject
 ParsingObject (const ParsingObject &)
ParsingObject & operator= (const ParsingObject &)
bool parse (std::istream &f)
bool parse (const char *const filename)
void ask_parameters ()
virtual std::string parameter_info ()

Protected Types

typedef ParsingObject base_type

Protected Member Functions

bool actual_can_read (const FileSignature &signature, std::istream &input) const override
void initialise_keymap () override
 Initialise all keywords.
void set_defaults () override
 Set defaults before parsing.
bool actual_do_parsing (const std::string &filename) const
bool post_processing () override
 This will be called at the end of the parsing.
virtual void set_key_values ()
 This will be called before parsing or parameter_info is called.

Protected Attributes

std::string listmode_filename
std::string crystal_map_filename
std::string template_proj_data_filename
double lor_randomization_sigma
KeyParser parser

Additional Inherited Members

Public Types inherited from stir::InputFileFormat< ListModeData >
typedef ListModeData data_type

Detailed Description

template<class EventDataType>
class stir::SAFIRCListmodeInputFileFormat< EventDataType >

Class for reading SAFIR coincidence listmode data.

It reads a parameter file, which refers to

  • optional crystal map containing the mapping between detector index triple and cartesian coordinates of the crystal surfaces (see DetectorCoordinateMap)
  • the binary data file with the coincidence listmode data in SAFIR format (see CListModeDataSAFIR)
  • a template projection data file, which defines the scanner

If the map is not defined, the scanner detectors will be used. Otherwise, the nearest LOR of the scanner will be selected for each event.

An example of such a parameter file would be

CListModeDataSAFIR Parameters:=
listmode data filename:= listmode_input.clm.safir
template projection data filename:= <projdata-filename>
; optional map specifying the actual location of the crystals
crystal map filename:= crystal_map.txt
; optional random displacement of the LOR end-points in mm (only used of a map is present)
LOR randomization (Gaussian) sigma:=0
END CListModeDataSAFIR Parameters:=
Class for reading SAFIR listmode data with variable geometry.
Definition CListModeDataSAFIR.h:42
A base class for specifying an LOR with geometric coordinates.
Definition LORCoordinates.h:59

The first 32 bytes of the binary file are interpreted as file signature and matched against the strings "MUPET CListModeData\0", "SAFIR CListModeData\0" and "NeuroLF CListModeData\0". If either is successfull, the class claims it can read the file format. The rest of the file is read as records as specified as template parameter, e.g. CListRecordSAFIR.

Member Function Documentation

◆ get_name()

template<class EventDataType>
const std::string stir::SAFIRCListmodeInputFileFormat< EventDataType >::get_name ( ) const
inlineoverridevirtual

◆ can_read() [1/2]

template<class EventDataType>
bool stir::SAFIRCListmodeInputFileFormat< EventDataType >::can_read ( const FileSignature & signature,
std::istream & input ) const
inlineoverridevirtual

Checks in binary data file for correct signature.

Reimplemented from stir::InputFileFormat< ListModeData >.

◆ can_read() [2/2]

template<class EventDataType>
bool stir::SAFIRCListmodeInputFileFormat< EventDataType >::can_read ( const FileSignature & signature,
const std::string & filename ) const
inlineoverride

Checks in binary data file for correct signature (can be either "SAFIR CListModeData", "NeuroLF CListModeData" or "MUPET CListModeData").

References stir::standardise_interfile_keyword(), and stir::warning().

◆ read_from_file()

template<class EventDataType>
std::unique_ptr< data_type > stir::SAFIRCListmodeInputFileFormat< EventDataType >::read_from_file ( std::istream & input) const
inlineoverridevirtual

read data from a stream

This function should throw an exception if the read fails.

Warning
This member throws for most implementations. Use a filename instead.

Implements stir::InputFileFormat< ListModeData >.

References stir::error().

◆ actual_can_read()

template<class EventDataType>
bool stir::SAFIRCListmodeInputFileFormat< EventDataType >::actual_can_read ( const FileSignature & signature,
std::istream & input ) const
inlineoverrideprotectedvirtual

◆ initialise_keymap()

template<class EventDataType>
void stir::SAFIRCListmodeInputFileFormat< EventDataType >::initialise_keymap ( )
inlineoverrideprotectedvirtual

Initialise all keywords.

Reimplemented from stir::ParsingObject.

References stir::ParsingObject::initialise_keymap().

◆ set_defaults()

template<class EventDataType>
void stir::SAFIRCListmodeInputFileFormat< EventDataType >::set_defaults ( )
inlineoverrideprotectedvirtual

Set defaults before parsing.

Reimplemented from stir::ParsingObject.

References stir::ParsingObject::set_defaults().

◆ post_processing()

template<class EventDataType>
bool stir::SAFIRCListmodeInputFileFormat< EventDataType >::post_processing ( )
inlineoverrideprotectedvirtual

This will be called at the end of the parsing.

Returns
false if everything OK, true if not

Reimplemented from stir::ParsingObject.


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