|
TPCCLIB
|
Procedures for reading ECAT 6.3 format. More...
#include "libtpcimgio.h"Go to the source code of this file.
Functions | |
| int | ecat63ReadMainheader (FILE *fp, ECAT63_mainheader *h) |
| int | ecat63ReadImageheader (FILE *fp, int blk, ECAT63_imageheader *h, int verbose, char *errmsg) |
| int | ecat63ReadAttnheader (FILE *fp, int blk, ECAT63_attnheader *h, int verbose, char *errmsg) |
| int | ecat63ReadScanheader (FILE *fp, int blk, ECAT63_scanheader *h, int verbose, char *errmsg) |
| int | ecat63ReadNormheader (FILE *fp, int blk, ECAT63_normheader *h, int verbose, char *errmsg) |
| int | ecat63ReadMatdata (FILE *fp, int strtblk, int blkNr, char *data, int dtype) |
| int | ecat63ReadImageMatrix (FILE *fp, int first_block, int last_block, ECAT63_imageheader *h, float **fdata) |
| int | ecat63ReadScanMatrix (FILE *fp, int first_block, int last_block, ECAT63_scanheader *h, float **fdata) |
| int | ecat63ReadAttnMatrix (FILE *fp, int first_block, int last_block, ECAT63_attnheader *h, float **fdata) |
| float | ecat63rFloat (void *bufi, int isvax, int islittle) |
| int | ecat63rInt (void *bufi, int isvax, int islittle) |
| int | ecat63pxlbytes (short int data_type) |
Procedures for reading ECAT 6.3 format.
Assumptions:
Definition in file ecat63r.c.
| int ecat63pxlbytes | ( | short int | data_type | ) |
Returns the nr of bytes required for storage of one pixel of specified data_type
| data_type | data type code |
Definition at line 973 of file ecat63r.c.
Referenced by ecat63WriteImageMatrix(), and ecat63WriteScanMatrix().
| int ecat63ReadAttnheader | ( | FILE * | fp, |
| int | blk, | ||
| ECAT63_attnheader * | h, | ||
| int | verbose, | ||
| char * | errmsg ) |
Read ECAT 6.3 attenuation header
| fp | File pointer to ECAT file; position is not important. |
| blk | Block number from matrix list [2..number of blocks]. |
| h | Pointer to the header struct where contents are put. |
| verbose | Verbose level; if zero, then only warnings are printed into stderr. |
| errmsg | Pointer to error message, at least 128 characters; enter NULL, if not needed. |
Definition at line 296 of file ecat63r.c.
Referenced by ecat63ReadAllToImg(), ecat63ReadAttnMatrix(), ecat63ReadPlaneToImg(), ecat6PrintSubheader(), imgReadEcat63Frame(), and imgReadEcat63Header().
| int ecat63ReadAttnMatrix | ( | FILE * | fp, |
| int | first_block, | ||
| int | last_block, | ||
| ECAT63_attnheader * | h, | ||
| float ** | fdata ) |
Read ECAT63 attenuation matrix header and data.
If only header is to be read, set last_block=first_block. Note: data is not calibrated with factor in main header.
| fp | ECAT file pointer. |
| first_block | Subheader record number. |
| last_block | Last data block number. |
| h | Pointer to subheader data which is filled. |
| fdata | Float pointer to the address of the matrix data; any old contents are not freed, therefore you must free the pointer after data is copied elsewhere. |
Definition at line 830 of file ecat63r.c.
| int ecat63ReadImageheader | ( | FILE * | fp, |
| int | blk, | ||
| ECAT63_imageheader * | h, | ||
| int | verbose, | ||
| char * | errmsg ) |
Read ECAT 6.3 image header.
| fp | File pointer to ECAT file; position is not important. |
| blk | Block number from matrix list [2..number of blocks]. |
| h | Pointer to the header struct where contents are put. |
| verbose | Verbose level; if zero, then only warnings are printed into stderr. |
| errmsg | Pointer to error message, at least 128 characters; enter NULL, if not needed. |
Definition at line 187 of file ecat63r.c.
Referenced by ecat63ReadAllToImg(), ecat63ReadImageMatrix(), ecat63ReadPlaneToImg(), ecat6PrintSubheader(), imgReadEcat63Frame(), and imgReadEcat63Header().
| int ecat63ReadImageMatrix | ( | FILE * | fp, |
| int | first_block, | ||
| int | last_block, | ||
| ECAT63_imageheader * | h, | ||
| float ** | fdata ) |
Read ECAT63 image matrix header and data.
If only header is to be read, set last_block=first_block. Note: data is not calibrated with factor in main header.
| fp | ECAT file pointer |
| first_block | Subheader record number |
| last_block | Last data block number |
| h | Ptr to subheader data which is filled |
| fdata | Ptr to the address of the matrix data; any old contents are not freed, therefore you must free the pointer after data is copied elsewhere. |
Definition at line 627 of file ecat63r.c.
| int ecat63ReadMainheader | ( | FILE * | fp, |
| ECAT63_mainheader * | h ) |
Read ECAT 6.3 main header.
| fp | file pointer |
| h | target Ecat 6.3 main header structure |
Definition at line 25 of file ecat63r.c.
Referenced by atnMake(), ecat63AddImg(), ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), ecatFixMatrixlist(), imgRead(), imgReadEcat63Frame(), imgReadEcat63Header(), and imgWriteEcat63Frame().
| int ecat63ReadMatdata | ( | FILE * | fp, |
| int | strtblk, | ||
| int | blkNr, | ||
| char * | data, | ||
| int | dtype ) |
Read ECAT 6.3 matrix data and convert byte order if necessary Remember to allocate memory for full blocks! There are differences here when compared to ecat7.c
| fp | file pointer from where data is read |
| strtblk | starting block [>= 1] |
| blkNr | number of block to be read [>= 0] |
| data | pointer to block where data is read |
| dtype | data type code |
Definition at line 568 of file ecat63r.c.
Referenced by ecat63ReadAllToImg(), ecat63ReadAttnMatrix(), ecat63ReadImageMatrix(), ecat63ReadPlaneToImg(), ecat63ReadScanMatrix(), and imgReadEcat63Frame().
| int ecat63ReadNormheader | ( | FILE * | fp, |
| int | blk, | ||
| ECAT63_normheader * | h, | ||
| int | verbose, | ||
| char * | errmsg ) |
Read ECAT 6.3 normalization header.
Note that ECAT 6.3 normalization data is usually stored in scan file format, not in normalization format.
| fp | File pointer to ECAT file; position is not important. |
| blk | Block number from matrix list [2..number of blocks]. |
| h | Pointer to the header struct where contents are put. |
| verbose | Verbose level; if zero, then only warnings are printed into stderr. |
| errmsg | Pointer to error message, at least 128 characters; enter NULL, if not needed. |
Definition at line 483 of file ecat63r.c.
Referenced by ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), ecat6PrintSubheader(), imgReadEcat63Frame(), and imgReadEcat63Header().
| int ecat63ReadScanheader | ( | FILE * | fp, |
| int | blk, | ||
| ECAT63_scanheader * | h, | ||
| int | verbose, | ||
| char * | errmsg ) |
Read ECAT 6.3 scan header.
| fp | File pointer to ECAT file; position is not important. |
| blk | Block number from matrix list [2..number of blocks]. |
| h | Pointer to the header struct where contents are put. |
| verbose | Verbose level; if zero, then only warnings are printed into stderr. |
| errmsg | Pointer to error message, at least 128 characters; enter NULL, if not needed. |
Definition at line 377 of file ecat63r.c.
Referenced by ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), ecat63ReadScanMatrix(), ecat6PrintSubheader(), imgReadEcat63Frame(), and imgReadEcat63Header().
| int ecat63ReadScanMatrix | ( | FILE * | fp, |
| int | first_block, | ||
| int | last_block, | ||
| ECAT63_scanheader * | h, | ||
| float ** | fdata ) |
Read ECAT63 scan matrix header and data.
If only header is to be read, set last_block=first_block. Note: data is not calibrated with factor in main header.
| fp | ECAT file pointer. |
| first_block | Subheader record number. |
| last_block | Last data block number. |
| h | Pointer to subheader data which is filled. |
| fdata | Double pointer to the address of the matrix data; any old contents are not freed, therefore you must free the pointer after data is copied elsewhere. |
Definition at line 731 of file ecat63r.c.
Referenced by atnMake().
| float ecat63rFloat | ( | void * | bufi, |
| int | isvax, | ||
| int | islittle ) |
Reading ECAT 6.3 floats
| bufi | pointer to 32-bit long data block |
| isvax | 1 for VAX format |
| islittle | 1 for little endian |
Definition at line 928 of file ecat63r.c.
Referenced by ecat63ReadAttnheader(), ecat63ReadImageheader(), ecat63ReadMainheader(), ecat63ReadMatdata(), ecat63ReadNormheader(), and ecat63ReadScanheader().
| int ecat63rInt | ( | void * | bufi, |
| int | isvax, | ||
| int | islittle ) |
Reading and writing ECAT 6.3 32-bit ints. 32-bit int format is same in VAX and i386
| bufi | pointer to 32-bit long data block |
| isvax | 1 for VAX format |
| islittle | 1 for littel endian |
Definition at line 953 of file ecat63r.c.
Referenced by ecat63ReadImageheader(), ecat63ReadMatdata(), and ecat63ReadScanheader().