3 #ifndef __stir_IO_ECAT962ListmodeInputFileFormat_h__ 4 #define __stir_IO_ECAT962ListmodeInputFileFormat_h__ 29 #ifndef HAVE_LLN_MATRIX 30 # error HAVE_LLN_MATRIX not define: you need the lln ecat library. 45 virtual const std::string get_name()
const {
return "ECAT962"; }
47 virtual bool can_read(
const FileSignature& signature, std::istream& input)
const 49 return this->actual_can_read(signature, input);
51 virtual bool can_read(
const FileSignature& signature,
const std::string& listmode_filename_prefix)
const 53 const std::string singles_filename = listmode_filename_prefix +
"_1.sgl";
54 std::ifstream singles_file(singles_filename.c_str(), std::ios::binary);
55 char buffer[
sizeof(Main_header)];
56 Main_header singles_main_header;
57 singles_file.read(buffer,
sizeof(singles_main_header));
60 unmap_main_header(buffer, &singles_main_header);
61 shared_ptr<Scanner> scanner_sptr;
63 if (scanner_sptr->get_type() == Scanner::E962)
70 virtual bool actual_can_read(
const FileSignature& signature, std::istream& input)
const 72 warning(
"can_read for ECAT962 listmode data with istream not implemented %s:%d. Sorry", __FILE__, __LINE__);
87 error(
"read_from_file for ECAT962 listmode data with istream not implemented %s:%d. Sorry", __FILE__, __LINE__);
88 return unique_ptr<data_type>();
90 virtual unique_ptr<data_type>
read_from_file(
const std::string& filename)
const Classes for listmode events for the ECAT 962 (aka Exact HR+)
A class to read/store the file signature.
Definition: FileSignature.h:34
Declaration of class stir::CListModeDataECAT.
This file declares various utility functions.
Declaration of routines which convert CTI things into our building blocks and vice versa...
A class that reads the listmode data for ECAT scanners.
Definition: CListModeDataECAT.h:48
Declaration of stir::error()
const char * get_signature() const
get access to the signature
Definition: FileSignature.h:52
void warning(const char *const s,...)
Print warning with format string a la printf.
Definition: warning.cxx:41
void error(const char *const s,...)
Print error with format string a la printf and throw exception.
Definition: error.cxx:42
void find_scanner(shared_ptr< Scanner > &scanner_ptr, const Main_header &mhead)
determine scanner type from the main_header
Definition: stir_ecat7.cxx:184