1 #ifndef __stir_IO_ECAT6ImageInputFileFormat_h__ 2 #define __stir_IO_ECAT6ImageInputFileFormat_h__ 38 virtual const std::string get_name()
const {
return "ECAT6"; }
41 virtual bool actual_can_read(
const FileSignature& signature, std::istream& input)
const {
return false; }
43 bool can_read(
const FileSignature& signature, std::istream& input)
const 53 error(
"read_from_file for ECAT6 with istream not implemented %s:%d. Sorry", __FILE__, __LINE__);
54 return unique_ptr<data_type>();
56 virtual unique_ptr<data_type>
read_from_file(
const std::string& filename)
const 60 ECAT6_Main_header mhead;
61 FILE* cti_fptr = fopen(filename.c_str(),
"rb");
66 error(
"error reading main header in ECAT 6 file %s\n", filename.c_str());
69 warning(
"\nReading frame 1, gate 1, data 0, bed 0 from file %s\n", filename.c_str());
71 = ECAT6_to_VoxelsOnCartesianGrid( 1, 1, 0, 0, cti_fptr, mhead);
73 return unique_ptr<data_type>(tmp);
77 error(
"ECAT6ImageInputFileFormat: file '%s' does not look like an ECAT6 image.", filename.c_str());
79 return unique_ptr<data_type>();
This class is used to represent voxelised densities on a cuboid grid (3D).
Definition: FBP3DRPReconstruction.h:43
#define STIR_DEPRECATED
Deprecation macro.
Definition: deprecated.h:19
int cti_read_ECAT6_Main_header(FILE *fptr, ECAT6_Main_header *h)
Read header data from a file and place it into a ECAT6_Main_header struct. Returns EXIT_SUCCESS if no...
Definition: ecat6_utils.cxx:290
A class to read/store the file signature.
Definition: FileSignature.h:34
This file declares various utility functions.
This file declares a deprecation macro.
Declaration of routines which convert ECAT6 things into our building blocks and vice versa...
Declaration of ECAT 6 CTI functions to access data.
Declaration of stir::error()
void warning(const char *const s,...)
Print warning with format string a la printf.
Definition: warning.cxx:41
bool is_ECAT6_image_file(const std::string &filename)
checks if the file is in ECAT6 format and if the file contains images
Definition: stir_ecat6.cxx:140
void error(const char *const s,...)
Print error with format string a la printf and throw exception.
Definition: error.cxx:42
defines the stir::VoxelsOnCartesianGrid class