1 /***************************************************************************** 2 Major portions of this software are copyrighted by the Medical College 3 of Wisconsin, 1994-2000, and are released under the Gnu General Public 4 License, Version 2. See the file README.Copyright for details. 5 ******************************************************************************/ 6 7 #ifndef _THD_TAGLIST_HEADER_ 8 #define _THD_TAGLIST_HEADER_ 9 10 /*----------------------------------------------------------------------- 11 October 1998: User defined "tags" to be placed into a dataset. 12 -------------------------------------------------------------------------*/ 13 14 #define MAX_TAG_LABEL 40 15 #define MAX_TAG_NUM 666 16 17 typedef struct { 18 int set , ti ; 19 float x,y,z, val ; 20 char label[MAX_TAG_LABEL] ; 21 } THD_usertag ; 22 23 typedef struct { 24 int num ; 25 char label[MAX_TAG_LABEL] ; 26 THD_usertag tag[MAX_TAG_NUM] ; 27 } THD_usertaglist ; 28 29 #define INIT_TAGLIST(tl) \ 30 do{ int iq ; \ 31 for( iq=0 ; iq < MAX_TAG_NUM ; iq++ ){ \ 32 (tl).tag[ii].set = 0 ; \ 33 (tl).tag[ii].label[0] = '\0' ; \ 34 } } while(0) 35 36 #define TAGLIST_COUNT(tl) ((tl)->num) 37 #define TAGLIST_SUBTAG(tl,i) ((tl)->tag[i]) 38 #define TAGLIST_LABEL(tl) ((tl)->label) 39 40 #define TAG_LABEL(tt) ((tt).label) 41 #define TAG_X(tt) ((tt).x) 42 #define TAG_Y(tt) ((tt).y) 43 #define TAG_Z(tt) ((tt).z) 44 #define TAG_T(tt) ((tt).t) 45 #define TAG_VAL(tt) ((tt).val) 46 #define TAG_SET(tt) ((tt).set) 47 48 #define TAG_SETLABEL(tt,str) \ 49 ( strncpy((tt).label,(str),MAX_TAG_LABEL-1) , \ 50 (tt).label[MAX_TAG_LABEL-1] = '\0' ) 51 52 #define TAGLIST_SETLABEL(tl,str) TAG_SETLABEL(*(tl),(str)) 53 54 #define ATRNAME_TAGSET_NUM "TAGSET_NUM" 55 #define ATRNAME_TAGSET_LABELS "TAGSET_LABELS" 56 #define ATRNAME_TAGSET_FLOATS "TAGSET_FLOATS" 57 58 #endif 59