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  

imseq.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 _MCW_IMSEQ_HEADER_
00008 #define _MCW_IMSEQ_HEADER_
00009 
00010 #include <X11/X.h>
00011 #include <X11/Intrinsic.h>
00012 #include <X11/Shell.h>
00013 #include <X11/cursorfont.h>
00014 
00015 #include <Xm/Xm.h>
00016 #include <Xm/Form.h>
00017 #include <Xm/Scale.h>
00018 #include <Xm/PushB.h>
00019 #include <Xm/DrawingA.h>
00020 #include <Xm/Protocols.h>
00021 #include <Xm/MwmUtil.h>
00022 #include <Xm/DialogS.h>
00023 #include <Xm/Label.h>
00024 #include <Xm/AtomMgr.h>
00025 
00026 #include <stdio.h>
00027 #include <string.h>
00028 #include <math.h>
00029 #include <ctype.h>
00030 #include <signal.h>
00031 
00032 #include "mrilib.h"
00033 #include "vecmat.h"
00034 
00035 #include "display.h"
00036 #include "bbox.h"
00037 #include "xutil.h"
00038 #include "machdep.h"
00039 
00040 #include "coxplot.h"  /* 30 Dec 1998 */
00041 
00042 /*** typedefs ***/
00043 
00044 #ifndef HAVE_GET_PTR_TYPEDEF
00045 #  define HAVE_GET_PTR_TYPEDEF
00046    typedef XtPointer (*get_ptr)() ;  /* function type */
00047 #endif
00048 
00049 typedef struct {
00050       int num_total , num_series ;  /* # of images, # in "series" */
00051 
00052       void (* send_CB)() ;   /* callback, if non_NULL */
00053 
00054       MCW_function_list * transforms0D ;
00055       MCW_function_list * transforms2D ;
00056       MCW_function_list * slice_proj   ;  /* 31 Jan 2002 */
00057 
00058       XtPointer parent , aux ;
00059 } MCW_imseq_status ;
00060 
00061 #define ISQ_DOING_SLICE_PROJ(ss)      \
00062  ( (ss)->slice_proj_range >  0   &&   \
00063    (ss)->slice_proj_func  != NULL   )
00064 
00065 #define IM_WIDTH(im) \
00066   ( ((im)->dx > 0) ? ((im)->nx * (im)->dx) : ((im)->nx) )
00067 
00068 #define IM_HEIGHT(im) \
00069   ( ((im)->dy > 0) ? ((im)->ny * (im)->dy) : ((im)->ny) )
00070 
00071 /* define dimensions used in the window */
00072 
00073 #define FORM_FRAC_BASE  1000
00074 #define IMAGE_FRAC      0.8
00075 #define DFRAC           0.01
00076 #define FRAC_MAX        0.95
00077 #define FRAC_MIN        0.25
00078 
00079 #define COLOR_BAR_WIDTH 16
00080 #define COLOR_BAR_SPACE  4
00081 
00082 /* button stuff */
00083 
00084 #define NBUTTON_BOT 4   /* # buttons at bottom */
00085 #define NBUTTON_RIG 3   /* # buttons at right  */
00086 
00087 #define LEADING_BOT        XmNleftAttachment
00088 #define LEADING_WIDGET_BOT XmNleftWidget
00089 #define TRAILING_BOT       XmNrightAttachment
00090 #define EDGING_BOT         XmNbottomAttachment
00091 #define SPACING_BOT        XmNleftOffset
00092 
00093 #define LEADING_RIG        XmNtopAttachment
00094 #define LEADING_WIDGET_RIG XmNtopWidget
00095 #define TRAILING_RIG       XmNbottomAttachment
00096 #define EDGING_RIG         XmNrightAttachment
00097 #define SPACING_RIG        XmNtopOffset
00098 
00099 #define NARROW 5
00100 
00101 /* image destruction stuff */
00102 
00103 #define KILL_2XIM(one,two)                          \
00104    do { if( (two) != (one) ) MCW_kill_XImage(two) ; \
00105         MCW_kill_XImage(one) ; (one) = (two) = NULL ; } while(0)
00106 
00107 #define KILL_2ndXIM(one,two) \
00108    do { if( (two) != (one) ) MCW_kill_XImage(two) ; \
00109         (two) = NULL ; } while(0)
00110 
00111 #define KILL_1MRI(one) \
00112    do{ if( (one) != NULL ){ mri_free(one) ; (one) = NULL ; }} while(0)
00113 
00114 #define ISQ_VALID(seq) ((seq)!=NULL && ((seq)->valid)>0)
00115 #define ISQ_REALZ(seq) ((seq)!=NULL && ((seq)->valid)>1)
00116 
00117 /*----------------------- button box stuff -----------------------*/
00118 
00119 typedef struct {
00120       int nbut ;
00121       char ** lbut ;
00122       int type , frame ;
00123 
00124       XtPointer parent , aux ;
00125 } ISQ_boxdef ;
00126 
00127 #define NBOX_DISP  9           /* # button boxes in Disp dialog */
00128 
00129 #define NBOX_MAX   NBOX_DISP     /* max # boxes to allow for in imseq */
00130 
00131 #define ISQ_ROT_0   1   /* values returned by various button boxes */
00132 #define ISQ_ROT_90  2   /* in the Disp dialog (will be transferred */
00133 #define ISQ_ROT_180 4   /* to values in the options data)          */
00134 #define ISQ_ROT_270 8
00135 
00136 #define ISQ_TO_MRI_ROT(x) (x)   /* convert ISQ_ROT codes to MRI_ROT codes */
00137 
00138 #define ISQ_SCL_AUTO 1
00139 #define ISQ_SCL_GRP  2
00140 #define ISQ_SCL_USER 65536
00141 
00142 #define ISQ_RNG_MINTOMAX  1
00143 #define ISQ_RNG_02TO98    2
00144 #define ISQ_RNG_USER      4  /* 04 Nov 2003 */
00145 
00146 #define ISQ_ASPECT 1
00147 
00148 #define ISQ_SAV_NSIZE 1
00149 #define ISQ_SAV_PNM   2
00150 #define ISQ_SAV_ONE   4      /* 26 Jul 2001: no longer used */
00151 
00152 #define ISQ_IMPROC_NONE   0  /* values returned by various button   */
00153 #define ISQ_IMPROC_FLAT   1
00154 #define ISQ_IMPROC_SHARP  2  /* boxes in the Disp dialog improc box */
00155 #define ISQ_IMPROC_SOBEL  4  /* (powers of 2 of button indexes)     */
00156 
00157 #define ISQ_CX_MAG        1  /* values returned by buttons in */
00158 #define ISQ_CX_PHASE      2  /* the Disp dialog "complex" box */
00159 #define ISQ_CX_REAL       4
00160 #define ISQ_CX_IMAG       8
00161 
00162 typedef struct {
00163       int mirror , rot , no_overlay ,
00164           scale_group , scale_range , free_aspect ,
00165           save_nsize , save_pnm , save_one , improc_code , cx_code ;
00166 
00167       XtPointer parent , aux ;
00168 
00169       int save_filter ;  /* 27 Jun 2001 */
00170       int save_agif   ;  /* 27 Jul 2001 */
00171       int save_mpeg   ;  /* 02 Jul 2001 */
00172 } ISQ_options ;
00173 
00174 #define ISQ_OPT_EQUAL(opta,optb)                    \
00175     ( ((opta).mirror      == (optb).mirror     ) && \
00176       ((opta).rot         == (optb).rot        ) && \
00177       ((opta).no_overlay  == (optb).no_overlay ) && \
00178       ((opta).scale_group == (optb).scale_group) && \
00179       ((opta).scale_range == (optb).scale_range) && \
00180       ((opta).free_aspect == (optb).free_aspect) && \
00181       ((opta).improc_code == (optb).improc_code) && \
00182       ((opta).cx_code     == (optb).cx_code    )     )
00183 
00184 /* 09 Oct 1998 */
00185 
00186 #define ISQ_DEFAULT_OPT(opt) do{ (opt).mirror      = FALSE ;            \
00187                                  (opt).rot         = ISQ_ROT_0 ;        \
00188                                  (opt).no_overlay  = False ;            \
00189                                  (opt).scale_group = ISQ_SCL_AUTO ;     \
00190                                  (opt).scale_range = ISQ_RNG_02TO98 ;   \
00191                                  (opt).free_aspect = False ;            \
00192                                  (opt).save_nsize  = False ;            \
00193                                  (opt).save_pnm    = False ;            \
00194                                  (opt).save_one    = True ;             \
00195                                  (opt).improc_code = ISQ_IMPROC_NONE ;  \
00196                                  (opt).cx_code     = ISQ_CX_MAG ;       \
00197                                  (opt).parent      = NULL ;             \
00198                                  (opt).aux         = NULL ;             \
00199                                  (opt).save_filter = -1   ;             \
00200                                  (opt).save_agif   = 0    ;             \
00201                                  (opt).save_mpeg   = 0    ;             \
00202                                } while(0)
00203 
00204 /*------------- statistics for image display scaling -------------*/
00205 
00206 #define NHISTOG 500
00207 
00208 typedef struct {
00209       Boolean one_done , glob_done ;
00210       float   min,max , per02,per98 ,
00211               scl_mm,lev_mm , scl_per,lev_per ;
00212       float   entropy ;
00213 
00214       XtPointer parent , aux ;
00215 } ISQ_indiv_statistics ;
00216 
00217 typedef struct {
00218       Boolean mm_done , per_done ;
00219       float   min,max , per02,per98 ,
00220               scl_mm,lev_mm , scl_per,lev_per ;
00221       int hist[NHISTOG] ;
00222       XtWorkProcId worker ;
00223 
00224       XtPointer parent , aux ;
00225 } ISQ_glob_statistics ;
00226 
00227 #define ISQ_SCLEV(mn,mx,dp,sc,lv) \
00228   ( (lv) = (mn) , (sc) = (((mx)>(mn)) ? (((dp)-0.49)/((mx)-(mn))) : 1.0) )
00229 
00230 /*--- "callback" data stuff: info about events in image window ---*/
00231 
00232 typedef struct {
00233       int          reason ;       /* isqCR_??? defined below */
00234       XEvent *     event ;        /* may be NULL */
00235       int          xim,yim ;      /* original image coords, */
00236                                   /* OR new image size */
00237 
00238       int          key ;          /* keyvalue */
00239       int          nim ;          /* new image number */
00240       ISQ_options  opt ;          /* new options */
00241       XtPointer    userdata ;     /* misc stuff */
00242 
00243       XtPointer parent , aux ;
00244 } ISQ_cbs ;
00245 
00246 #define isqCR_buttonpress 1   /* button press in image */
00247 #define isqCR_keypress    2   /* key press in image */
00248 #define isqCR_geometry    3   /* the display geometry altered */
00249 #define isqCR_newimage    4   /* moved to a new image */
00250 #define isqCR_newmontage  5   /* a new image montage layout */
00251 #define isqCR_destroy     99  /* the MCW_imseq was destroyed */
00252 
00253 #define isqCR_getimage    401
00254 #define isqCR_getoverlay  402
00255 #define isqCR_getstatus   403
00256 #define isqCR_getqimage   404
00257 
00258 #define isqCR_getxynim    411  /* 30 Dec 1998 */
00259 
00260 #define isqCR_getmemplot  421  /* 21 Feb 2001 */
00261 #define isqCR_getlabel    422  /* 19 Sep 2001 */
00262 
00263 #define isqCR_dxplus      301  /* arrowpad reasons */
00264 #define isqCR_dxminus     302
00265 #define isqCR_dyplus      303
00266 #define isqCR_dyminus     304
00267 #define isqCR_appress     309
00268 
00269 #define isqCR_button2_points 501  /* Feb 1998 */
00270 #define isqCR_button2_key    502  /* 20 Feb 2003 */
00271 
00272 #define isqCR_force_redisplay 601 /* 22 Aug 1998 */
00273 
00274 #define COLORMAP_CHANGE(sq)                                          \
00275   do{ if( ISQ_REALZ((sq)) && (sq)->dc->visual_class == TrueColor ){  \
00276          if( (sq)->status->send_CB != NULL ){                        \
00277             ISQ_cbs cbs ;                                            \
00278             cbs.reason = isqCR_force_redisplay ;                     \
00279             AFNI_CALL_VOID_3ARG( (sq)->status->send_CB      ,        \
00280                                  MCW_imseq * , (sq)         ,        \
00281                                  XtPointer   , (sq)->getaux ,        \
00282                                  ISQ_cbs *   , &cbs          ) ;     \
00283          } else {                                                    \
00284             KILL_2XIM( (sq)->given_xbar , (sq)->sized_xbar ) ;       \
00285             ISQ_redisplay( (sq) , -1 , isqDR_display ) ;             \
00286          }                                                           \
00287     } } while(0)
00288 
00289 /*------------------------------*/
00290 
00291 #ifndef MONT_NMAX
00292 #define MONT_NMAX 13
00293 #endif
00294 
00295 #ifndef MONT_SMAX
00296 #define MONT_SMAX 199
00297 #endif
00298 
00299 #ifndef MONT_GMAX
00300 #define MONT_GMAX 13
00301 #endif
00302 
00303 extern void ISQ_montage_CB( Widget , XtPointer , XtPointer ) ;
00304 extern void ISQ_montage_action_CB( Widget , XtPointer , XtPointer ) ;
00305 
00306 /*------------- the central data type -------------*/
00307 
00308 #define ISQ_NHELP   2047
00309 #define ISQ_NWIDGET 128
00310 
00311 struct MCW_imseq ;  /* incomplete definition, completed below: */
00312 
00313 typedef struct MCW_imseq {
00314 
00315      int valid ;             /* flag if this structure is valid:
00316                                   0 => no good at all
00317                                   1 => valid but unrealized
00318                                   2 => valid and realized        */
00319 
00320      int ignore_redraws ;    /* flag to ignore external redraws */
00321 
00322      int horig , vorig ;     /* horz and vert dimens, sans aspect */
00323 
00324      int hbase , vbase ;     /* horz and vert "standard" image dimensions */
00325      int hactual , vactual ; /* dimensions, allowing for rotations */
00326      int old_hact, old_vact; /* recent values */
00327      float scl , lev ;       /* for scaling intensities */
00328      int   bot , top ;       /* for clipping intensities */
00329 
00330      Boolean done_first ;    /* for the done button */
00331 
00332      MCW_DC * dc ;           /* graphics data (copy of a pointer) */
00333 
00334      MCW_imseq_status * status ;    /* status of image sequence */
00335 
00336      float last_width_mm , last_height_mm ;  /* physical sizes (in mm, say)*/
00337 
00338      ISQ_options opt, old_opt ;     /* image display options */
00339 
00340      Widget wtop, wform, wimage, wbar, wscale , winfo ,
00341             wbut_bot[NBUTTON_BOT] , wbut_rig[NBUTTON_RIG] ; /* windows */
00342 
00343      Widget wbar_menu , wbar_rng_but , wbar_zer_but  , wbar_flat_but ,
00344             wbar_sharp_but ;
00345      float  rng_bot,rng_top,rng_ztop , flat_bot,flat_top , sharp_fac ;
00346      int    zer_color ;
00347 
00348      MCW_arrowval * arrow[NARROW] ; /* arrow controls */
00349 
00350      MCW_arrowpad * arrowpad ;      /* arrowpad in lower right corner */
00351 
00352      int marg_bot , marg_rig , wf_wide , wf_high ;
00353 
00354      int        num_bbox ;
00355      MCW_bbox * bbox[NBOX_MAX] ;  /* button boxes */
00356      Widget     dialog ;
00357      int        dialog_starter ;
00358      ISQ_options save_opt ;
00359 
00360      get_ptr   getim ;  /* pointer to image retrieval procedure */
00361      XtPointer getaux ; /* pointer to image retrieval auxiliary data */
00362 
00363      int  im_nr ;         /* index of latest and greatest */
00364      char im_label[64] ;
00365      char im_helptext[ISQ_NHELP+1] ;
00366 
00367      int    onoff_num , onoff_state ;
00368      Widget onoff_widgets[ISQ_NWIDGET] ;  /* widgets on & off */
00369 
00370      int last_image_type ;
00371 
00372      int mont_nx    , mont_ny    , mont_skip    , mont_gap    , mont_gapcolor    ;
00373      int mont_nx_old, mont_ny_old, mont_skip_old, mont_gap_old, mont_gapcolor_old;
00374      int mont_periodic ;
00375      MCW_arrowval * mont_across_av , * mont_down_av , * mont_skip_av ,
00376                   * mont_gap_av , * mont_gapcolor_av ;
00377 
00378      float image_frac ;  /* 25 Oct 1996 */
00379 
00380      MCW_arrowval * transform0D_av ;      /* 30 Oct 1996 */
00381      generic_func * transform0D_func ;
00382      int            transform0D_index ;
00383 
00384      MCW_arrowval * transform2D_av ;
00385      generic_func * transform2D_func ;
00386      int            transform2D_index ;
00387 
00388      MCW_arrowval * slice_proj_av ;       /* 31 Jan 2002 */
00389      float_func   * slice_proj_func ;
00390      int            slice_proj_index ;
00391      MCW_arrowval * slice_proj_range_av ;
00392      int            slice_proj_range ;
00393 
00394      MCW_arrowval *      rowgraph_av  ;   /* 30 Dec 1998 */
00395      int                 rowgraph_num ;
00396      MEM_topshell_data * rowgraph_mtd ;
00397 
00398      MCW_arrowval *      surfgraph_av ;   /* 21 Jan 1999 */
00399      int                 surfgraph_num ;
00400      MEM_topshell_data * surfgraph_mtd ;
00401      MCW_arrowpad *      surfgraph_arrowpad ;
00402      float               surfgraph_theta , surfgraph_phi ;
00403 
00404      int never_drawn ;
00405 
00406      int    button2_enabled , button2_active , button2_drawmode ;
00407      Pixel  button2_pixel ;
00408      int    wimage_width , wimage_height ;
00409 
00410      /*--- data below here should be freed before deletion ---*/
00411 
00412      MRI_IMAGE * imim , * ovim ;  /* latest and greatest (already processed) */
00413 
00414      int         need_orim , set_orim ; /* flag to compute orim */
00415      MRI_IMAGE * orim ;                 /* input underlay image (for rowgraphs) */
00416 
00417      XImage * given_xim  , * sized_xim  ;  /* for actual displaying */
00418      XImage * given_xbar , * sized_xbar ;
00419 
00420      ISQ_indiv_statistics * imstat ;
00421      ISQ_glob_statistics  * glstat ;
00422 
00423      /*--- temporary, I hope [Hah!] ---*/
00424 
00425      int saver_from , saver_to ;
00426      char * saver_prefix ;
00427 
00428      /*--- the obligatory ---*/
00429 
00430      XtPointer parent ;
00431 
00432      /* extra text for winfo [07 Aug 1999] */
00433 
00434      char winfo_extra[64] ;
00435 
00436      /* text for sides of window in default orientation [01 Dec 1999] */
00437 
00438      char winfo_sides[4][16] ;
00439 
00440      /* opacity of overlay */
00441 
00442      float ov_opacity ;              /* 07 Mar 2001 */
00443      MCW_arrowval * ov_opacity_av ;
00444      Widget ov_opacity_sep ;         /* 08 Mar 2001 */
00445 
00446      Widget record_rc , record_cbut; /* 24 Apr 2001: recording stuff */
00447      MCW_bbox * record_status_bbox ;
00448      MCW_bbox * record_method_bbox ;
00449      int record_status ;
00450      int record_method ;
00451      int record_mode ;
00452      struct MCW_imseq * record_imseq ;
00453      MRI_IMARR * record_imarr ;
00454      MEM_plotdata ** record_mplot ;  /* 05 Jan 2005 */
00455 
00456      MCW_bbox * save_one_bbox ;      /* 26 Jul 2001 */
00457      MCW_bbox * save_agif_bbox ;     /* 27 Jul 2001 */
00458 
00459      float clbot,cltop , barbot,bartop ; /* 29 Jul 2001 */
00460 
00461      MEM_plotdata * mplot ;              /* 19 Sep 2001 */
00462      MCW_bbox * wbar_plots_bbox ;        /* 20 Sep 2001 */
00463      MCW_arrowval * wbar_label_av ;      /* 20 Sep 2001 */
00464      MCW_arrowval * wbar_labsz_av ;      /* 21 Sep 2001 */
00465 
00466      Widget        zoom_sep              /* 11 Mar 2002 */;
00467      MCW_arrowval *zoom_val_av ;
00468      Widget        zoom_drag_pb ;
00469      int    zoom_fac ;
00470      float  zoom_hor_off, zoom_ver_off ;
00471      int    zoom_pw , zoom_ph ;
00472      Pixmap zoom_pixmap  ;
00473      XImage *zoom_xim  ;
00474      int    zoom_button1 , zoom_xp,zoom_yp ; /* 15 Mar 2002 */
00475 
00476      int cropit , crop_xa,crop_xb , crop_ya,crop_yb ; /* 11 Jun 2002 */
00477      int crop_nxorg , crop_nyorg , crop_allowed ;
00478      Widget        crop_drag_pb ;                     /* 17 Jun 2002 */
00479      int           crop_drag ;
00480 
00481      int button2_width ;                              /* 08 Oct 2002 */
00482 
00483      int cursor_state ;                               /* 10 Mar 2003 */
00484 
00485      MCW_bbox *pen_bbox ;                             /* 18 Jul 2003 */
00486 
00487      int last_bx,last_by ;                            /* 23 Oct 2003 */
00488      int cmap_changed ;
00489 
00490      int do_graymap ;                                 /* 24 Oct 2003 */
00491      MEM_topshell_data * graymap_mtd ;
00492      Widget wbar_graymap_pb ;
00493 
00494      XtIntervalId timer_id ;                          /* 03 Dec 2003 */
00495      int          timer_func, timer_param, timer_delay ;
00496 
00497      int dont_place_dialog ;                          /* 23 Jan 2004 */
00498 
00499      MCW_arrowval *wbar_ticnum_av, *wbar_ticsiz_av ;  /* 23 Feb 2004 */
00500 
00501      float last_dx , last_dy ;                        /* 08 Jun 2004 */
00502 
00503      float rgb_gamma ;                                /* 25 Apr 2005 */
00504      float rgb_offset ;
00505 } MCW_imseq ;
00506 
00507 #define ISQ_TIMERFUNC_INDEX  701
00508 #define ISQ_TIMERFUNC_BOUNCE 702
00509 
00510 extern void ISQ_timer_CB( XtPointer , XtIntervalId * ) ; /* 03 Dec 2003 */
00511 extern void ISQ_timer_stop( MCW_imseq * ) ;
00512 
00513 extern void ISQ_zoom_av_CB( MCW_arrowval *, XtPointer ) ;
00514 extern void ISQ_zoom_pb_CB( Widget, XtPointer, XtPointer ) ;
00515 extern void ISQ_crop_pb_CB( Widget, XtPointer, XtPointer ) ;
00516 extern void ISQ_actually_pan( MCW_imseq * , int , int ) ;
00517 extern int ISQ_show_zoom( MCW_imseq *seq )  ;
00518 
00519 #define CURSOR_NORMAL    0                            /* 10 Mar 2003 */
00520 #define CURSOR_PENCIL    1
00521 #define CURSOR_CROSSHAIR 2                            /* 18 Jul 2003 */
00522 
00523 extern void ISQ_set_cursor_state( MCW_imseq * , int ) ;
00524 
00525 extern void ISQ_pen_bbox_CB( Widget, XtPointer, XtPointer ) ; /* 18 Jul 2003 */
00526 
00527 /*--------------------------------------------------------------------*/
00528 
00529 #define ISQ_LABEL_OFF  0  /* 20 Sep 2001 */
00530 #define ISQ_LABEL_UPLF 1
00531 #define ISQ_LABEL_UPRT 2
00532 #define ISQ_LABEL_DNLF 3
00533 #define ISQ_LABEL_DNRT 4
00534 #define ISQ_LABEL_UPMD 5
00535 #define ISQ_LABEL_DNMD 6
00536 
00537 /*--------------------------------------------------------------------*/
00538 
00539 #define ISQ_USE_SIDES(isq) ( (isq)->winfo_sides[0][0] != '\0' || \
00540                              (isq)->winfo_sides[1][0] != '\0' || \
00541                              (isq)->winfo_sides[2][0] != '\0' || \
00542                              (isq)->winfo_sides[3][0] != '\0'      )
00543 
00544 /***---------- prototypes: user callable ----------***/
00545 
00546 extern MCW_imseq * open_MCW_imseq( MCW_DC * , get_ptr , XtPointer ) ;
00547 
00548 /* Drive Reasons for the next routine */
00549 
00550 #define isqDR_imhelptext    101
00551 #define isqDR_options       102
00552 #define isqDR_numtotal      103
00553 #define isqDR_cursor        104
00554 #define isqDR_unrealize     105
00555 #define isqDR_realize       106
00556 #define isqDR_display       107
00557 #define isqDR_overlay       108
00558 #define isqDR_arrowpadon    109
00559 #define isqDR_reimage       110
00560 #define isqDR_reshow        111
00561 #define isqDR_newseq        112
00562 #define isqDR_arrowpadoff   113
00563 #define isqDR_title         114
00564 #define isqDR_clearstat     115
00565 #define isqDR_onoffwid      116
00566 #define isqDR_getimnr       117
00567 #define isqDR_icon          118
00568 #define isqDR_sendmontage   119
00569 #define isqDR_periodicmont  120
00570 #define isqDR_setmontage    121
00571 #define isqDR_setifrac      130
00572 #define isqDR_setrange      131
00573 #define isqDR_bgicon        132
00574 
00575 #define isqDR_arrowpadhint  201
00576 #define isqDR_winfotext     202
00577 #define isqDR_getoptions    203
00578 #define isqDR_winfosides    204
00579 
00580 #define isqDR_destroy       666
00581 
00582 #define isqDR_offwid          0
00583 #define isqDR_onwid           1
00584 #define isqDR_togwid          2
00585 
00586 #define isqDR_button2_enable  501
00587 #define isqDR_button2_disable 502
00588 #define isqDR_button2_pixel   503
00589 #define isqDR_button2_mode    504
00590 #define isqDR_button2_width   505
00591 
00592 #define isqDR_ignore_redraws  521
00593 #define isqDR_keypress        522  /* 18 Feb 2005 */
00594 
00595 #define BUTTON2_OPENPOLY        0
00596 #define BUTTON2_CLOSEDPOLY      1
00597 #define BUTTON2_POINTS          2
00598 #define BUTTON2_NODRAW          3
00599 
00600 #define isqDR_rebar           602  /* 23 Aug 1998 */
00601 #define isqDR_opacitybut      603  /* 07 Mar 2001 */
00602 #define isqDR_record_mode     604  /* 24 Apr 2001 */
00603 #define isqDR_record_disable  605  /* 24 Apr 2001 */
00604 #define isqDR_zoombut         606  /* 11 Mar 2002 */
00605 #define isqDR_getopacity      607  /* 21 Jan 2003 */
00606 #define isqDR_setopacity      608  /* 21 Jan 2003 */
00607 #define isqDR_setimsave       609  /* 23 Jan 2003 */
00608 #define isqDR_penbbox         610  /* 18 Jul 2003 */
00609 
00610 #define isqDR_plot_label      701  /* 20 Sep 2001 */
00611 #define isqDR_plot_plot       702  /* 20 Sep 2001 */
00612 #define isqDR_save_jpeg       703  /* 28 Jul 2005 */
00613 
00614 extern Boolean drive_MCW_imseq( MCW_imseq * , int , XtPointer ) ;
00615 
00616 extern Boolean ISQ_setup_new( MCW_imseq * , XtPointer ) ;
00617 
00618 /*** prototypes: internals ***/
00619 
00620 extern void ISQ_redisplay( MCW_imseq * , int , int ) ;
00621 
00622 extern MCW_imseq_status * ISQ_copy_status( MCW_imseq_status * ) ;
00623 
00624 extern void ISQ_reset_dimen( MCW_imseq * , float , float ) ;
00625 
00626 extern void ISQ_scale_CB( Widget , XtPointer , XtPointer ) ;
00627 
00628 extern void ISQ_wbar_plots_CB( Widget , XtPointer , XtPointer ) ; /* 20 Sep 2001 */
00629 extern void ISQ_wbar_label_CB( MCW_arrowval * , XtPointer ) ;
00630 
00631 extern void ISQ_wbar_menu_CB( Widget , XtPointer , XtPointer ) ;
00632 extern void ISQ_set_rng_CB( Widget , XtPointer , MCW_choose_cbs * ) ;
00633 extern void ISQ_set_zcol_CB( Widget , XtPointer , MCW_choose_cbs * ) ;
00634 extern void ISQ_set_flat_CB( Widget , XtPointer , MCW_choose_cbs * ) ;
00635 extern void ISQ_set_sharp_CB( Widget , XtPointer , MCW_choose_cbs * ) ;
00636 
00637 extern void ISQ_but_disp_CB( Widget , XtPointer , XtPointer ) ;
00638 extern void ISQ_but_save_CB( Widget , XtPointer , XtPointer ) ;
00639 extern void ISQ_but_done_CB( Widget , XtPointer , XtPointer ) ;
00640 extern void ISQ_but_color_CB( Widget , XtPointer , XtPointer ) ;
00641 extern void ISQ_but_cswap_CB( Widget , XtPointer , XtPointer ) ;
00642 extern void ISQ_but_cnorm_CB( Widget , XtPointer , XtPointer ) ;
00643 
00644 extern void ISQ_place_dialog( MCW_imseq * ) ;  /* 05 Jan 1999 */
00645 extern void ISQ_place_widget( Widget, Widget ) ;  /* 27 Oct 2003 */
00646 
00647 #undef REQUIRE_TWO_DONES
00648 #ifdef REQUIRE_TWO_DONES
00649    extern void ISQ_but_done_reset( MCW_imseq * ) ;
00650 #else
00651 #  define ISQ_but_done_reset(xx)  /* nada */
00652 #endif
00653 
00654 extern void ISQ_disp_act_CB( Widget , XtPointer , XtPointer ) ;
00655 
00656 extern void ISQ_drawing_EV( Widget , XtPointer , XEvent * , Boolean * ) ;
00657 extern void ISQ_button2_EV( Widget , XtPointer , XEvent * , Boolean * ) ;
00658 
00659 extern void ISQ_make_image( MCW_imseq * ) ;
00660 extern void ISQ_show_image( MCW_imseq * ) ;
00661 extern void ISQ_draw_winfo( MCW_imseq * ) ;
00662 
00663  /* 06 Mar 2001 */
00664 extern MRI_IMAGE * ISQ_overlay( MCW_DC *, MRI_IMAGE *, MRI_IMAGE *, float ) ;
00665 #define ISQ_GOOD_OVERLAY_TYPE(dt) ( (dt)==MRI_short || (dt)==MRI_rgb )
00666 
00667  /* 07 Mar 2001 */
00668 extern void ISQ_opacity_CB( MCW_arrowval * , XtPointer ) ;
00669 extern char * ISQ_opacity_label( int ) ;
00670 extern MRI_IMAGE * ISQ_index_to_rgb( MCW_DC * , int , MRI_IMAGE * ) ;
00671 #define ISQ_SKIP_OVERLAY(isq) ((isq)->opt.no_overlay || (isq)->ov_opacity == 0.0)
00672 
00673 extern MRI_IMAGE * ISQ_manufacture_one( int nim , int overlay , MCW_imseq * seq ) ;
00674 extern void ISQ_make_montage( MCW_imseq * ) ;
00675 
00676 extern void ISQ_make_bar( MCW_imseq * ) ;
00677 extern void ISQ_show_bar( MCW_imseq * ) ;
00678 extern void ISQ_set_barhint( MCW_imseq * , char * ) ; /* 29 Jul 2001 */
00679 
00680 extern MRI_IMAGE * ISQ_process_mri( int , MCW_imseq * , MRI_IMAGE * ) ;
00681 
00682 extern MRI_IMAGE    * ISQ_getimage  ( int , MCW_imseq * ) ; /* 31 Jan 2002 */
00683 extern MRI_IMAGE    * ISQ_getoverlay( int , MCW_imseq * ) ; /* 11 Jun 2002 */
00684 extern MEM_plotdata * ISQ_getmemplot( int , MCW_imseq * ) ;
00685 extern char         * ISQ_getlabel  ( int , MCW_imseq * ) ;
00686 
00687 extern void ISQ_free_alldata( MCW_imseq * ) ;
00688 
00689 extern int ISQ_set_image_number( MCW_imseq * , int ) ;
00690 
00691 extern Boolean ISQ_disp_options( MCW_imseq * , Boolean ) ;
00692 
00693 /* type for defining buttons */
00694 
00695 typedef struct {
00696    char           * name ;
00697    XtCallbackProc   func_CB ;
00698 
00699    XtPointer parent , aux ;
00700 } ISQ_bdef ;
00701 
00702 Boolean ISQ_statistics_WP( XtPointer ) ;
00703 
00704 void ISQ_statify_one( MCW_imseq * , int , MRI_IMAGE * ) ;
00705 void ISQ_statify_all( MCW_imseq * , Boolean ) ;
00706 
00707 void ISQ_perpoints( float,float , int h[] , float * , float * ) ;
00708 
00709 void ISQ_mapxy   ( MCW_imseq * , int,int , int *,int *,int * ) ;
00710 void ISQ_flipxy  ( MCW_imseq * , int *,int * ) ;
00711 void ISQ_unflipxy( MCW_imseq * , int *,int * ) ;
00712 
00713 void ISQ_arrow_CB( MCW_arrowval * , XtPointer ) ;
00714 
00715 void ISQ_arrowpad_CB( MCW_arrowpad * , XtPointer ) ;
00716 
00717 extern void ISQ_transform_CB     ( MCW_arrowval * , XtPointer ) ;
00718 extern char * ISQ_transform_label( MCW_arrowval * , XtPointer ) ;
00719 
00720 extern void ISQ_slice_proj_CB    ( MCW_arrowval * , XtPointer ) ;
00721 
00722 #define ROWGRAPH_MAX  9
00723 #define SURFGRAPH_MAX 2
00724 
00725 #define ROWGRAPH_MASK  1
00726 #define SURFGRAPH_MASK 2
00727 #define GRAYMAP_MASK   4  /* 24 Oct 2003 */
00728 
00729 extern void ISQ_rowgraph_CB     ( MCW_arrowval * , XtPointer ) ;
00730 extern char * ISQ_rowgraph_label( MCW_arrowval * , XtPointer ) ;
00731 extern void ISQ_rowgraph_draw( MCW_imseq * seq ) ;
00732 extern void ISQ_rowgraph_mtdkill( MEM_topshell_data * mp ) ;
00733 
00734 extern void ISQ_graymap_draw( MCW_imseq * seq ) ;           /* 24 Oct 2003 */
00735 extern void ISQ_graymap_mtdkill( MEM_topshell_data * mp ) ;
00736 
00737 extern void ISQ_surfgraph_CB     ( MCW_arrowval * , XtPointer ) ;
00738 extern char * ISQ_surfgraph_label( MCW_arrowval * , XtPointer ) ;
00739 extern void ISQ_surfgraph_draw( MCW_imseq * seq ) ;
00740 extern void ISQ_surfgraph_mtdkill( MEM_topshell_data * mp ) ;
00741 extern MEM_plotdata * plot_image_surface( MRI_IMAGE * , float,float,float,int,int ) ;
00742 extern void ISQ_surfgraph_arrowpad_CB( MCW_arrowpad * , XtPointer ) ;
00743 
00744 /*---- temporary, I hope (yeah, sure, right, uh huh) ----*/
00745 
00746 extern void ISQ_saver_CB( Widget , XtPointer , MCW_choose_cbs * ) ;
00747 
00748 extern MEM_plotdata * ISQ_plot_label( MCW_imseq *, char * ) ; /* 20 Sep 2001 */
00749 
00750 /*---- 24 Apr 2001: recording stuff ----*/
00751 
00752 #define RECORD_STATUS_OFF         (1<<0)
00753 #define RECORD_STATUS_NEXTONE     (1<<1)
00754 #define RECORD_STATUS_ON          (1<<2)
00755 
00756 #define RECORD_ISON(ib) ((ib) > RECORD_STATUS_OFF)
00757 
00758 #define RECORD_METHOD_AFTEREND     (1<<0)
00759 #define RECORD_METHOD_BEFORESTART  (1<<1)
00760 #define RECORD_METHOD_INSERT_MM    (1<<2)
00761 #define RECORD_METHOD_INSERT_PP    (1<<3)
00762 #define RECORD_METHOD_OVERWRITE    (1<<4)
00763 #define RECORD_METHOD_OVERWRITE_MM (1<<5)
00764 #define RECORD_METHOD_OVERWRITE_PP (1<<6)
00765 
00766 extern void ISQ_record_button( MCW_imseq * ) ;
00767 extern void ISQ_record_CB( Widget,XtPointer,XtPointer ) ;
00768 extern void ISQ_butsave_EV( Widget, XtPointer, XEvent *, Boolean * ) ;
00769 
00770 extern void ISQ_record_open( MCW_imseq * ) ;
00771 extern void ISQ_record_update( MCW_imseq * , int ) ;
00772 extern void ISQ_record_addim( MCW_imseq * , int,int ) ;
00773 extern XtPointer ISQ_record_getim( int , int , XtPointer ) ;
00774 extern void ISQ_record_send_CB( MCW_imseq * , XtPointer , ISQ_cbs * ) ;
00775 extern void ISQ_record_kill_CB( Widget , XtPointer , XtPointer ) ;
00776 
00777 extern void ISQ_remove_widget( MCW_imseq * , Widget ) ;
00778 extern void ISQ_cropper( MCW_imseq *, XButtonEvent *) ; /* 17 Jun 2002 */
00779 
00780 extern void ISQ_snapshot( Widget w ) ;                 /* 18 Jun 2003 */
00781 extern void ISQ_snapsave( int,int, byte *, Widget ) ;  /* 03 Jul 2003 */
00782 
00783 extern int ISQ_handle_keypress( MCW_imseq * , unsigned long ); /* 18 Feb 2005 */
00784 
00785 extern void mri_rgb_transform_nD( MRI_IMAGE *, int, generic_func * ) ;
00786 
00787 extern void ISQ_save_jpeg( MCW_imseq *seq , char *fname ) ; /* 28 Jul 2005 */
00788 
00789 #endif /* _MCW_IMSEQ_HEADER_ */
 

Powered by Plone

This site conforms to the following standards: