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_receive.c File Reference

#include "afni.h"

Go to the source code of this file.


Defines

#define ADDPT(i, j, k)
#define SFRAC   0.495

Functions

int AFNI_receive_init (Three_D_View *im3d, int rmask, gen_func *cb, void *cb_data, char *cbname)
void AFNI_receive_destroy (Three_D_View *im3d)
int AFNI_receive_control (Three_D_View *im3d, int key, int code, void *arg)
void AFNI_toggle_drawing (Three_D_View *im3d)
void AFNI_process_alteration (Three_D_View *im3d)
void AFNI_process_drawnotice (Three_D_View *im3d)
void AFNI_process_dsetchange (Three_D_View *im3d)
void AFNI_process_viewpoint (Three_D_View *im3d)
void AFNI_process_timeindex (Three_D_View *im3d)
void AFNI_process_redisplay (Three_D_View *im3d)
void AFNI_process_funcdisplay (Three_D_View *im3d)
void AFNI_process_drawing (Three_D_View *im3d, int mode, int npts, int *xd, int *yd, int *zd)
void AFNI_3d_linefill (int nin, int *xin, int *yin, int *zin, int *nout, int **xout, int **yout, int **zout)
void AFNI_ijk_to_xyz (THD_3dim_dataset *dset, int ii, int jj, int kk, float *xx, float *yy, float *zz)
void AFNI_xyz_to_ijk (THD_3dim_dataset *dset, float xx, float yy, float zz, int *ii, int *jj, int *kk)
void AFNI_xyz_to_dicomm (THD_3dim_dataset *dset, float xx, float yy, float zz, float *xd, float *yd, float *zd)
void AFNI_dicomm_to_xyz (THD_3dim_dataset *dset, float xd, float yd, float zd, float *xx, float *yy, float *zz)

Define Documentation

#define ADDPT i,
j,
k   
 

Value:

do{ if( nut == nall ){                                      \
         nall += 128 ;                                        \
         xut = (int *) realloc( xut , sizeof(int) * nall ) ;  \
         yut = (int *) realloc( yut , sizeof(int) * nall ) ;  \
         zut = (int *) realloc( zut , sizeof(int) * nall ) ;  \
      }                                                       \
      xut[nut] = xlast = (i) ;                                \
      yut[nut] = ylast = (j) ;                                \
      zut[nut] = zlast = (k) ; nut++ ; } while(0)

#define SFRAC   0.495
 


Function Documentation

void AFNI_3d_linefill int    nin,
int *    xin,
int *    yin,
int *    zin,
int *    nout,
int **    xout,
int **    yout,
int **    zout
 

Definition at line 772 of file afni_receive.c.

References abs, ENTRY, malloc, x2, y1, and z1.

Referenced by AFNI_process_drawing().

00774 {
00775    int * xut , * yut , * zut ;
00776    int   nut , iin , jout , nall ;
00777    int   x1,y1,z1 , x2,y2,z2 , dx,dy,dz , adx,ady,adz , xlast,ylast,zlast ;
00778    float fdxyz , fdx,fdy,fdz , fx,fy,fz ;
00779 
00780 ENTRY("AFNI_3d_linefill") ;
00781 
00782    /* sanity check */
00783 
00784    if( nin <= 0 || xin == NULL || yin == NULL || zin == NULL ){
00785       *nout = 0 ; *xout = *yout = *zout = NULL ; EXRETURN ;
00786    }
00787 
00788    /* trivial case */
00789 
00790    if( nin == 1 ){
00791       nut = 1 ;                                             *nout = nut ;
00792       xut = (int *) malloc(sizeof(int)) ; xut[0] = xin[0] ; *xout = xut ;
00793       yut = (int *) malloc(sizeof(int)) ; yut[0] = yin[0] ; *yout = yut ;
00794       zut = (int *) malloc(sizeof(int)) ; zut[0] = zin[0] ; *zout = zut ;
00795       EXRETURN ;
00796    }
00797 
00798    /* setup to scan through lines */
00799 
00800    nall = nin ;
00801    xut  = (int *) malloc( sizeof(int) * nall ) ;
00802    yut  = (int *) malloc( sizeof(int) * nall ) ;
00803    zut  = (int *) malloc( sizeof(int) * nall ) ;
00804    nut  = 0 ;
00805 
00806 #undef  ADDPT
00807 #define ADDPT(i,j,k)                                          \
00808   do{ if( nut == nall ){                                      \
00809          nall += 128 ;                                        \
00810          xut = (int *) realloc( xut , sizeof(int) * nall ) ;  \
00811          yut = (int *) realloc( yut , sizeof(int) * nall ) ;  \
00812          zut = (int *) realloc( zut , sizeof(int) * nall ) ;  \
00813       }                                                       \
00814       xut[nut] = xlast = (i) ;                                \
00815       yut[nut] = ylast = (j) ;                                \
00816       zut[nut] = zlast = (k) ; nut++ ; } while(0)
00817 
00818    /* draw line from point #iin to #iin+1 */
00819 
00820    x2 = xin[0] ; y2 = yin[0] ; z2 = zin[0] ;
00821    for( iin=0 ; iin < nin-1 ; iin++ ){
00822       x1  = x2         ; y1  = y2         ; z1  = z2 ;
00823       x2  = xin[iin+1] ; y2  = yin[iin+1] ; z2  = zin[iin+1] ;
00824       dx  = x2 - x1    ; dy  = y2 - y1    ; dz  = z2 - z1 ;
00825       adx = abs(dx)    ; ady = abs(dy)    ; adz = abs(dz) ;
00826 
00827       /* add start point to list */
00828 
00829       ADDPT(x1,y1,z1) ;
00830 
00831       /* special case: neighbors ==> skip to next line */
00832 
00833       if( adx <= 1 && ady <= 1 && adz <= 1 ) continue ;
00834 
00835       /* OK, we have to do work (moan) */
00836 
00837 #define SFRAC 0.495
00838 
00839       fdxyz = adx + ady + adz ;                /* Manhattan distance */
00840       fdx   = SFRAC * dx / fdxyz ;             /* steps */
00841       fdy   = SFRAC * dy / fdxyz ;
00842       fdz   = SFRAC * dz / fdxyz ;
00843 
00844       /* step thru in small increments,
00845          adding new integer points, and stopping at line's end */
00846 
00847 #if 0
00848 fprintf(stderr,"linefill: from %d %d %d to %d %d %d\n",
00849         x1,y1,z1 , x2,y2,z2 ) ;
00850 #endif
00851 
00852       fx = x1+fdx+0.499 ; fy = y1+fdy+0.499 ; fz = z1+fdz+0.499 ;
00853       do {
00854          fx = fx + fdx ; fy = fy + fdy ; fz = fz + fdz ;
00855          x1 = (int) fx ; y1 = (int) fy ; z1 = (int) fz ;
00856 
00857 #if 0
00858 fprintf(stderr,"   at %d %d %d\n",x1,y1,z1) ;
00859 #endif
00860 
00861          if( x1 == x2    && y1 == y2    && z1 == z2    ) break ;
00862 
00863          if( x1 != xlast || y1 != ylast || z1 != zlast ) ADDPT(x1,y1,z1) ;
00864       } while(1) ;
00865 
00866    } /* end of loop over lines */
00867 
00868    ADDPT(x2,y2,z2) ;  /* add last point */
00869 
00870    *nout = nut ; *xout = xut ; *yout = yut ; *zout = zut ;
00871    EXRETURN ;
00872 }

void AFNI_dicomm_to_xyz THD_3dim_dataset   dset,
float    xd,
float    yd,
float    zd,
float *    xx,
float *    yy,
float *    zz
 

Definition at line 923 of file afni_receive.c.

References ISVALID_DSET, TEMP_FVEC3, THD_3dmm_to_dicomm(), and THD_fvec3::xyz.

00926 {
00927    THD_fvec3 fv ;
00928 
00929    if( ! ISVALID_DSET(dset) ) return ;
00930 
00931    fv  = THD_3dmm_to_dicomm( dset , TEMP_FVEC3(xd,yd,zd) ) ;
00932    *xx = fv.xyz[0] ;
00933    *yy = fv.xyz[1] ;
00934    *zz = fv.xyz[2] ;
00935    return ;
00936 }

void AFNI_ijk_to_xyz THD_3dim_dataset   dset,
int    ii,
int    jj,
int    kk,
float *    xx,
float *    yy,
float *    zz
 

Definition at line 878 of file afni_receive.c.

References ISVALID_DSET, TEMP_IVEC3, THD_3dind_to_3dmm(), and THD_fvec3::xyz.

00881 {
00882    THD_fvec3 fv ;
00883 
00884    if( ! ISVALID_DSET(dset) ) return ;
00885 
00886    fv  = THD_3dind_to_3dmm( dset , TEMP_IVEC3(ii,jj,kk) ) ;
00887    *xx = fv.xyz[0] ;
00888    *yy = fv.xyz[1] ;
00889    *zz = fv.xyz[2] ;
00890    return ;
00891 }

void AFNI_process_alteration Three_D_View   im3d
 

Definition at line 427 of file afni_receive.c.

References AFNI_CALL_VOID_4ARG, ENTRY, IM3D_VALID, AFNI_view_info::num_receiver, RECEIVE_ALTERATION, AFNI_view_info::receiver, AFNI_receiver::receiver_data, AFNI_receiver::receiver_func, AFNI_receiver::receiver_funcname, STATUS, and Three_D_View::vinfo.

Referenced by AFNI_underlay_CB().

00428 {
00429    int ir ;
00430 
00431 ENTRY("AFNI_process_alteration") ;
00432 
00433    if( !IM3D_VALID(im3d) || im3d->vinfo->receiver == NULL  ||
00434                             im3d->vinfo->num_receiver == 0   ) EXRETURN ;
00435 
00436    for( ir=0 ; ir < im3d->vinfo->num_receiver ; ir++ ){
00437       if( im3d->vinfo->receiver[ir] != NULL ){
00438 STATUS(im3d->vinfo->receiver[ir]->receiver_funcname) ;
00439 #if 0
00440          im3d->vinfo->receiver[ir]->receiver_func(
00441                    RECEIVE_ALTERATION , 0 , NULL ,
00442                    im3d->vinfo->receiver[ir]->receiver_data ) ;
00443 #else
00444          AFNI_CALL_VOID_4ARG( im3d->vinfo->receiver[ir]->receiver_func ,
00445                               int,RECEIVE_ALTERATION , int,0 ,
00446                               void *,NULL ,
00447                               void *,im3d->vinfo->receiver[ir]->receiver_data ) ;
00448 #endif
00449       }
00450    }
00451 
00452    EXRETURN ;
00453 }

void AFNI_process_drawing Three_D_View   im3d,
int    mode,
int    npts,
int *    xd,
int *    yd,
int *    zd
 

Process drawn points:

  • npts = number of points sent in
  • mode = type of points to follow:
    • PLANAR_MODE + zz ==> axis zz is fixed, for zz=1,2,3
    • SINGLE_MODE + zz ==> one point only, clicked in a window with zz fixed
    • THREED_MODE ==> points are in 3D (not planar) (not currently possible)
    • UNDO_MODE ==> undo last drawing action
  • xd[i] = x index of point i, for i=0..npts-1
  • yd[i] = y index of point i, for i=0..npts-1
  • zd[i] = z index of point i, for i=0..npts-1
These indices are with respect to the dataset brick axes. ---------------------------------------------------------------------

Definition at line 683 of file afni_receive.c.

References AFNI_3d_linefill(), AFNI_CALL_VOID_4ARG, AFNI_process_drawnotice(), AFNI_view_info::drawing_enabled, DRAWING_FILL, DRAWING_LINES, AFNI_view_info::drawing_mode, DRAWING_NODRAW, DRAWING_POINTS, ENTRY, free, IM3D_VALID, AFNI_view_info::num_receiver, RECEIVE_DRAWING_MASK, RECEIVE_POINTS, AFNI_view_info::receiver, AFNI_receiver::receiver_data, AFNI_receiver::receiver_func, AFNI_receiver::receiver_funcname, AFNI_receiver::receiver_mask, STATUS, Three_D_View::vinfo, xn, yn, and zn.

Referenced by AFNI_gra_send_CB(), and AFNI_seq_send_CB().

00685 {
00686    int ii , nn , ir , nsent ;
00687    int *vp[4] , *xn=NULL , *yn=NULL , *zn=NULL ;
00688 
00689 ENTRY("AFNI_process_drawing") ;
00690 
00691    if( !IM3D_VALID(im3d) || im3d->vinfo->receiver == NULL  ||
00692                             im3d->vinfo->num_receiver == 0 ||
00693        npts < 0          || im3d->vinfo->drawing_enabled == 0 ) EXRETURN ;
00694 
00695 if(PRINT_TRACING){
00696   char str[256] ; sprintf(str,"received %d points",npts) ; STATUS(str) ;
00697 }
00698 
00699    /*-- if no further treatment is needed,
00700         just flag input data to be set to receiver --*/
00701 
00702    if( im3d->vinfo->drawing_mode == DRAWING_POINTS ||
00703        im3d->vinfo->drawing_mode == DRAWING_NODRAW || npts <= 1 ){
00704 
00705       xn = xd ; yn = yd ; zn = zd ; nn = npts ;
00706    }
00707 
00708    /*-- must fill in the lines:
00709         create arrays xn, yn, zn of length nn --*/
00710 
00711    else if( im3d->vinfo->drawing_mode == DRAWING_LINES ){
00712 
00713       AFNI_3d_linefill( npts , xd,yd,zd , &nn , &xn , &yn , &zn ) ;
00714    }
00715 
00716    /*-- must fill in the polygon --*/
00717 
00718    else if( im3d->vinfo->drawing_mode == DRAWING_FILL ){
00719 
00720       /* this just fills the lines like above --
00721          need to write a real polygon filling routine? */
00722 
00723       AFNI_3d_linefill( npts , xd,yd,zd , &nn , &xn , &yn , &zn ) ;
00724    }
00725 
00726    /*-- send data to receivers that want it --*/
00727 
00728 #if 0
00729 fprintf(stderr,"Sending %d points to receiver\n",nn) ;
00730 #endif
00731 
00732    vp[3] = &mode ;                        /* how the points are arranged */
00733 
00734    vp[0] = xn ; vp[1] = yn ; vp[2] = zn ;
00735 
00736    for( nsent=ir=0 ; ir < im3d->vinfo->num_receiver ; ir++ ){
00737 
00738       if( im3d->vinfo->receiver[ir] != NULL &&
00739           (im3d->vinfo->receiver[ir]->receiver_mask & RECEIVE_DRAWING_MASK) ){
00740 
00741 STATUS(im3d->vinfo->receiver[ir]->receiver_funcname) ;
00742 #if 0
00743          im3d->vinfo->receiver[ir]->receiver_func(
00744                    RECEIVE_POINTS , nn ,
00745                    (void *) vp , im3d->vinfo->receiver[ir]->receiver_data ) ;
00746 #else
00747          AFNI_CALL_VOID_4ARG( im3d->vinfo->receiver[ir]->receiver_func ,
00748                               int,RECEIVE_POINTS , int,nn ,
00749                               void *,vp ,
00750                               void *,im3d->vinfo->receiver[ir]->receiver_data ) ;
00751 #endif
00752          nsent++ ;
00753       }
00754    }
00755 
00756    /* 30 Mar 1999: also send DRAWNOTICE to receivers that like this stuff */
00757 
00758    if( nsent > 0 ) AFNI_process_drawnotice( im3d ) ;
00759 
00760    /*-- free any created arrays --*/
00761 
00762    if( xn != xd ){ free(xn); free(yn); free(zn); }
00763    EXRETURN ;
00764 }

void AFNI_process_drawnotice Three_D_View   im3d
 

Definition at line 459 of file afni_receive.c.

References AFNI_CALL_VOID_4ARG, ENTRY, IM3D_VALID, AFNI_view_info::num_receiver, RECEIVE_DRAWNOTICE, RECEIVE_DRAWNOTICE_MASK, AFNI_view_info::receiver, AFNI_receiver::receiver_data, AFNI_receiver::receiver_func, AFNI_receiver::receiver_funcname, AFNI_receiver::receiver_mask, STATUS, and Three_D_View::vinfo.

Referenced by AFNI_process_drawing(), DRAW_fillin_CB(), DRAW_quit_CB(), DRAW_redo_CB(), DRAW_ttatlas_CB(), DRAW_undo_CB(), NUD_doall_CB(), NUD_quit_CB(), NUD_update_base(), and process_NIML_Node_ROI().

00460 {
00461    int ir ;
00462 
00463 ENTRY("AFNI_process_drawnotice") ;
00464 
00465    if( !IM3D_VALID(im3d) || im3d->vinfo->receiver == NULL  ||
00466                             im3d->vinfo->num_receiver == 0   ) EXRETURN ;
00467 
00468    for( ir=0 ; ir < im3d->vinfo->num_receiver ; ir++ ){
00469 
00470       if( im3d->vinfo->receiver[ir] != NULL &&
00471           (im3d->vinfo->receiver[ir]->receiver_mask & RECEIVE_DRAWNOTICE_MASK) ){
00472 
00473 STATUS(im3d->vinfo->receiver[ir]->receiver_funcname) ;
00474 #if 0
00475          im3d->vinfo->receiver[ir]->receiver_func(
00476                    RECEIVE_DRAWNOTICE , 0 , NULL ,
00477                    im3d->vinfo->receiver[ir]->receiver_data ) ;
00478 #else
00479          AFNI_CALL_VOID_4ARG( im3d->vinfo->receiver[ir]->receiver_func ,
00480                               int,RECEIVE_DRAWNOTICE , int,0 ,
00481                               void *,NULL ,
00482                               void *,im3d->vinfo->receiver[ir]->receiver_data ) ;
00483 #endif
00484       }
00485    }
00486 
00487    EXRETURN ;
00488 }

void AFNI_process_dsetchange Three_D_View   im3d
 

Definition at line 494 of file afni_receive.c.

References AFNI_CALL_VOID_4ARG, ENTRY, IM3D_VALID, AFNI_view_info::num_receiver, RECEIVE_DSETCHANGE, RECEIVE_DSETCHANGE_MASK, AFNI_view_info::receiver, AFNI_receiver::receiver_data, AFNI_receiver::receiver_func, AFNI_receiver::receiver_funcname, AFNI_receiver::receiver_mask, STATUS, and Three_D_View::vinfo.

Referenced by AFNI_rescan_all_CB(), and AFNI_rescan_CB().

00495 {
00496    int ir ;
00497 
00498 ENTRY("AFNI_process_dsetchange") ;
00499 
00500    if( !IM3D_VALID(im3d) || im3d->vinfo->receiver == NULL  ||
00501                             im3d->vinfo->num_receiver == 0   ) EXRETURN ;
00502 
00503    for( ir=0 ; ir < im3d->vinfo->num_receiver ; ir++ ){
00504 
00505       if( im3d->vinfo->receiver[ir] != NULL &&
00506           (im3d->vinfo->receiver[ir]->receiver_mask & RECEIVE_DSETCHANGE_MASK) ){
00507 
00508 STATUS(im3d->vinfo->receiver[ir]->receiver_funcname) ;
00509 #if 0
00510          im3d->vinfo->receiver[ir]->receiver_func(
00511                    RECEIVE_DSETCHANGE , 0 , NULL ,
00512                    im3d->vinfo->receiver[ir]->receiver_data ) ;
00513 #else
00514          AFNI_CALL_VOID_4ARG( im3d->vinfo->receiver[ir]->receiver_func ,
00515                               int,RECEIVE_DSETCHANGE , int,0 ,
00516                               void *,NULL ,
00517                               void *,im3d->vinfo->receiver[ir]->receiver_data ) ;
00518 #endif
00519       }
00520    }
00521 
00522    EXRETURN ;
00523 }

void AFNI_process_funcdisplay Three_D_View   im3d
 

Send funcdisplay notification to receivers that care [05 Mar 2002]. ---------------------------------------------------------------------

Definition at line 635 of file afni_receive.c.

References AFNI_CALL_VOID_4ARG, ENTRY, IM3D_VALID, AFNI_view_info::num_receiver, RECEIVE_FUNCDISPLAY, RECEIVE_FUNCDISPLAY_MASK, AFNI_view_info::receiver, AFNI_receiver::receiver_data, AFNI_receiver::receiver_func, AFNI_receiver::receiver_funcname, AFNI_receiver::receiver_mask, STATUS, and Three_D_View::vinfo.

Referenced by AFNI_bucket_CB(), AFNI_redisplay_func(), and AFNI_time_index_CB().

00636 {
00637    int ir ;
00638 
00639 ENTRY("AFNI_process_funcdisplay") ;
00640 
00641    if( !IM3D_VALID(im3d) || im3d->vinfo->receiver == NULL  ||
00642                             im3d->vinfo->num_receiver == 0   ) EXRETURN ;
00643 
00644    for( ir=0 ; ir < im3d->vinfo->num_receiver ; ir++ ){
00645       if( im3d->vinfo->receiver[ir] != NULL &&
00646           (im3d->vinfo->receiver[ir]->receiver_mask & RECEIVE_FUNCDISPLAY_MASK) ){
00647 
00648 STATUS(im3d->vinfo->receiver[ir]->receiver_funcname) ;
00649 #if 0
00650          im3d->vinfo->receiver[ir]->receiver_func(
00651                    RECEIVE_FUNCDISPLAY , 0 , NULL ,
00652                    im3d->vinfo->receiver[ir]->receiver_data ) ;
00653 #else
00654          AFNI_CALL_VOID_4ARG( im3d->vinfo->receiver[ir]->receiver_func ,
00655                               int,RECEIVE_FUNCDISPLAY , int,0 ,
00656                               void *,NULL ,
00657                               void *,im3d->vinfo->receiver[ir]->receiver_data ) ;
00658 #endif
00659       }
00660    }
00661 
00662    EXRETURN ;
00663 }

void AFNI_process_redisplay Three_D_View   im3d
 

Send redisplay notification to receivers that care [04 Mar 2002]. ---------------------------------------------------------------------

Definition at line 601 of file afni_receive.c.

References AFNI_CALL_VOID_4ARG, ENTRY, IM3D_VALID, AFNI_view_info::num_receiver, RECEIVE_REDISPLAY, RECEIVE_REDISPLAY_MASK, AFNI_view_info::receiver, AFNI_receiver::receiver_data, AFNI_receiver::receiver_func, AFNI_receiver::receiver_funcname, AFNI_receiver::receiver_mask, STATUS, and Three_D_View::vinfo.

Referenced by AFNI_set_viewpoint().

00602 {
00603    int ir ;
00604 
00605 ENTRY("AFNI_process_redisplay") ;
00606 
00607    if( !IM3D_VALID(im3d) || im3d->vinfo->receiver == NULL  ||
00608                             im3d->vinfo->num_receiver == 0   ) EXRETURN ;
00609 
00610    for( ir=0 ; ir < im3d->vinfo->num_receiver ; ir++ ){
00611       if( im3d->vinfo->receiver[ir] != NULL &&
00612           (im3d->vinfo->receiver[ir]->receiver_mask & RECEIVE_REDISPLAY_MASK) ){
00613 
00614 STATUS(im3d->vinfo->receiver[ir]->receiver_funcname) ;
00615 #if 0
00616          im3d->vinfo->receiver[ir]->receiver_func(
00617                    RECEIVE_REDISPLAY , 0 , NULL ,
00618                    im3d->vinfo->receiver[ir]->receiver_data ) ;
00619 #else
00620          AFNI_CALL_VOID_4ARG( im3d->vinfo->receiver[ir]->receiver_func ,
00621                               int,RECEIVE_REDISPLAY , int,0 ,
00622                               void *,NULL ,
00623                               void *,im3d->vinfo->receiver[ir]->receiver_data ) ;
00624 #endif
00625       }
00626    }
00627 
00628    EXRETURN ;
00629 }

void AFNI_process_timeindex Three_D_View   im3d
 

Send time index change notice to receivers that care [29 Jan 2003] ---------------------------------------------------------------------

Definition at line 567 of file afni_receive.c.

References AFNI_CALL_VOID_4ARG, ENTRY, IM3D_VALID, AFNI_view_info::num_receiver, RECEIVE_TIMEINDEX, RECEIVE_TIMEINDEX_MASK, AFNI_view_info::receiver, AFNI_receiver::receiver_data, AFNI_receiver::receiver_func, AFNI_receiver::receiver_funcname, AFNI_receiver::receiver_mask, STATUS, and Three_D_View::vinfo.

Referenced by AFNI_setup_viewing(), and AFNI_time_index_CB().

00568 {
00569    int ir ;
00570 
00571 ENTRY("AFNI_process_timeindex") ;
00572 
00573    if( !IM3D_VALID(im3d) || im3d->vinfo->receiver == NULL  ||
00574                             im3d->vinfo->num_receiver == 0   ) EXRETURN ;
00575 
00576    for( ir=0 ; ir < im3d->vinfo->num_receiver ; ir++ ){
00577       if( im3d->vinfo->receiver[ir] != NULL &&
00578           (im3d->vinfo->receiver[ir]->receiver_mask & RECEIVE_TIMEINDEX_MASK) ){
00579 
00580 STATUS(im3d->vinfo->receiver[ir]->receiver_funcname) ;
00581 #if 0
00582          im3d->vinfo->receiver[ir]->receiver_func(
00583                    RECEIVE_TIMEINDEX , 0 , NULL ,
00584                    im3d->vinfo->receiver[ir]->receiver_data ) ;
00585 #else
00586          AFNI_CALL_VOID_4ARG( im3d->vinfo->receiver[ir]->receiver_func ,
00587                               int,RECEIVE_TIMEINDEX , int,0 ,
00588                               void *,NULL ,
00589                               void *,im3d->vinfo->receiver[ir]->receiver_data ) ;
00590 #endif
00591       }
00592    }
00593 
00594    EXRETURN ;
00595 }

void AFNI_process_viewpoint Three_D_View   im3d
 

Definition at line 529 of file afni_receive.c.

References AFNI_CALL_VOID_4ARG, ENTRY, AFNI_view_info::i1, IM3D_VALID, AFNI_view_info::j2, AFNI_view_info::k3, AFNI_view_info::num_receiver, RECEIVE_VIEWPOINT, RECEIVE_VIEWPOINT_MASK, AFNI_view_info::receiver, AFNI_receiver::receiver_data, AFNI_receiver::receiver_func, AFNI_receiver::receiver_funcname, AFNI_receiver::receiver_mask, STATUS, and Three_D_View::vinfo.

Referenced by AFNI_crosshair_visible_CB(), and AFNI_set_viewpoint().

00530 {
00531    int ir , ijk[3] ;
00532 
00533 ENTRY("AFNI_process_viewpoint") ;
00534 
00535    if( !IM3D_VALID(im3d) || im3d->vinfo->receiver == NULL  ||
00536                             im3d->vinfo->num_receiver == 0   ) EXRETURN ;
00537 
00538    ijk[0] = im3d->vinfo->i1 ;
00539    ijk[1] = im3d->vinfo->j2 ;
00540    ijk[2] = im3d->vinfo->k3 ;
00541 
00542    for( ir=0 ; ir < im3d->vinfo->num_receiver ; ir++ ){
00543       if( im3d->vinfo->receiver[ir] != NULL &&
00544           (im3d->vinfo->receiver[ir]->receiver_mask & RECEIVE_VIEWPOINT_MASK) ){
00545 
00546 STATUS(im3d->vinfo->receiver[ir]->receiver_funcname) ;
00547 #if 0
00548          im3d->vinfo->receiver[ir]->receiver_func(
00549                    RECEIVE_VIEWPOINT , 3 , ijk ,
00550                    im3d->vinfo->receiver[ir]->receiver_data ) ;
00551 #else
00552          AFNI_CALL_VOID_4ARG( im3d->vinfo->receiver[ir]->receiver_func ,
00553                               int,RECEIVE_VIEWPOINT , int,3 ,
00554                               void *,ijk ,
00555                               void *,im3d->vinfo->receiver[ir]->receiver_data ) ;
00556 #endif
00557       }
00558    }
00559 
00560    EXRETURN ;
00561 }

int AFNI_receive_control Three_D_View   im3d,
int    key,
int    code,
void *    arg
 

Control how the receiver works:

  • code = indicates what action is
  • arg = extra information, if code needs it
This function returns 0 if all is OK, and returns -1 if an error occurs. ---------------------------------------------------------------------

Definition at line 183 of file afni_receive.c.

References AFNI_toggle_drawing(), arg, Three_D_View::dc, DRAWING_FILL, DRAWING_LINES, DRAWING_LINEWIDTH, AFNI_view_info::drawing_mode, DRAWING_NODRAW, DRAWING_OVCINDEX, AFNI_view_info::drawing_pixel, DRAWING_POINTS, DRAWING_SHUTDOWN, DRAWING_STARTUP, DRAWING_X11PIXEL, DRAWNOTICE_SHUTDOWN, DRAWNOTICE_STARTUP, drive_MCW_imseq(), DSETCHANGE_SHUTDOWN, DSETCHANGE_STARTUP, ENTRY, EVERYTHING_SHUTDOWN, free, FUNCDISPLAY_SHUTDOWN, FUNCDISPLAY_STARTUP, IM3D_VALID, ind, isqDR_button2_mode, isqDR_button2_pixel, isqDR_button2_width, key, MCW_DCOV::ncol_ov, AFNI_view_info::num_receiver, MCW_DC::ovc, OVERLAY_SHUTDOWN, OVERLAY_STARTUP, MCW_DCOV::pix_ov, RECEIVE_ALL_MASK, RECEIVE_DRAWING_MASK, RECEIVE_DRAWNOTICE_MASK, RECEIVE_DSETCHANGE_MASK, RECEIVE_FUNCDISPLAY_MASK, RECEIVE_OVERLAY_MASK, RECEIVE_REDISPLAY_MASK, RECEIVE_TIMEINDEX_MASK, RECEIVE_VIEWPOINT_MASK, AFNI_view_info::receiver, REDISPLAY_SHUTDOWN, REDISPLAY_STARTUP, RETURN, Three_D_View::s123, Three_D_View::s231, Three_D_View::s312, TIMEINDEX_SHUTDOWN, TIMEINDEX_STARTUP, VIEWPOINT_SHUTDOWN, VIEWPOINT_STARTUP, and Three_D_View::vinfo.

Referenced by DRAW_color_CB(), DRAW_done_CB(), DRAW_finalize_dset_CB(), DRAW_mode_CB(), DRAW_quit_CB(), DSET2_dset_recv(), DSETN_dset_recv(), r_save_dataset_as(), RCREND_done_CB(), REND_done_CB(), and TTget_main().

00184 {
00185 ENTRY("AFNI_receive_control") ;
00186 
00187    /* check input for OK-osity */
00188 
00189    if( ! IM3D_VALID(im3d) || im3d->vinfo->receiver == NULL ) RETURN(-1) ;
00190    if( key < 0 || key >= im3d->vinfo->num_receiver )         RETURN(-1) ;
00191    if( im3d->vinfo->receiver[key] == NULL )                  RETURN(-1) ;
00192 
00193    /* take appropriate actions */
00194 
00195    switch( code ){
00196 
00197       default: RETURN(-1) ;
00198 
00199       case DRAWNOTICE_STARTUP:{    /* 30 Mar 1999 */
00200          im3d->vinfo->receiver[key]->receiver_mask |= RECEIVE_DRAWNOTICE_MASK ;
00201       }
00202       break ;
00203 
00204       case DRAWNOTICE_SHUTDOWN:{   /* 30 Mar 1999 */
00205          im3d->vinfo->receiver[key]->receiver_mask &= (RECEIVE_ALL_MASK - RECEIVE_DRAWNOTICE_MASK) ;
00206       }
00207       break ;
00208 
00209       case DSETCHANGE_STARTUP:{    /* 31 Mar 1999 */
00210          im3d->vinfo->receiver[key]->receiver_mask |= RECEIVE_DSETCHANGE_MASK ;
00211       }
00212       break ;
00213 
00214       case DSETCHANGE_SHUTDOWN:{   /* 30 Mar 1999 */
00215          im3d->vinfo->receiver[key]->receiver_mask &= (RECEIVE_ALL_MASK - RECEIVE_DSETCHANGE_MASK) ;
00216       }
00217       break ;
00218 
00219       case DRAWING_STARTUP:{
00220          im3d->vinfo->receiver[key]->receiver_mask |= RECEIVE_DRAWING_MASK ;
00221          AFNI_toggle_drawing( im3d ) ;
00222       }
00223       break ;
00224 
00225       case DRAWING_SHUTDOWN:{
00226          im3d->vinfo->receiver[key]->receiver_mask &= (RECEIVE_ALL_MASK - RECEIVE_DRAWING_MASK) ;
00227          AFNI_toggle_drawing( im3d ) ;
00228       }
00229       break ;
00230 
00231       case DRAWING_OVCINDEX:{
00232          int ind = (int) arg ;
00233 
00234          if( ind <= 0 || ind >= im3d->dc->ovc->ncol_ov ){
00235             RETURN(-1) ;
00236          } else {
00237             Pixel ppp = im3d->dc->ovc->pix_ov[ind] ;
00238             drive_MCW_imseq( im3d->s123, isqDR_button2_pixel, (XtPointer)ppp ) ;
00239             drive_MCW_imseq( im3d->s231, isqDR_button2_pixel, (XtPointer)ppp ) ;
00240             drive_MCW_imseq( im3d->s312, isqDR_button2_pixel, (XtPointer)ppp ) ;
00241             im3d->vinfo->drawing_pixel = ppp ;
00242          }
00243       }
00244       break ;
00245 
00246       case DRAWING_X11PIXEL:{
00247          Pixel ppp = (Pixel) arg ;
00248          drive_MCW_imseq( im3d->s123, isqDR_button2_pixel, (XtPointer)ppp ) ;
00249          drive_MCW_imseq( im3d->s231, isqDR_button2_pixel, (XtPointer)ppp ) ;
00250          drive_MCW_imseq( im3d->s312, isqDR_button2_pixel, (XtPointer)ppp ) ;
00251          im3d->vinfo->drawing_pixel = ppp ;
00252       }
00253       break ;
00254 
00255       case DRAWING_LINES:
00256       case DRAWING_FILL:
00257       case DRAWING_POINTS:
00258       case DRAWING_NODRAW:{
00259          im3d->vinfo->drawing_mode = code ;
00260          drive_MCW_imseq( im3d->s123, isqDR_button2_mode, (XtPointer)code ) ;
00261          drive_MCW_imseq( im3d->s231, isqDR_button2_mode, (XtPointer)code ) ;
00262          drive_MCW_imseq( im3d->s312, isqDR_button2_mode, (XtPointer)code ) ;
00263       }
00264       break ;
00265 
00266       case DRAWING_LINEWIDTH:{    /* 08 Oct 2002 */
00267         int ww = (int) arg ;
00268         if( ww >= 0 ){
00269           drive_MCW_imseq( im3d->s123, isqDR_button2_width, (XtPointer)ww ) ;
00270           drive_MCW_imseq( im3d->s231, isqDR_button2_width, (XtPointer)ww ) ;
00271           drive_MCW_imseq( im3d->s312, isqDR_button2_width, (XtPointer)ww ) ;
00272         }
00273       }
00274       break ;
00275 
00276       case VIEWPOINT_STARTUP:{
00277          im3d->vinfo->receiver[key]->receiver_mask |= RECEIVE_VIEWPOINT_MASK ;
00278       }
00279       break ;
00280 
00281       case VIEWPOINT_SHUTDOWN:{
00282          im3d->vinfo->receiver[key]->receiver_mask &= (RECEIVE_ALL_MASK - RECEIVE_VIEWPOINT_MASK) ;
00283       }
00284       break ;
00285 
00286       case REDISPLAY_STARTUP:{
00287          im3d->vinfo->receiver[key]->receiver_mask |= RECEIVE_REDISPLAY_MASK ;
00288       }
00289       break ;
00290 
00291       case REDISPLAY_SHUTDOWN:{
00292          im3d->vinfo->receiver[key]->receiver_mask &= (RECEIVE_ALL_MASK - RECEIVE_REDISPLAY_MASK) ;
00293       }
00294       break ;
00295 
00296       case FUNCDISPLAY_STARTUP:{
00297          im3d->vinfo->receiver[key]->receiver_mask |= RECEIVE_FUNCDISPLAY_MASK ;
00298       }
00299       break ;
00300 
00301       case FUNCDISPLAY_SHUTDOWN:{
00302          im3d->vinfo->receiver[key]->receiver_mask &= (RECEIVE_ALL_MASK - RECEIVE_FUNCDISPLAY_MASK) ;
00303       }
00304       break ;
00305 
00306       case OVERLAY_STARTUP:{
00307          im3d->vinfo->receiver[key]->receiver_mask |= RECEIVE_OVERLAY_MASK ;
00308       }
00309       break ;
00310 
00311       case OVERLAY_SHUTDOWN:{
00312          im3d->vinfo->receiver[key]->receiver_mask &= (RECEIVE_ALL_MASK - RECEIVE_OVERLAY_MASK) ;
00313       }
00314       break ;
00315 
00316       case TIMEINDEX_STARTUP:{
00317          im3d->vinfo->receiver[key]->receiver_mask |= RECEIVE_TIMEINDEX_MASK ;
00318       }
00319       break ;
00320 
00321       case TIMEINDEX_SHUTDOWN:{
00322          im3d->vinfo->receiver[key]->receiver_mask &= (RECEIVE_ALL_MASK - RECEIVE_TIMEINDEX_MASK) ;
00323       }
00324       break ;
00325 
00326       case EVERYTHING_SHUTDOWN:{
00327          im3d->vinfo->receiver[key]->receiver_mask = 0 ;
00328          AFNI_toggle_drawing( im3d ) ;
00329       }
00330       break ;
00331 
00332    } /* end of switch on codes */
00333 
00334    /* possibly remove this receiver, and maybe even all receivers */
00335 
00336    if( im3d->vinfo->receiver[key]->receiver_mask == 0 ){   /* receiving nothing at all? */
00337       int ir , nn=0 ;
00338 
00339       if( im3d->vinfo->receiver[key]->receiver_funcname != NULL )
00340         free( im3d->vinfo->receiver[key]->receiver_funcname ) ;
00341 
00342       free( im3d->vinfo->receiver[key] ) ;                 /* toss this one fer shur */
00343       im3d->vinfo->receiver[key] = NULL ;
00344 
00345       for( ir=0 ; ir < im3d->vinfo->num_receiver ; ir++ )  /* see if any are left */
00346          if( im3d->vinfo->receiver[ir] != NULL ) nn++ ;
00347 
00348       if( nn == 0 ) im3d->vinfo->num_receiver = 0 ;        /* if not, toss them all */
00349    }
00350 
00351    RETURN(0) ;
00352 }

void AFNI_receive_destroy Three_D_View   im3d
 

Turn off all reception for this viewer. ---------------------------------------------------------------------------

Definition at line 135 of file afni_receive.c.

References AFNI_CALL_VOID_4ARG, AFNI_view_info::drawing_enabled, DRAWING_LINES, AFNI_view_info::drawing_mode, ENTRY, free, IM3D_VALID, AFNI_view_info::num_receiver, RECEIVE_CLOSURE, AFNI_view_info::receiver, AFNI_receiver::receiver_data, AFNI_receiver::receiver_func, AFNI_receiver::receiver_funcname, and Three_D_View::vinfo.

Referenced by AFNI_closedown_3dview().

00136 {
00137    int ir ;
00138 
00139 ENTRY("AFNI_receive_destroy") ;
00140 
00141    if( !IM3D_VALID(im3d) ) EXRETURN ;
00142 
00143    if( im3d->vinfo->receiver != NULL && im3d->vinfo->num_receiver > 0 ){
00144 
00145       for( ir=0 ; ir < im3d->vinfo->num_receiver ; ir++ ){
00146 
00147          if( im3d->vinfo->receiver[ir] != NULL ){
00148 #if 0
00149             im3d->vinfo->receiver[ir]->receiver_func(
00150                    RECEIVE_CLOSURE , 0 , NULL ,
00151                    im3d->vinfo->receiver[ir]->receiver_data ) ;
00152 #else
00153             AFNI_CALL_VOID_4ARG( im3d->vinfo->receiver[ir]->receiver_func ,
00154                                  int,RECEIVE_CLOSURE , int,0 ,
00155                                  void *,NULL ,
00156                                  void *,im3d->vinfo->receiver[ir]->receiver_data ) ;
00157 #endif
00158 
00159             if( im3d->vinfo->receiver[ir]->receiver_funcname != NULL )
00160               free( im3d->vinfo->receiver[ir]->receiver_funcname ) ;
00161             free( im3d->vinfo->receiver[ir] ) ;
00162             im3d->vinfo->receiver[ir] = NULL ;
00163          }
00164       }
00165 
00166       im3d->vinfo->num_receiver    = 0 ;
00167       im3d->vinfo->drawing_enabled = 0 ;
00168       im3d->vinfo->drawing_mode    = DRAWING_LINES ;  /* default */
00169    }
00170 
00171    EXRETURN ;
00172 }

int AFNI_receive_init Three_D_View   im3d,
int    rmask,
gen_func   cb,
void *    cb_data,
char *    cbname
 

Set up to have AFNI send data to a receiver:

rmask = bitwise OR (|) mask of RECEIVE_*_MASK (cf. afni.h)

cb = callback function to receive data; will be called like cb( int why , int np , void * vp , void * cb_data ) where why = a RECEIVE_* code (cf. below) np = count of data in vp (may be 0) vp = pointer to data being sent (may be NULL) cb_data = pointer passed into this routine

cbname = string to identify callback func (for debugging)

why = RECEIVE_VIEWPOINT --> np = 3, vp = int *, pointing to array of dataset voxel indices just jumped to; vp[0] = x index, etc.

why = RECEIVE_REDISPLAY --> the user did something to cause an image redisplay besides changing the viewpoint. For this call, np and vp are unused.

why = RECEIVE_FUNCDISPLAY --> the user did something to cause the function display to change. For this call, np and vp are unused.

why = RECEIVE_POINTS --> np = number of points drawn vp = int **, pointer to array of arrays of dataset voxel indices: vp[0][i] = x index of point i vp[1][i] = y index of point i vp[2][i] = z index of point i, vp[3][0] = sending mode for i=0..np-1

why = RECEIVE_DRAWNOTICE --> the user drew something and that information was sent to a receiver. This call will occur AFTER all the RECEIVE_POINTS calls have been done. If no RECEIVE_POINTS calls are made, then no RECEIVE_DRAWNOTICE calls will be made either. For this call, np and vp are unused.

why = RECEIVE_DSETCHANGE --> the user did something (like rescan a session) that may have changed dataset pointers. The receiving routine should use dataset idcodes to re-find the correct dataset pointers. For this call, np and vp are unused.

why = RECEIVE_CLOSURE --> the user closed the controller window, which means that no more data will be coming from it -- even if it is reopened, AFNI_receive_init must be called again. For this call, np and vp are unused.

why = RECEIVE_ALTERATION --> the user changed something in the controller -- the dataset, the time index, the resampling, .... This is basically a warning message. For this call, np and vp are unused.

why = RECEIVE_TIMEINDEX --> the time index changed in im3d; for this call, np,vp are unused. The new time index is in im3d->vinfo->time_index

This function returns a non-negative int if all is OK -- this value is the "key" that is used in calls to AFNI_receive_control when you want to manipulate the status of this connection.

This function returns -1 if an error occurs.

Modified 29 Mar 1999 to allow for multiple receivers (but drawing can only be done in one mode). ---------------------------------------------------------------------

Definition at line 93 of file afni_receive.c.

References AFMALL, AFNI_toggle_drawing(), AFREALL, ENTRY, gen_func, IM3D_VALID, AFNI_view_info::num_receiver, RECEIVE_ALL_MASK, AFNI_view_info::receiver, AFNI_receiver::receiver_data, AFNI_receiver::receiver_func, AFNI_receiver::receiver_funcname, AFNI_receiver::receiver_mask, RETURN, and Three_D_View::vinfo.

Referenced by AFNI_init_niml(), DRAW_finalize_dset_CB(), DSET2_main(), DSETN_main(), RCREND_main(), REND_main(), and TTget_main().

00095 {
00096    int ir ;
00097 
00098 ENTRY("AFNI_receive_init") ;
00099 
00100    /* check for invalid entries */
00101 
00102    if( ! IM3D_VALID(im3d)            ||               /* no good? */
00103        cb == NULL                    ||               /* no receiver? */
00104        (rmask & RECEIVE_ALL_MASK) == 0 ) RETURN(-1) ; /* no action? */
00105 
00106    for( ir=0 ; ir < im3d->vinfo->num_receiver ; ir++ )
00107       if( im3d->vinfo->receiver[ir] == NULL ) break ;
00108 
00109    if( ir == im3d->vinfo->num_receiver ){
00110 #if 0
00111 fprintf(stderr,"AFNI_receive_init AFREALL() with ir=%d num_receiver=%d\n",
00112         ir,im3d->vinfo->num_receiver ) ;
00113 #endif
00114       im3d->vinfo->receiver = AFREALL( im3d->vinfo->receiver, AFNI_receiver *, ir+1 );
00115       im3d->vinfo->num_receiver ++ ;
00116    }
00117    im3d->vinfo->receiver[ir] = AFMALL( AFNI_receiver, sizeof(AFNI_receiver)) ;
00118 
00119    im3d->vinfo->receiver[ir]->receiver_func = cb ;
00120    im3d->vinfo->receiver[ir]->receiver_mask = rmask ;
00121    im3d->vinfo->receiver[ir]->receiver_data = cb_data ;
00122 
00123    im3d->vinfo->receiver[ir]->receiver_funcname =
00124      strdup( (cbname != NULL) ? cbname : "[unknown func]" ) ;
00125 
00126    AFNI_toggle_drawing( im3d ) ;
00127 
00128    RETURN(ir) ;  /* 15 Jun 1999: used to return 0, which is not correct! */
00129 }

void AFNI_toggle_drawing Three_D_View   im3d
 

Definition at line 358 of file afni_receive.c.

References AFNI_view_info::drawing_enabled, AFNI_view_info::drawing_mode, AFNI_view_info::drawing_pixel, drive_MCW_grapher(), drive_MCW_imseq(), ENTRY, Three_D_View::g123, Three_D_View::g231, Three_D_View::g312, graDR_button2_disable, graDR_button2_enable, IM3D_OPEN, isqDR_button2_disable, isqDR_button2_enable, isqDR_button2_mode, isqDR_button2_pixel, AFNI_view_info::num_receiver, RECEIVE_DRAWING_MASK, AFNI_view_info::receiver, AFNI_receiver::receiver_mask, Three_D_View::s123, Three_D_View::s231, Three_D_View::s312, and Three_D_View::vinfo.

Referenced by AFNI_receive_control(), AFNI_receive_init(), and AFNI_view_xyz_CB().

00359 {
00360    int turn_on = 0 ;
00361 
00362 ENTRY("AFNI_toggle_drawing") ;
00363 
00364    if( ! IM3D_OPEN(im3d) ) EXRETURN ;
00365 
00366    /* count up how many receivers want the drawing */
00367 
00368    if( im3d->vinfo->receiver != NULL ){
00369       int ir ;
00370       for( ir=0 ; ir < im3d->vinfo->num_receiver ; ir++ )
00371          if( im3d->vinfo->receiver[ir] != NULL &&
00372              (im3d->vinfo->receiver[ir]->receiver_mask & RECEIVE_DRAWING_MASK) )
00373             turn_on++ ;
00374    }
00375    im3d->vinfo->drawing_enabled = (turn_on != 0) ;
00376 
00377    if( ! im3d->vinfo->drawing_enabled ){
00378 
00379    /*-- quench the flames --*/
00380 
00381       drive_MCW_imseq( im3d->s123 , isqDR_button2_disable , NULL ) ;
00382       drive_MCW_imseq( im3d->s231 , isqDR_button2_disable , NULL ) ;
00383       drive_MCW_imseq( im3d->s312 , isqDR_button2_disable , NULL ) ;
00384 
00385       drive_MCW_grapher( im3d->g123 , graDR_button2_disable , NULL ) ;
00386       drive_MCW_grapher( im3d->g231 , graDR_button2_disable , NULL ) ;
00387       drive_MCW_grapher( im3d->g312 , graDR_button2_disable , NULL ) ;
00388 
00389    } else {
00390 
00391    /*-- come on baby, light my fire --*/
00392 
00393       drive_MCW_imseq( im3d->s123 , isqDR_button2_enable , NULL ) ;
00394       drive_MCW_imseq( im3d->s231 , isqDR_button2_enable , NULL ) ;
00395       drive_MCW_imseq( im3d->s312 , isqDR_button2_enable , NULL ) ;
00396 
00397       if( im3d->vinfo->drawing_pixel > 0 ){
00398          drive_MCW_imseq( im3d->s123, isqDR_button2_pixel,
00399                           (XtPointer)im3d->vinfo->drawing_pixel ) ;
00400          drive_MCW_imseq( im3d->s231, isqDR_button2_pixel,
00401                           (XtPointer)im3d->vinfo->drawing_pixel ) ;
00402          drive_MCW_imseq( im3d->s312, isqDR_button2_pixel,
00403                           (XtPointer)im3d->vinfo->drawing_pixel ) ;
00404       }
00405 
00406       drive_MCW_imseq( im3d->s123, isqDR_button2_mode,
00407                        (XtPointer)im3d->vinfo->drawing_mode ) ;
00408       drive_MCW_imseq( im3d->s231, isqDR_button2_mode,
00409                        (XtPointer)im3d->vinfo->drawing_mode ) ;
00410       drive_MCW_imseq( im3d->s312, isqDR_button2_mode,
00411                        (XtPointer)im3d->vinfo->drawing_mode ) ;
00412 
00413       drive_MCW_grapher( im3d->g123 , graDR_button2_enable , NULL ) ;
00414       drive_MCW_grapher( im3d->g231 , graDR_button2_enable , NULL ) ;
00415       drive_MCW_grapher( im3d->g312 , graDR_button2_enable , NULL ) ;
00416 
00417    }
00418 
00419    EXRETURN ;
00420 }

void AFNI_xyz_to_dicomm THD_3dim_dataset   dset,
float    xx,
float    yy,
float    zz,
float *    xd,
float *    yd,
float *    zd
 

Definition at line 908 of file afni_receive.c.

References ISVALID_DSET, TEMP_FVEC3, THD_3dmm_to_dicomm(), and THD_fvec3::xyz.

00911 {
00912    THD_fvec3 fv ;
00913 
00914    if( ! ISVALID_DSET(dset) ) return ;
00915 
00916    fv  = THD_3dmm_to_dicomm( dset , TEMP_FVEC3(xx,yy,zz) ) ;
00917    *xd = fv.xyz[0] ;
00918    *yd = fv.xyz[1] ;
00919    *zd = fv.xyz[2] ;
00920    return ;
00921 }

void AFNI_xyz_to_ijk THD_3dim_dataset   dset,
float    xx,
float    yy,
float    zz,
int *    ii,
int *    jj,
int *    kk
 

Definition at line 893 of file afni_receive.c.

References THD_ivec3::ijk, ISVALID_DSET, TEMP_FVEC3, and THD_3dmm_to_3dind().

00896 {
00897    THD_ivec3 iv ;
00898 
00899    if( ! ISVALID_DSET(dset) ) return ;
00900 
00901    iv  = THD_3dmm_to_3dind ( dset , TEMP_FVEC3(xx,yy,zz) ) ;
00902    *ii = iv.ijk[0] ;
00903    *jj = iv.ijk[1] ;
00904    *kk = iv.ijk[2] ;
00905    return ;
00906 }
 

Powered by Plone

This site conforms to the following standards: