00001 /****************************************************************************** 00002 00003 Copyright (c) 2000-2008 Turku PET Centre 00004 00005 ift.h 00006 00007 Modification history: 00008 2000-12-13 Vesa Oikonen 00009 2004-08-23 VO 00010 Doxygen style comments. 00011 Functions "renamed" with defines. 00012 2005-01-12 VO 00013 Changed and additional comments not affecting compiled code. 00014 2005-01-15 VO 00015 SIF related stuff moved from libpet to new libsif. 00016 2005-01-16 VO 00017 studynr and isotope_name were added to SIF structure. 00018 00019 00020 ******************************************************************************/ 00021 #ifndef _SIF_H 00022 #define _SIF_H 00023 /*****************************************************************************/ 00024 #include <stdio.h> 00025 #include <stdlib.h> 00026 #include <unistd.h> 00027 #include <math.h> 00028 #include <time.h> 00029 #include <ctype.h> 00030 #include <string.h> 00031 #include <strings.h> 00032 /*****************************************************************************/ 00033 char siferrmsg[128]; 00034 /*****************************************************************************/ 00036 typedef struct { 00038 time_t scantime; 00040 int frameNr; 00042 int colNr; 00044 int version; 00046 char studynr[11]; 00048 char isotope_name[8]; 00050 double *x1; 00052 double *x2; 00054 double *prompts; 00056 double *randoms; 00058 double *trues; 00060 double *weights; 00061 } SIF; 00062 /*****************************************************************************/ 00063 int SIF_TEST; 00064 /*****************************************************************************/ 00065 extern void libsif_printdate(FILE *fp); 00066 extern int sifRead(char *filename, SIF *data); 00067 extern int sifWrite(SIF *data, char *filename); 00068 extern void sifPrint(SIF *data); 00069 extern void sifEmpty(SIF *data); 00070 extern void sifInit(SIF *data); 00071 extern int sifSetmem(SIF *data, int frameNr); 00072 extern void sifWeight(SIF *data, double halflife); 00073 extern void sifModerate(SIF *sif, double limit); 00074 /*****************************************************************************/ 00075 #define readSIF sifRead 00076 #define writeSIF sifWrite 00077 #define printSIF sifPrint 00078 #define emptySIF sifEmpty 00079 #define weightSIF sifWeight 00080 #define initSIF sifInit 00081 #define setmemSIF sifSetmem 00082 /*****************************************************************************/ 00083 #endif 00084