|
STIR 6.4.0
|

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::InterfileHeaderSiemens |
| a class for Interfile keywords (and parsing) common to all types of data More... | |
| class | stir::InterfileRawDataHeaderSiemens |
| a class for Interfile keywords (and parsing) specific to Siemens PET projection, list mode data or norm data More... | |
| class | stir::InterfilePDFSHeaderSiemens |
| a class for Interfile keywords (and parsing) specific to projection data (i.e. ProjDataFromStream) for Siemens PET scanners More... | |
| class | stir::InterfileListmodeHeaderSiemens |
| a class for Interfile keywords (and parsing) specific to Siemens listmode data (in PETLINK format) More... | |
| class | stir::InterfileNormHeaderSiemens |
| a class for Interfile keywords (and parsing) specific to Siemens (component-based) normalisation data 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 (). | |
| int | stir::ecat::ecat6::cti_rings2plane (short nrings, short ring0, short ring1) |
| Get sinogram plane from 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| bool | stir::ecat::ecat6::is_ECAT6_file (const std::string &filename) |
| checks if the file is in ECAT6 format | |
| 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 | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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: | |
| 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 | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| short | stir::ecat::find_ECAT_system_type (const Scanner &scanner) |
| Find the value used in the ECAT Main header for a given scanner. | |
| 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. | |
| std::vector< int > | stir::ecat::find_segment_sequence (const ProjDataInfo &pdi) |
| Return the sequence of how Siemens stores segments. | |
| std::vector< int > | stir::ecat::find_timing_poss_sequence (const ProjDataInfo &pdi) |
| Return the sequence of how Siemens stores TOF bins. | |
| virtual bool | stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityInputFileFormat::actual_can_read (const FileSignature &signature, std::istream &input) const |
| Class for reading images in ECAT7 file-format. | |
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 |
References cti_numdoc().
Referenced by cti_numdoc().
| 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 |
References cti_rings2plane().
Referenced by cti_rings2plane(), and ProjData_to_ECAT6().
| 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 |
References cti_create().
Referenced by stir::ecat::ecat6::ECAT6OutputFileFormat::actual_write_to_file(), cti_create(), DiscretisedDensity_to_ECAT6(), and 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 |
References cti_rblk().
Referenced by cti_rblk(), and get_scandata().
| 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. |
References cti_wblk().
Referenced by cti_wblk(), and cti_write_idata().
| 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 |
References cti_read_ECAT6_Main_header().
Referenced by cti_read_ECAT6_Main_header(), get_attnheaders(), get_normheaders(), get_scanheaders(), and 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 |
References cti_read_scan_subheader().
Referenced by cti_read_scan_subheader(), and get_scanheaders().
| 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 |
References cti_read_attn_subheader().
Referenced by cti_read_attn_subheader(), and get_attnheaders().
| 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 |
References cti_read_norm_subheader().
Referenced by cti_read_norm_subheader(), and get_normheaders().
| 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 |
References cti_read_image_subheader().
Referenced by cti_read_image_subheader().
| 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 |
References cti_enter().
Referenced by cti_enter(), cti_write_image(), and cti_write_scan().
| 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. |
References cti_lookup().
Referenced by cti_lookup(), get_attnheaders(), get_normheaders(), and get_scanheaders().
| 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 |
References cti_write_image_subheader().
Referenced by cti_write_image(), and cti_write_image_subheader().
| 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 |
References cti_write_ECAT6_Main_header(), cti_write_image(), cti_write_scan(), cti_write_scan_subheader(), file_data_to_host(), get_attnheaders(), get_normheaders(), get_scandata(), get_scanheaders(), img_zero_fill(), and scan_zero_fill().
Referenced by cti_write_ECAT6_Main_header().
| 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 |
References cti_write_scan_subheader().
Referenced by cti_write_ECAT6_Main_header(), cti_write_scan(), and cti_write_scan_subheader().
| 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 |
References cti_lookup(), cti_read_ECAT6_Main_header(), cti_read_scan_subheader(), and get_scanheaders().
Referenced by cti_write_ECAT6_Main_header(), and get_scanheaders().
| 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.
References cti_rblk(), file_data_to_host(), and get_scandata().
Referenced by cti_write_ECAT6_Main_header(), and get_scandata().
| 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 |
References cti_lookup(), cti_read_attn_subheader(), cti_read_ECAT6_Main_header(), and get_attnheaders().
Referenced by cti_write_ECAT6_Main_header(), and get_attnheaders().
| 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 |
References cti_lookup(), cti_read_ECAT6_Main_header(), cti_read_norm_subheader(), and get_normheaders().
Referenced by cti_write_ECAT6_Main_header(), and get_normheaders().
| bool stir::ecat::ecat6::is_ECAT6_file | ( | const std::string & | filename | ) |
checks if the file is in ECAT6 format
As ECAT6 doesn't have a 'magic number' this check is somewhat heuristic. Checks are only on the main header. Current checks are:
References is_ECAT6_file().
Referenced by is_ECAT6_attenuation_file(), is_ECAT6_emission_file(), is_ECAT6_file(), is_ECAT6_image_file(), and 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 find_scanner_from_ECAT6_Main_header(), and stir::ecat::find_scanner_from_ECAT_system_type().
Referenced by DiscretisedDensity_to_ECAT6(), and find_scanner_from_ECAT6_Main_header().
| 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
References stir::convert_array(), cti_numcod(), cti_write_image(), DiscretisedDensity_to_ECAT6(), stir::Array< num_dimensions, elemT >::find_max(), stir::Array< num_dimensions, elemT >::find_min(), find_scanner_from_ECAT6_Main_header(), stir::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing(), stir::VectorWithOffset< T >::get_length(), stir::VectorWithOffset< T >::get_min_index(), stir::DiscretisedDensity< num_dimensions, elemT >::get_origin(), img_zero_fill(), and stir::warning().
| 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 cti_create(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), make_ECAT6_Main_header(), and ProjData_to_ECAT6().
Referenced by ProjData_to_ECAT6(), and ProjData_to_ECAT6().
| 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
References stir::convert_array(), cti_numcod(), cti_rings2plane(), cti_write_scan(), stir::Array< num_dimensions, elemT >::find_max(), stir::Array< num_dimensions, elemT >::find_min(), stir::get(), stir::ProjDataInfoCylindrical::get_max_ring_difference(), stir::DataWithProjDataInfo::get_max_segment_num(), stir::DataWithProjDataInfo::get_max_tangential_pos_num(), stir::DataWithProjDataInfo::get_max_view_num(), stir::DataWithProjDataInfo::get_min_axial_pos_num(), stir::ProjDataInfoCylindrical::get_min_ring_difference(), stir::DataWithProjDataInfo::get_min_segment_num(), stir::DataWithProjDataInfo::get_min_tangential_pos_num(), stir::DataWithProjDataInfo::get_min_view_num(), stir::DataWithProjDataInfo::get_num_axial_poss(), stir::DataWithProjDataInfo::get_num_tangential_poss(), stir::DataWithProjDataInfo::get_num_views(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), stir::ProjData::get_sinogram(), stir::ProjDataInfoCylindricalArcCorr::get_tangential_sampling(), ProjData_to_ECAT6(), scan_zero_fill(), and stir::warning().
| 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::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing(), stir::VectorWithOffset< T >::get_length(), and 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_max_segment_num(), stir::ProjDataInfo::get_min_segment_num(), stir::ProjDataInfo::get_num_axial_poss(), stir::ProjDataInfo::get_scanner_sptr(), 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:
References is_ECAT7_file().
Referenced by is_ECAT7_attenuation_file(), is_ECAT7_emission_file(), is_ECAT7_file(), is_ECAT7_image_file(), stir::DiscretisedDensity< 3, float >::read_from_file(), stir::ProjData::read_from_file(), and 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 find_scanner(), and stir::ecat::find_scanner_from_ECAT_system_type().
Referenced by stir::ecat::ecat7::ECAT966ListmodeInputFileFormat::can_read(), stir::ecat::ecat7::CListModeDataECAT< CListRecordT >::CListModeDataECAT(), DiscretisedDensity_to_ECAT7(), find_scanner(), 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 DiscretisedDensity_to_ECAT7(), find_scanner(), stir::ecat::find_type_from_ECAT_data_type(), stir::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing(), stir::VectorWithOffset< T >::get_length(), stir::VectorWithOffset< T >::get_max_index(), stir::VectorWithOffset< T >::get_min_index(), stir::DiscretisedDensity< num_dimensions, elemT >::get_physical_coordinates_for_indices(), 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::DataWithProjDataInfo::get_proj_data_info_sptr(), make_ECAT7_main_header(), and ProjData_to_ECAT7().
Referenced by ProjData_to_ECAT7(), and ProjData_to_ECAT7().
| 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.
References ProjData_to_ECAT7(), and stir::warning().
| 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::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing(), stir::VectorWithOffset< T >::get_length(), and 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_num_segments(), stir::ProjDataInfo::get_sampling_in_s(), stir::ProjDataInfo::get_scanner_ptr(), stir::Scanner::get_type(), stir::NumericType::id, 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.
References make_subheader_for_ECAT7(), and stir::warning().
Referenced by make_subheader_for_ECAT7(), and make_subheader_for_ECAT7().
| 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.
References make_subheader_for_ECAT7(), and stir::warning().
| 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.
References make_pdfs_from_matrix(), and write_basic_interfile_header_for_ECAT7().
Referenced by make_pdfs_from_matrix(), and write_basic_interfile_header_for_ECAT7().
| 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(), make_pdfs_from_matrix(), stir::max_filename_length, stir::warning(), write_basic_interfile_header_for_ECAT7(), stir::write_basic_interfile_image_header(), and stir::write_basic_interfile_PDFS_header().
Referenced by make_pdfs_from_matrix(), and write_basic_interfile_header_for_ECAT7().
| 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::ByteOrder::big_endian, stir::error(), find_ECAT_data_type(), and stir::warning().
Referenced by find_ECAT_data_type().
| 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 find_ECAT_system_type(), stir::Scanner::get_name(), stir::Scanner::get_type(), and stir::warning().
Referenced by find_ECAT_system_type(), stir::ecat::ecat6::make_ECAT6_Main_header(), stir::ecat::ecat7::make_ECAT7_main_header(), stir::ecat::ecat6::ECAT6OutputFileFormat::post_processing(), stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityOutputFileFormat::post_processing(), stir::ecat::ecat7::ECAT7OutputFileFormat::post_processing(), and stir::ecat::ecat7::ECAT7ParametricDensityOutputFileFormat< DiscretisedDensityT >::post_processing().
| 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.
References find_scanner_from_ECAT_system_type().
Referenced by stir::ecat::ecat7::find_scanner(), stir::ecat::ecat6::find_scanner_from_ECAT6_Main_header(), find_scanner_from_ECAT_system_type(), stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityInputFileFormat::read_from_file(), and stir::ecat::ecat7::SinglesRatesFromECAT7::read_singles_from_file().
| 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 find_segment_sequence(), and stir::ProjDataInfo::get_max_segment_num().
Referenced by find_segment_sequence(), stir::InterfilePDFSHeader::post_processing(), and stir::InterfileRawDataHeaderSiemens::post_processing().
| 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 find_timing_poss_sequence(), and stir::ProjDataInfo::get_num_tof_poss().
Referenced by find_timing_poss_sequence(), and stir::InterfilePDFSHeaderSiemens::post_processing().
|
protectedvirtual |
Class for reading images in ECAT7 file-format.
Preliminary
Implements stir::InputFileFormat< DynamicDiscretisedDensity >.
References actual_can_read(), and stir::FileSignature::get_signature().
Referenced by actual_can_read().