TPCCLIB
Loading...
Searching...
No Matches
tpcextensions.h
Go to the documentation of this file.
1
6#ifndef _TPCEXTENSIONS_H_
7#define _TPCEXTENSIONS_H_
8/*****************************************************************************/
9
10/*****************************************************************************/
11#include "tpcclibConfig.h"
12/*****************************************************************************/
13#include <errno.h>
14#include <string.h>
15#include <stdio.h>
16#include <stdint.h>
17#include <stdlib.h>
18#include <strings.h>
19#include <ctype.h>
20#include <math.h>
21#include <float.h>
22#include <time.h>
23#include <sys/time.h>
24/*****************************************************************************/
25
26/*****************************************************************************/
28#ifndef MAX_UNITS_LEN
29#define MAX_UNITS_LEN 32
30#endif
31/*****************************************************************************/
32
33/*****************************************************************************/
35#ifndef MAX_TACNAME_LEN
36#define MAX_TACNAME_LEN 31
37#endif
39#ifndef MAX_PARNAME_LEN
40#define MAX_PARNAME_LEN MAX_TACNAME_LEN
41#endif
42/*****************************************************************************/
43
44/*****************************************************************************/
46#ifndef MAX_STUDYNR_LEN
47#define MAX_STUDYNR_LEN 255
48#endif
49/*****************************************************************************/
50
51/*****************************************************************************/
53typedef enum {
60 // possibility to add more weighting schemes
61 WEIGHTING_LAST
62} weights;
63/*****************************************************************************/
64
65/*****************************************************************************/
78/*****************************************************************************/
79
80/*****************************************************************************/
85typedef enum {
182} unit;
183/*****************************************************************************/
184
185/*****************************************************************************/
232/*****************************************************************************/
233
234/*****************************************************************************/
254/*****************************************************************************/
255
256/*****************************************************************************/
257/* stringext */
258extern int strTokenNr(const char *s1, const char *s2);
259extern int strTokenNCpy(const char *s1, const char *s2, int i, char *s3, int count);
260extern int strChrCount(const char *s1, const char *s2);
261extern int strUppercaseCount(const char *s);
262extern void strReplaceChar(char *s, char c1, char c2);
263#ifndef HAVE_STRCASESTR
264extern char *strcasestr(const char *haystack, const char *needle);
265#endif
266#ifndef HAVE_STRNDUP
267extern char *strndup(const char *s, size_t n);
268#endif
269#ifndef HAVE_STRNLEN
270extern size_t strnlen(const char *s, size_t n);
271#endif
272//#ifndef HAVE_STRLCAT
273extern size_t strlcat(char *dst, const char *src, size_t dstsize);
274//#endif
275//#ifndef HAVE_STRLCPY
276extern size_t strlcpy(char *dst, const char *src, size_t dstsize);
277//#endif
278extern char *strstrNoQuotation(const char *haystack, const char *needle);
279extern int strncpyCleanSpaces(char *s1, const char *s2, int maxlen);
280extern int strCleanSpaces(char *s);
281extern int strncpyClean(char *s1, const char *s2, int maxlen);
282extern int strClean(char *s);
283extern char *strTokenDup(const char *s1, const char *s2, int *next);
284extern int strInPars(char *s);
285extern void strCleanPars(char *s);
286extern char *strncatInt(char *str1, const int n, size_t count);
287extern char *strncatDouble(char *str1, const double d, size_t count);
288extern char *strncatIntZ(char *str1, const int n, const int maxn, size_t count);
289extern int strIsSpaceOnly(char *s);
290extern char *strdelstr(char *s1, const char *s2);
291extern char *strTrimLeft(char *s, const size_t t);
292extern char *strEncodeForXML(const char *s);
293extern void strCleanForXML(char *s);
294/*****************************************************************************/
295
296/*****************************************************************************/
297/* decpoint */
298extern int strIsValidNumber(const char *s);
299extern double atofVerified(const char *s);
300extern int atofCheck(const char *s, double *v);
301extern int strHaveDecimalComma(const char *s);
302extern int strHaveDecimalSeparator(const char *s);
303extern int atofList(const char *s1, const char *s2, double *x, int maxn);
304/*****************************************************************************/
305
306/*****************************************************************************/
307/* filename */
308extern void filenameRmPath(char *s);
309extern void filenameRmFile(char *s);
310extern int filenameRmExtension(char *s);
311extern void filenameRmExtensions(char *s);
312extern int fnmatch(const char *fname, const char *key);
313extern int fncasematch(const char *fname, const char *key);
314extern char *filenameGetExtension(const char *s);
315extern char *filenameGetExtensions(const char *s);
316/*****************************************************************************/
317
318/*****************************************************************************/
319/* proginfo */
320extern int tpcProcessStdOptions(const char *s, int *print_usage, int *print_version, int *verbose_level);
321extern void tpcPrintUsage(const char *program, char *text[], FILE *fp);
322extern int tpcHtmlUsage(const char *program, char *text[], const char *path);
323extern void tpcPrintBuild(const char *program, FILE *fp);
324extern void tpcProgramName(const char *program, int version, int copyright, char *prname, int n);
325extern int tpcYesNo(const char *s);
326/*****************************************************************************/
327
328/*****************************************************************************/
329/* units */
330extern char *unitName(int unit_code);
331extern int unitIdentify(const char *s);
332extern int unitIdentifyFilename(const char *s);
333extern int unitIsDistance(int u);
334extern int unitIsTime(int u);
335extern int unitIsVolume(int u);
336extern int unitIsMass(int u);
337extern int unitIsMole(int u);
338extern int unitIsRadioactivity(int u);
339extern int unitIsRAConc(int u);
340extern int unitIsCombinatorial(int u);
341extern double unitConversionFactor(const int u1, const int u2);
342extern int unitInverse(int u);
343extern int unitDividerHasVolume(int u);
344extern int unitDividerHasMass(int u);
345extern int unitDividendHasRadioactivity(int u);
346extern int unitCombination(const int u1, const int u2, const int v1, const int v2);
347extern int unitDividerMassVolumeConversion(int u);
348extern int unitMultiply(int ua, int ub);
349/*****************************************************************************/
350
351/*****************************************************************************/
352/* statusmsg */
353extern void statusPrint(FILE *fp, TPCSTATUS *s);
354extern void statusInit(TPCSTATUS *s);
355extern void statusFree(TPCSTATUS *s);
356extern void statusSet(TPCSTATUS *s, const char *func, const char *srcfile, int srcline, tpcerror error);
357extern char *errorMsg(tpcerror e);
358/*****************************************************************************/
359
360/*****************************************************************************/
361/* readasciifile */
362extern size_t asciiFileSize(FILE *fp, int *nonprintable);
363extern char *asciiFileRead(FILE *fp, char *data, size_t maxlen);
364extern int asciiCommentLine(const char *line, int *cont);
365/*****************************************************************************/
366
367/*****************************************************************************/
368/* datetime */
369#ifndef HAVE_GMTIME_R
370extern struct tm* gmtime_r(const time_t* t, struct tm* tm);
371#endif
372#ifndef HAVE_LOCALTIME_R
373extern struct tm* localtime_r(const time_t* t, struct tm* tm);
374#endif
375//#ifndef HAVE_TIMEGM
376extern time_t timegm(struct tm *tm); // always needed at least in macOS
377//#endif
378extern char* ctime_r_int(const time_t *t, char *buf);
379extern int strDateValid(const char *str);
380extern int strDateValid2(const char *str, char *intdate);
381extern int strDateValid3(const char *str, char *intdate);
382extern int strDateValid4(int dateint, char *intdate, int *year, int *month, int *day);
383extern int strTimeValid(const char *str);
384extern int strDateTimeValid(const char *str, char *intdate);
385extern int strDateTimeRead(const char *str, struct tm *date);
386extern int strDateRead(const char *str, struct tm *date);
387extern void time_to_tm(time_t totalsecs, int offset, struct tm *result);
388extern double tmDifference(struct tm *tm1, struct tm *tm0);
389extern void tmAdd(int s, struct tm *d);
390extern double strDateTimeDifference(const char *dt1, const char *dt0);
391extern int strDateTimeAdd(int s, char *dt);
392extern double timespecDifference(struct timespec const *ts2, struct timespec const *ts1);
393/*****************************************************************************/
394
395/*****************************************************************************/
396/* studynr */
397extern int studynrVerify(const char *s, int zero_ok);
398extern int studynrStandardize(char *s);
399extern int studynrFromFilename(const char *fname, char *studynr, int force);
400/*****************************************************************************/
401
402/*****************************************************************************/
403/* doubleutil */
404extern int doubleMatch(const double v1, const double v2, const double lim);
405extern int doubleArrayMatch(const double *a1, const double *a2, const unsigned int n, const double lim);
406extern int doubleMatchRel(const double v1, const double v2, const double lim);
407extern double doubleMachEps();
408extern void doubleCopy(double *t, double *s, const unsigned int n);
409extern unsigned int doubleCopyFinite(double *t, double *s, const unsigned int n);
410extern unsigned int doubleNaNs(double *a, const unsigned int n);
411extern unsigned int doubleRange(double *a, const unsigned int n, double *amin, double *amax);
412extern double doubleSum(double *a, const unsigned int n);
413extern double doubleMean(double *a, const unsigned int n);
414extern double doubleWMean(double *a, double *w, const unsigned int n);
415extern int doubleGetWithUnit(const char *s, double *v, int *u);
416extern int doubleSpanPositives(double *a, const int n);
417extern int doubleCSpanPositives(double *a, const int n);
418extern unsigned int doubleNonzeroes(double *a, const unsigned int n);
419extern unsigned int doubleMaxIndex(double *a, const unsigned int n);
420extern unsigned int doubleAbsMaxIndex(double *a, const unsigned int n);
421extern unsigned int doubleMinIndex(double *a, const unsigned int n);
422extern unsigned int doubleAbsMinIndex(double *a, const unsigned int n);
423extern unsigned int doubleGEIndex(double *a, const unsigned int n, double lim);
424extern unsigned int doubleGTIndex(double *a, const unsigned int n, double lim);
425extern double inverfc(double x);
426extern int linRegr3p(
427 double x1, double y1, double x2, double y2, double x3, double y3, double *slope, double *ic
428);
429/*****************************************************************************/
430
431/*****************************************************************************/
432/* floatutil */
433extern int floatMatch(const float v1, const float v2, const float lim);
434extern int floatMatchRel(const float v1, const float v2, const float lim);
435extern float floatMachEps();
436extern void floatCopy(float *t, float *s, const unsigned int n);
437extern unsigned int floatMaxIndex(float *a, const unsigned int n);
438extern float floatSum(float *a, const unsigned int n);
439extern float floatMean(float *a, const unsigned int n);
440extern int floatGetWithUnit(const char *s, float *v, int *u);
441extern int floatSpanPositives(float *a, const int n);
442extern int floatCSpanPositives(float *a, const int n);
443extern unsigned int floatNonzeroes(float *a, const unsigned int n);
444/*****************************************************************************/
445
446/*****************************************************************************/
447/* intutil */
448extern int atoiCheck(const char *s, int *v);
449extern unsigned int factorial(unsigned int n);
450extern unsigned long long int lfactorial(unsigned long long int n);
451extern uint32_t sqrt_uint64(uint64_t n);
454typedef struct INTLIST {
456 int nr;
458 int _nr;
460 int *i;
461} INTLIST;
462extern void intlistInit(INTLIST *l);
463extern void intlistFree(INTLIST *l);
464extern int intlistAdd(INTLIST *l, const int v, const int ifnew);
465extern void intlistSort(INTLIST *l);
466extern int intlistAddFromString(const char *s1, const char *s2, INTLIST *l, const int ifnew);
467extern int intlistExpandFromString(const char *s1, const char *s2, INTLIST *l, const int ifnew);
468/*****************************************************************************/
469
470/*****************************************************************************/
471/* roiname */
472extern char *roinameSubpart(
473 const char *roiname, const char *dlm, const unsigned int si,
474 char *subpart, const unsigned int slen
475);
476extern char *roinameEditByTemplate(
477 const char *template, const char *currname,
478 char *newname, const unsigned int count
479);
480extern char *roinameAddField(
481 char *roiname, const char *field,
482 const unsigned int in, const unsigned int count
483);
484extern int roinameExists(char *roiname);
485extern int roinameMatch(const char *roiname, const char *test_str, TPCSTATUS *status);
486/*****************************************************************************/
487
488/*****************************************************************************/
489/* endian */
490enum { // used by endianness()
491 ENDIAN_UNKNOWN,
492 ENDIAN_BIG,
493 ENDIAN_LITTLE,
494 ENDIAN_BIG_WORD, /* Middle-endian, Honeywell 316 style */
495 ENDIAN_LITTLE_WORD /* Middle-endian, PDP-11 style */
496};
497extern int endianness();
498extern int endianLittle();
499extern void swap(void *from, void *to, int size);
500extern void swabip(void *buf, int size);
501extern void swawbip(void *buf, int size);
502extern void swawip(void *buf, int size);
503extern void swap64ip(void *buf, unsigned long long size);
504extern void swap32ip(void *buf, unsigned long long size);
505extern void swap16ip(void *buf, unsigned long long size);
506/*****************************************************************************/
507
508/*****************************************************************************/
509#endif /* TPCEXTENSIONS */
510
double timespecDifference(struct timespec const *ts2, struct timespec const *ts1)
Definition datetime.c:550
int strDateValid3(const char *str, char *intdate)
Definition datetime.c:203
char * ctime_r_int(const time_t *t, char *buf)
Convert calendar time t into a null-terminated string of the form YYYY-MM-DD hh:mm:ss,...
Definition datetime.c:108
int strDateValid(const char *str)
Definition datetime.c:144
int strDateTimeRead(const char *str, struct tm *date)
Definition datetime.c:339
int strDateRead(const char *str, struct tm *date)
Definition datetime.c:370
time_t timegm(struct tm *tm)
Inverse of gmtime, converting struct tm to time_t.
Definition datetime.c:76
double strDateTimeDifference(const char *dt1, const char *dt0)
Definition datetime.c:511
void tmAdd(int s, struct tm *d)
Definition datetime.c:492
int strTimeValid(const char *str)
Definition datetime.c:273
void time_to_tm(time_t totalsecs, int offset, struct tm *result)
Definition datetime.c:435
int strDateValid2(const char *str, char *intdate)
Definition datetime.c:168
struct tm * gmtime_r(const time_t *t, struct tm *tm)
Convert time_t to GMT struct tm.
Definition datetime.c:31
int strDateTimeValid(const char *str, char *intdate)
Definition datetime.c:297
int strDateValid4(int dateint, char *intdate, int *year, int *month, int *day)
Definition datetime.c:239
int strDateTimeAdd(int s, char *dt)
Definition datetime.c:529
struct tm * localtime_r(const time_t *t, struct tm *tm)
Convert time_t to local time in struct tm.
Definition datetime.c:53
double tmDifference(struct tm *tm1, struct tm *tm0)
Definition datetime.c:478
double atofVerified(const char *s)
Definition decpoint.c:75
int strHaveDecimalComma(const char *s)
Definition decpoint.c:115
int atofCheck(const char *s, double *v)
Definition decpoint.c:94
int atofList(const char *s1, const char *s2, double *x, int maxn)
Definition decpoint.c:150
int strHaveDecimalSeparator(const char *s)
Definition decpoint.c:132
int strIsValidNumber(const char *s)
Definition decpoint.c:33
unsigned int doubleNonzeroes(double *a, const unsigned int n)
Definition doubleutil.c:339
unsigned int doubleNaNs(double *a, const unsigned int n)
Definition doubleutil.c:156
int doubleGetWithUnit(const char *s, double *v, int *u)
Definition doubleutil.c:272
int doubleSpanPositives(double *a, const int n)
Definition doubleutil.c:302
unsigned int doubleAbsMinIndex(double *a, const unsigned int n)
Definition doubleutil.c:416
double doubleMachEps()
Definition doubleutil.c:105
unsigned int doubleGEIndex(double *a, const unsigned int n, double lim)
Definition doubleutil.c:435
int doubleCSpanPositives(double *a, const int n)
Definition doubleutil.c:320
int doubleMatch(const double v1, const double v2, const double lim)
Definition doubleutil.c:27
int doubleMatchRel(const double v1, const double v2, const double lim)
Definition doubleutil.c:77
double doubleWMean(double *a, double *w, const unsigned int n)
Definition doubleutil.c:244
unsigned int doubleMaxIndex(double *a, const unsigned int n)
Definition doubleutil.c:357
double inverfc(double x)
Definition doubleutil.c:473
int doubleArrayMatch(const double *a1, const double *a2, const unsigned int n, const double lim)
Definition doubleutil.c:51
int linRegr3p(double x1, double y1, double x2, double y2, double x3, double y3, double *slope, double *ic)
Linear regression for three (x,y) points.
Definition doubleutil.c:521
unsigned int doubleCopyFinite(double *t, double *s, const unsigned int n)
Definition doubleutil.c:136
unsigned int doubleRange(double *a, const unsigned int n, double *amin, double *amax)
Definition doubleutil.c:174
unsigned int doubleAbsMaxIndex(double *a, const unsigned int n)
Definition doubleutil.c:377
unsigned int doubleGTIndex(double *a, const unsigned int n, double lim)
Definition doubleutil.c:452
double doubleSum(double *a, const unsigned int n)
Definition doubleutil.c:206
void doubleCopy(double *t, double *s, const unsigned int n)
Definition doubleutil.c:117
double doubleMean(double *a, const unsigned int n)
Definition doubleutil.c:224
unsigned int doubleMinIndex(double *a, const unsigned int n)
Definition doubleutil.c:396
void swap32ip(void *buf, unsigned long long size)
Definition endian.c:210
void swap64ip(void *buf, unsigned long long size)
Definition endian.c:184
void swabip(void *buf, int size)
Definition endian.c:115
int endianLittle()
Definition endian.c:53
void swawip(void *buf, int size)
Definition endian.c:161
void swap16ip(void *buf, unsigned long long size)
Definition endian.c:234
int endianness()
Definition endian.c:26
void swap(void *from, void *to, int size)
Definition endian.c:69
void swawbip(void *buf, int size)
Definition endian.c:138
void filenameRmFile(char *s)
Definition filename.c:44
char * filenameGetExtensions(const char *s)
Get all extensions of a file name.
Definition filename.c:203
char * filenameGetExtension(const char *s)
Get the last extension of a file name.
Definition filename.c:178
void filenameRmPath(char *s)
Definition filename.c:20
void filenameRmExtensions(char *s)
Definition filename.c:89
int filenameRmExtension(char *s)
Definition filename.c:71
int fnmatch(const char *fname, const char *key)
Definition filename.c:104
int fncasematch(const char *fname, const char *key)
Definition filename.c:139
float floatMachEps()
Definition floatutil.c:82
float floatMean(float *a, const unsigned int n)
Definition floatutil.c:150
unsigned int floatNonzeroes(float *a, const unsigned int n)
Definition floatutil.c:247
void floatCopy(float *t, float *s, const unsigned int n)
Definition floatutil.c:94
float floatSum(float *a, const unsigned int n)
Definition floatutil.c:132
int floatGetWithUnit(const char *s, float *v, int *u)
Definition floatutil.c:174
int floatMatch(const float v1, const float v2, const float lim)
Definition floatutil.c:27
int floatCSpanPositives(float *a, const int n)
Definition floatutil.c:228
int floatMatchRel(const float v1, const float v2, const float lim)
Definition floatutil.c:54
unsigned int floatMaxIndex(float *a, const unsigned int n)
Definition floatutil.c:113
int floatSpanPositives(float *a, const int n)
Definition floatutil.c:210
uint32_t sqrt_uint64(uint64_t n)
Definition intutil.c:79
void intlistInit(INTLIST *l)
Definition intutil.c:102
int intlistExpandFromString(const char *s1, const char *s2, INTLIST *l, const int ifnew)
Definition intutil.c:212
unsigned long long int lfactorial(unsigned long long int n)
Definition intutil.c:63
void intlistFree(INTLIST *l)
Definition intutil.c:114
void intlistSort(INTLIST *l)
Definition intutil.c:159
int atoiCheck(const char *s, int *v)
Definition intutil.c:25
int intlistAddFromString(const char *s1, const char *s2, INTLIST *l, const int ifnew)
Definition intutil.c:178
int intlistAdd(INTLIST *l, const int v, const int ifnew)
Definition intutil.c:130
unsigned int factorial(unsigned int n)
Definition intutil.c:46
int tpcProcessStdOptions(const char *s, int *print_usage, int *print_version, int *verbose_level)
Definition proginfo.c:47
void tpcProgramName(const char *program, int version, int copyright, char *prname, int n)
Definition proginfo.c:408
int tpcYesNo(const char *s)
Definition proginfo.c:461
int tpcHtmlUsage(const char *program, char *text[], const char *path)
Definition proginfo.c:169
void tpcPrintBuild(const char *program, FILE *fp)
Definition proginfo.c:339
void tpcPrintUsage(const char *program, char *text[], FILE *fp)
Definition proginfo.c:114
char * asciiFileRead(FILE *fp, char *data, size_t maxlen)
int asciiCommentLine(const char *line, int *cont)
size_t asciiFileSize(FILE *fp, int *nonprintable)
int roinameMatch(const char *roiname, const char *test_str, TPCSTATUS *status)
Definition roiname.c:183
char * roinameSubpart(const char *roiname, const char *dlm, const unsigned int si, char *subpart, const unsigned int slen)
Definition roiname.c:20
char * roinameAddField(char *roiname, const char *field, const unsigned int in, const unsigned int count)
Definition roiname.c:106
int roinameExists(char *roiname)
Verifies whether TAC name exists or not.
Definition roiname.c:158
char * roinameEditByTemplate(const char *template, const char *currname, char *newname, const unsigned int count)
Definition roiname.c:65
void statusPrint(FILE *fp, TPCSTATUS *s)
Definition statusmsg.c:82
void statusInit(TPCSTATUS *s)
Definition statusmsg.c:104
char * errorMsg(tpcerror e)
Definition statusmsg.c:68
void statusSet(TPCSTATUS *s, const char *func, const char *srcfile, int srcline, tpcerror error)
Definition statusmsg.c:142
void statusFree(TPCSTATUS *s)
Definition statusmsg.c:126
int strTokenNr(const char *s1, const char *s2)
Definition stringext.c:25
void strReplaceChar(char *s, char c1, char c2)
Definition stringext.c:134
int strInPars(char *s)
Definition stringext.c:452
void strCleanForXML(char *s)
Definition stringext.c:772
char * strstrNoQuotation(const char *haystack, const char *needle)
Definition stringext.c:224
char * strncatIntZ(char *str1, const int n, const int maxn, size_t count)
Definition stringext.c:538
int strCleanSpaces(char *s)
Definition stringext.c:299
char * strncatDouble(char *str1, const double d, size_t count)
Definition stringext.c:516
void strCleanPars(char *s)
Definition stringext.c:475
char * strEncodeForXML(const char *s)
Definition stringext.c:734
char * strTrimLeft(char *s, const size_t t)
Definition stringext.c:713
size_t strnlen(const char *s, size_t n)
Definition stringext.c:566
int strncpyCleanSpaces(char *s1, const char *s2, int maxlen)
Definition stringext.c:264
char * strncatInt(char *str1, const int n, size_t count)
Definition stringext.c:494
int strTokenNCpy(const char *s1, const char *s2, int i, char *s3, int count)
Definition stringext.c:53
size_t strlcpy(char *dst, const char *src, size_t dstsize)
Definition stringext.c:635
int strncpyClean(char *s1, const char *s2, int maxlen)
Definition stringext.c:320
int strIsSpaceOnly(char *s)
Definition stringext.c:674
int strChrCount(const char *s1, const char *s2)
Definition stringext.c:98
char * strTokenDup(const char *s1, const char *s2, int *next)
Definition stringext.c:412
char * strdelstr(char *s1, const char *s2)
Definition stringext.c:691
int strClean(char *s)
Definition stringext.c:388
int strUppercaseCount(const char *s)
Definition stringext.c:118
char * strcasestr(const char *haystack, const char *needle)
Definition stringext.c:155
size_t strlcat(char *dst, const char *src, size_t dstsize)
Definition stringext.c:595
char * strndup(const char *s, size_t n)
Definition stringext.c:204
int verbose
Verbose level, used by statusPrint() etc.
FILE * fp
File pointer for writing log information during development and testing.
int forgiving
Force level, 0 for strict tests for data units etc.
char * current_func
Function where status was last time set.
int current_line
Source line nr where status was last time set.
char * last_file
Source file name where status previously set.
char * current_file
Source file name where status was last time set.
int last_line
Source line nr where status was previously set.
tpcerror error
Error code.
char * last_func
Function where status was previously set.
int studynrFromFilename(const char *fname, char *studynr, int force)
Definition studynr.c:79
int studynrStandardize(char *s)
Definition studynr.c:47
int studynrVerify(const char *s, int zero_ok)
Definition studynr.c:22
weights
Is data weighted, or are weight factors available with data?
@ WEIGHTING_OFF
Not weighted or weights not available (weights for all included samples are 1.0).
@ WEIGHTING_ON_FD
Weights based on decay and sample frequency or frame length (Thiele et al, 2008).
@ WEIGHTING_UNKNOWN
Not known; usually assumed that not weighted.
@ WEIGHTING_ON_GENERAL
Weighted or weights are available, but not specified.
@ WEIGHTING_ON_F
Weights based on sample frequency or frame length.
@ WEIGHTING_ON_COUNTS
Weights based on counts (Mazoyer et al, 1986).
int unitIsRAConc(int u)
Definition units.c:726
int unitDividendHasRadioactivity(int u)
Definition units.c:710
unit
@ UNIT_UMOL_PER_DL_MIN
umol/(dL*min)
@ UNIT_L
liter
@ UNIT_MMOL_PER_DL_MIN
mmol/(dL*min)
@ UNIT_MIN_KBQ_PER_ML
min*kBq/mL
@ UNIT_YEAR
years
@ UNIT_MMOL_PER_G_MIN
mmol/(g*min)
@ UNIT_MOL
mole
@ UNIT_BQ_PER_G
Bq/g.
@ UNIT_MBQ_PER_ML
MBq/mL.
@ UNIT_MIN
minutes
@ UNIT_KG
kilogram
@ UNIT_ML_PER_ML
mL/mL
@ UNIT_MMOL_PER_100G_MIN
mmol/(100g*min)
@ UNIT_ML_PER_ML_MIN
mL/(mL*min)
@ UNIT_MSEC
milliseconds
@ UNIT_UMOL_PER_ML_MIN
umol/(mL*min)
@ UNIT_MIN_BQ_PER_ML
min*Bq/mL
@ UNIT_CPS
counts/s
@ UNIT_MG_PER_DL_MIN
mg/(dL*min)
@ UNIT_PID_PER_L
Percent of injected dose / L.
@ UNIT_UMOL
micromole
@ UNIT_MBQ
megaBecquerel
@ UNIT_UNKNOWN
Unknown unit.
@ UNIT_ML_PER_100G_MIN
mL/(100g*min)
@ UNIT_CPM
counts/min
@ UNIT_KCOUNTS
kilocounts
@ UNIT_UMOL_PER_L
umol/L
@ UNIT_ML
milliliter
@ UNIT_PER_SEC
1/s
@ UNIT_KCPM
kilocounts/min
@ UNIT_ML_PER_DL
mL/dL
@ UNIT_KCPS
kilocounts/s
@ UNIT_MMOL_PER_ML
mmol/mL
@ UNIT_MOL_PER_L
mol/L
@ UNIT_G
gram
@ UNIT_PID_PER_G
Percent of injected dose / g.
@ UNIT_NMOL
nanomole
@ UNIT_UCI_PER_G
uCi/g
@ UNIT_KBQ
kiloBecquerel
@ UNIT_LAST
end of list
@ UNIT_ML_PER_G
mL/g
@ UNIT_NMOL_PER_ML
nmol/mL
@ UNIT_SEC_BQ_PER_ML
s*Bq/mL
@ UNIT_KBQ_PER_ML
kBq/mL
@ UNIT_MONTH
months
@ UNIT_ML_PER_G_MIN
mL/(g*min)
@ UNIT_ML_PER_DL_MIN
mL/(dL*min)
@ UNIT_UNITLESS
Unitless.
@ UNIT_PMOL_PER_L
pmol/L
@ UNIT_G_PER_ML
g/mL
@ UNIT_PID_PER_ML
Percent of injected dose / mL.
@ UNIT_MMOL_PER_ML_MIN
mmol/(mL*min)
@ UNIT_CM
centimeter
@ UNIT_UCI_PER_ML
uCi/mL
@ UNIT_COUNTS
counts
@ UNIT_DL
desiliter
@ UNIT_MBQ_PER_NMOL
MBq/nmol (specific activity).
@ UNIT_MCI
milliCurie
@ UNIT_NMOL_PER_L
nmol/L
@ UNIT_PER_HOUR
1/h
@ UNIT_SEC
seconds
@ UNIT_MBQ_PER_G
MBq/g.
@ UNIT_NCI
nanoCurie
@ UNIT_KBQ_PER_G
kBq/g
@ UNIT_DAY
days
@ UNIT_PID
Percent of injected dose.
@ UNIT_100G
100 grams
@ UNIT_UMOL_PER_ML
umol/mL
@ UNIT_PID_PER_KG
Percent of injected dose / kg.
@ UNIT_GBQ_PER_NMOL
GBq/nmol (specific activity).
@ UNIT_ML_PER_ML_SEC
mL/(mL*sec)
@ UNIT_UG
microgram
@ UNIT_MM
millimeter
@ UNIT_BQ
Becquerel.
@ UNIT_UMOL_PER_G_MIN
umol/(g*min)
@ UNIT_SEC_KBQ_PER_ML
s*kBq/mL
@ UNIT_PMOL_PER_ML
pmol/mL
@ UNIT_PMOL
picomole
@ UNIT_HU
Hounsfield Unit.
@ UNIT_UL
microliter
@ UNIT_HOUR
hours
@ UNIT_UMOL_PER_100G_MIN
umol/(100g*min)
@ UNIT_UM
micrometer
@ UNIT_UCI
microCurie
@ UNIT_MMOL_PER_L
mmol/L
@ UNIT_PER_MIN
1/min
@ UNIT_GBQ
gigaBecquerel
@ UNIT_PERCENTAGE
Percentage (%).
@ UNIT_CI
Curie.
@ UNIT_NCI_PER_G
nCi/g
@ UNIT_MG
milligram
@ UNIT_BQ_PER_ML
Bq/mL.
@ UNIT_MG_PER_100G_MIN
mg/(100g*min)
@ UNIT_M
meter
@ UNIT_MMOL
millimole
@ UNIT_NCI_PER_ML
nCi/mL
int unitIsMass(int u)
Definition units.c:402
int unitInverse(int u)
Definition units.c:654
tpcerror
Error codes. Error code tpcerror, same as error message position in the table (table can not be acces...
@ TPCERROR_NO_REFERENCE
Reference not found.
@ TPCERROR_INVALID_SEPARATOR
Invalid field delimiter.
@ TPCERROR_DUPLICATE_DATA
File contains duplicate data.
@ TPCERROR_INVALID_XRANGE
Invalid sample time range.
@ TPCERROR_INVALID_VALUE
Invalid value.
@ TPCERROR_NO_FILE
File does not exist.
@ TPCERROR_NO_SOLUTION
No solution.
@ TPCERROR_INVALID_PARNR
Invalid number of parameters.
@ TPCERROR_NO_VALUE
Value not found.
@ TPCERROR_OVERLAPPING_DATA
Overlapping data.
@ TPCERROR_NO_DATETIME
File contains no date or time.
@ TPCERROR_BAD_FIT
Fitting not successful.
@ TPCERROR_UNKNOWN_UNIT
Unknown data unit.
@ TPCERROR_FAIL
General error.
@ TPCERROR_INVALID_FORMAT
Invalid file format.
@ TPCERROR_INVALID_HEADER
Invalid header contents.
@ TPCERROR_TOO_BIG
File is too big.
@ TPCERROR_CANNOT_OPEN
Cannot open file.
@ TPCERROR_OUT_OF_MEMORY
Cannot allocate memory.
@ TPCERROR_INVALID_X
Invalid sample time.
@ TPCERROR_NO_KEY
Key not found.
@ TPCERROR_NO_X
No sample times.
@ TPCERROR_UNSUPPORTED
Unsupported file type.
@ TPCERROR_FILE_EXISTS
File exists.
@ TPCERROR_OK
No error.
@ TPCERROR_LAST
marking the end of list
@ TPCERROR_NO_WEIGHTS
File contains no weights.
@ TPCERROR_INCOMPATIBLE_UNIT
Incompatible units.
@ TPCERROR_LARGE_GAP
Large gap in data.
@ TPCERROR_INVALID_FILENAME
Invalid file name.
@ TPCERROR_UNKNOWN_ISOTOPE
Unknown isotope.
@ TPCERROR_NO_DATA
File contains no data.
@ TPCERROR_MISSING_HEADER
Missing header.
@ TPCERROR_CANNOT_DELETE
Cannot delete.
@ TPCERROR_TOO_FEW
File contains too few samples.
@ TPCERROR_CANNOT_READ
Cannot read file.
@ TPCERROR_MISSING_DATA
File contains missing values.
@ TPCERROR_INCOMPATIBLE_DATA
Incompatible data.
@ TPCERROR_CANNOT_WRITE
Cannot write file.
int unitIdentify(const char *s)
Definition units.c:162
int unitIdentifyFilename(const char *s)
Definition units.c:311
int unitIsRadioactivity(int u)
Definition units.c:444
double unitConversionFactor(const int u1, const int u2)
Definition units.c:487
char * unitName(int unit_code)
Definition units.c:143
int unitCombination(const int u1, const int u2, const int v1, const int v2)
Definition units.c:745
int unitIsCombinatorial(int u)
Definition units.c:468
int unitIsDistance(int u)
Definition units.c:339
int unitDividerHasVolume(int u)
Definition units.c:678
int unitIsMole(int u)
Definition units.c:423
tactype
TAC content types.
@ TACTYPE_REF
Reference region TAC.
@ TACTYPE_PARENT
Parent tracer in plasma.
@ TACTYPE_UNKNOWN
Content type not known.
@ TACTYPE_METABOLITE
Metabolite in plasma.
@ TACTYPE_PLASMA
Plasma TAC.
@ TACTYPE_PIXEL
Image pixel TAC.
@ TACTYPE_VOI
Image volume-of-interest TAC.
@ TACTYPE_BLOOD
Blood TAC.
int unitDividerMassVolumeConversion(int u)
Definition units.c:775
int unitMultiply(int ua, int ub)
Definition units.c:809
int unitIsVolume(int u)
Definition units.c:382
int unitIsTime(int u)
Definition units.c:359
int unitDividerHasMass(int u)
Definition units.c:694