Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

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    Major portions of this software are copyrighted by the Medical College
00003    of Wisconsin, 1994-2000, and are released under the Gnu General Public
00004    License, Version 2.  See the file README.Copyright for details.
00005 ******************************************************************************/
00006 
00007 #ifndef _AFNI_PLUGOUT_HEADER_
00008 #define _AFNI_PLUGOUT_HEADER_
00009 
00010 extern void AFNI_init_plugouts( void ) ;  /* prototypes */
00011 extern int AFNI_have_plugouts( void ) ;   /* 07 Nov 2001 */
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     /* 21 Nov 2001: number of TCP/IP control ports */
00020 #define BASE_TCP_CONTROL 7955  /* control via ports number 7955 .. 7959       */
00021 
00022 #define POACKSIZE       4   /* size of all plugout acknowledgment strings */
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   /* msec */
00040 #define LONG_DELAY      10
00041 #define VLONG_DELAY    100
00042 
00043 #define PO_MAXMODES 16       /* max I/O modes allowed for one plugout */
00044 
00045 #define POMODE_TT_XYZ_DELTA     1  /* I/O mode codes */
00046 #define POMODE_DICOM_XYZ_DELTA  2
00047 #define POMODE_DSET_IJK_DELTA   3
00048 
00049 #define POMODE_SURFID_DELTA    21  /* 05 Sep 2001 */
00050 #define POMODE_UNDERLAY_DELTA  31  /* 11 Jan 2002 */
00051 #define POMODE_OVERLAY_DELTA   32
00052 
00053 typedef struct {
00054    IOCHAN * ioc ;                  /* how to talk to plugout */
00055    int ioc_ready ;                 /* is talking ready? */
00056    char ioc_name[128] ;
00057    char po_name[128] ;             /* identifier for plugout */
00058 
00059    int npomode ;
00060    int pomode[PO_MAXMODES] ;       /* I/O modes for this plugout */
00061 
00062    /** things to recall about the current state **/
00063 
00064    float xi , yj , zk ;     /* DICOM coordinates of viewpoint */
00065    int   ix , jy , kz ;     /* dataset indices of viewpoint */
00066    int   time_index ;
00067    int   view_type ;
00068    int   sess_num , anat_num , func_num ;
00069    float func_threshold ;
00070    int   surfindex ;        /* 06 Sep 2001 */
00071 
00072    int do_ack ;             /* acknowledgements? 06 Sep 2001 */
00073 
00074    THD_3dim_dataset *dset_underlay ;  /* 11 Jan 2002 */
00075    THD_3dim_dataset *dset_overlay  ;
00076 
00077 } PLUGOUT_spec ;
00078 
00079 /* Remember the movie Death Wish? */
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 /** prototypes **/
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 /* ALLOW_PLUGINS */
00095 #endif /* _AFNI_PLUGOUT_HEADER_ */
 

Powered by Plone

This site conforms to the following standards: