TPCCLIB
|
IO for result files and handling RES struct data. More...
Go to the source code of this file.
Functions | |
void | resEmpty (RES *res) |
void | resInit (RES *res) |
int | resSetmem (RES *res, int voiNr) |
void | resFixParnames (RES *res) |
void | resPrint (RES *res) |
int | resRead (char *filename, RES *res, int verbose) |
int | resWrite (RES *res, char *filename, int verbose) |
int | resWriteHTML (RES *res, char *fname, int verbose) |
int | resWriteXHTML11_doctype (FILE *fp) |
int | resWriteXHTML11_head (FILE *fp, char *author_name) |
int | resWriteHTML_table (RES *res, FILE *fp) |
int | resFName2study (char *fname, char *studyNumber) |
int | resMedian (double *data, int nr, double *median, double *min, double *max) |
int | resMean (double *data, int nr, double *mean, double *sd) |
void | resSortByName (RES *res) |
int | resCopyMHeader (RES *res1, RES *res2) |
int | resDelete (RES *res, int voi) |
int | resSelect (RES *data, char *name) |
int | resSelectRegions (RES *res, char *region_name, int reset) |
int | resParameterPrintType (RES *res, int parIndex) |
int | resIsDuplicateNames (RES *res) |
int | resMatchHeader (RES *res1, RES *res2) |
int | resMatchRegions (RES *res1, RES *res2) |
int | resMatchParameternames (RES *res1, RES *res2) |
int | resMatchParameters (RES *res1, RES *res2, int test_par, double test_limit, int test_sd) |
int | resMatchParametersAbs (RES *res1, RES *res2, int test_par, double test_limit, int test_sd) |
int | resRNameSubfieldExists (RES *res) |
Variables | |
int | RESULT_TEST |
char | reserrmsg [64] |
int resDelete | ( | RES * | res, |
int | voi ) |
Delete specified region (0..voiNr-1) from the structure.
res | Pointer to the result data. |
voi | TAC index (0..voiNr-1). |
Definition at line 1342 of file result.c.
void resEmpty | ( | RES * | res | ) |
Free memory allocated for results. All data are cleared.
res | Pointer to RES structure. |
Definition at line 22 of file result.c.
Referenced by fitToResult(), resInit(), resRead(), and resSetmem().
void resFixParnames | ( | RES * | res | ) |
Fix result parameter names and units, so that both representations are filled correctly, that is, the new string lists *parname[] and *parunit[], and the deprecated titleline[] and unitline[].
New representation, if filled, always overwrites the deprecated one. Units are assumed to follow parameter name representation.
res | Pointer to RES struct. |
Definition at line 107 of file result.c.
Referenced by dftToResult(), fitToResult(), resMatchParameternames(), resRead(), resWrite(), and resWriteHTML().
int resFName2study | ( | char * | fname, |
char * | studyNumber ) |
Set study number based on file name.
Definition at line 1169 of file result.c.
void resInit | ( | RES * | res | ) |
int resIsDuplicateNames | ( | RES * | res | ) |
Check if result structure contains duplicate region names.
res | Pointer to the result data. |
Definition at line 1473 of file result.c.
Check whether result header field values are the same.
Fields that are not checked: program, time, titleline.
res1 | Pointers to the result data that are tested |
res2 | Pointers to the result data that are tested |
Definition at line 1494 of file result.c.
Check whether result parameter names are the same.
res1 | Pointers to the result data that are tested. |
res2 | Pointers to the result data that are tested. |
Definition at line 1564 of file result.c.
Check whether result parameter values are the same.
res1 | Pointers to the result data that are tested. |
res2 | Pointers to the result data that are tested. |
test_par | Parameter index (0..parNr-1) that is verified; <0, if all. |
test_limit | Test limit (how exact match is required). |
test_sd | Test (1) or do not test (0) SD and Confidence limits. |
Definition at line 1600 of file result.c.
Check whether the two sets of result parameter values are similar within a given absolute range.
res1 | Pointers to the result data that are tested. |
res2 | Pointers to the result data that are tested. |
test_par | Parameter index (0..parNr-1) that is verified; <0, if all. |
test_limit | Test limit; positive value, below which the absolute difference must be. |
test_sd | Test (1) or do not test (0) SD and Confidence limits. |
Definition at line 1694 of file result.c.
Check whether result region names are the same.
res1 | Pointers to the result data that are tested. |
res2 | Pointers to the result data that are tested. |
Definition at line 1531 of file result.c.
int resMean | ( | double * | data, |
int | nr, | ||
double * | mean, | ||
double * | sd ) |
Calculate the mean and sd in the specified double array data of length nr.
NULL pointer may be specified to function in place of an unwanted return parameter.
data | Array of data. |
nr | Length of data array. |
mean | Pointer where mean is written. |
sd | Pointer where S.D. is written. |
Definition at line 1222 of file result.c.
Referenced by rescoll_tabulate().
int resMedian | ( | double * | data, |
int | nr, | ||
double * | median, | ||
double * | min, | ||
double * | max ) |
Calculate the median and the lowest and highest value in the specified double array data of length nr.
Note that array is sorted in this function. NULL pointer may be specified to function in place of an unwanted return parameter.
data | Array of data. |
nr | Length of data array. |
median | Pointer where median is written. |
min | Pointer where min is written. |
max | Pointer where max is written. |
Definition at line 1186 of file result.c.
Referenced by rescoll_tabulate().
int resParameterPrintType | ( | RES * | res, |
int | parIndex ) |
Determine whether the result parameter should be printed as integer (0), float (1), or exponential (2).
res | Pointer to the result struct. |
parIndex | Index of the parameter to test. |
Definition at line 1447 of file result.c.
Referenced by rescoll_tabulate(), resWrite(), and resWriteHTML_table().
void resPrint | ( | RES * | res | ) |
int resRead | ( | char * | filename, |
RES * | res, | ||
int | verbose ) |
Read RES file contents to the specified data structure.
filename | Result file name. |
res | Pointer to initiated RES structure; any previous contents are deleted. |
verbose | Verbose level; if <=0, then nothing is printed into stdout. |
Definition at line 199 of file result.c.
int resRNameSubfieldExists | ( | RES * | res | ) |
Check whether region name sub-fields exist in any region.
res | Pointer to RES struct. |
Definition at line 1763 of file result.c.
int resSelect | ( | RES * | data, |
char * | name ) |
Select VOIs (sets sw=1), whose names are matching specified string.
If no string is specified, then all VOIs are selected.
data | Pointer to the result data. |
name | Region name string. |
Definition at line 1369 of file result.c.
int resSelectRegions | ( | RES * | res, |
char * | region_name, | ||
int | reset ) |
Select the VOIs that have matching region name or number.
Sets sw=1 or sw=0. This will replace resSelect().
res | Pointer to RES data where VOIs are selected |
region_name | Name or VOI number which is searched |
reset | 1=Non-matching VOIs are deselected, 0=Old selections are preserved |
Definition at line 1417 of file result.c.
int resSetmem | ( | RES * | res, |
int | voiNr ) |
Allocate memory for result data. Old data is destroyed.
res | Pointer to initiated and possibly allocated result data. |
voiNr | Nr of regional results. |
Definition at line 70 of file result.c.
Referenced by fitToResult(), res_allocate_with_dft(), and resRead().
void resSortByName | ( | RES * | res | ) |
int resWrite | ( | RES * | res, |
char * | filename, | ||
int | verbose ) |
Write calculation results into specified file.
If file exists, a backup file (+BACKUP_EXTENSION) is written also. If "stdout" is given as filename, output is directed to stdout. If filename extension is *.htm(l), file is saved in HTML format.
res | Pointer to result data. |
filename | Output file name. |
verbose | Verbose level; if <=0, then nothing is printed into stdout. |
Definition at line 565 of file result.c.
Referenced by resPrint().
int resWriteHTML | ( | RES * | res, |
char * | fname, | ||
int | verbose ) |
Write calculation results into specied XHTML 1.1 file. If file exists, a backup file (+BACKUP_EXTENSION) is written also. If "stdout" is given as filename, output is directed to stdout.
res | Pointer to result data |
fname | Output file name |
verbose | Verbose level; if <=0, then nothing is printed into stdout |
Definition at line 865 of file result.c.
Referenced by resWrite().
int resWriteHTML_table | ( | RES * | res, |
FILE * | fp ) |
Write calculation results as one HTML table into an opened (X)HTML file.
res | Pointer to result data. |
fp | Output file pointer. |
Definition at line 1013 of file result.c.
Referenced by resWriteHTML().
int resWriteXHTML11_doctype | ( | FILE * | fp | ) |
Write XHTML 1.1 doctype into an opened file pointer.
fp | Output file pointer. |
Definition at line 941 of file result.c.
Referenced by resWriteHTML().
int resWriteXHTML11_head | ( | FILE * | fp, |
char * | author_name ) |
Write XHTML 1.1 head for PET results file into an opened file pointer.
fp | File pointer where to write. |
author_name | Author name, for example software name. |
Definition at line 960 of file result.c.
Referenced by resWriteHTML().
char reserrmsg[64] |
Error message from RES functions
Definition at line 6 of file result.c.
Referenced by resRead(), resWrite(), and resWriteHTML().
int RESULT_TEST |
Verbose prints from RES functions
Definition at line 5 of file result.c.
Referenced by resFixParnames(), resMatchParameternames(), resMatchParameters(), resMatchParametersAbs(), resMatchRegions(), and resWriteHTML_table().