TPCCLIB
|
Reading and writing IFT format files. More...
#include "libtpcmisc.h"
Go to the source code of this file.
Functions | |
int | iftRead (IFT *ift, char *filename, int is_key_required, int verbose) |
char * | iftReadValue (char *filename, char *keystr, int verbose) |
int | iftWriteItem (IFT *ift, int item, FILE *fp, int verbose) |
int | iftWrite (IFT *ift, char *filename, int verbose) |
int | defRead (IFT *ift, char *filename, int verbose) |
Variables | |
int | IFT_SPACE_BEFORE_EQ_SIGN = 1 |
int | IFT_SPACE_AFTER_EQ_SIGN = 1 |
int defRead | ( | IFT * | ift, |
char * | filename, | ||
int | verbose ) |
Read definition file, for example microPET header file, into IFT structure.
ift | Pointer to initiated but empty IFT |
filename | Input filename |
verbose | Verbose level; if zero, then only warnings are printed into stderr |
Definition at line 321 of file iftfile.c.
Referenced by imgReadMicropetFrame(), and imgReadMicropetHeader().
int iftRead | ( | IFT * | ift, |
char * | filename, | ||
int | is_key_required, | ||
int | verbose ) |
Read IFT file keys and values. Previous contents of IFT are preserved.
This function can read the initial ASCII part of files that contain also binary data.
ift | Pointer to initiated but empty IFT structure. |
filename | Input file name. |
is_key_required | 0=key name is not required, 1=only lines with key and equals sign are read. |
verbose | Verbose level; if zero, then only warnings are printed into stderr |
Definition at line 24 of file iftfile.c.
Referenced by cptReadOne(), dftRead(), hrrtMakeCalHdr(), iftReadValue(), interfileIsHeader(), irdRead(), readEcat931Calibrationfile(), tsvRead(), vrdRead(), and xelRead().
char * iftReadValue | ( | char * | filename, |
char * | keystr, | ||
int | verbose ) |
Read value string from IFT file.
filename | File name. |
keystr | String to search for in the key. If NULL, or key containing the string is not found, then if there is only one value in the file, pointer to that is returned. |
verbose | Verbose level; if zero, then only warnings are printed into stderr |
Definition at line 180 of file iftfile.c.
int iftWrite | ( | IFT * | ift, |
char * | filename, | ||
int | verbose ) |
Write all keys and values.
ift | Pointer to IFT structure. |
filename | Output filename, or string "stdout" to print on console. |
verbose | Verbose level; if zero, then only warnings are printed into stderr |
Definition at line 282 of file iftfile.c.
Referenced by cptReadOne(), ecat7MainheaderFromIFT(), ecat7ReadHeaders(), hrrtMakeCalHdr(), and niftiHeaderFromIFT().
int iftWriteItem | ( | IFT * | ift, |
int | item, | ||
FILE * | fp, | ||
int | verbose ) |
Write one item in IFT to the specified file pointer.
ift | Pointer to initiated but empty IFT structure. |
item | Index [0..keyNr-1] of key and value to write. |
fp | Output file pointer. |
verbose | Verbose level; if zero, then only warnings are printed into stderr |
Definition at line 221 of file iftfile.c.
Referenced by iftWrite().
int IFT_SPACE_AFTER_EQ_SIGN = 1 |
Use space after equal sign in IFT
Definition at line 13 of file iftfile.c.
Referenced by iftWriteItem().
int IFT_SPACE_BEFORE_EQ_SIGN = 1 |
Use space before equal sign in IFT
Definition at line 11 of file iftfile.c.
Referenced by iftWriteItem().