STIR  6.2.0
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
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 >:
Inheritance graph
[legend]

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_typeread_from_file (std::istream &input) const override
 read data from a stream More...
 
std::unique_ptr< data_typeread_from_file (const std::string &filename) const override
 read data from a filename More...
 
- Public Member Functions inherited from stir::ParsingObject
 ParsingObject (const ParsingObject &)
 
ParsingObjectoperator= (const ParsingObject &)
 
void ask_parameters ()
 
virtual std::string parameter_info ()
 
bool parse (std::istream &f)
 
bool parse (const char *const filename)
 

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. More...
 
- Protected Member Functions inherited from stir::ParsingObject
virtual void set_key_values ()
 This will be called before parsing or parameter_info is called. More...
 

Protected Attributes

std::string listmode_filename
 
std::string crystal_map_filename
 
std::string template_proj_data_filename
 
double lor_randomization_sigma
 
- Protected Attributes inherited from stir::ParsingObject
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

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

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

◆ read_from_file() [1/2]

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

◆ read_from_file() [2/2]

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

read data from a filename

This function should throw an exception if the read fails.

Default implementation used open_read_binary and read_from_file(std::istream&).

Reimplemented from stir::InputFileFormat< ListModeData >.

References stir::info().

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