|
TPCCLIB
|
Header file for libtpcecat. More...
#include "tpcclibConfig.h"#include <stdio.h>#include <string.h>#include <math.h>#include <stdint.h>#include <stdlib.h>#include <strings.h>#include <ctype.h>#include <float.h>#include <unistd.h>#include <locale.h>#include <time.h>#include "tpcextensions.h"#include "tpcift.h"Go to the source code of this file.
Data Structures | |
| struct | ECAT_MATDIR |
| struct | ECAT_MATRIXLIST |
| struct | ECAT_MATVAL |
Macros | |
| #define | BACKUP_EXTENSION ".bak" |
| #define | ECATBLKSIZE 512 |
Functions | |
| int | ecatReadBlock (const char *filename, FILE *fp, const unsigned int blocknumber, unsigned char *data) |
| int | ecatVerifyMagic (const char *filename, FILE *fp) |
| int | ecatWriteMainheader (IFT *ift, unsigned char *buf, TPCSTATUS *status) |
| int | ecatReadMainheader (const unsigned char *buf, IFT *ift, TPCSTATUS *status) |
| void | ecatMListInit (ECAT_MATRIXLIST *ml) |
| void | ecatMListFree (ECAT_MATRIXLIST *ml) |
| void | ecatMListReadId (int format, unsigned int id, ECAT_MATVAL *mv) |
| unsigned int | ecatMListMakeId (int format, unsigned int frame, unsigned int plane, unsigned int gate, unsigned int data, unsigned int bed) |
| unsigned int | ecatMValToId (int format, ECAT_MATVAL *mv) |
| int | ecatMListRead (int format, FILE *fp, ECAT_MATRIXLIST *ml, TPCSTATUS *status) |
| void | ecatMListPrint (int format, ECAT_MATRIXLIST *ml, FILE *fp) |
Header file for libtpcecat.
Definition in file tpcecat.h.
| #define ECATBLKSIZE 512 |
ECAT matrix block size
Definition at line 37 of file tpcecat.h.
Referenced by ecatMListRead(), ecatReadBlock(), ecatVerifyMagic(), and imgWrite().
| void ecatMListFree | ( | ECAT_MATRIXLIST * | ml | ) |
Free memory allocated for ECAT matrix list. All contents are destroyed.
| ml | Pointer to matrix list. |
Definition at line 38 of file ecatmatrixlist.c.
Referenced by ecatMListRead().
| void ecatMListInit | ( | ECAT_MATRIXLIST * | ml | ) |
Initiate the ECAT matrix list struct before any use.
| ml | Pointer to matrix list. |
Definition at line 23 of file ecatmatrixlist.c.
| unsigned int ecatMListMakeId | ( | int | format, |
| unsigned int | frame, | ||
| unsigned int | plane, | ||
| unsigned int | gate, | ||
| unsigned int | data, | ||
| unsigned int | bed ) |
Make matrix identifier (matnum) code for specific matrix.
| format | ECAT format: 6 or 7. |
| frame | Frame [0..511] for ECAT7, [0..4095] for ECAT6. |
| plane | Plane [0..1023] for ECAT7, [0..255] for ECAT6. |
| gate | Gate [0..63]. |
| data | Data [0..7] for ECAT7, [0..3] for ECAT6. |
| bed | Bed position [0..15]. |
Definition at line 84 of file ecatmatrixlist.c.
Referenced by ecatMValToId().
| void ecatMListPrint | ( | int | format, |
| ECAT_MATRIXLIST * | ml, | ||
| FILE * | fp ) |
Print ECAT matrix list.
| format | ECAT format: 6 or 7. |
| ml | Pointer to matrix list to print. |
| fp | File pointer to print to; usually stdout. |
Definition at line 250 of file ecatmatrixlist.c.
| int ecatMListRead | ( | int | format, |
| FILE * | fp, | ||
| ECAT_MATRIXLIST * | ml, | ||
| TPCSTATUS * | status ) |
Read ECAT matrix list from ECAT file.
| format | ECAT format: 6 or 7. |
| fp | File pointer of file, opened with fp=fopen(filename, "rb"), to read the matrix list from. |
| ml | Pointer to initiated matrix list; any previous content is deleted. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 140 of file ecatmatrixlist.c.
| void ecatMListReadId | ( | int | format, |
| unsigned int | id, | ||
| ECAT_MATVAL * | mv ) |
Read matrix identifier code (matnum) into matrix value structure.
| format | ECAT format: 6 or 7. |
| id | Matrix identifier code (matnum) to decode. |
| mv | Pointer to data structure in where frame, plane etc numbers are written. |
Definition at line 52 of file ecatmatrixlist.c.
Referenced by ecatMListPrint().
| unsigned int ecatMValToId | ( | int | format, |
| ECAT_MATVAL * | mv ) |
Make matrix identifier (matnum) code for specific matrix.
| format | ECAT format: 6 or 7. |
| mv | Pointer to data structure from where frame, plane etc numbers are read. |
Definition at line 124 of file ecatmatrixlist.c.
| int ecatReadBlock | ( | const char * | filename, |
| FILE * | fp, | ||
| const unsigned int | blocknumber, | ||
| unsigned char * | data ) |
Read specified data block from an ECAT file.
| filename | Name of file to open and read specified data block; file is closed after reading; enter NULL to use the file pointer (next argument) instead. |
| fp | File pointer of file, opened with fp=fopen(filename, "rb"), to read the specified data block from; enter NULL to open file (previous argument) locally. This function leaves the file pointer to the end of data block. |
| blocknumber | Block number to read; enter 0 to read the block from current file pointer position, if file pointer was given. |
| data | Pointer to write block data in; must be allocated for at least ECATBLKSIZE bytes. |
Definition at line 23 of file ecatio.c.
Referenced by ecatMListRead(), and ecatVerifyMagic().
Read ECAT main header from data block into IFT struct.
| buf | Pointer to data block containing main header. |
| ift | Pointer to initiated IFT struct; any previous contents are NOT deleted. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 100 of file ecatheader.c.
| int ecatVerifyMagic | ( | const char * | filename, |
| FILE * | fp ) |
Verify that given file (either file name or file pointer) appears to be ECAT file, based on the magic number.
ECAT 7 has defined magic numbers, which are checked. ECAT 6 format does not a defined magic number, therefore here the file is only checked to not indicate anything else than ECAT 6.
| filename | Name of file to open and to verify for the magic number; file is closed after reading; enter NULL to use the file pointer (next argument) instead. |
| fp | File pointer of file to check, opened with fp=fopen(filename, "rb"); enter NULL to open file (previous argument) locally. This function rewinds the file pointer to start before and after reading the data. |
Definition at line 84 of file ecatio.c.
Write ECAT main header from IFT struct into data block.
| ift | Pointer to IFT struct containing main header fields; contents are not modified. |
| buf | Pointer to data block of size ECATBLKSIZE bytes. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 25 of file ecatheader.c.
Referenced by imgWrite().