STIR
6.2.0
|
Files | |
file | ECAT7DynamicDiscretisedDensityOutputFileFormat.cxx |
Implementation of class stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityOutputFileFormat. | |
file | add_ecat7_header_to_sgl.cxx |
Prepend contents of ECAT7 header to a new sgl file (from list mode acquisition) | |
file | show_ecat7_header.cxx |
Show contents of ECAT7 header. | |
file | ecat6_types.h |
ECAT 6 CTI matrix parameters. | |
file | ecat6_utils.h |
Declaration of ECAT 6 CTI functions to access data. | |
file | ECAT6ImageInputFileFormat.h |
Declaration of class stir::ecat::ecat6::ECAT6ImageInputFileFormat. | |
file | ECAT6OutputFileFormat.h |
Declaration of class stir::ecat::ecat7::ECAT6OutputFileFormat. | |
file | ECAT7DynamicDiscretisedDensityInputFileFormat.h |
Declaration of class stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityInputFileFormat. | |
file | ECAT7DynamicDiscretisedDensityOutputFileFormat.h |
Declaration of class stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityOutputFileFormat. | |
file | ECAT7ImageInputFileFormat.h |
Declaration of class stir::ecat::ecat7::ECAT7ImageInputFileFormat. | |
file | ECAT7OutputFileFormat.h |
Declaration of class stir::ecat::ecat7::ECAT7OutputFileFormat. | |
file | ECAT7ParametricDensityOutputFileFormat.h |
Declaration of class stir::ecat::ecat7::ECAT7ParametricDensityOutputFileFormat. | |
file | ECAT8_32bitListmodeInputFileFormat.h |
Declaration of class stir::ecat::ECAT8_32bitListmodeInputFileFormat. | |
file | ECAT962ListmodeInputFileFormat.h |
Declaration of class stir::ecat::ecat7::ECAT962ListmodeInputFileFormat. | |
file | ECAT966ListmodeInputFileFormat.h |
Declaration of class stir::ecat::ecat7::ECAT966ListmodeInputFileFormat. | |
file | InterfileHeaderSiemens.h |
This file declares the classes stir::InterfileHeaderSiemens, stir::InterfileRawDataHeaderSiemens, stir::InterfilePDFSHeaderSiemens, stir::InterfileListmodeHeaderSiemens, stir:InterfileNormHeaderSiemens. | |
file | stir_ecat6.h |
Declaration of routines which convert ECAT6 things into our building blocks and vice versa. | |
file | stir_ecat7.h |
Declaration of routines which convert CTI things into our building blocks and vice versa. | |
file | stir_ecat_common.h |
Declaration of routines which convert ECAT things into our building blocks and vice versa. | |
file | ecat6_utils.cxx |
Implementation of ECAT 6 CTI functions to access data. | |
file | ECAT6OutputFileFormat.cxx |
Implementation of class stir::ECAT6OutputFileFormat. | |
file | ECAT7DynamicDiscretisedDensityInputFileFormat.cxx |
Implementation of class stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityInputFileFormat. | |
file | ECAT7DynamicDiscretisedDensityOutputFileFormat.cxx |
Implementation of class stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityOutputFileFormat. | |
file | ECAT7OutputFileFormat.cxx |
Implementation of class stir::ecat::ecat7::ECAT7OutputFileFormat. | |
file | ECAT7ParametricDensityOutputFileFormat.cxx |
Implementation of class stir::ecat::ecat7::ECAT7ParametricDensityOutputFileFormat. | |
file | stir_ecat6.cxx |
Implementation of routines which convert CTI things into our building blocks and vice versa. | |
file | stir_ecat7.cxx |
Implementation of routines which convert ECAT7 things into our building blocks and vice versa. | |
file | stir_ecat_common.cxx |
Implementation of routines which convert ECAT6, ECAT7 and ECAT8 things into our building blocks and vice versa. | |
file | add_ecat7_header_to_sgl.cxx |
Prepend contents of ECAT7 header to a new sgl file (from list mode acquisition) | |
file | BinNormalisationFromECAT7.cxx |
Implementation for class stir::ecat::ecat7::BinNormalisationFromECAT7. | |
file | BinNormalisationFromECAT8.cxx |
Implementation for class stir::ecat::BinNormalisationFromECAT8. | |
file | copy_ecat7_header.cxx |
Copy contents of an ECAT7 header from 1 file to another. | |
file | ecat_swap_corners.cxx |
A (slightly dangerous) utility to perform so-called corner-swapping for ECAT6 projection data. | |
file | is_ecat7_file.cxx |
A simple utility that allows to check if a file is in the ECAT7 format. | |
Classes | |
class | stir::ecat::ecat6::ECAT6ImageInputFileFormat |
Class for reading images in ECAT6 file-format. More... | |
class | stir::ecat::ecat6::ECAT6OutputFileFormat |
Implementation of OutputFileFormat paradigm for the ECAT6 format. More... | |
class | stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityInputFileFormat |
Class for reading images in ECAT7 file-format. More... | |
class | stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityOutputFileFormat |
Implementation of OutputFileFormat paradigm for the ECAT7 format. More... | |
class | stir::ecat::ecat7::ECAT7ImageInputFileFormat |
Class for reading images in ECAT7 file-format. More... | |
class | stir::ecat::ecat7::ECAT7OutputFileFormat |
Implementation of OutputFileFormat paradigm for the ECAT7 format. More... | |
class | stir::ecat::ecat7::ECAT7ParametricDensityOutputFileFormat< DiscretisedDensityT > |
Implementation of OutputFileFormat paradigm for the ECAT7 format. More... | |
class | stir::ecat::ECAT8_32bitListmodeInputFileFormat |
Class for being able to read list mode data from the ECAT 8_32bit scanner via the listmode-data registry. More... | |
class | stir::ecat::ecat7::ECAT962ListmodeInputFileFormat |
Class for reading list mode data from the ECAT 962 scanner. More... | |
class | stir::ecat::ecat7::ECAT966ListmodeInputFileFormat |
Class for reading list mode data from the ECAT 966 scanner. More... | |
class | stir::ecat::ecat7::BinNormalisationFromECAT7 |
A BinNormalisation class that gets the normalisation factors from an ECAT7 3D normalisation file. More... | |
class | stir::ecat::BinNormalisationFromECAT8 |
A BinNormalisation class that gets the normalisation factors from an ECAT8 3D normalisation file. Note that you have to point it to the "Interfile" header. More... | |
struct | stir::ecat::ecat6::ScanInfoRec |
ECAT 6 CTI scanner parameters. More... | |
Enumerations | |
enum | stir::ecat::ECATDataType { ECAT_unknown_data_type = 0, ECAT_Byte_data_type = 1, ECAT_I2_little_endian_data_type = 2, ECAT_I4_little_endian_data_type = 3, ECAT_R4_VAX_data_type = 4, ECAT_R4_IEEE_big_endian_data_type = 5, ECAT_I2_big_endian_data_type = 6, ECAT_I4_big_endian_data_type = 7 } |
Possible values for the data_type field in ECAT headers. More... | |
Functions | |
long | stir::ecat::ecat6::cti_numcod (int frame, int plane, int gate, int data, int bed) |
Encode scan information into a single, incomprehensible number. | |
void | stir::ecat::ecat6::cti_numdoc (long matnum, Matval *matval) |
Unpack encoded data into a nice struct. Reverse of cti_numcod (). More... | |
int | stir::ecat::ecat6::cti_rings2plane (short nrings, short ring0, short ring1) |
Get sinogram plane from ring pair. More... | |
FILE * | stir::ecat::ecat6::cti_create (const char *fname, const ECAT6_Main_header *mhead) |
Open a file and write main header to it. Returns a pointer to the file, or 0 if unsuccessful. More... | |
int | stir::ecat::ecat6::cti_rblk (FILE *fptr, int blkno, void *bufr, int nblks) |
Read from a matrix file starting at the given block. Returns EXIT_SUCCESS if all went well. More... | |
int | stir::ecat::ecat6::cti_wblk (FILE *fptr, int blkno, void *bufr, int nblks) |
Write blocks from buffer into file. Returns EXIT_SUCCESS if successful. More... | |
int | stir::ecat::ecat6::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 error. More... | |
int | stir::ecat::ecat6::cti_read_scan_subheader (FILE *fptr, const ECAT6_Main_header *, int blknum, Scan_subheader *) |
Read header data from a file and place it into a Scan_subheader struct. Returns EXIT_SUCCESS if no error. More... | |
int | stir::ecat::ecat6::cti_read_attn_subheader (FILE *fptr, const ECAT6_Main_header *h, int blknum, Attn_subheader *header_ptr) |
Read header data from a file and place it into a Attn_subheader struct. Returns EXIT_SUCCESS if no error. More... | |
int | stir::ecat::ecat6::cti_read_norm_subheader (FILE *fptr, const ECAT6_Main_header *h, int blknum, Norm_subheader *header_ptr) |
Read header data from a file and place it into a Norm_subheader struct. Returns EXIT_SUCCESS if no error. More... | |
int | stir::ecat::ecat6::cti_read_image_subheader (FILE *fptr, const ECAT6_Main_header *h, int blknum, Image_subheader *header_ptr) |
Read header data from a file and place it into an Image_subheader struct. Returns EXIT_SUCCESS if no error. More... | |
int | stir::ecat::ecat6::cti_enter (FILE *fptr, const ECAT6_Main_header *mhead_ptr, long matnum, int nblks) |
Create entry in file corresponding to matnum, and return offset of next block. Or some such. Returns 0 if there was an error. More... | |
int | stir::ecat::ecat6::cti_lookup (FILE *fptr, const ECAT6_Main_header *mhead_ptr, long matnum, MatDir *entry) |
Look up a "matrix number" in the file and return the MatDir entry for it. Returns 0 if the lookup was NOT successful. More... | |
int | stir::ecat::ecat6::cti_write_idata (FILE *fptr, int blk, const short *data, int isize) |
Write data in blocks from buffer into file. | |
int | stir::ecat::ecat6::cti_write_image_subheader (FILE *fptr, const ECAT6_Main_header *h, int blknum, const Image_subheader *header_ptr) |
Write an image subheader into a matrix file. Returns 0 if successful. More... | |
int | stir::ecat::ecat6::cti_write_ECAT6_Main_header (FILE *fptr, const ECAT6_Main_header *header_ptr) |
Write an image main header into a matrix file. Returns 0 if successful. More... | |
int | stir::ecat::ecat6::cti_write_scan_subheader (FILE *fptr, const ECAT6_Main_header *h, int blknum, const Scan_subheader *header_ptr) |
Write a scan subheader into a matrix file. More... | |
int | stir::ecat::ecat6::cti_write_image (FILE *fptr, long matnum, const ECAT6_Main_header *mhead_ptr, const Image_subheader *header_ptr, const short *data, int data_size) |
Write an image, including headers, into a matrix file. | |
int | stir::ecat::ecat6::cti_write_scan (FILE *fptr, long matnum, const ECAT6_Main_header *mhead_ptr, const Scan_subheader *header_ptr, const short *data, int data_size) |
Write a scan, including headers, into a matrix file. | |
int | stir::ecat::ecat6::get_scanheaders (FILE *fptr, long matnum, ECAT6_Main_header *mhead, Scan_subheader *shead, ScanInfoRec *scanParams) |
Read main header and subheader from scan file. Returns EXIT_SUCCESS if no error. More... | |
int | stir::ecat::ecat6::get_scandata (FILE *fptr, char *scan, ScanInfoRec *scanParams) |
Read scan data from file. Returns EXIT_FAILURE if the data could not be read. More... | |
int | stir::ecat::ecat6::get_attnheaders (FILE *fptr, long matnum, ECAT6_Main_header *mhead, Attn_subheader *shead, ScanInfoRec *attnParams) |
Read main header and subheader from attn file. Returns EXIT_SUCCESS if no error. More... | |
int | stir::ecat::ecat6::get_normheaders (FILE *fptr, long matnum, ECAT6_Main_header *mhead, Norm_subheader *shead, ScanInfoRec *nrmParams) |
Read main header and subheader from normalisation file. Returns EXIT_SUCCESS if no error. More... | |
bool | stir::ecat::ecat6::is_ECAT6_file (const std::string &filename) |
checks if the file is in ECAT6 formatAs ECAT6 doesn't have a 'magic number' this check is somewhat heuristic. Checks are only on the main header. Current checks are: More... | |
bool | stir::ecat::ecat6::is_ECAT6_image_file (const std::string &filename) |
checks if the file is in ECAT6 format and if the file contains images | |
bool | stir::ecat::ecat6::is_ECAT6_emission_file (const std::string &filename) |
checks if the file is in ECAT6 format and if the file contains emission sinograms (or blank/transmision) | |
bool | stir::ecat::ecat6::is_ECAT6_attenuation_file (const std::string &filename) |
checks if the file is in ECAT6 format and if the file contains attenuation correction factors | |
Scanner * | stir::ecat::ecat6::find_scanner_from_ECAT6_Main_header (const ECAT6_Main_header &mhead) |
determine scanner type from the ECAT6_Main_header More... | |
Succeeded | stir::ecat::ecat6::DiscretisedDensity_to_ECAT6 (DiscretisedDensity< 3, float > const &density, std::string const &cti_name, std::string const &orig_name, const Scanner &scanner, const int frame_num=1, const int gate_num=1, const int data_num=0, const int bed_num=0) |
Create a new ECAT6 image file and write the data in there. More... | |
Succeeded | stir::ecat::ecat6::DiscretisedDensity_to_ECAT6 (FILE *fptr, DiscretisedDensity< 3, float > const &density, const ECAT6_Main_header &mhead, const int frame_num=1, const int gate_num=1, const int data_num=0, const int bed_num=0) |
Write an (extra) image to an existing ECAT6 file. More... | |
Succeeded | stir::ecat::ecat6::ProjData_to_ECAT6 (ProjData const &proj_data, std::string const &cti_name, std::string const &orig_name, const int frame_num=1, const int gate_num=1, const int data_num=0, const int bed_num=0, const bool write_2D_sinograms=false) |
Create a new ECAT6 sinogram file and write the data in there. More... | |
Succeeded | stir::ecat::ecat6::ProjData_to_ECAT6 (FILE *fptr, ProjData const &proj_data, const ECAT6_Main_header &mhead, const int frame_num=1, const int gate_num=1, const int data_num=0, const int bed_num=0, const bool write_2D_sinograms=false) |
Write an (extra) set of sinograms to an existing ECAT6 file. More... | |
void | stir::ecat::ecat6::make_ECAT6_Main_header (ECAT6_Main_header &, const Scanner &, const std::string &orig_name, ExamInfo const &exam_info) |
Fill in most of the main header given a Scanner object and orig_name. | |
void | stir::ecat::ecat6::make_ECAT6_Main_header (ECAT6_Main_header &mhead, Scanner const &scanner, const std::string &orig_name, DiscretisedDensity< 3, float > const &density) |
Fill in most of the main header given a Scanner object and orig_name and an image. More... | |
void | stir::ecat::ecat6::make_ECAT6_Main_header (ECAT6_Main_header &mhead, const std::string &orig_name, ProjDataInfo const &proj_data_info) |
Fill in most of the main header given an orig_name and a proj_data_info. More... | |
bool | stir::ecat::ecat7::is_ECAT7_file (const std::string &filename) |
checks if the file is in ECAT7 formatThis partly relies on the implementation of matrix_open in the LLN matrix library. Additional checks are made on the main header. Current checks are: More... | |
bool | stir::ecat::ecat7::is_ECAT7_image_file (const std::string &filename) |
checks if the file is in ECAT6 format and if the file contains images | |
bool | stir::ecat::ecat7::is_ECAT7_emission_file (const std::string &filename) |
checks if the file is in ECAT6 format and if the file contains emission sinograms (or blank/transmision) | |
bool | stir::ecat::ecat7::is_ECAT7_attenuation_file (const std::string &filename) |
checks if the file is in ECAT6 format and if the file contains attenuation correction factors | |
void | stir::ecat::ecat7::find_scanner (shared_ptr< Scanner > &scanner_ptr, const Main_header &mhead) |
determine scanner type from the main_header More... | |
Succeeded | stir::ecat::ecat7::DiscretisedDensity_to_ECAT7 (DiscretisedDensity< 3, float > const &density, std::string const &cti_name, std::string const &orig_name, const Scanner &scanner, const int frame_num=1, const int gate_num=1, const int data_num=0, const int bed_num=0) |
Create a new ECAT7 image file and write the data in there. | |
Succeeded | stir::ecat::ecat7::DiscretisedDensity_to_ECAT7 (MatrixFile *mptr, DiscretisedDensity< 3, float > const &density, const int frame_num=1, const int gate_num=1, const int data_num=0, const int bed_num=0) |
Write an (extra) image to an existing ECAT7 file. More... | |
Succeeded | stir::ecat::ecat7::ProjData_to_ECAT7 (ProjData const &proj_data, NumericType output_type, std::string const &cti_name, std::string const &orig_name, const int frame_num=1, const int gate_num=1, const int data_num=0, const int bed_num=0, const bool write_as_attenuation=false, float scale_factor=0.0F) |
Create a new ECAT7 sinogram file and write the data in there. More... | |
Succeeded | stir::ecat::ecat7::ProjData_to_ECAT7 (MatrixFile *mptr, ProjData const &proj_data, const int frame_num=1, const int gate_num=1, const int data_num=0, const int bed_num=0, float scale_factor=0.0F) |
Write an (extra) set of sinograms to an existing ECAT7 file. More... | |
void | stir::ecat::ecat7::make_ECAT7_main_header (Main_header &, const Scanner &, const std::string &orig_name, ExamInfo const &exam_info) |
Fill in most of the main header given a Scanner object and orig_name. | |
void | stir::ecat::ecat7::make_ECAT7_main_header (Main_header &mhead, Scanner const &scanner, const std::string &orig_name, DiscretisedDensity< 3, float > const &density) |
Fill in most of the main header given a Scanner object and orig_name and an image. More... | |
NumericType | stir::ecat::ecat7::make_ECAT7_main_header (Main_header &mhead, const std::string &orig_name, ExamInfo const &exam_info, ProjDataInfo const &proj_data_info, const bool write_as_attenuation=false, NumericType output_type=NumericType::FLOAT) |
Fill in most of the main header given an orig_name and a proj_data_info. More... | |
void | stir::ecat::ecat7::make_subheader_for_ECAT7 (Attn_subheader &shead, const Main_header &mhead, const ProjDataInfo &proj_data_info) |
Fill in most of the subheader. More... | |
void | stir::ecat::ecat7::make_subheader_for_ECAT7 (Scan3D_subheader &shead, const Main_header &mhead, const ProjDataInfo &proj_data_info) |
Fill in most of the subheader. More... | |
ProjDataFromStream * | stir::ecat::ecat7::make_pdfs_from_matrix (MatrixFile *const mptr, MatrixData *const matrix, const shared_ptr< std::iostream > &stream_ptr) |
Make a ProjDataFromStream object that 'points' into an ECAT7 file. More... | |
Succeeded | stir::ecat::ecat7::write_basic_interfile_header_for_ECAT7 (std::string &interfile_header_name, const std::string &ECAT7_filename, const int frame_num, const int gate_num, const int data_num, const int bed_num) |
Writes an Interfile header that 'points' into an ECAT7 file. More... | |
void | stir::ecat::find_type_from_ECAT_data_type (NumericType &type, ByteOrder &byte_order, const short data_type) |
Find out which NumericType and ByteOrder corresponds to a ECAT data type. | |
short | stir::ecat::find_ECAT_data_type (const NumericType &type, const ByteOrder &byte_order) |
Find out which ECAT data type corresponds to a certain NumericType and ByteOrder. More... | |
short | stir::ecat::find_ECAT_system_type (const Scanner &scanner) |
Find the value used in the ECAT Main header for a given scanner. More... | |
Scanner * | stir::ecat::find_scanner_from_ECAT_system_type (const short system_type) |
Find the scanner corresponding to the system type in the main header. More... | |
std::vector< int > | stir::ecat::find_segment_sequence (const ProjDataInfo &pdi) |
Return the sequence of how Siemens stores segments. More... | |
std::vector< int > | stir::ecat::find_timing_poss_sequence (const ProjDataInfo &pdi) |
Return the sequence of how Siemens stores TOF bins. More... | |
virtual bool | stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityInputFileFormat::actual_can_read (const FileSignature &signature, std::istream &input) const |
Class for reading images in ECAT7 file-format. More... | |
Possible values for the data_type field in ECAT headers.
The data_type field is used to indicate how the data are written. Note that the VAX_float type is not the same as IEEE float with little_endian byte order.
void stir::ecat::ecat6::cti_numdoc | ( | long | matnum, |
Matval * | matval | ||
) |
Unpack encoded data into a nice struct. Reverse of cti_numcod ().
matnum | the thingy to decode |
matval | struct containing the decoded values from matnum |
int stir::ecat::ecat6::cti_rings2plane | ( | short | nrings, |
short | ring0, | ||
short | ring1 | ||
) |
Get sinogram plane from ring pair.
ring0 | first ring in ring pair |
ring1 | second ring in ring pair |
FILE * stir::ecat::ecat6::cti_create | ( | const char * | fname, |
const ECAT6_Main_header * | mhead | ||
) |
Open a file and write main header to it. Returns a pointer to the file, or 0 if unsuccessful.
fname | name of file to open |
mhead | pointer to main header struct to copy into the file |
Referenced by stir::ecat::ecat6::ECAT6OutputFileFormat::actual_write_to_file(), stir::ecat::ecat6::DiscretisedDensity_to_ECAT6(), and stir::ecat::ecat6::ProjData_to_ECAT6().
int stir::ecat::ecat6::cti_rblk | ( | FILE * | fptr, |
int | blkno, | ||
void * | bufr, | ||
int | nblks | ||
) |
Read from a matrix file starting at the given block. Returns EXIT_SUCCESS if all went well.
fptr | file pointer |
blkno | first block to read |
nblks | number of blocks to read |
int stir::ecat::ecat6::cti_wblk | ( | FILE * | fptr, |
int | blkno, | ||
void * | bufr, | ||
int | nblks | ||
) |
Write blocks from buffer into file. Returns EXIT_SUCCESS if successful.
fptr | pointer to file. |
blkno | position in file of first block to write. |
nblks | number of blocks to write. |
int stir::ecat::ecat6::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 error.
fptr | file containing the header data |
h | struct to fill with header info |
Referenced by stir::ecat::ecat6::ECAT6ImageInputFileFormat::read_from_file().
int stir::ecat::ecat6::cti_read_scan_subheader | ( | FILE * | fptr, |
const ECAT6_Main_header * | h, | ||
int | blknum, | ||
Scan_subheader * | header_ptr | ||
) |
Read header data from a file and place it into a Scan_subheader struct. Returns EXIT_SUCCESS if no error.
fptr | file containing the header data |
blknum | block number at which to begin reading |
h | struct to fill |
int stir::ecat::ecat6::cti_read_attn_subheader | ( | FILE * | fptr, |
const ECAT6_Main_header * | h, | ||
int | blknum, | ||
Attn_subheader * | header_ptr | ||
) |
Read header data from a file and place it into a Attn_subheader struct. Returns EXIT_SUCCESS if no error.
fptr | file containing the header data |
blknum | block number at which to begin reading |
header_ptr | struct to fill |
int stir::ecat::ecat6::cti_read_norm_subheader | ( | FILE * | fptr, |
const ECAT6_Main_header * | h, | ||
int | blknum, | ||
Norm_subheader * | header_ptr | ||
) |
Read header data from a file and place it into a Norm_subheader struct. Returns EXIT_SUCCESS if no error.
fptr | file containing the header data |
blknum | block number at which to begin reading |
header_ptr | struct to fill |
int stir::ecat::ecat6::cti_read_image_subheader | ( | FILE * | fptr, |
const ECAT6_Main_header * | h, | ||
int | blknum, | ||
Image_subheader * | header_ptr | ||
) |
Read header data from a file and place it into an Image_subheader struct. Returns EXIT_SUCCESS if no error.
fptr | file containing the header data |
blknum | block number at which to begin reading |
header_ptr | struct to fill |
int stir::ecat::ecat6::cti_enter | ( | FILE * | fptr, |
const ECAT6_Main_header * | mhead_ptr, | ||
long | matnum, | ||
int | nblks | ||
) |
Create entry in file corresponding to matnum, and return offset of next block. Or some such. Returns 0 if there was an error.
fptr | pointer to file. |
mhead_ptr | pointer to a main header |
matnum | desired matnum. |
nblks | number of blocks |
int stir::ecat::ecat6::cti_lookup | ( | FILE * | fptr, |
const ECAT6_Main_header * | mhead_ptr, | ||
long | matnum, | ||
MatDir * | entry | ||
) |
Look up a "matrix number" in the file and return the MatDir entry for it. Returns 0 if the lookup was NOT successful.
fptr | file containing all the tabulated information. |
mhead_ptr | pointer to a main header |
matnum | index. |
entry | where to put the result. |
int stir::ecat::ecat6::cti_write_image_subheader | ( | FILE * | fptr, |
const ECAT6_Main_header * | h, | ||
int | blknum, | ||
const Image_subheader * | header_ptr | ||
) |
Write an image subheader into a matrix file. Returns 0 if successful.
fptr | pointer to file. |
blknum | offset (in blocks) in file of first block to write. |
header_ptr | header to write |
int stir::ecat::ecat6::cti_write_ECAT6_Main_header | ( | FILE * | fptr, |
const ECAT6_Main_header * | header_ptr | ||
) |
Write an image main header into a matrix file. Returns 0 if successful.
fptr | pointer to file. |
header_ptr | header to write |
int stir::ecat::ecat6::cti_write_scan_subheader | ( | FILE * | fptr, |
const ECAT6_Main_header * | h, | ||
int | blknum, | ||
const Scan_subheader * | header_ptr | ||
) |
Write a scan subheader into a matrix file.
fptr | pointer to file. |
blknum | block offset at which to begin writing |
header_ptr | header to write |
int stir::ecat::ecat6::get_scanheaders | ( | FILE * | fptr, |
long | matnum, | ||
ECAT6_Main_header * | mhead, | ||
Scan_subheader * | shead, | ||
ScanInfoRec * | scanParams | ||
) |
Read main header and subheader from scan file. Returns EXIT_SUCCESS if no error.
fptr | pointer to scan file |
matnum | matnum for scan |
mhead | where to put the main header |
shead | where to put the subheader |
scanParams | where to put the scan parameters |
int stir::ecat::ecat6::get_scandata | ( | FILE * | fptr, |
char * | scan, | ||
ScanInfoRec * | scanParams | ||
) |
Read scan data from file. Returns EXIT_FAILURE if the data could not be read.
fptr | scan file |
scan | buffer for the data, must be preallocated |
scanParams | data parameters |
The data will be stored according to the data_type in scanParams, but converted (i.e. byte-swapped etc.) to the hosts native format.
int stir::ecat::ecat6::get_attnheaders | ( | FILE * | fptr, |
long | matnum, | ||
ECAT6_Main_header * | mhead, | ||
Attn_subheader * | shead, | ||
ScanInfoRec * | attnParams | ||
) |
Read main header and subheader from attn file. Returns EXIT_SUCCESS if no error.
fptr | pointer to attn file |
matnum | matnum for attn |
mhead | where to put the main header |
shead | where to put the subheader |
attnParams | where to put the attn parameters |
int stir::ecat::ecat6::get_normheaders | ( | FILE * | fptr, |
long | matnum, | ||
ECAT6_Main_header * | mhead, | ||
Norm_subheader * | shead, | ||
ScanInfoRec * | nrmParams | ||
) |
Read main header and subheader from normalisation file. Returns EXIT_SUCCESS if no error.
fptr | pointer to nrm file |
matnum | matnum for nrm |
mhead | where to put the main header |
shead | where to put the subheader |
nrmParams | where to put the nrm parameters |
bool stir::ecat::ecat6::is_ECAT6_file | ( | const std::string & | filename | ) |
checks if the file is in ECAT6 formatAs ECAT6 doesn't have a 'magic number' this check is somewhat heuristic. Checks are only on the main header. Current checks are:
Referenced by stir::TimeFrameDefinitions::TimeFrameDefinitions().
Scanner * stir::ecat::ecat6::find_scanner_from_ECAT6_Main_header | ( | const ECAT6_Main_header & | mhead | ) |
determine scanner type from the ECAT6_Main_header
Returns a Unknown_Scanner if it does not recognise it.
References stir::ecat::find_scanner_from_ECAT_system_type().
Succeeded stir::ecat::ecat6::DiscretisedDensity_to_ECAT6 | ( | DiscretisedDensity< 3, float > const & | density, |
std::string const & | cti_name, | ||
std::string const & | orig_name, | ||
const Scanner & | scanner, | ||
const int | frame_num = 1 , |
||
const int | gate_num = 1 , |
||
const int | data_num = 0 , |
||
const int | bed_num = 0 |
||
) |
Create a new ECAT6 image file and write the data in there.
References stir::ecat::ecat6::cti_create(), and stir::ecat::ecat6::make_ECAT6_Main_header().
Referenced by stir::ecat::ecat6::ECAT6OutputFileFormat::actual_write_to_file().
Succeeded stir::ecat::ecat6::DiscretisedDensity_to_ECAT6 | ( | FILE * | fptr, |
DiscretisedDensity< 3, float > const & | density, | ||
const ECAT6_Main_header & | mhead, | ||
const int | frame_num = 1 , |
||
const int | gate_num = 1 , |
||
const int | data_num = 0 , |
||
const int | bed_num = 0 |
||
) |
Write an (extra) image to an existing ECAT6 file.
Some consistency checks are performed between the image and the data in the main header
Succeeded stir::ecat::ecat6::ProjData_to_ECAT6 | ( | ProjData const & | proj_data, |
std::string const & | cti_name, | ||
std::string const & | orig_name, | ||
const int | frame_num = 1 , |
||
const int | gate_num = 1 , |
||
const int | data_num = 0 , |
||
const int | bed_num = 0 , |
||
const bool | write_2D_sinograms = false |
||
) |
Create a new ECAT6 sinogram file and write the data in there.
References stir::ecat::ecat6::cti_create(), stir::ProjData::get_proj_data_info_sptr(), and stir::ecat::ecat6::make_ECAT6_Main_header().
Succeeded stir::ecat::ecat6::ProjData_to_ECAT6 | ( | FILE * | fptr, |
ProjData const & | proj_data, | ||
const ECAT6_Main_header & | mhead, | ||
const int | frame_num = 1 , |
||
const int | gate_num = 1 , |
||
const int | data_num = 0 , |
||
const int | bed_num = 0 , |
||
const bool | write_2D_sinograms = false |
||
) |
Write an (extra) set of sinograms to an existing ECAT6 file.
Some consistency checks are performed between the proj_data and the data in the main header
void stir::ecat::ecat6::make_ECAT6_Main_header | ( | ECAT6_Main_header & | mhead, |
Scanner const & | scanner, | ||
const std::string & | orig_name, | ||
DiscretisedDensity< 3, float > const & | density | ||
) |
Fill in most of the main header given a Scanner object and orig_name and an image.
Sets file_type, num_planes, plane_separation as well
References stir::ecat::ecat6::make_ECAT6_Main_header().
void stir::ecat::ecat6::make_ECAT6_Main_header | ( | ECAT6_Main_header & | mhead, |
const std::string & | orig_name, | ||
ProjDataInfo const & | proj_data_info | ||
) |
Fill in most of the main header given an orig_name and a proj_data_info.
It gets the scanner from the proj_data_info object. Sets file_type, num_planes, plane_separation as well
References stir::ProjDataInfo::get_scanner_sptr(), stir::ecat::ecat6::make_ECAT6_Main_header(), and stir::warning().
bool stir::ecat::ecat7::is_ECAT7_file | ( | const std::string & | filename | ) |
checks if the file is in ECAT7 formatThis partly relies on the implementation of matrix_open in the LLN matrix library. Additional checks are made on the main header. Current checks are:
Referenced by stir::TimeFrameDefinitions::TimeFrameDefinitions().
void stir::ecat::ecat7::find_scanner | ( | shared_ptr< Scanner > & | scanner_ptr, |
const Main_header & | mhead | ||
) |
determine scanner type from the main_header
Returns a Unknown_Scanner if it does not recognise it.
References stir::ecat::find_scanner_from_ECAT_system_type().
Referenced by stir::ecat::ecat7::ECAT966ListmodeInputFileFormat::can_read(), stir::ecat::ecat7::CListModeDataECAT< CListRecordT >::CListModeDataECAT(), and stir::ecat::ecat7::SinglesRatesFromSglFile::read_singles_from_sgl_file().
Succeeded stir::ecat::ecat7::DiscretisedDensity_to_ECAT7 | ( | MatrixFile * | mptr, |
DiscretisedDensity< 3, float > const & | density, | ||
const int | frame_num = 1 , |
||
const int | gate_num = 1 , |
||
const int | data_num = 0 , |
||
const int | bed_num = 0 |
||
) |
Write an (extra) image to an existing ECAT7 file.
Some consistency checks are performed between the image and the data in the main header
References stir::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing(), stir::VectorWithOffset< Array< num_dimensions - 1, elemT > >::get_length(), and stir::warning().
Succeeded stir::ecat::ecat7::ProjData_to_ECAT7 | ( | ProjData const & | proj_data, |
NumericType | output_type, | ||
std::string const & | cti_name, | ||
std::string const & | orig_name, | ||
const int | frame_num = 1 , |
||
const int | gate_num = 1 , |
||
const int | data_num = 0 , |
||
const int | bed_num = 0 , |
||
const bool | write_as_attenuation = false , |
||
float | scale_factor = 0.0F |
||
) |
Create a new ECAT7 sinogram file and write the data in there.
Note that not all output_type are supported by the ECAT7 format. If a wrong type is used, it will be forced to floats.
References stir::ProjData::get_proj_data_info_sptr(), and stir::ecat::ecat7::make_ECAT7_main_header().
Succeeded stir::ecat::ecat7::ProjData_to_ECAT7 | ( | MatrixFile * | mptr, |
ProjData const & | proj_data, | ||
const int | frame_num = 1 , |
||
const int | gate_num = 1 , |
||
const int | data_num = 0 , |
||
const int | bed_num = 0 , |
||
float | scale_factor = 0.0F |
||
) |
Write an (extra) set of sinograms to an existing ECAT7 file.
Some consistency checks are performed between the proj_data and the data in the main header pointer of mptr.
For ECAT7, the data type for the output is determined by the file_type
field of the main header.
void stir::ecat::ecat7::make_ECAT7_main_header | ( | Main_header & | mhead, |
Scanner const & | scanner, | ||
const std::string & | orig_name, | ||
DiscretisedDensity< 3, float > const & | density | ||
) |
Fill in most of the main header given a Scanner object and orig_name and an image.
Sets num_planes, plane_separation as well
References stir::ecat::ecat7::make_ECAT7_main_header().
NumericType stir::ecat::ecat7::make_ECAT7_main_header | ( | Main_header & | mhead, |
const std::string & | orig_name, | ||
ExamInfo const & | exam_info, | ||
ProjDataInfo const & | proj_data_info, | ||
const bool | write_as_attenuation = false , |
||
NumericType | output_type = NumericType::FLOAT |
||
) |
Fill in most of the main header given an orig_name and a proj_data_info.
It gets the scanner from the proj_data_info object. Sets num_planes, plane_separation as well and attempts septa_state.
Defaults mean that it will set to file_type Float3dSinogram.
acquisition_type
field will be set to either TransmissionScan
or StaticEmission
, depending on write_as_attenuation. This is not necessarily correct. References stir::Scanner::get_default_bin_size(), stir::ProjDataInfo::get_max_segment_num(), stir::ProjDataInfo::get_min_segment_num(), stir::ProjDataInfo::get_num_axial_poss(), stir::ProjDataInfo::get_sampling_in_s(), stir::ProjDataInfo::get_scanner_ptr(), stir::ecat::ecat7::make_ECAT7_main_header(), and stir::warning().
void stir::ecat::ecat7::make_subheader_for_ECAT7 | ( | Attn_subheader & | shead, |
const Main_header & | mhead, | ||
const ProjDataInfo & | proj_data_info | ||
) |
Fill in most of the subheader.
void stir::ecat::ecat7::make_subheader_for_ECAT7 | ( | Scan3D_subheader & | shead, |
const Main_header & | mhead, | ||
const ProjDataInfo & | proj_data_info | ||
) |
Fill in most of the subheader.
ProjDataFromStream* stir::ecat::ecat7::make_pdfs_from_matrix | ( | MatrixFile *const | mptr, |
MatrixData *const | matrix, | ||
const shared_ptr< std::iostream > & | stream_ptr | ||
) |
Make a ProjDataFromStream object that 'points' into an ECAT7 file.
Succeeded stir::ecat::ecat7::write_basic_interfile_header_for_ECAT7 | ( | std::string & | interfile_header_name, |
const std::string & | ECAT7_filename, | ||
const int | frame_num, | ||
const int | gate_num, | ||
const int | data_num, | ||
const int | bed_num | ||
) |
Writes an Interfile header that 'points' into an ECAT7 file.
Only data types AttenCor, Byte3dSinogram, Short3dSinogram, Float3dSinogram, ByteVolume, PetVolume can be handled.
interfile_header_name will be set to the header name used. It will be of the form ECAT7_filename_extension_f1g1d0b0.hs or .hv. For example, for ECAT7_filename test.S, and frame=2, gate=3, data=4, bed=5, the header name will be test_S_f2g3d4b5.hs
References stir::find_filename(), and stir::warning().
short stir::ecat::find_ECAT_data_type | ( | const NumericType & | type, |
const ByteOrder & | byte_order | ||
) |
Find out which ECAT data type corresponds to a certain NumericType and ByteOrder.
Returns 0 when it does not recognise it
References stir::NumericType::integer_type(), stir::NumericType::signed_type(), stir::NumericType::size_in_bytes(), and stir::warning().
short stir::ecat::find_ECAT_system_type | ( | const Scanner & | scanner | ) |
Find the value used in the ECAT Main header for a given scanner.
Returns 0 if the scanner is not recognised
References stir::Scanner::get_name(), stir::Scanner::get_type(), and stir::warning().
Referenced by stir::ecat::ecat7::ECAT7OutputFileFormat::post_processing(), stir::ecat::ecat6::ECAT6OutputFileFormat::post_processing(), stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityOutputFileFormat::post_processing(), stir::ecat::ecat7::ECAT7ParametricDensityOutputFileFormat< DiscretisedDensityT >::post_processing(), and stir::ScannerTests::run_tests().
Scanner * stir::ecat::find_scanner_from_ECAT_system_type | ( | const short | system_type | ) |
Find the scanner corresponding to the system type in the main header.
Returns a Scanner(Scanner::Unknown_Scanner) object when the scanner is not recognised.
Referenced by stir::ecat::ecat7::find_scanner(), stir::ecat::ecat6::find_scanner_from_ECAT6_Main_header(), stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityInputFileFormat::read_from_file(), stir::ecat::ecat7::SinglesRatesFromECAT7::read_singles_from_file(), and stir::ecat::ecat7::BinNormalisationFromECAT7::set_up().
std::vector< int > stir::ecat::find_segment_sequence | ( | const ProjDataInfo & | pdi | ) |
Return the sequence of how Siemens stores segments.
ECAT 7,8 always stores segments as 0, -1, +1, ... (numbering is in STIR convention)
References stir::ProjDataInfo::get_max_segment_num().
std::vector< int > stir::ecat::find_timing_poss_sequence | ( | const ProjDataInfo & | pdi | ) |
Return the sequence of how Siemens stores TOF bins.
Siemens always stores segments as 0, -1, +1, ... (numbering is in STIR convention)
References stir::ProjDataInfo::get_num_tof_poss().
|
protectedvirtual |
Class for reading images in ECAT7 file-format.
Preliminary
Implements stir::InputFileFormat< DynamicDiscretisedDensity >.
References stir::FileSignature::get_signature().