Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
afni_plugout.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #ifndef _AFNI_PLUGOUT_HEADER_
00008 #define _AFNI_PLUGOUT_HEADER_
00009
00010 extern void AFNI_init_plugouts( void ) ;
00011 extern int AFNI_have_plugouts( void ) ;
00012
00013 #ifdef ALLOW_PLUGINS
00014
00015 #include "afni.h"
00016 #include <ctype.h>
00017 #include <unistd.h>
00018
00019 #define NUM_TCP_CONTROL 5
00020 #define BASE_TCP_CONTROL 7955
00021
00022 #define POACKSIZE 4
00023
00024 #define PO_ACK_BAD(ic) \
00025 do{ if( verbose ) fprintf(stderr,"PO: sending 'BAD' to plugout\n") ; \
00026 iochan_sendall( (ic) , "BAD" , POACKSIZE ) ; } while(0)
00027
00028 #define PO_ACK_OK(ic) \
00029 do{ if( verbose ) fprintf(stderr,"PO: sending 'OK!' to plugout\n") ; \
00030 iochan_sendall( (ic) , "OK!" , POACKSIZE ) ; } while(0)
00031
00032 #define PO_ACK_GOOD PO_ACK_OK
00033
00034 #define PO_SEND(ic,str) \
00035 do{ int ll = strlen((str))+1 ; \
00036 if( verbose ) fprintf(stderr,"PO: sending %d bytes to plugout\n",ll) ; \
00037 iochan_sendall( (ic) , (str) , ll ) ; } while(0)
00038
00039 #define SHORT_DELAY 2
00040 #define LONG_DELAY 10
00041 #define VLONG_DELAY 100
00042
00043 #define PO_MAXMODES 16
00044
00045 #define POMODE_TT_XYZ_DELTA 1
00046 #define POMODE_DICOM_XYZ_DELTA 2
00047 #define POMODE_DSET_IJK_DELTA 3
00048
00049 #define POMODE_SURFID_DELTA 21
00050 #define POMODE_UNDERLAY_DELTA 31
00051 #define POMODE_OVERLAY_DELTA 32
00052
00053 typedef struct {
00054 IOCHAN * ioc ;
00055 int ioc_ready ;
00056 char ioc_name[128] ;
00057 char po_name[128] ;
00058
00059 int npomode ;
00060 int pomode[PO_MAXMODES] ;
00061
00062
00063
00064 float xi , yj , zk ;
00065 int ix , jy , kz ;
00066 int time_index ;
00067 int view_type ;
00068 int sess_num , anat_num , func_num ;
00069 float func_threshold ;
00070 int surfindex ;
00071
00072 int do_ack ;
00073
00074 THD_3dim_dataset *dset_underlay ;
00075 THD_3dim_dataset *dset_overlay ;
00076
00077 } PLUGOUT_spec ;
00078
00079
00080
00081 #define DESTROY_PLUGOUT(po) \
00082 do{ if( (po) != NULL ){ \
00083 iochan_set_cutoff((po)->ioc) ; \
00084 IOCHAN_CLOSE((po)->ioc) ; \
00085 free((po)) ; (po) = NULL ; } } while(0)
00086
00087
00088
00089 Boolean AFNI_plugout_workproc( XtPointer ) ;
00090 PLUGOUT_spec * new_PLUGOUT_spec( int , char * ) ;
00091 int AFNI_process_plugout( PLUGOUT_spec * ) ;
00092 void AFNI_plugout_exit(void) ;
00093
00094 #endif
00095 #endif