Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

result.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
#include "include/result.h"

Functions

int resQSortComp (const void *f1, const void *f2)
int resQSortName (const void *voi1, const void *voi2)
void resEmpty (RES *res)
void resInit (RES *res)
int resSetmem (RES *res, int voiNr)
void resPrint (RES *res)
int resRead (char *filename, RES *res)
int resWrite (RES *res, char *filename)
int resWriteHTML (RES *res, char *fname)
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)

Function Documentation

int resCopyMHeader RES res1,
RES res2
 

Copy result main header information to another result structure.

int resDelete RES res,
int  voi
 

Delete specified region (0..voiNr-1) from the structure.

Returns:
Returns 0 if ok.

void resEmpty RES res  ) 
 

Free memory allocated for results. All data are cleared.

int resFName2study char *  fname,
char *  studyNumber
 

See studynr_from_fname()

void resInit RES res  ) 
 

Initiate RES structure. This should be called once before first use.

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.

Returns:
Returns 0 if succesfull.

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.

Returns:
Returns 0 if succesfull.

void resPrint RES res  ) 
 

Print to stdout the contents of RES data structure.

int resQSortComp const void *  f1,
const void *  f2
 

int resQSortName const void *  voi1,
const void *  voi2
 

int resRead char *  filename,
RES res
 

Read RES file contents to the specified data structure, emptying its old contents.

Returns:
In case of an error, >0 is returned, and a description is written in reserrmsg.

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.

Returns:
Returns the number of matches, or <0, if an error occurred.

int resSetmem RES res,
int  voiNr
 

Allocate memory for result data. Old data is destroyed.

void resSortByName RES res  ) 
 

Sort RES regions by region name.

int resWrite RES res,
char *  filename
 

Write calculation results into specied file. If file exists, a backup file () 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.

Returns:
In case of an error, >0 is returned, and a description is written in reserrmsg.

int resWriteHTML RES res,
char *  fname
 

Write calculation results into specied file. If file exists, a backup file () is written also. If "stdout" is given as filename, output is directed to stdout

Returns:
In case of an error, >0 is returned, and a description is written in reserrmsg.


Generated on Fri Jan 21 16:17:42 2005 for libPET by  doxygen 1.4.1