Doxygen Source Code Documentation
afni_widg.c File Reference
#include "afni.h"
#include "afni_plugout.h"
#include "logo.h"
#include "afni48.xbm"
#include "afni48cor.xbm"
#include "afni48axi.xbm"
#include "afni48sag.xbm"
#include "afni48gra.xbm"
#include "afni48gracor.xbm"
#include "afni48grasag.xbm"
#include "afni48graaxi.xbm"
#include "afni16.xbm"
#include "rwc.xbm"
#include "lll.h"
Go to the source code of this file.
Define Documentation
|
Value: "Off: no display of crosshairs\n" \ "Single: display of single crosshairs\n" \ "Multi: display of crosshairs for each\n" \ " slice in the 'montage' layouts\n" \ "LR+AP: display crosshairs only parallel\n" \ " to the L-R and A-P axes [etc.]\n\n" \ "N.B.: When a slice has an image viewer\n" \ " and a grapher open at the same time,\n" \ " then a 'frame' will be drawn around\n" \ " the voxels being graphed. In Single\n" \ " crosshair mode, only this frame will\n" \ " be drawn. In Multi mode, the actual\n" \ " crosshairs will also be drawn.\n" \ "N.B.: You can set AFNI_CROSSHAIR_LINES\n" \ " in Datamode->Misc->Edit Environment\n" \ " to have crosshairs drawn as thin lines\n" \ " rather than as overlaid voxels." Definition at line 146 of file afni_widg.c. |
|
Value: "Controls the\n" \ "crosshair color\n" \ "in the image\n" \ "viewing windows." Definition at line 165 of file afni_widg.c. |
|
Value: "Controls the crosshair\n" \ "gap (in voxels).\n\n" \ "N.B.: When a grapher is\n" \ " opened with an image\n" \ " viewer, then the gap\n" \ " in that viewer will\n" \ " be replaced by a\n" \ " frame drawn around the\n" \ " voxels being graphed." Definition at line 171 of file afni_widg.c. |
|
Value: "Displays coordinates of\n" \ "the crosshair point in the\n" \ "DICOM coordinates (3D input)\n" \ "or voxel indices (image input)\n" \ "\n" \ "A Button-3 popup menu lets you\n" \ "change coordinate display order." Definition at line 182 of file afni_widg.c. |
|
Value: "Controls the gap\n" \ "in the markers'\n" \ "cross (in pixels)" Definition at line 224 of file afni_widg.c. |
|
Value: "Controls the color used\n" \ "to display the selected\n" \ "marker (the 'primary').\n" \ "\n" \ "Oct 1998: Also controls\n" \ " the color for 'tags'." Definition at line 206 of file afni_widg.c. |
|
Value: "Use the arrows (or type) to set the\n" \ "(cubical) voxel dimensions for the\n" \ "data resampling" Definition at line 280 of file afni_widg.c. |
|
Value: "Controls the color used\n" \ "to display non-selected\n" \ "markers (the 'secondaries')" Definition at line 214 of file afni_widg.c. |
|
Value: "Controls the size\n" \ "of the markers on\n" \ "the screen (pixels)" Definition at line 219 of file afni_widg.c. |
|
|
|
Value: "Click the hand\n" \ "on any button to\n" \ "get a little help\n" \ " ----- OR -----\n" \ "Use the Motif Help\n" \ "key (usually F1) if\n" \ "the cursor is over\n" \ "a button." Definition at line 245 of file afni_widg.c. |
|
Value: "Use this button to\n" \ "clear (unset) the chosen\n" \ "marker point" Definition at line 234 of file afni_widg.c. |
|
Value: "pressed IN: you are allowed to change the markers\n" \ "pressed OUT: you aren't allowed to change the markers\n\n"\ "WARNING: if you previously executed a geometric\n" \ "transformation, and then re-execute it with\n" \ "altered markers, you will re-write the old transformed\n" \ "dataset, AND also destroy any `downstream' transformed\n" \ "datasets -- for example, re-doing a AC-PC aligned view\n" \ "will destroy the Talairach view (if any) that follows it" Definition at line 136 of file afni_widg.c. |
|
Value: "Use this button to run quality\n" \ "checks on the marker set\n" \ "after all markers are defined\n" \ "and to enable the transformation" Definition at line 239 of file afni_widg.c. |
|
Value: "Use this button to\n" \ "set or reset the chosen\n" \ "marker point" Definition at line 229 of file afni_widg.c. |
|
Value: "Use this button to execute the geometric\n" \ "transformation when all the marker points\n" \ "have been properly defined.\n\n" \ "WARNING: if you previously executed a geometric\n" \ "transformation, and then re-execute it with\n" \ "altered markers, you will re-write the old transformed\n" \ "dataset, AND also destroy any `downstream' transformed\n" \ "datasets -- for example, re-doing a AC-PC aligned view\n" \ "will destroy the Talairach view (if any) that follows it" Definition at line 269 of file afni_widg.c. |
|
Value: " Press (twice) to\n" \ " close this AFNI\n" \ " control window.\n\n" \ "N.B.: when the last\n" \ " control window is\n" \ " closed, AFNI will\n" \ " quit.\n\n" \ "Pressing this button\n" \ "with the Shift or Ctrl\n" \ "keys, or with the other\n" \ "mouse buttons also down,\n" \ "will also make AFNI quit." Definition at line 255 of file afni_widg.c. |
|
Value: "pressed IN: overlay dataset will display\n" \ "pressed OUT: overlay dataset won't display" \ "\n" \ "This is useful for seeing what anatomical\n" \ "features are 'under' a particular overlay color." Definition at line 129 of file afni_widg.c. |
|
Value: "pressed IN: markers for this view will display\n" \ "pressed OUT: markers for this view won't display\n"\ "\n" \ "Markers are used to specify anatomical locations\n"\ "required for transformation of coordinates.\n" \ "\n" \ "Oct 1998: Also controls the display of dataset\n" \ " 'tags' -- see the 'Edit Tagset' plugin." Definition at line 119 of file afni_widg.c. |
|
Value: "pressed IN: Uses a larger 'bounding box' when creating\n" \ " the Talairach view; this extends 10 mm more\n" \ " inferior than the old box, which will encompass\n" \ " all of the cerebellum and more of the brainstem.\n" \ "\n" \ "pressed OUT: Uses the old 'bounding box' size when creating\n" \ " the Talairach view; this is for compatibility\n" \ " with BRIKs created with older versions of AFNI.\n" \ "\n" \ "Nota Bene: The state of this button is only used by AFNI at\n" \ " moment the 'Transform Data' button is used to\n" \ " transform from the AC-PC aligned view to the\n" \ " Talairach view." Definition at line 98 of file afni_widg.c. |
|
Value: "Normal: button opens viewing window\n" \ "Inverted: button raises opened window\n" \ " * Right-click on inverted button\n" \ " 'fetches' image/graph window\n\n" \ "N.B.: AFNI does not read datasets from\n" \ " disk until a window is opened.\n" \ " This can make opening the first\n" \ " viewing window be quite slow.\n" \ "\n" \ "The Graph buttons are only enabled for\n" \ "datasets that are viewing their data files\n" \ "directly (NOT warping on demand -- see the\n" \ "top of the 'Define Datamode' control panel)" Definition at line 191 of file afni_widg.c. |
|
Definition at line 53 of file afni_widg.c. |
|
if USE_OPTMENUS is defined, then option menus will be used in place of MCW_arrowvals wherever possible * Definition at line 50 of file afni_widg.c. |
|
|
|
|
|
Value: if( num_entry == 1 ){ \ XmUpdateDisplay(im3d->vwid->top_shell); REPORT_PROGRESS("."); } Definition at line 67 of file afni_widg.c. Referenced by AFNI_make_widgets(). |
|
Definition at line 61 of file afni_widg.c. |
|
|
|
|
|
Definition at line 14 of file afni_widg.c. |
|
Definition at line 13 of file afni_widg.c. |
|
|
|
|
|
|
Function Documentation
|
Definition at line 7606 of file afni_widg.c. Referenced by RT_start_dataset(). |
|
at this point, ii = index of a controller to use * Definition at line 7687 of file afni_widg.c. Referenced by AFNI_drive_open_window(), and AFNI_quit_CB(). |
|
|
popup on picture widget (right of Quit button) * Definition at line 7160 of file afni_widg.c. Referenced by AFNI_drive_close_window(), AFNI_quit_CB(), and RT_start_dataset(). |
|
Find first open controller [05 Mar 2002]. --------------------------------------------------------------------- Definition at line 7176 of file afni_widg.c. Referenced by new_RT_input(), PLUG_startup_plugin_CB(), PLUTO_popup_worker(), process_NIML_AFNI_dataset(), process_NIML_Node_ROI(), process_NIML_SUMA_crosshair_xyz(), process_NIML_SUMA_ixyz(), and RT_start_dataset(). |
|
Definition at line 7418 of file afni_widg.c. Referenced by AFNI_drive_open_window(), and MAIN_workprocess(). |
|
Definition at line 7715 of file afni_widg.c. |
|
Definition at line 7587 of file afni_widg.c. Referenced by AFNI_drive_open_window(), and AFNI_startup_layout_CB(). |
|
Definition at line 3391 of file afni_widg.c. References AFNI_anatmode_bbox_label, MCW_BB_frame, and MCW_BB_radio_one. Referenced by AFNI_make_widgets().
03415 { char * hh[] = { "View data direct from brick" , 03416 "View data resampled to new grid" } ; 03417 MCW_bbox_hints( dmode->anatmode_bbox , 2 , hh ) ; 03418 } 03419 03420 ADDTO_KILL(im3d->kl,dmode->anatmode_bbox) ; 03421 03422 /*-- resampling control: anat mode --*/ 03423 03424 dmode->anat_resam_av = new_MCW_arrowval( 03425 dmode->rowcol , 03426 "ULay resam mode" , 03427 AVOPT_STYLE , 03428 FIRST_RESAM_TYPE , 03429 LAST_RESAM_TYPE , 03430 im3d->vinfo->anat_resam_mode , 03431 MCW_AV_readtext , 0 , 03432 AFNI_resam_av_CB , (XtPointer) im3d , 03433 AFNI_resam_texter , NULL ) ; 03434 03435 dmode->anat_resam_av->parent = (XtPointer) im3d ; 03436 dmode->anat_resam_av->allow_wrap = 1 ; /* wrap values */ 03437 dmode->anat_resam_av->fastdelay = 1000 ; /* slow it down */ 03438 03439 #ifndef USE_OPTMENUS 03440 XtVaSetValues( dmode->anat_resam_av->wtext , 03441 XmNcolumns , NSTR_SHORT_RESAM , 03442 XmNmaxLength , NSTR_SHORT_RESAM , 03443 NULL ) ; 03444 #endif 03445 03446 MCW_reghelp_children( dmode->anat_resam_av->wrowcol , 03447 "This controls the resampling mode for\n" 03448 "underlay data (for display and writing):\n\n" 03449 "NN = nearest neighbor resampling [fastest]\n" 03450 "Li = linear interpolation [OK]\n" 03451 "Cu = cubic interpolation [nice but slow]\n" 03452 "Bk = blocky interpolation [between NN & Li]" ) ; 03453 MCW_reghint_children( dmode->anat_resam_av->wrowcol , "Resampling method" ) ; 03454 03455 ADDTO_KILL(im3d->kl,dmode->anat_resam_av) ; 03456 03457 /*----- resampling: voxel size -----*/ 03458 03459 dmode->resam_vox_av = 03460 new_MCW_arrowval( 03461 dmode->rowcol , /* parent */ 03462 "Resam (mm)" , /* label */ 03463 MCW_AV_downup , /* arrow directions */ 03464 1 , /* min value (0.1 mm from decim) */ 03465 40 , /* max value (4.0 mm) */ 03466 (int)(10*INIT_resam_vox) , /* init value */ 03467 MCW_AV_editext , /* input/output text display */ 03468 1 , /* decimal shift */ 03469 AFNI_resam_vox_av_CB , /* routine to call when button */ 03470 (XtPointer) im3d , /* is pressed, and its data */ 03471 NULL,NULL /* no special display */ 03472 ) ; 03473 03474 XtVaSetValues( dmode->resam_vox_av->wtext , XmNcolumns , 7 , NULL ) ; 03475 03476 dmode->resam_vox_av->parent = (XtPointer) im3d ; 03477 03478 MCW_reghelp_children( dmode->resam_vox_av->wrowcol , 03479 AFNI_disp_resam_vox_help ) ; 03480 MCW_reghint_children( dmode->resam_vox_av->wrowcol , 03481 "Resampled voxel size" ) ; 03482 03483 ADDTO_KILL(im3d->kl,dmode->resam_vox_av) ; 03484 03485 /*--- separator between anat and func stuff ---*/ 03486 03487 (void) XtVaCreateManagedWidget( 03488 "dialog" , xmSeparatorWidgetClass , dmode->rowcol , 03489 XmNseparatorType , XmDOUBLE_LINE , 03490 NULL ) ; 03491 03492 /*--- bbox to control how we see the func data ---*/ 03493 03494 dmode->funcmode_bbox = 03495 new_MCW_bbox( dmode->rowcol , 03496 2 , AFNI_funcmode_bbox_label , 03497 MCW_BB_radio_one , 03498 MCW_BB_frame , 03499 AFNI_funcmode_CB , (XtPointer) im3d ) ; 03500 03501 dmode->funcmode_bbox->parent = (XtPointer) im3d ; 03502 03503 MCW_reghelp_children( dmode->funcmode_bbox->wrowcol , 03504 "View OLay Data Brick ==> data from overlay file is displayed\n" 03505 " (will be grayed-out if data is not available)\n" 03506 "Warp OLay on Demand ==> data is resampled as needed for display\n\n" 03507 "N.B.: Overlay data is always on top of underlay data.\n" 03508 " To be displayed directly from the overlay data brick,\n" 03509 " this brick must conform in dimensions to the underlay\n" 03510 " data being displayed. Even if the overlay brick exists,\n" 03511 " if its dimensions do not correspond to the underlay brick\n" 03512 " or the resampling dimension (below), then the overlay data\n" 03513 " being displayed will be 'warped-on-demand'. Such warping\n" 03514 " always occurs from the 'most original' source. For example,\n" 03515 " if a Talairach view brick is altered (via a plugin, or another\n" 03516 " external editing program), then viewing the brick may be quite\n" 03517 " different from viewing the warped data, which will be recomputed\n" 03518 " from the Original view brick (if available), without reference\n" 03519 " to whatever alterations may have been made in the Talairach view." 03520 ) ; 03521 03522 { char * hh[] = { "View data direct from brick" , 03523 "View data resampled to new grid" } ; 03524 MCW_bbox_hints( dmode->funcmode_bbox , 2 , hh ) ; 03525 } 03526 03527 ADDTO_KILL(im3d->kl,dmode->funcmode_bbox) ; 03528 03529 /*-- func resampling control (moved here 03 Nov 1996) --*/ 03530 03531 dmode->func_resam_av = new_MCW_arrowval( 03532 dmode->rowcol , 03533 #ifdef USE_OPTMENUS 03534 "OLay resam mode" , 03535 #else 03536 "OLay mode " , 03537 #endif 03538 AVOPT_STYLE , 03539 FIRST_RESAM_TYPE , 03540 LAST_RESAM_TYPE , 03541 im3d->vinfo->func_resam_mode , 03542 MCW_AV_readtext , 0 , 03543 AFNI_resam_av_CB , (XtPointer) im3d , 03544 AFNI_resam_texter , NULL ) ; 03545 03546 dmode->func_resam_av->parent = (XtPointer) im3d ; 03547 dmode->func_resam_av->allow_wrap = 1 ; /* wrap values */ 03548 dmode->func_resam_av->fastdelay = 1000 ; /* slow it down */ 03549 03550 #ifndef USE_OPTMENUS 03551 XtVaSetValues( dmode->func_resam_av->wtext , 03552 XmNcolumns , NSTR_SHORT_RESAM , 03553 XmNmaxLength , NSTR_SHORT_RESAM , 03554 NULL ) ; 03555 #endif 03556 03557 MCW_reghelp_children( dmode->func_resam_av->wrowcol , 03558 "This controls the resampling mode for\n" 03559 "overlay data (display and writing):\n\n" 03560 "NN = nearest neighbor resampling [fastest]\n" 03561 "Li = linear interpolation [OK]\n" 03562 "Cu = cubic interpolation [nice but slow]\n" 03563 "Bk = blocky interpolation [between NN & Li]\n\n" 03564 "N.B.: Dataset sub-bricks without statistical\n" 03565 " parameters attached will be interpolated using\n" 03566 " this method. Those with statistical parameters\n" 03567 " will be interpolated using the method chosen below." ) ; 03568 03569 MCW_reghint_children( dmode->func_resam_av->wrowcol , "Resampling method" ) ; 03570 03571 /*-- thr resampling control (09 Dec 1997) --*/ 03572 03573 dmode->thr_resam_av = new_MCW_arrowval( 03574 dmode->rowcol , 03575 #ifdef USE_OPTMENUS 03576 "Stat resam mode" , 03577 #else 03578 "Stat mode " , 03579 #endif 03580 AVOPT_STYLE , 03581 FIRST_RESAM_TYPE , 03582 LAST_RESAM_TYPE , 03583 im3d->vinfo->thr_resam_mode , 03584 MCW_AV_readtext , 0 , 03585 AFNI_resam_av_CB , (XtPointer) im3d , 03586 AFNI_resam_texter , NULL ) ; 03587 03588 dmode->thr_resam_av->parent = (XtPointer) im3d ; 03589 dmode->thr_resam_av->allow_wrap = 1 ; /* wrap values */ 03590 dmode->thr_resam_av->fastdelay = 1000 ; /* slow it down */ 03591 03592 #ifndef USE_OPTMENUS 03593 XtVaSetValues( dmode->thr_resam_av->wtext , 03594 XmNcolumns , NSTR_SHORT_RESAM , 03595 XmNmaxLength , NSTR_SHORT_RESAM , 03596 NULL ) ; 03597 #endif 03598 03599 MCW_reghelp_children( dmode->thr_resam_av->wrowcol , 03600 "This controls the resampling mode for\n" 03601 "overlay data (threshold only):\n\n" 03602 "NN = nearest neighbor resampling [fastest]\n" 03603 "Li = linear interpolation [OK]\n" 03604 "Cu = cubic interpolation [nice but slow]\n" 03605 "Bk = blocky interpolation [between NN & Li]\n\n" 03606 "N.B.: Dataset sub-bricks without statistical\n" 03607 " parameters attached will be interpolated using\n" 03608 " the method chosen above. Those with statistical\n" 03609 " parameters will be interpolated using this method." ) ; 03610 03611 MCW_reghint_children( dmode->thr_resam_av->wrowcol , "Resampling method" ) ; 03612 03613 /*--- separator between func stuff and write buttons ---*/ 03614 03615 (void) XtVaCreateManagedWidget( 03616 "dialog" , xmSeparatorWidgetClass , dmode->rowcol , 03617 XmNseparatorType , XmDOUBLE_LINE , 03618 NULL ) ; 03619 03620 /*---- 23 Nov 1996: rowcol for Write buttons ----*/ 03621 03622 dmode->write_rowcol = 03623 XtVaCreateWidget( 03624 "dialog" , xmRowColumnWidgetClass , dmode->rowcol , 03625 XmNorientation , XmHORIZONTAL , 03626 XmNpacking , XmPACK_TIGHT , 03627 XmNmarginHeight , 0 , 03628 XmNmarginWidth , 0 , 03629 XmNspacing , 1 , 03630 XmNtraversalOn , False , 03631 XmNinitialResourcesPersistent , False , 03632 NULL ) ; 03633 03634 /*-- 23 Nov 1996: label at left --*/ 03635 03636 (void) XtVaCreateManagedWidget( 03637 "dialog" , xmLabelWidgetClass , dmode->write_rowcol , 03638 LABEL_ARG("Write ") , 03639 XmNalignment , XmALIGNMENT_BEGINNING , 03640 XmNrecomputeSize , False , 03641 XmNtraversalOn , False , 03642 XmNinitialResourcesPersistent , False , 03643 NULL ) ; 03644 03645 /*--- write pushbuttons ---*/ 03646 03647 dmode->write_anat_pb = 03648 XtVaCreateManagedWidget( 03649 "dialog" , xmPushButtonWidgetClass , dmode->write_rowcol , 03650 LABEL_ARG("ULay") , 03651 XmNtraversalOn , False , 03652 XmNinitialResourcesPersistent , False , 03653 NULL ) ; 03654 03655 XtAddCallback( dmode->write_anat_pb , XmNactivateCallback , 03656 AFNI_write_dataset_CB , im3d ) ; 03657 03658 MCW_register_hint( dmode->write_anat_pb , 03659 "Write current anatomy to disk" ) ; 03660 03661 dmode->write_func_pb = 03662 XtVaCreateManagedWidget( 03663 "dialog" , xmPushButtonWidgetClass , dmode->write_rowcol , 03664 LABEL_ARG("OLay") , 03665 XmNtraversalOn , False , 03666 XmNinitialResourcesPersistent , False , 03667 NULL ) ; 03668 03669 XtAddCallback( dmode->write_func_pb , XmNactivateCallback , 03670 AFNI_write_dataset_CB , im3d ) ; 03671 03672 MCW_register_hint( dmode->write_func_pb , 03673 "Write current overlay dataset to disk" ) ; 03674 03675 dmode->write_many_pb = 03676 XtVaCreateManagedWidget( 03677 "dialog" , xmPushButtonWidgetClass , dmode->write_rowcol , 03678 LABEL_ARG("Many") , 03679 XmNtraversalOn , False , 03680 XmNinitialResourcesPersistent , False , 03681 NULL ) ; 03682 03683 XtAddCallback( dmode->write_many_pb , XmNactivateCallback , 03684 AFNI_write_many_dataset_CB , im3d ) ; 03685 03686 MCW_register_hint( dmode->write_many_pb , 03687 "Write multiple datasets to disk" ) ; 03688 03689 MCW_reghelp_children( dmode->write_rowcol , 03690 "The purpose of the `Write' buttons is to recompute\n" 03691 "entire dataset bricks in the current coordinate\n" 03692 "system (`view') and write them to disk.\n" 03693 "\n" 03694 "The `Resam' controls determine the resolution and\n" 03695 "interpolation used in creating the new bricks.\n" 03696 "\n" 03697 "ULay --> current overlay dataset brick.\n" 03698 "OLay --> current underlay dataset brick.\n" 03699 "Many --> select one or more datasets from a list.\n" 03700 "\n" 03701 "N.B.:\n" 03702 " + Only dataset bricks that are warped from\n" 03703 " a `parent' dataset can be written out.\n" 03704 " AFNI will not destroy original data (I hope).\n" 03705 " + This operation may be very time-consuming,\n" 03706 " especially for 3D+time datasets!" 03707 ) ; 03708 03709 /*---- 23 Nov 1996: Row of Buttons for Rescan Session ----*/ 03710 03711 dmode->rescan_rowcol = 03712 XtVaCreateWidget( 03713 "dialog" , xmRowColumnWidgetClass , dmode->rowcol , 03714 XmNorientation , XmHORIZONTAL , 03715 XmNpacking , XmPACK_TIGHT , 03716 XmNmarginHeight , 0 , 03717 XmNmarginWidth , 0 , 03718 XmNspacing , 1 , 03719 XmNtraversalOn , False , 03720 XmNinitialResourcesPersistent , False , 03721 NULL ) ; 03722 03723 /*-- 23 Nov 1996: label at left --*/ 03724 03725 (void) XtVaCreateManagedWidget( 03726 "dialog" , xmLabelWidgetClass , dmode->rescan_rowcol , 03727 LABEL_ARG("Rescan") , 03728 XmNalignment , XmALIGNMENT_BEGINNING , 03729 XmNrecomputeSize , False , 03730 XmNtraversalOn , False , 03731 XmNinitialResourcesPersistent , False , 03732 NULL ) ; 03733 03734 /*-- pushbutton for one session rescan --*/ 03735 03736 dmode->rescan_pb = 03737 XtVaCreateManagedWidget( 03738 "dialog" , xmPushButtonWidgetClass , dmode->rescan_rowcol , 03739 LABEL_ARG("This") , 03740 XmNmarginHeight , 0 , 03741 XmNtraversalOn , False , 03742 XmNinitialResourcesPersistent , False , 03743 NULL ) ; 03744 03745 XtAddCallback( dmode->rescan_pb , XmNactivateCallback , 03746 AFNI_rescan_CB , im3d ) ; 03747 03748 MCW_register_hint( dmode->rescan_pb , 03749 "Read current session again" ) ; 03750 03751 /*-- 23 Nov 1996: pushbutton for all session rescan --*/ 03752 03753 dmode->rescan_all_pb = 03754 XtVaCreateManagedWidget( 03755 "dialog" , xmPushButtonWidgetClass , dmode->rescan_rowcol , 03756 LABEL_ARG("All ") , 03757 XmNmarginHeight , 0 , 03758 XmNtraversalOn , False , 03759 XmNinitialResourcesPersistent , False , 03760 NULL ) ; 03761 03762 XtAddCallback( dmode->rescan_all_pb , XmNactivateCallback , 03763 AFNI_rescan_all_CB , im3d ) ; 03764 03765 MCW_register_hint( dmode->rescan_all_pb , 03766 "Read all sessions again" ) ; 03767 03768 dmode->rescan_timeseries_pb = 03769 XtVaCreateManagedWidget( 03770 "dialog" , xmPushButtonWidgetClass , dmode->rescan_rowcol , 03771 LABEL_ARG("*.1D") , 03772 XmNmarginHeight , 0 , 03773 XmNtraversalOn , False , 03774 XmNinitialResourcesPersistent , False , 03775 NULL ) ; 03776 03777 XtAddCallback( dmode->rescan_timeseries_pb , XmNactivateCallback , 03778 AFNI_rescan_timeseries_CB , im3d ) ; 03779 03780 MCW_register_hint( dmode->rescan_timeseries_pb , 03781 "Read directories for new time series files" ) ; 03782 03783 MCW_reghelp_children( dmode->rescan_rowcol , 03784 "The purpose of the `Rescan' buttons is to read\n" 03785 "the contents of session directories again in\n" 03786 "order to make newly created datasets (e.g., from\n" 03787 "the 3dmerge program) available for AFNI viewing.\n" 03788 "\n" 03789 "This --> rescan just the current session.\n" 03790 "All --> rescan all session directories.\n" 03791 "*.1D --> rescan for timeseries files instead\n" 03792 " of AFNI datasets. Note that the program\n" 03793 " won't re-read a filename that has already\n" 03794 " been read in. This means that if you change\n" 03795 " the contents of a .1D file, AFNI will not\n" 03796 " be aware of that fact even after this rescan\n" 03797 " operation." 03798 ) ; 03799 03800 /*---- 04 Mar 1997: Row of Buttons for Reading ----*/ 03801 03802 dmode->read_rowcol = 03803 XtVaCreateWidget( 03804 "dialog" , xmRowColumnWidgetClass , dmode->rowcol , 03805 XmNorientation , XmHORIZONTAL , 03806 XmNpacking , XmPACK_TIGHT , 03807 XmNmarginHeight , 0 , 03808 XmNmarginWidth , 0 , 03809 XmNspacing , 1 , 03810 XmNtraversalOn , False , 03811 XmNinitialResourcesPersistent , False , 03812 NULL ) ; 03813 03814 /*-- label at left --*/ 03815 03816 (void) XtVaCreateManagedWidget( 03817 "dialog" , xmLabelWidgetClass , dmode->read_rowcol , 03818 LABEL_ARG("Read ") , 03819 XmNalignment , XmALIGNMENT_BEGINNING , 03820 XmNrecomputeSize , False , 03821 XmNtraversalOn , False , 03822 XmNinitialResourcesPersistent , False , 03823 NULL ) ; 03824 03825 /*-- pushbutton for session input --*/ 03826 03827 dmode->read_sess_pb = 03828 XtVaCreateManagedWidget( 03829 "dialog" , xmPushButtonWidgetClass , dmode->read_rowcol , 03830 LABEL_ARG("Sess") , 03831 XmNmarginHeight , 0 , 03832 XmNtraversalOn , False , 03833 XmNinitialResourcesPersistent , False , 03834 NULL ) ; 03835 03836 XtAddCallback( dmode->read_sess_pb , XmNactivateCallback , 03837 AFNI_read_sess_CB , im3d ) ; 03838 03839 MCW_register_hint( dmode->read_sess_pb , 03840 "Read in a new session directory" ) ; 03841 03842 /*-- pushbutton for timeseries input --*/ 03843 03844 dmode->read_1D_pb = 03845 XtVaCreateManagedWidget( 03846 "dialog" , xmPushButtonWidgetClass , dmode->read_rowcol , 03847 LABEL_ARG(" 1D ") , 03848 XmNmarginHeight , 0 , 03849 XmNtraversalOn , False , 03850 XmNinitialResourcesPersistent , False , 03851 NULL ) ; 03852 03853 XtAddCallback( dmode->read_1D_pb , XmNactivateCallback , 03854 AFNI_read_1D_CB , im3d ) ; 03855 03856 MCW_register_hint( dmode->read_1D_pb , 03857 "Read in a new time series file" ) ; 03858 03859 /*-- pushbutton for Web input --*/ 03860 03861 dmode->read_Web_pb = 03862 XtVaCreateManagedWidget( 03863 "dialog" , xmPushButtonWidgetClass , dmode->read_rowcol , 03864 LABEL_ARG("Web ") , 03865 XmNmarginHeight , 0 , 03866 XmNtraversalOn , False , 03867 XmNinitialResourcesPersistent , False , 03868 NULL ) ; 03869 03870 XtAddCallback( dmode->read_Web_pb , XmNactivateCallback , 03871 AFNI_read_Web_CB , im3d ) ; 03872 03873 MCW_register_hint( dmode->read_Web_pb , 03874 "Read dataset via http:// or ftp://" ) ; 03875 03876 MCW_reghelp_children( dmode->read_rowcol , 03877 "The purpose of the `Read' buttons is to read\n" 03878 "in new data. (The `Rescan' buttons are to\n" 03879 "re-read data from old directories.)\n" 03880 "\n" 03881 "Sess --> Read a new session directory.\n\n" 03882 "1D --> Read a new timeseries file.\n\n" 03883 "Web --> Read datasets from the Web:\n" 03884 " e.g., http://some.place/dir/anat+orig\n" 03885 " ftp://some.place/dir/func+orig\n" 03886 " or http://some.place/dir/AFNILIST\n" 03887 " where AFNILIST is a text file with one\n" 03888 " dataset name per line (will be\n" 03889 " fetched from same Web directory;\n" 03890 " do NOT put ftp:// or http:// in\n" 03891 " the AFNILIST file!)." 03892 ) ; 03893 03894 /*---- 04 Nov 1996: a place to put menubars ----*/ 03895 03896 dmode->mbar_rowcol = 03897 XtVaCreateWidget( 03898 "dialog" , xmRowColumnWidgetClass , dmode->rowcol , 03899 XmNorientation , XmHORIZONTAL , 03900 XmNpacking , XmPACK_TIGHT , 03901 XmNmarginHeight , 0 , 03902 XmNmarginWidth , 0 , 03903 XmNspacing , 1 , 03904 XmNtraversalOn , False , 03905 XmNinitialResourcesPersistent , False , 03906 NULL ) ; 03907 03908 /* 04 Nov 1996: make the "Lock" menubar */ 03909 03910 AFNI_lock_button( im3d ) ; 03911 03912 /* 30 Oct 1996: make the "Misc" menubar */ 03913 03914 AFNI_misc_button( im3d ) ; 03915 03916 /*-- manage the managers --*/ 03917 03918 XtManageChild( dmode->write_rowcol ) ; 03919 XtManageChild( dmode->rescan_rowcol ) ; 03920 XtManageChild( dmode->read_rowcol ) ; 03921 XtManageChild( dmode->mbar_rowcol ) ; 03922 XtManageChild( dmode->rowcol ) ; 03923 03924 /*--------------------------------------------------*/ 03925 /*************** Program controls *******************/ 03926 /*--------------------------------------------------*/ 03927 03928 /*----- rowcol to hold all program controls stuff -----*/ 03929 03930 STATUS("making prog->rowcol") ; 03931 03932 prog->rowcol = 03933 XtVaCreateWidget( 03934 "dialog" , xmRowColumnWidgetClass , prog->frame , 03935 XmNpacking , XmPACK_TIGHT , 03936 XmNorientation , XmVERTICAL , 03937 XmNtraversalOn , False , 03938 XmNinitialResourcesPersistent , False , 03939 NULL ) ; 03940 03941 if( im3d->type == AFNI_3DDATA_VIEW ){ 03942 prog->rc_top = 03943 XtVaCreateWidget( 03944 "dialog" , xmRowColumnWidgetClass , prog->rowcol , 03945 XmNpacking , XmPACK_TIGHT , 03946 XmNorientation , XmHORIZONTAL , 03947 XmNspacing , 1 , 03948 XmNmarginHeight, 0 , 03949 XmNmarginWidth , 0 , 03950 XmNtraversalOn , False , 03951 XmNinitialResourcesPersistent , False , 03952 NULL ) ; 03953 03954 if( MAX_CONTROLLERS > 1 ){ 03955 prog->clone_pb = 03956 XtVaCreateManagedWidget( 03957 "dialog" , xmPushButtonWidgetClass , prog->rc_top , 03958 LABEL_ARG("New ") , 03959 XmNtraversalOn , False , 03960 XmNinitialResourcesPersistent , False , 03961 NULL ) ; 03962 03963 XtAddCallback( prog->clone_pb , XmNactivateCallback , 03964 AFNI_clone_controller_CB , im3d ) ; 03965 03966 MCW_register_help( prog->clone_pb , 03967 "Use this to open\n" 03968 "a new AFNI control\n" 03969 "window." 03970 ) ; 03971 MCW_register_hint( prog->clone_pb , 03972 "Open a new AFNI controller window" ) ; 03973 } else { 03974 prog->clone_pb = NULL ; 03975 } 03976 03977 prog->panel_pb = 03978 XtVaCreateManagedWidget( 03979 "dialog" , xmPushButtonWidgetClass , prog->rc_top , 03980 LABEL_ARG("Views") , 03981 XmNtraversalOn , False , 03982 XmNinitialResourcesPersistent , False , 03983 NULL ) ; 03984 03985 prog->panel_pb_inverted = True ; 03986 MCW_invert_widget( prog->panel_pb ) ; 03987 03988 MCW_register_help( prog->panel_pb , 03989 "Use this to close and open\n" 03990 "the viewing control panel\n" 03991 "located to the right." 03992 ) ; 03993 MCW_register_hint( prog->panel_pb , 03994 "Open/close control panel to right" ) ; 03995 03996 XtAddCallback( prog->panel_pb , XmNactivateCallback , 03997 AFNI_controller_panel_CB , im3d ) ; 03998 03999 } else { 04000 prog->rc_top = prog->clone_pb = prog->panel_pb = NULL ; 04001 } 04002 04003 /*----- pushbutton: button help -----*/ 04004 04005 prog->rc_bot = 04006 XtVaCreateWidget( 04007 "dialog" , xmRowColumnWidgetClass , prog->rowcol , 04008 XmNpacking , XmPACK_TIGHT , 04009 XmNorientation , XmHORIZONTAL , 04010 XmNspacing , 1 , 04011 XmNmarginHeight, 0 , 04012 XmNmarginWidth , 0 , 04013 XmNtraversalOn , False , 04014 XmNinitialResourcesPersistent , False , 04015 NULL ) ; 04016 04017 prog->button_help_pb = 04018 XtVaCreateManagedWidget( 04019 "dialog" , xmPushButtonWidgetClass , prog->rc_bot , 04020 LABEL_ARG("BHelp") , 04021 XmNtraversalOn , False , 04022 XmNinitialResourcesPersistent , False , 04023 NULL ) ; 04024 04025 XtAddCallback( prog->button_help_pb , XmNactivateCallback , 04026 MCW_click_help_CB , im3d ) ; 04027 04028 MCW_register_help( prog->button_help_pb , AFNI_help_help ) ; 04029 MCW_register_hint( prog->button_help_pb , "Gets more help for a button" ) ; 04030 04031 /*----- pushbutton: quit -----*/ 04032 04033 prog->quit_pb = 04034 XtVaCreateManagedWidget( 04035 "dialog" , xmPushButtonWidgetClass , prog->rc_bot , 04036 LABEL_ARG("done ") , 04037 XmNrecomputeSize , False , 04038 XmNtraversalOn , False , 04039 XmNinitialResourcesPersistent , False , 04040 XmNuserData , (XtPointer) im3d , 04041 NULL ) ; 04042 04043 MCW_set_widget_bg( prog->quit_pb , MCW_hotcolor(prog->quit_pb) , 0 ) ; 04044 04045 XtAddCallback( prog->quit_pb , XmNactivateCallback , 04046 AFNI_quit_CB , im3d ) ; 04047 04048 MCW_register_help( prog->quit_pb , AFNI_quit_help ) ; 04049 MCW_register_hint( prog->quit_pb , "Click twice to close window" ) ; 04050 04051 prog->quit_first = True ; /* mark this button as not pressed yet */ 04052 04053 /*----- manage the managers -----*/ 04054 04055 if( prog->rc_top != NULL ) XtManageChild( prog->rc_top ) ; 04056 XtManageChild( prog->rc_bot ) ; 04057 XtManageChild( prog->rowcol ) ; 04058 04059 /*----------------------------------------*/ 04060 /* for the overlapping panels, make the */ 04061 /* help callback raise them to the top */ 04062 /*----------------------------------------*/ 04063 04064 #if 0 04065 XtAddCallback( marks->rowcol , XmNhelpCallback , AFNI_raiseup_CB , NULL ) ; 04066 XtAddCallback( func->rowcol , XmNhelpCallback , AFNI_raiseup_CB , NULL ) ; 04067 XtAddCallback( dmode->rowcol , XmNhelpCallback , AFNI_raiseup_CB , NULL ) ; 04068 #endif 04069 04070 /*-------------------------------------------------------------*/ 04071 /*----- stuff here that goes below all else on popup menu -----*/ 04072 /*-------------------------------------------------------------*/ 04073 04074 (void) XtVaCreateManagedWidget( 04075 "dialog" , xmSeparatorWidgetClass , imag->popmenu , 04076 XmNseparatorType , XmDOUBLE_LINE , 04077 NULL ) ; 04078 04079 /*--- label for background pixel ---*/ 04080 04081 imag->pop_bkgd_lab = 04082 XtVaCreateWidget( 04083 "dialog" , xmLabelWidgetClass , imag->popmenu , 04084 LABEL_ARG(" bkgd =xxxxxx") , 04085 XmNalignment , XmALIGNMENT_BEGINNING , 04086 XmNrecomputeSize , True , 04087 XmNtraversalOn , False , 04088 XmNinitialResourcesPersistent , False , 04089 NULL ) ; 04090 04091 imag->do_bkgd_lab = False ; 04092 04093 /*----------------------------------------------*/ 04094 /************** make a picture ****************/ 04095 /*----------------------------------------------*/ 04096 04097 vwid->picture = NULL ; /* default ==> no picture */ 04098 vwid->picture_index = 0 ; 04099 04100 #ifdef WANT_LOGO_BITMAP 04101 if( im3d->type == AFNI_3DDATA_VIEW ){ 04102 vwid->picture = 04103 XtVaCreateManagedWidget( 04104 "dialog" , xmLabelWidgetClass , vwid->top_form , 04105 XmNtopAttachment , XmATTACH_WIDGET , 04106 XmNtopWidget , imag->frame , 04107 XmNtopOffset , 0 , 04108 XmNleftAttachment , XmATTACH_WIDGET , 04109 XmNleftWidget , prog->frame , 04110 XmNleftOffset , 0 , 04111 XmNlabelType , XmPIXMAP , 04112 XmNalignment , XmALIGNMENT_CENTER , 04113 XmNwidth , logo_width , 04114 XmNheight , logo_height , 04115 XmNmarginWidth , 0 , 04116 XmNmarginHeight , 0 , 04117 XmNrecomputeSize , False , 04118 XmNtraversalOn , False , 04119 XmNinitialResourcesPersistent , False , 04120 NULL ) ; 04121 MCW_register_help( vwid->picture , AFNI_abohelp ) ; 04122 } 04123 #else 04124 MCW_register_help( imag->rowcol , AFNI_abohelp ) ; 04125 MCW_register_help( view->rowcol , AFNI_abohelp ) ; 04126 MCW_register_help( marks->rowcol , AFNI_abohelp ) ; 04127 MCW_register_help( func->rowcol , AFNI_abohelp ) ; 04128 MCW_register_help( dmode->rowcol , AFNI_abohelp ) ; 04129 MCW_register_help( prog->rowcol , AFNI_abohelp ) ; 04130 #endif 04131 04132 /*** load icon, if desired and possible ***/ 04133 04134 #ifdef WANT_AFNI_BITMAP 04135 #ifndef DONT_INSTALL_ICONS 04136 if( afni48_pixmap != XmUNSPECIFIED_PIXMAP ){ 04137 Boolean good ; 04138 04139 good = MCW_check_iconsize( afni48_width,afni48_height , im3d->dc ) ; 04140 04141 if( good ){ 04142 XtVaSetValues( im3d->vwid->top_shell , 04143 XmNiconPixmap , afni48_pixmap , 04144 NULL ) ; 04145 afni48_good = 1 ; 04146 } 04147 } 04148 #endif 04149 #endif 04150 04151 /*---------------------------------------------------*/ 04152 /*********** hidden popup menu on picture ************/ 04153 /*---------------------------------------------------*/ 04154 04155 prog->hidden_menu = NULL ; 04156 04157 #ifdef USE_HIDDEN 04158 if( vwid->picture != NULL ){ 04159 04160 /** popup on picture widget (right of Quit button) **/ 04161 04162 #ifdef BAD_BUTTON3_POPUPS /* 21 Jul 2003 */ 04163 prog->hidden_menu = 04164 XmCreatePopupMenu( prog->quit_pb , "menu" , NULL , 0 ) ; 04165 #else 04166 prog->hidden_menu = 04167 XmCreatePopupMenu( vwid->picture , "menu" , NULL , 0 ) ; 04168 #endif 04169 04170 if( prog->hidden_menu != NULL ){ 04171 SAVEUNDERIZE(XtParent(prog->hidden_menu)) ; /* 27 Feb 2001 */ 04172 04173 VISIBILIZE_WHEN_MAPPED(prog->hidden_menu) ; 04174 04175 /*** 04176 XtAddCallback( prog->hidden_menu , 04177 XmNunmapCallback , AFNI_hidden_CB , im3d ) ; 04178 ***/ 04179 04180 /*** 04181 XtVaSetValues( prog->hidden_menu , 04182 XmNspacing , 1 , 04183 XmNmarginHeight , 0 , 04184 XmNmarginWidth , 0 , 04185 NULL ) ; 04186 ***/ 04187 04188 XtInsertEventHandler( vwid->picture , /* handle events in picture */ 04189 04190 0 04191 | ButtonPressMask /* button presses */ 04192 | KeyPressMask /* get keystrokes */ 04193 , 04194 FALSE , /* nonmaskable events? */ 04195 AFNI_hidden_EV , /* handler */ 04196 (XtPointer) im3d , /* client data */ 04197 XtListTail /* last in queue */ 04198 ) ; 04199 04200 #ifdef ALLOW_DATASET_VLIST 04201 /**--- pullright menu for points ---**/ 04202 04203 prog->hidden_pts_menu = 04204 XmCreatePulldownMenu( prog->hidden_menu , "menu" , NULL , 0 ) ; 04205 04206 VISIBILIZE_WHEN_MAPPED(prog->hidden_pts_menu) ; 04207 04208 /** cascade button to bring this menu up **/ 04209 04210 prog->hidden_pts_cbut = 04211 XtVaCreateManagedWidget( 04212 "dialog" , xmCascadeButtonWidgetClass , prog->hidden_menu , 04213 LABEL_ARG("Points List") , 04214 XmNsubMenuId , prog->hidden_pts_menu , 04215 XmNtraversalOn , False , 04216 XmNinitialResourcesPersistent , False , 04217 NULL ) ; 04218 04219 /** "Read Pts: IJK" button in pts menu **/ 04220 04221 prog->hidden_readpts_ijk_pb = 04222 XtVaCreateManagedWidget( 04223 "dialog" , xmPushButtonWidgetClass , prog->hidden_pts_menu , 04224 LABEL_ARG("Read Pts: IJK") , 04225 XmNmarginHeight , 0 , 04226 XmNtraversalOn , False , 04227 XmNinitialResourcesPersistent , False , 04228 NULL ) ; 04229 04230 XtAddCallback( prog->hidden_readpts_ijk_pb , XmNactivateCallback , 04231 AFNI_hidden_CB , im3d ) ; 04232 04233 /** "Read Pts: XYZ" button in pts menu **/ 04234 04235 prog->hidden_readpts_xyz_pb = 04236 XtVaCreateManagedWidget( 04237 "dialog" , xmPushButtonWidgetClass , prog->hidden_pts_menu , 04238 LABEL_ARG("Read Pts: XYZ") , 04239 XmNmarginHeight , 0 , 04240 XmNtraversalOn , False , 04241 XmNinitialResourcesPersistent , False , 04242 NULL ) ; 04243 04244 XtAddCallback( prog->hidden_readpts_xyz_pb , XmNactivateCallback , 04245 AFNI_hidden_CB , im3d ) ; 04246 04247 /** "Write Pts: IJK" button in pts menu **/ 04248 04249 prog->hidden_writepts_ijk_pb = 04250 XtVaCreateManagedWidget( 04251 "dialog" , xmPushButtonWidgetClass , prog->hidden_pts_menu , 04252 LABEL_ARG("Write Pts: IJK") , 04253 XmNmarginHeight , 0 , 04254 XmNtraversalOn , False , 04255 XmNinitialResourcesPersistent , False , 04256 NULL ) ; 04257 04258 XtAddCallback( prog->hidden_writepts_ijk_pb , XmNactivateCallback , 04259 AFNI_hidden_CB , im3d ) ; 04260 04261 /** "Write Pts: XYZ" button in pts menu **/ 04262 04263 prog->hidden_writepts_xyz_pb = 04264 XtVaCreateManagedWidget( 04265 "dialog" , xmPushButtonWidgetClass , prog->hidden_pts_menu , 04266 LABEL_ARG("Write Pts: XYZ") , 04267 XmNmarginHeight , 0 , 04268 XmNtraversalOn , False , 04269 XmNinitialResourcesPersistent , False , 04270 NULL ) ; 04271 04272 XtAddCallback( prog->hidden_writepts_xyz_pb , XmNactivateCallback , 04273 AFNI_hidden_CB , im3d ) ; 04274 04275 /** "Set Pts: COLOR" button in pts menu **/ 04276 04277 prog->hidden_colorpts_pb = 04278 XtVaCreateManagedWidget( 04279 "dialog" , xmPushButtonWidgetClass , prog->hidden_pts_menu , 04280 LABEL_ARG("Set Pts: COLOR") , 04281 XmNmarginHeight , 0 , 04282 XmNtraversalOn , False , 04283 XmNinitialResourcesPersistent , False , 04284 NULL ) ; 04285 04286 XtAddCallback( prog->hidden_colorpts_pb , XmNactivateCallback , 04287 AFNI_hidden_CB , im3d ) ; 04288 04289 /*---- END OF PTS STUFF ----*/ 04290 #endif 04291 04292 /*---- Various Poetry Options ----*/ 04293 04294 xstr = XmStringCreateLtoR( "---- Poetry ----" , XmFONTLIST_DEFAULT_TAG ) ; 04295 (void) XtVaCreateManagedWidget( 04296 "dialog" , xmLabelWidgetClass , prog->hidden_menu , 04297 XmNlabelString , xstr , 04298 XmNrecomputeSize , False , 04299 XmNinitialResourcesPersistent , False , 04300 NULL ) ; 04301 XmStringFree(xstr) ; 04302 04303 (void) XtVaCreateManagedWidget( 04304 "dialog" , xmSeparatorWidgetClass , prog->hidden_menu , 04305 XmNseparatorType , XmSINGLE_LINE , 04306 NULL ) ; 04307 04308 /*----------*/ 04309 04310 prog->hidden_mission_pb = 04311 XtVaCreateManagedWidget( 04312 "dialog" , xmPushButtonWidgetClass , prog->hidden_menu , 04313 LABEL_ARG("Mission Statement") , 04314 XmNmarginHeight , 0 , 04315 XmNtraversalOn , False , 04316 XmNinitialResourcesPersistent , False , 04317 NULL ) ; 04318 XtAddCallback( prog->hidden_mission_pb , XmNactivateCallback , 04319 AFNI_hidden_CB , im3d ) ; 04320 04321 /*----------*/ 04322 04323 #ifdef USE_SONNETS 04324 if( ! NO_frivolities ){ 04325 prog->hidden_sonnet_pb = 04326 XtVaCreateManagedWidget( 04327 "dialog" , xmPushButtonWidgetClass , prog->hidden_menu , 04328 LABEL_ARG("Shakespeare") , 04329 XmNmarginHeight , 0 , 04330 XmNtraversalOn , False , 04331 XmNinitialResourcesPersistent , False , 04332 NULL ) ; 04333 04334 XtAddCallback( prog->hidden_sonnet_pb , XmNactivateCallback , 04335 AFNI_sonnet_CB , im3d ) ; 04336 } 04337 #endif 04338 04339 /*----------*/ 04340 04341 prog->hidden_gamberi_pb = 04342 XtVaCreateManagedWidget( 04343 "dialog" , xmPushButtonWidgetClass , prog->hidden_menu , 04344 LABEL_ARG("Gamberi Cattivi") , 04345 XmNmarginHeight , 0 , 04346 XmNtraversalOn , False , 04347 XmNinitialResourcesPersistent , False , 04348 NULL ) ; 04349 XtAddCallback( prog->hidden_gamberi_pb , XmNactivateCallback , 04350 AFNI_hidden_CB , im3d ) ; 04351 04352 /*----------*/ 04353 04354 (void) XtVaCreateManagedWidget( 04355 "dialog" , xmSeparatorWidgetClass , prog->hidden_menu , 04356 XmNseparatorType , XmSINGLE_LINE , 04357 NULL ) ; 04358 04359 prog->hidden_ranpoem_pb = 04360 XtVaCreateManagedWidget( 04361 "dialog" , xmPushButtonWidgetClass , prog->hidden_menu , 04362 LABEL_ARG("Random Poem") , 04363 XmNmarginHeight , 0 , 04364 XmNtraversalOn , False , 04365 XmNinitialResourcesPersistent , False , 04366 NULL ) ; 04367 XtAddCallback( prog->hidden_ranpoem_pb , XmNactivateCallback , 04368 AFNI_hidden_CB , im3d ) ; 04369 04370 /*----------*/ 04371 04372 #if !defined(NO_FRIVOLITIES) 04373 prog->hidden_faces_pb = 04374 XtVaCreateManagedWidget( 04375 "dialog" , xmPushButtonWidgetClass , prog->hidden_menu , 04376 LABEL_ARG("All AFNI Faces") , 04377 XmNmarginHeight , 0 , 04378 XmNtraversalOn , False , 04379 XmNinitialResourcesPersistent , False , 04380 NULL ) ; 04381 XtAddCallback( prog->hidden_faces_pb , XmNactivateCallback , 04382 AFNI_hidden_CB , im3d ) ; 04383 #else 04384 prog->hidden_faces_pb = NULL ; 04385 #endif 04386 04387 prog->hidden_broutim_pb = /* 06 Jun 2005 */ 04388 XtVaCreateManagedWidget( 04389 "dialog" , xmPushButtonWidgetClass , prog->hidden_menu , 04390 LABEL_ARG("Brodmann Areas") , 04391 XmNmarginHeight , 0 , 04392 XmNtraversalOn , False , 04393 XmNinitialResourcesPersistent , False , 04394 NULL ) ; 04395 XtAddCallback( prog->hidden_broutim_pb , XmNactivateCallback , 04396 AFNI_broutim_CB , im3d ) ; 04397 04398 /*----------*/ 04399 04400 #if !defined(NO_FRIVOLITIES) && defined(DARWIN) 04401 (void) XtVaCreateManagedWidget( 04402 "dialog" , xmSeparatorWidgetClass , prog->hidden_menu , 04403 XmNseparatorType , XmSINGLE_LINE , 04404 NULL ) ; 04405 04406 prog->hidden_speech_pb = 04407 XtVaCreateManagedWidget( 04408 "dialog" , xmPushButtonWidgetClass , prog->hidden_menu , 04409 LABEL_ARG("Say Something") , 04410 XmNmarginHeight , 0 , 04411 XmNtraversalOn , False , 04412 XmNinitialResourcesPersistent , False , 04413 NULL ) ; 04414 XtAddCallback( prog->hidden_speech_pb , XmNactivateCallback , 04415 AFNI_hidden_CB , im3d ) ; 04416 #else 04417 prog->hidden_speech_pb = NULL ; 04418 #endif 04419 04420 /*----------*/ 04421 04422 #if !defined(NO_FRIVOLITIES) && defined(DARWIN) 04423 prog->hidden_browser_pb = 04424 XtVaCreateManagedWidget( 04425 "dialog" , xmPushButtonWidgetClass , prog->hidden_menu , 04426 LABEL_ARG("Web Browser") , 04427 XmNmarginHeight , 0 , 04428 XmNtraversalOn , False , 04429 XmNinitialResourcesPersistent , False , 04430 NULL ) ; 04431 XtAddCallback( prog->hidden_browser_pb , XmNactivateCallback , 04432 AFNI_hidden_CB , im3d ) ; 04433 #else 04434 prog->hidden_browser_pb = NULL ; 04435 #endif 04436 04437 } /* if prog->hidden_menu isn't NULL */ 04438 } 04439 #endif /* USE_HIDDEN */ 04440 04441 EXRETURN ; 04442 } 04443 04444 /*-------------------------------------------------------------------------- 04445 Find out how many controller windows are active at this instant 04446 ----------------------------------------------------------------------------*/ 04447 04448 int AFNI_count_controllers(void) 04449 { 04450 int ii , cnt ; 04451 04452 ENTRY("AFNI_count_controllers") ; 04453 04454 for( ii=0,cnt=0 ; ii < MAX_CONTROLLERS ; ii++ ) 04455 if( IM3D_OPEN(GLOBAL_library.controllers[ii]) ) cnt++ ; 04456 04457 RETURN(cnt) ; 04458 } 04459 04460 /*-------------------------------------------------------------------*/ 04461 /*! Find first open controller [05 Mar 2002]. 04462 ---------------------------------------------------------------------*/ 04463 04464 Three_D_View * AFNI_find_open_controller(void) 04465 { 04466 int ii ; 04467 for( ii=0 ; ii < MAX_CONTROLLERS ; ii++ ) 04468 if( IM3D_OPEN(GLOBAL_library.controllers[ii]) ) 04469 return GLOBAL_library.controllers[ii] ; 04470 04471 return NULL ; /* should be impossible */ 04472 } 04473 04474 /*-------------------------------------------------------------------*/ 04475 /*! Popup a message, somewhere, anywhere [05 Mar 2002]. 04476 ---------------------------------------------------------------------*/ 04477 04478 void AFNI_popup_message( char *str ) 04479 { 04480 Three_D_View *im3d ; 04481 if( str == NULL || str[0] == '\0' ) return ; 04482 im3d = AFNI_find_open_controller() ; 04483 (void) MCW_popup_message( im3d->vwid->prog->clone_pb , 04484 str, MCW_USER_KILL|MCW_TIMER_KILL ) ; 04485 return ; 04486 } 04487 04488 /*------------------------------------------------------------------- 04489 Find out which controller this is. Return -1 if there is an error. 04490 ---------------------------------------------------------------------*/ 04491 04492 int AFNI_controller_index( Three_D_View *im3d ) 04493 { 04494 int ii ; 04495 04496 ENTRY("AFNI_controller_index") ; 04497 04498 if( ! IM3D_VALID(im3d) ) RETURN(-1) ; 04499 04500 for( ii=0 ; ii < MAX_CONTROLLERS ; ii++ ) 04501 if( GLOBAL_library.controllers[ii] == im3d ) RETURN(ii) ; 04502 04503 RETURN(-1) ; 04504 } 04505 04506 /*--------------------------------------------------------------------------- 04507 Create and return a new controller for AFNI. 04508 Inputs: 04509 "shell" is a top level shell, to contain the entire widget hierarchy. 04510 If this shell is NULL, then the routine will create it. 04511 Normally, you would pass in the results of XtVaAppInitialize 04512 as the first controller's shell, and let the routine create 04513 any subsequent shells needed. 04514 "dc" must be created by MCW_new_DC before this routine. It contains 04515 all the information pertaining to the X11 display. 04516 "im3d_type" is one of AFNI_3DDATA_VIEW or AFNI_IMAGES_VIEW. The former 04517 is for viewing 3D datasets; the latter is a restricted version for 04518 viewing images only (mostly obsolete now -- use program aiv instead). 04519 -----------------------------------------------------------------------------*/ 04520 04521 Three_D_View * new_AFNI_controller( Widget shell , MCW_DC *dc , int im3d_type ) 04522 { 04523 Three_D_View *im3d ; 04524 int ii , last_color ; 04525 04526 ENTRY("new_AFNI_controller") ; 04527 04528 /*-- create the basic stuff --*/ 04529 04530 im3d = myXtNew(Three_D_View) ; INIT_KILL(im3d->kl) ; 04531 04532 im3d->vwid = myXtNew(AFNI_widget_set) ; ADDTO_KILL(im3d->kl,im3d->vwid) ; 04533 im3d->type = im3d_type ; 04534 im3d->opened = 0 ; /* not yet opened up */ 04535 im3d->dc = dc ; 04536 im3d->vinfo = myXtNew( AFNI_view_info ); ADDTO_KILL(im3d->kl,im3d->vinfo); 04537 04538 im3d->brand_new = 1 ; /* 07 Dec 2001 */ 04539 04540 /* 27 Jan 2004: mark if this currently looking at dummy dataset */ 04541 04542 im3d->dummied = GLOBAL_library.have_dummy_dataset ; 04543 04544 im3d->fimdata = myXtNew( AFNI_fimmer_type ); ADDTO_KILL(im3d->kl,im3d->fimdata); 04545 CLEAR_FIMDATA(im3d) ; 04546 04547 strcpy( im3d->window_title , "GPL AFNI" ) ; 04548 04549 if( shell != NULL ){ 04550 im3d->vwid->top_shell = shell ; 04551 } else { 04552 im3d->vwid->top_shell = XtVaAppCreateShell( 04553 "AFNI" , "AFNI" , 04554 topLevelShellWidgetClass , dc->display , 04555 XmNinitialResourcesPersistent , False , 04556 NULL ) ; 04557 } 04558 04559 DC_yokify( im3d->vwid->top_shell , dc ) ; 04560 04561 XtVaSetValues( im3d->vwid->top_shell , 04562 XmNtitle , im3d->window_title , 04563 XmNallowShellResize , True , /* let code resize shell */ 04564 XmNdeleteResponse , XmDO_NOTHING , /* deletion handled below */ 04565 NULL ) ; 04566 04567 XmAddWMProtocolCallback( /* make "Close" window menu work */ 04568 im3d->vwid->top_shell , 04569 XmInternAtom( dc->display , "WM_DELETE_WINDOW" , False ) , 04570 AFNI_quit_CB , im3d ) ; 04571 04572 if( MCW_isitmwm( im3d->vwid->top_shell ) ) 04573 XtVaSetValues( im3d->vwid->top_shell , 04574 XmNmwmDecorations , 04575 MWM_DECOR_ALL | MWM_DECOR_RESIZEH | MWM_DECOR_MAXIMIZE , 04576 NULL ) ; 04577 04578 /*----- null out datasets -----*/ 04579 04580 for( ii=0 ; ii <= LAST_VIEW_TYPE ; ii++ ){ 04581 im3d->anat_dset[ii] = im3d->fim_dset[ii] = NULL ; |
|
compute height of widgets in the view-> column * Definition at line 4585 of file afni_widg.c. References AFNI_IGNORE_NOTHING, DATAXES_TYPE, DEFAULT_FIM_SCALE, DRAWING_LINES, GLOBAL_argopt, INIT_crosshair_color, INIT_crosshair_gap, INIT_montage_periodic, INIT_resam_anat, INIT_resam_func, INIT_resam_thr, INIT_resam_vox, last_color, UNDERLAY_ANAT, and VIEW_ORIGINAL_TYPE. Referenced by AFNI_make_widgets().
04630 : receive stuff, including drawing */ 04631 /* Mar 1999: modified to allow for multiple receivers */ 04632 04633 im3d->vinfo->receiver = AFMALL( AFNI_receiver*, 04634 sizeof(AFNI_receiver *)); 04635 im3d->vinfo->receiver[0] = NULL ; 04636 im3d->vinfo->num_receiver = 0 ; 04637 im3d->vinfo->drawing_enabled = 0 ; 04638 im3d->vinfo->drawing_mode = DRAWING_LINES ; 04639 im3d->vinfo->drawing_pixel = 0 ; 04640 04641 /** July 1996: set up the montage crosshair stuff **/ 04642 04643 LOAD_IVEC3(im3d->vinfo->xhairs_ndown,0,0,0) ; 04644 LOAD_IVEC3(im3d->vinfo->xhairs_nup ,0,0,0) ; 04645 LOAD_IVEC3(im3d->vinfo->xhairs_nskip,0,0,0) ; 04646 im3d->vinfo->xhairs_show_montage = True ; 04647 im3d->vinfo->xhairs_periodic = INIT_montage_periodic ; 04648 im3d->vinfo->xhairs_all = False ; 04649 04650 /** June 1996: stuff for interactive FIM **/ 04651 04652 im3d->s123 = im3d->s231 = im3d->s312 = NULL ; /* no viewing windows yet */ 04653 im3d->g123 = im3d->g231 = im3d->g312 = NULL ; /* no graphing windows yet */ 04654 04655 im3d->b123_anat = im3d->b231_anat = im3d->b312_anat = /* created later */ 04656 im3d->b123_fim = im3d->b231_fim = im3d->b312_fim = 04657 im3d->b123_ulay = im3d->b231_ulay = im3d->b312_ulay = NULL ; 04658 04659 im3d->ignore_seq_callbacks = AFNI_IGNORE_NOTHING ; /* don't ignore these now */ 04660 04661 /* set up which datasets to deal with (defaults) */ 04662 04663 im3d->vinfo->sess_num = 0 ; /* 1st session */ 04664 im3d->vinfo->anat_num = 0 ; /* 1st anatomy */ 04665 im3d->vinfo->func_num = 0 ; /* 1st function */ 04666 04667 AFNI_make_widgets( im3d ) ; /* rest of the widgets */ 04668 04669 /* 02 Nov 1996: create daxes and voxwarp spaces for viewing */ 04670 04671 im3d->wod_daxes = myXtNew(THD_dataxes) ; 04672 im3d->wod_daxes->type = DATAXES_TYPE ; 04673 04674 im3d->anat_voxwarp = myXtNew(THD_warp) ; 04675 im3d->anat_voxwarp->type = ILLEGAL_TYPE ; 04676 04677 im3d->fim_voxwarp = myXtNew(THD_warp) ; 04678 im3d->fim_voxwarp->type = ILLEGAL_TYPE ; 04679 04680 im3d->fim_selfwarp = NULL ; /* 27 Aug 2002 */ 04681 04682 RETURN(im3d) ; 04683 } 04684 04685 /*---------------------------------------------------------------*/ 04686 04687 static float DSET_bigness( THD_3dim_dataset *dset ) /* 07 Dec 2001 */ 04688 { 04689 float bb ; 04690 04691 if( !DSET_ONDISK(dset) ) return -1 ; 04692 04693 bb = DSET_NVOX(dset) 04694 * DSET_NVALS(dset) 04695 * mri_datum_size(DSET_BRICK_TYPE(dset,0)) ; 04696 04697 if( DSET_COMPRESSED(dset) || DSET_IS_MINC(dset) ) bb *= 1.5 ; 04698 04699 return bb ; 04700 } 04701 04702 /*--------------------------------------------------------------- 04703 Set up the controller with some data to view! 04704 -----------------------------------------------------------------*/ 04705 04706 void AFNI_initialize_controller( Three_D_View * im3d ) 04707 { 04708 int ii ; 04709 char ttl[16] ; 04710 04711 ENTRY("AFNI_initialize_controller") ; 04712 04713 /*--- check for various criminal behavior; 04714 the sentence for anything illegal is death ---*/ 04715 04716 if( ! IM3D_VALID(im3d) ){ 04717 fprintf(stderr, 04718 "\n*** AFNI_initialize_controller: invalid input ***\n") ; 04719 EXIT(1) ; 04720 } 04721 04722 if( GLOBAL_library.sslist == NULL ){ /* any data to use? */ 04723 fprintf(stderr, 04724 "\n*** AFNI_initialize_controller: no sessions to view ***\n") ; 04725 EXIT(1) ; 04726 } 04727 04728 im3d->ss_now = GLOBAL_library.sslist->ssar[ im3d->vinfo->sess_num ] ; 04729 04730 if( im3d->ss_now == NULL ){ /* bad choice of initial session! */ 04731 04732 im3d->vinfo->sess_num = 0 ; /* reset 1st session */ 04733 im3d->vinfo->anat_num = 0 ; /* reset 1st anatomy */ 04734 im3d->vinfo->func_num = 0 ; /* reset 1st function */ 04735 04736 im3d->ss_now = GLOBAL_library.sslist->ssar[ im3d->vinfo->sess_num ] ; 04737 04738 if( im3d->ss_now == NULL ){ /* still no data? */ 04739 fprintf(stderr, 04740 "\n*** AFNI_initialize_controller: illegal initial session ***\n") ; 04741 EXIT(1) ; 04742 } 04743 } 04744 04745 /* 07 Dec 2001: find "smallest" datasets */ 04746 04747 if( im3d->brand_new && AFNI_yesenv("AFNI_START_SMALL") ){ 04748 int jj,jb=0,qb ; float bb,mm ; 04749 for( mm=1.e+33,jb=jj=0 ; jj < im3d->ss_now->num_dsset ; jj++ ){ 04750 if( ISANAT(im3d->ss_now->dsset[jj][0]) ){ 04751 bb = DSET_bigness(im3d->ss_now->dsset[jj][0]) ; 04752 if( bb > 0 && bb < mm ){ mm = bb; jb = jj; } 04753 } 04754 } 04755 if( mm < 1.e+33 ) im3d->vinfo->anat_num = qb = jb ; 04756 04757 for( mm=1.e+33,jb=jj=0 ; jj < im3d->ss_now->num_dsset ; jj++ ){ 04758 if( ISFUNC(im3d->ss_now->dsset[jj][0]) ){ 04759 bb = DSET_bigness(im3d->ss_now->dsset[jj][0]) ; 04760 if( jj != qb && bb > 0 && bb < mm ){ mm = bb; jb = jj; } 04761 } 04762 } 04763 if( mm < 1.e+33 ) im3d->vinfo->func_num = jb ; 04764 04765 } else if( im3d->brand_new ){ /* 29 Jul 2003 */ 04766 int jj ; 04767 for( jj=0 ; jj < im3d->ss_now->num_dsset ; jj++ ) 04768 if( ISANAT(im3d->ss_now->dsset[jj][0]) ) break ; 04769 if( jj < im3d->ss_now->num_dsset ) im3d->vinfo->anat_num = jj ; 04770 04771 for( jj=0 ; jj < im3d->ss_now->num_dsset ; jj++ ) 04772 if( ISFUNC(im3d->ss_now->dsset[jj][0]) ) break ; 04773 if( jj < im3d->ss_now->num_dsset ) im3d->vinfo->func_num = jj ; 04774 } 04775 04776 /* copy pointers from this session into the controller for fast access */ 04777 04778 for( ii=0 ; ii <= LAST_VIEW_TYPE ; ii++ ) 04779 im3d->anat_dset[ii] = im3d->ss_now->dsset[im3d->vinfo->anat_num][ii] ; 04780 04781 /*--- 11/23/94 addition: scan for a good view in the 04782 initial setup (to allow for input of datasets w/o +orig view) */ 04783 04784 for( ii=0 ; ii <= LAST_VIEW_TYPE ; ii++ ) 04785 if( ISVALID_3DIM_DATASET(im3d->anat_dset[ii]) ) break ; 04786 04787 if( ii > LAST_VIEW_TYPE ){ 04788 fprintf(stderr,"\n*** AFNI_initialize_controller: cannot initialize view ***\n") ; 04789 EXIT(1) ; 04790 } 04791 im3d->vinfo->view_type = ii ; /* first view with a good anat */ 04792 04793 /* now find a function that can be viewed here */ 04794 04795 if( !ISVALID_3DIM_DATASET(im3d->ss_now->dsset[im3d->vinfo->func_num][ii]) ){ 04796 for( ii=0 ; ii < im3d->ss_now->num_dsset ; ii++ ) 04797 if(ISVALID_3DIM_DATASET(im3d->ss_now->dsset[ii][im3d->vinfo->view_type])){ 04798 im3d->vinfo->func_num = ii ; break ; 04799 } 04800 } 04801 04802 for( ii=0 ; ii <= LAST_VIEW_TYPE ; ii++ ) 04803 im3d->fim_dset[ii] = im3d->ss_now->dsset[im3d->vinfo->func_num][ii] ; 04804 04805 /*--- 11/23/94 addition end */ 04806 04807 im3d->anat_now = im3d->anat_dset[im3d->vinfo->view_type] ; /* will not be NULL */ 04808 im3d->fim_now = im3d->fim_dset [im3d->vinfo->view_type] ; /* this may be NULL */ 04809 04810 /* initial point of view = middle of dataset brick */ 04811 04812 im3d->vinfo->i1 = im3d->anat_now->daxes->nxx / 2 ; /* integer indexes */ 04813 im3d->vinfo->j2 = im3d->anat_now->daxes->nyy / 2 ; 04814 im3d->vinfo->k3 = im3d->anat_now->daxes->nzz / 2 ; 04815 SAVE_VPT(im3d) ; 04816 04817 if( im3d->type == AFNI_3DDATA_VIEW ){ /* compute float coordinates, too */ 04818 THD_fvec3 fv ; 04819 04820 im3d->anat_now->wod_flag = 0 ; /* 02 Nov 1996 */ 04821 04822 fv = THD_3dind_to_3dmm( im3d->anat_now , 04823 TEMP_IVEC3( im3d->vinfo->i1 , 04824 im3d->vinfo->j2 , 04825 im3d->vinfo->k3 ) ) ; 04826 04827 fv = THD_3dmm_to_dicomm( im3d->anat_now , fv ) ; 04828 04829 im3d->vinfo->xi = fv.xyz[0] ; /* set display coords */ 04830 im3d->vinfo->yj = fv.xyz[1] ; /* to Dicom standard */ 04831 im3d->vinfo->zk = fv.xyz[2] ; 04832 04833 } else { 04834 im3d->vinfo->xi = im3d->vinfo->i1 ; /* probably never used */ 04835 im3d->vinfo->yj = im3d->vinfo->j2 ; 04836 im3d->vinfo->zk = im3d->vinfo->k3 ; 04837 } 04838 04839 /** set various widgets and values **/ 04840 04841 MCW_set_bbox( im3d->vwid->view->view_bbox , 1 << im3d->vinfo->view_type ) ; 04842 MCW_set_bbox( im3d->vwid->view->see_func_bbox , (im3d->vinfo->func_visible) ? 1 : 0 ) ; 04843 04844 LOAD_IVEC3(im3d->vinfo->xhairs_ndown,0,0,0) ; 04845 LOAD_IVEC3(im3d->vinfo->xhairs_nup ,0,0,0) ; 04846 LOAD_IVEC3(im3d->vinfo->xhairs_nskip,0,0,0) ; 04847 im3d->vinfo->xhairs_periodic = INIT_montage_periodic ; 04848 MCW_set_bbox( im3d->vwid->imag->wrap_bbox , im3d->vinfo->xhairs_periodic ? 1 : 0 ) ; 04849 MCW_set_bbox( im3d->vwid->imag->xhall_bbox , im3d->vinfo->xhairs_all ? 1 : 0 ) ; 04850 04851 CLEAR_FIMDATA(im3d) ; 04852 04853 sprintf(ttl , "%sAFNI" , AFNI_controller_label(im3d) ) ; 04854 XtVaSetValues( im3d->vwid->top_shell , XmNiconName , ttl , NULL ) ; 04855 04856 /* 06 Dec 2001: cool cursor stuff */ 04857 04858 WAIT_for_window( im3d->vwid->top_shell ) ; 04859 04860 POPUP_cursorize( im3d->vwid->func->inten_label ) ; 04861 POPUP_cursorize( im3d->vwid->picture ) ; 04862 POPUP_cursorize( imag->crosshair_label ) ; 04863 04864 RESET_AFNI_QUIT(im3d) ; 04865 EXRETURN ; 04866 } 04867 04868 /*--------------------------------------------------------------------------- 04869 23 Sep 2000: A hack to allow the creation of a specific controller, 04870 instead of letting AFNI_clone_controller_CB choose the index. 04871 -----------------------------------------------------------------------------*/ 04872 04873 static int cii_override = -1 ; 04874 04875 void AFNI_make_controller( int cii ) 04876 { 04877 int ii ; 04878 04879 ENTRY("AFNI_make_controller") ; 04880 04881 if( cii < 0 || cii >= MAX_CONTROLLERS || 04882 IM3D_VALID(GLOBAL_library.controllers[cii]) ) EXRETURN ; 04883 04884 cii_override = cii ; 04885 AFNI_clone_controller_CB( GLOBAL_library.controllers[0]->vwid->prog->clone_pb , 04886 GLOBAL_library.controllers[0] , NULL ) ; 04887 04888 cii_override = -1 ; 04889 EXRETURN ; 04890 } 04891 04892 /*---------------------------------------------------------------------------*/ 04893 04894 void AFNI_clone_controller_CB( Widget wcall , XtPointer cd , XtPointer cbs ) 04895 { 04896 int ii , xx , yy ; 04897 Three_D_View * im3d ; 04898 Three_D_View * caller_im3d = (Three_D_View *) cd ; 04899 MCW_DC * new_dc , * old_dc ; 04900 04901 ENTRY("AFNI_clone_controller_CB") ; 04902 04903 ii = AFNI_count_controllers() ; 04904 if( ii >= MAX_CONTROLLERS ) EXRETURN ; 04905 04906 SHOW_AFNI_PAUSE ; 04907 04908 /** 23 Sep 2000: if cii_override is set, use that for 04909 the index of the controller to create **/ 04910 04911 if( cii_override < 0 ){ 04912 /** look for a previously opened but now closed controller **/ 04913 04914 for( ii=0 ; ii < MAX_CONTROLLERS ; ii++ ){ 04915 im3d = GLOBAL_library.controllers[ii] ; 04916 if( IM3D_VALID(im3d) && ! im3d->opened ) break ; /* found it */ 04917 } 04918 } else { 04919 ii = MAX_CONTROLLERS ; /* skip this step */ 04920 } 04921 04922 if( ii >= MAX_CONTROLLERS ){ /* look for an empty one to create */ 04923 04924 if( cii_override < 0 ){ 04925 for( ii=0 ; ii < MAX_CONTROLLERS ; ii++ ){ 04926 im3d = GLOBAL_library.controllers[ii] ; 04927 if( im3d == NULL ) break ; 04928 } 04929 } else { 04930 ii = cii_override ; 04931 } 04932 if( ii >= MAX_CONTROLLERS ){ /* something funny has happened! */ 04933 SHOW_AFNI_READY ; EXRETURN ; 04934 } 04935 04936 /* 06 Nov 1996: allow creation of unique dc's for each controller */ 04937 04938 new_dc = NULL ; 04939 old_dc = GLOBAL_library.dc ; 04940 if( GLOBAL_argopt.unique_dcs ) 04941 new_dc = MCW_new_DC( wcall , GLOBAL_argopt.ncolor , 04942 INIT_ncolovr , INIT_colovr , INIT_labovr , 04943 GLOBAL_argopt.gamma , 0 ) ; 04944 04945 if( new_dc == NULL ) new_dc = old_dc ; 04946 04947 GLOBAL_library.controllers[ii] = 04948 new_AFNI_controller( NULL , new_dc , AFNI_3DDATA_VIEW ) ; 04949 04950 if( caller_im3d != NULL ){ 04951 MCW_widget_geom( caller_im3d->vwid->top_shell , NULL,NULL , &xx,&yy ) ; 04952 xx += 15 ; yy += 15 ; 04953 XtVaSetValues( GLOBAL_library.controllers[ii]->vwid->top_shell , 04954 XmNx , xx , XmNy , yy , NULL ) ; 04955 } 04956 } 04957 04958 /** at this point, ii = index of a controller to use **/ 04959 04960 im3d = GLOBAL_library.controllers[ii] ; 04961 04962 OPEN_CONTROLLER( im3d ) ; 04963 AFNI_initialize_controller( im3d ) ; /* decide what to see */ 04964 AFNI_initialize_view( NULL , im3d ) ; /* set up to see it */ 04965 04966 AFNI_controller_clonify() ; 04967 04968 SHOW_AFNI_READY ; EXRETURN ; 04969 } 04970 04971 /*----------------------------------------------------------------------- 04972 Called to determine if the "New" button should be active 04973 -------------------------------------------------------------------------*/ 04974 04975 void AFNI_controller_clonify(void) 04976 { 04977 Three_D_View * im3d ; 04978 int id ; 04979 Boolean clone_on ; 04980 04981 ENTRY("AFNI_controller_clonify") ; 04982 04983 if( MAX_CONTROLLERS == 1 ) EXRETURN ; 04984 04985 clone_on = (Boolean)( AFNI_count_controllers() < MAX_CONTROLLERS ) ; 04986 04987 for( id=0 ; id < MAX_CONTROLLERS ; id++ ){ 04988 im3d = GLOBAL_library.controllers[id] ; 04989 if( IM3D_OPEN(im3d) && im3d->vwid->prog->clone_pb != NULL ){ 04990 SENSITIZE( im3d->vwid->prog->clone_pb , clone_on ) ; 04991 RESET_AFNI_QUIT(im3d) ; 04992 } 04993 } 04994 04995 EXRETURN ; 04996 } 04997 04998 /*------------------------------------------------------------------------- 04999 04 Nov 1996: make a menubar to control the coordinate locking 05000 of the various controller windows 05001 ---------------------------------------------------------------------------*/ 05002 05003 void AFNI_lock_button( Three_D_View * im3d ) 05004 { 05005 Widget rc , mbar , menu , cbut , wpar ; 05006 XmString xstr ; 05007 05008 static char * clabel[] = { 05009 "Lock [A]", "Lock [B]", "Lock [C]", "Lock [D]", "Lock [E]", 05010 "Lock [F]", "Lock [G]", "Lock [H]", "Lock [I]", "Lock [J]", 05011 "Lock [K]", "Lock [L]", "Lock [M]", "Lock [N]", "Lock [O]", 05012 "Lock [P]", "Lock [Q]", "Lock [R]", "Lock [S]", "Lock [T]", 05013 "Lock [U]", "Lock [V]", "Lock [W]", "Lock [X]", "Lock [Y]", "Lock [Z]" } ; 05014 05015 static char * tlabel[] = { "Time Lock" } ; 05016 05017 static char * ijklabel[] = { "IJK lock" } ; 05018 05019 ENTRY("AFNI_lock_button") ; 05020 05021 wpar = im3d->vwid->dmode->mbar_rowcol ; 05022 05023 rc = XtVaCreateWidget( 05024 "dialog" , xmRowColumnWidgetClass , wpar , 05025 XmNorientation , XmHORIZONTAL , 05026 XmNpacking , XmPACK_TIGHT , 05027 XmNtraversalOn , False , 05028 XmNinitialResourcesPersistent , False , 05029 NULL ) ; 05030 05031 mbar = XmCreateMenuBar( rc , "dialog" , NULL,0 ) ; 05032 XtVaSetValues( mbar , 05033 XmNmarginWidth , 0 , 05034 XmNmarginHeight , 0 , 05035 XmNspacing , 3 , 05036 XmNborderWidth , 0 , 05037 XmNborderColor , 0 , 05038 XmNtraversalOn , False , 05039 XmNbackground , im3d->dc->ovc->pixov_brightest , 05040 NULL ) ; 05041 XtManageChild( mbar ) ; 05042 05043 menu = XmCreatePulldownMenu( mbar , "menu" , NULL,0 ) ; 05044 05045 VISIBILIZE_WHEN_MAPPED(menu) ; 05046 05047 xstr = XmStringCreateLtoR( "Lock" , XmFONTLIST_DEFAULT_TAG ) ; 05048 cbut = XtVaCreateManagedWidget( 05049 "dialog" , xmCascadeButtonWidgetClass , mbar , 05050 XmNlabelString , xstr , 05051 XmNsubMenuId , menu , 05052 XmNmarginWidth , 0 , 05053 XmNmarginHeight , 0 , 05054 XmNmarginBottom , 0 , 05055 XmNmarginTop , 0 , 05056 XmNmarginRight , 0 , 05057 XmNmarginLeft , 0 , 05058 XmNtraversalOn , False , 05059 XmNinitialResourcesPersistent , False , 05060 NULL ) ; 05061 XmStringFree( xstr ) ; 05062 05063 MCW_register_help( cbut , "Pressing this drops down\n" 05064 "the menu of controllers\n" 05065 "which should be 'locked'\n" 05066 "together in their viewpoint\n" 05067 "coordinates.\n" 05068 "N.B.: The lock will only take\n" 05069 " effect when you next move\n" 05070 " the crosshairs, or click\n" 05071 " on the 'Enforce' button." 05072 ) ; 05073 MCW_register_hint( cbut , "Lock AFNI controller viewpoints" ) ; 05074 05075 /*** top of menu = a label to click on that does nothing at all ***/ 05076 05077 xstr = XmStringCreateLtoR( "-- Cancel --" , XmFONTLIST_DEFAULT_TAG ) ; 05078 (void) XtVaCreateManagedWidget( 05079 "dialog" , xmLabelWidgetClass , menu , 05080 XmNlabelString , xstr , 05081 XmNrecomputeSize , False , 05082 XmNinitialResourcesPersistent , False , 05083 NULL ) ; 05084 XmStringFree(xstr) ; 05085 05086 (void) XtVaCreateManagedWidget( 05087 "dialog" , xmSeparatorWidgetClass , menu , 05088 XmNseparatorType , XmSINGLE_LINE , 05089 NULL ) ; 05090 05091 /*** button box to select locks ***/ 05092 05093 dmode->lock_bbox = new_MCW_bbox( menu , 05094 MAX_CONTROLLERS , clabel , 05095 MCW_BB_check , MCW_BB_noframe , 05096 AFNI_lock_change_CB , (XtPointer)im3d ) ; 05097 05098 MCW_set_bbox( dmode->lock_bbox , GLOBAL_library.controller_lock ) ; 05099 05100 MCW_reghint_children( dmode->lock_bbox->wrowcol , 05101 "Which ones are locked together?" ) ; 05102 05103 /*** button box to control the time lock ***/ 05104 05105 (void) XtVaCreateManagedWidget( 05106 "dialog" , xmSeparatorWidgetClass , menu , 05107 XmNseparatorType , XmSINGLE_LINE , 05108 NULL ) ; 05109 05110 dmode->time_lock_bbox = new_MCW_bbox( menu , 05111 1 , tlabel , 05112 MCW_BB_check , MCW_BB_noframe , 05113 AFNI_time_lock_change_CB , (XtPointer)im3d ) ; 05114 05115 MCW_set_bbox( dmode->time_lock_bbox , GLOBAL_library.time_lock ) ; 05116 05117 MCW_reghint_children( dmode->time_lock_bbox->wrowcol , 05118 "Lock time index as well?" ) ; 05119 05120 dmode->ijk_lock_bbox = new_MCW_bbox( menu , 05121 1 , ijklabel , 05122 MCW_BB_check , MCW_BB_noframe , 05123 AFNI_ijk_lock_change_CB , (XtPointer)im3d ) ; 05124 05125 MCW_set_bbox( dmode->ijk_lock_bbox , GLOBAL_library.ijk_lock ) ; 05126 05127 MCW_reghint_children( dmode->ijk_lock_bbox->wrowcol , 05128 "Lock using voxel indices?" ) ; 05129 05130 /*** pushbuttons ***/ 05131 05132 (void) XtVaCreateManagedWidget( 05133 "dialog" , xmSeparatorWidgetClass , menu , 05134 XmNseparatorType , XmSINGLE_LINE , 05135 NULL ) ; 05136 05137 /*** to clear all locks right now ***/ 05138 05139 xstr = XmStringCreateLtoR( "Clear All" , XmFONTLIST_DEFAULT_TAG ) ; 05140 dmode->lock_clear_pb = 05141 XtVaCreateManagedWidget( 05142 "dialog" , xmPushButtonWidgetClass , menu , 05143 XmNlabelString , xstr , 05144 XmNmarginHeight , 0 , 05145 XmNtraversalOn , False , 05146 XmNinitialResourcesPersistent , False , 05147 NULL ) ; 05148 XtAddCallback( dmode->lock_clear_pb , XmNactivateCallback , 05149 AFNI_lock_clear_CB , (XtPointer)im3d ) ; 05150 XmStringFree(xstr) ; 05151 MCW_register_hint( dmode->lock_clear_pb , "Clear all locked controllers" ) ; 05152 05153 /*** to set all locks right now [19 Apr 1999] ***/ 05154 05155 xstr = XmStringCreateLtoR( "Set All" , XmFONTLIST_DEFAULT_TAG ) ; 05156 dmode->lock_setall_pb = 05157 XtVaCreateManagedWidget( 05158 "dialog" , xmPushButtonWidgetClass , menu , 05159 XmNlabelString , xstr , 05160 XmNmarginHeight , 0 , 05161 XmNtraversalOn , False , 05162 XmNinitialResourcesPersistent , False , 05163 NULL ) ; 05164 XtAddCallback( dmode->lock_setall_pb , XmNactivateCallback , 05165 AFNI_lock_setall_CB , (XtPointer)im3d ) ; 05166 XmStringFree(xstr) ; 05167 MCW_register_hint( dmode->lock_setall_pb , "Set all locked controllers" ) ; 05168 05169 /*** to enforce locks right now ***/ 05170 05171 xstr = XmStringCreateLtoR( "Enforce" , XmFONTLIST_DEFAULT_TAG ) ; 05172 dmode->lock_enforce_pb = 05173 XtVaCreateManagedWidget( 05174 "dialog" , xmPushButtonWidgetClass , menu , 05175 XmNlabelString , xstr , 05176 XmNmarginHeight , 0 , 05177 XmNtraversalOn , False , 05178 XmNinitialResourcesPersistent , False , 05179 NULL ) ; 05180 XtAddCallback( dmode->lock_enforce_pb , XmNactivateCallback , 05181 AFNI_lock_enforce_CB , (XtPointer)im3d ) ; 05182 XmStringFree(xstr) ; 05183 MCW_register_hint( dmode->lock_enforce_pb , "Make lock work NOW" ) ; 05184 05185 XtManageChild( rc ) ; 05186 EXRETURN ; 05187 } 05188 05189 /*--------------------------------------------------------------------- 05190 30 Oct 1997: make a menubar for miscellaneous options 05191 -----------------------------------------------------------------------*/ 05192 05193 void AFNI_misc_button( Three_D_View * im3d ) 05194 { 05195 Widget rc , mbar , menu , cbut , wpar ; 05196 XmString xstr ; 05197 05198 ENTRY("AFNI_misc_button") ; 05199 05200 wpar = im3d->vwid->dmode->mbar_rowcol ; 05201 05202 rc = XtVaCreateWidget( 05203 "dialog" , xmRowColumnWidgetClass , wpar , 05204 XmNorientation , XmHORIZONTAL , 05205 XmNpacking , XmPACK_TIGHT , 05206 XmNtraversalOn , False , 05207 XmNinitialResourcesPersistent , False , 05208 NULL ) ; 05209 05210 mbar = XmCreateMenuBar( rc , "dialog" , NULL,0 ) ; 05211 XtVaSetValues( mbar , 05212 XmNmarginWidth , 0 , 05213 XmNmarginHeight , 0 , 05214 XmNspacing , 3 , 05215 XmNborderWidth , 0 , 05216 XmNborderColor , 0 , 05217 XmNtraversalOn , False , 05218 XmNbackground , im3d->dc->ovc->pixov_brightest , 05219 NULL ) ; 05220 XtManageChild( mbar ) ; 05221 05222 menu = XmCreatePulldownMenu( mbar , "menu" , NULL,0 ) ; 05223 05224 VISIBILIZE_WHEN_MAPPED(menu) ; 05225 05226 xstr = XmStringCreateLtoR( "Misc" , XmFONTLIST_DEFAULT_TAG ) ; 05227 cbut = XtVaCreateManagedWidget( 05228 "dialog" , xmCascadeButtonWidgetClass , mbar , 05229 XmNlabelString , xstr , 05230 XmNsubMenuId , menu , 05231 XmNmarginWidth , 0 , 05232 XmNmarginHeight , 0 , 05233 XmNmarginBottom , 0 , 05234 XmNmarginTop , 0 , 05235 XmNmarginRight , 0 , 05236 XmNmarginLeft , 0 , 05237 XmNtraversalOn , False , 05238 XmNinitialResourcesPersistent , False , 05239 NULL ) ; 05240 XmStringFree( xstr ) ; 05241 05242 MCW_register_help( cbut , "Pressing this drops down the menu\n" 05243 "of miscellaneous options:\n" 05244 #ifdef USE_WRITEOWNSIZE 05245 " Write=Own size? = Write dataset using current\n" 05246 " anat dimensions, or using\n" 05247 " size of dataset in its own\n" 05248 " .HEAD file.\n" 05249 #endif 05250 " Voxel Coords? = Show crosshair location\n" 05251 " in mm or voxel indexes\n" 05252 #ifndef DONT_USE_HINTS 05253 " Show Hints? = Turn popup hints\n" 05254 " off or on\n" 05255 #endif 05256 " ULay Info = Show 3dinfo output\n" 05257 " OLay Info = for current datasets\n" 05258 #ifdef ALLOW_PLUGINS 05259 " Edit Environment = Control environment vars\n" 05260 " Edit 2DChain = Control 2DChain function\n" 05261 #endif 05262 " Save Layout = Save windows layout/setup\n" 05263 " Run Script = Run an AFNI script file\n" 05264 " License Info = GPL & Copyright notice\n" 05265 " Version Check = Check AFNI version\n" 05266 " Purge Memory = Of dataset BRIKs\n" 05267 #ifdef USE_TRACING 05268 " Trace=MODE = Set trace mode to\n" 05269 " next legal setting\n" 05270 #endif 05271 #ifdef USING_MCW_MALLOC 05272 " Malloc Summary = Show memory usage\n" 05273 " Dump Malloc Table = Memory usage to a file" 05274 #endif 05275 ) ; 05276 MCW_register_hint( cbut , "Miscellaneous options" ) ; 05277 05278 /*** top of menu = a label to click on that does nothing at all ***/ 05279 05280 xstr = XmStringCreateLtoR( "-- Cancel --" , XmFONTLIST_DEFAULT_TAG ) ; 05281 (void) XtVaCreateManagedWidget( 05282 "dialog" , xmLabelWidgetClass , menu , 05283 XmNlabelString , xstr , 05284 XmNrecomputeSize , False , 05285 XmNinitialResourcesPersistent , False , 05286 NULL ) ; 05287 XmStringFree(xstr) ; 05288 05289 (void) XtVaCreateManagedWidget( 05290 "dialog" , xmSeparatorWidgetClass , menu , 05291 XmNseparatorType , XmSINGLE_LINE , 05292 NULL ) ; 05293 05294 #ifdef USE_WRITEOWNSIZE 05295 /*-- 01 Aug 1999: Toggle for Write dimensions --*/ 05296 05297 { char * blab[1] = { "Write=Own Size?" } ; 05298 dmode->misc_writeownsize_bbox = new_MCW_bbox( menu , 05299 1 , blab , 05300 MCW_BB_check , MCW_BB_noframe , 05301 AFNI_misc_CB , (XtPointer)im3d ) ; 05302 dmode->misc_writeownsize_pb = dmode->misc_writeownsize_bbox->wbut[0] ; 05303 } 05304 MCW_register_hint( dmode->misc_writeownsize_pb , "Controls dimensions using Write" ) ; 05305 #else 05306 dmode->misc_writeownsize_pb = NULL ; 05307 #endif 05308 05309 /*-- pushbutton for voxel index toggle --*/ 05310 05311 /* 01 Aug 1999: replace pushbutton with toggle button */ 05312 05313 { char * blab[1] = { "Voxel Coords?" } ; 05314 dmode->misc_voxind_bbox = new_MCW_bbox( menu , 05315 1 , blab , 05316 MCW_BB_check , MCW_BB_noframe , 05317 AFNI_misc_CB , (XtPointer)im3d ) ; 05318 dmode->misc_voxind_pb = dmode->misc_voxind_bbox->wbut[0] ; 05319 } 05320 MCW_register_hint( dmode->misc_voxind_pb , "Toggle coordinate display" ) ; 05321 05322 /*-- pushbutton to turn hints on and off --*/ 05323 05324 #ifndef DONT_USE_HINTS 05325 { char * hh = getenv("AFNI_HINTS") ; 05326 if( hh != NULL && ( strncmp(hh,"KILL",4)==0 || 05327 strncmp(hh,"kill",4)==0 || 05328 strncmp(hh,"Kill",4)==0 ) ){ 05329 05330 dmode->misc_hints_pb = 05331 XtVaCreateManagedWidget( 05332 "dialog" , xmLabelWidgetClass , menu , 05333 LABEL_ARG("*Hints Killed*") , 05334 XmNmarginHeight , 0 , 05335 XmNrecomputeSize , False , 05336 XmNinitialResourcesPersistent , False , 05337 NULL ) ; 05338 05339 } else { 05340 { char * blab[1] = { "Show Hints?" } ; 05341 dmode->misc_hints_bbox = new_MCW_bbox( menu , 05342 1 , blab , 05343 MCW_BB_check , MCW_BB_noframe , 05344 AFNI_misc_CB , (XtPointer)im3d ) ; 05345 dmode->misc_hints_pb = dmode->misc_hints_bbox->wbut[0] ; 05346 } 05347 MCW_register_hint( dmode->misc_hints_pb , "Toggle hints display" ) ; 05348 MCW_set_bbox( dmode->misc_hints_bbox , GLOBAL_library.hints_on ) ; 05349 } 05350 } 05351 #else 05352 dmode->misc_hints_pb = NULL ; 05353 #endif 05354 05355 /*-- pushbuttons to popup info about datasets --*/ 05356 05357 dmode->misc_anat_info_pb = 05358 XtVaCreateManagedWidget( 05359 "dialog" , xmPushButtonWidgetClass , menu , 05360 LABEL_ARG("ULay Info") , 05361 XmNmarginHeight , 0 , 05362 XmNtraversalOn , False , 05363 XmNinitialResourcesPersistent , False , 05364 NULL ) ; 05365 XtAddCallback( dmode->misc_anat_info_pb , XmNactivateCallback , 05366 AFNI_misc_CB , im3d ) ; 05367 MCW_register_hint( dmode->misc_anat_info_pb , "Popup anat dataset info" ) ; 05368 05369 dmode->misc_func_info_pb = 05370 XtVaCreateManagedWidget( 05371 "dialog" , xmPushButtonWidgetClass , menu , 05372 LABEL_ARG("OLay Info") , 05373 XmNmarginHeight , 0 , 05374 XmNtraversalOn , False , 05375 XmNinitialResourcesPersistent , False , 05376 NULL ) ; 05377 XtAddCallback( dmode->misc_func_info_pb , XmNactivateCallback , 05378 AFNI_misc_CB , im3d ) ; 05379 MCW_register_hint( dmode->misc_func_info_pb , "Popup func dataset info" ) ; 05380 05381 /*--- 20 Jun 2000: pushbutton to popup the Environment pseudo-plugin ---*/ 05382 05383 #ifdef ALLOW_PLUGINS 05384 (void) XtVaCreateManagedWidget( 05385 "dialog" , xmSeparatorWidgetClass , menu , 05386 XmNseparatorType , XmSINGLE_LINE , 05387 NULL ) ; 05388 05389 dmode->misc_environ_pb = /* 20 Jun 2000 */ 05390 XtVaCreateManagedWidget( 05391 "dialog" , xmPushButtonWidgetClass , menu , 05392 LABEL_ARG("Edit Environment") , 05393 XmNmarginHeight , 0 , 05394 XmNtraversalOn , False , 05395 XmNinitialResourcesPersistent , False , 05396 NULL ) ; 05397 XtAddCallback( dmode->misc_environ_pb , XmNactivateCallback , 05398 AFNI_misc_CB , im3d ) ; 05399 MCW_register_hint( dmode->misc_environ_pb , "Control environment variables" ) ; 05400 05401 dmode->misc_1dchain_pb = /* 03 Jul 2000 */ 05402 XtVaCreateManagedWidget( 05403 "dialog" , xmPushButtonWidgetClass , menu , 05404 LABEL_ARG("Edit 1DChain") , 05405 XmNmarginHeight , 0 , 05406 XmNtraversalOn , False , 05407 XmNinitialResourcesPersistent , False , 05408 NULL ) ; 05409 XtAddCallback( dmode->misc_1dchain_pb , XmNactivateCallback , 05410 AFNI_misc_CB , im3d ) ; 05411 MCW_register_hint( dmode->misc_1dchain_pb , "Control 1DChain function" ) ; 05412 AFNI_misc_CB( dmode->misc_1dchain_pb , im3d , NULL ) ; 05413 05414 dmode->misc_2dchain_pb = /* 03 Jul 2000 */ 05415 XtVaCreateManagedWidget( 05416 "dialog" , xmPushButtonWidgetClass , menu , 05417 LABEL_ARG("Edit 2DChain") , 05418 XmNmarginHeight , 0 , 05419 XmNtraversalOn , False , 05420 XmNinitialResourcesPersistent , False , 05421 NULL ) ; 05422 XtAddCallback( dmode->misc_2dchain_pb , XmNactivateCallback , 05423 AFNI_misc_CB , im3d ) ; 05424 MCW_register_hint( dmode->misc_2dchain_pb , "Control 2DChain function" ) ; 05425 AFNI_misc_CB( dmode->misc_2dchain_pb , im3d , NULL ) ; 05426 #endif 05427 05428 /*--- 23 Sep 2000: Save Layout [see afni_splash.c] ---*/ 05429 05430 dmode->misc_savelayout_pb = 05431 XtVaCreateManagedWidget( 05432 "dialog" , xmPushButtonWidgetClass , menu , 05433 LABEL_ARG("Save Layout") , 05434 XmNmarginHeight , 0 , 05435 XmNtraversalOn , False , 05436 XmNinitialResourcesPersistent , False , 05437 NULL ) ; 05438 XtAddCallback( dmode->misc_savelayout_pb , XmNactivateCallback , 05439 AFNI_save_layout_CB , im3d ) ; 05440 MCW_register_hint( dmode->misc_savelayout_pb , "Save windows layout to file" ) ; 05441 05442 /*--- 22 Jan 2003: Run Script [see afni_splash.c] ---*/ 05443 05444 dmode->misc_runscript_pb = 05445 XtVaCreateManagedWidget( 05446 "dialog" , xmPushButtonWidgetClass , menu , 05447 LABEL_ARG("Run Script") , 05448 XmNmarginHeight , 0 , 05449 XmNtraversalOn , False , 05450 XmNinitialResourcesPersistent , False , 05451 NULL ) ; 05452 XtAddCallback( dmode->misc_runscript_pb , XmNactivateCallback , 05453 AFNI_run_script_CB , im3d ) ; 05454 MCW_register_hint( dmode->misc_runscript_pb , "Run an AFNI script file" ) ; 05455 05456 /*--- 07 Nov 2001: start plugouts [see afni_plugout.c] ---*/ 05457 05458 #ifdef ALLOW_PLUGINS 05459 if( !AFNI_have_plugouts() ){ 05460 dmode->misc_plugout_pb = 05461 XtVaCreateManagedWidget( 05462 "dialog" , xmPushButtonWidgetClass , menu , 05463 LABEL_ARG("Start Plugouts") , 05464 XmNmarginHeight , 0 , 05465 XmNtraversalOn , False , 05466 XmNinitialResourcesPersistent , False , 05467 NULL ) ; 05468 XtAddCallback( dmode->misc_plugout_pb , XmNactivateCallback , 05469 AFNI_misc_CB , im3d ) ; 05470 MCW_register_hint( dmode->misc_plugout_pb , 05471 "Start listening for plugouts" ) ; 05472 } else { 05473 dmode->misc_plugout_pb = NULL ; 05474 } 05475 #else 05476 dmode->misc_plugout_pb = NULL ; 05477 #endif 05478 05479 /*-- 02 Mar 2002: button to start NIML --*/ 05480 05481 dmode->misc_niml_pb = 05482 XtVaCreateManagedWidget( 05483 "dialog" , xmPushButtonWidgetClass , menu , 05484 LABEL_ARG("Start NIML") , 05485 XmNmarginHeight , 0 , 05486 XmNtraversalOn , False , 05487 XmNinitialResourcesPersistent , False , 05488 NULL ) ; 05489 XtAddCallback( dmode->misc_niml_pb , XmNactivateCallback , 05490 AFNI_misc_CB , im3d ) ; 05491 MCW_register_hint( dmode->misc_niml_pb , 05492 "Start listening for NIML connections" ) ; 05493 05494 /*--- Utility buttons ---*/ 05495 05496 (void) XtVaCreateManagedWidget( 05497 "dialog" , xmSeparatorWidgetClass , menu , 05498 XmNseparatorType , XmSINGLE_LINE , 05499 NULL ) ; 05500 05501 dmode->misc_readme_env_pb = 05502 XtVaCreateManagedWidget( 05503 "dialog" , xmPushButtonWidgetClass , menu , 05504 LABEL_ARG("README.environment") , 05505 XmNmarginHeight , 0 , 05506 XmNtraversalOn , False , 05507 XmNinitialResourcesPersistent , False , 05508 NULL ) ; 05509 XtAddCallback( dmode->misc_readme_env_pb , XmNactivateCallback , 05510 AFNI_misc_CB , im3d ) ; 05511 MCW_register_hint( dmode->misc_readme_env_pb,"Display README.environment file" ); 05512 05513 dmode->misc_license_pb = 05514 XtVaCreateManagedWidget( 05515 "dialog" , xmPushButtonWidgetClass , menu , 05516 LABEL_ARG("License Info") , 05517 XmNmarginHeight , 0 , 05518 XmNtraversalOn , False , 05519 XmNinitialResourcesPersistent , False , 05520 NULL ) ; 05521 XtAddCallback( dmode->misc_license_pb , XmNactivateCallback , 05522 AFNI_misc_CB , im3d ) ; 05523 MCW_register_hint( dmode->misc_license_pb,"Display GPL & Copyright Notice" ); 05524 05525 if( !ALLOW_real_time ){ /* 01 May 2000: only if not doing realtime */ 05526 dmode->misc_vcheck_pb = 05527 XtVaCreateManagedWidget( 05528 "dialog" , xmPushButtonWidgetClass , menu , 05529 LABEL_ARG("Version Check") , 05530 XmNmarginHeight , 0 , 05531 XmNtraversalOn , False , 05532 XmNinitialResourcesPersistent , False , 05533 NULL ) ; 05534 XtAddCallback( dmode->misc_vcheck_pb , XmNactivateCallback , 05535 AFNI_misc_CB , im3d ) ; 05536 MCW_register_hint( dmode->misc_vcheck_pb,"Compare to master distribution" ); 05537 } else { 05538 dmode->misc_vcheck_pb = NULL ; 05539 } 05540 05541 /*--- pushbutton to purge unused datasets ---*/ 05542 05543 dmode->misc_purge_pb = 05544 XtVaCreateManagedWidget( 05545 "dialog" , xmPushButtonWidgetClass , menu , 05546 LABEL_ARG("Purge Memory") , 05547 XmNmarginHeight , 0 , 05548 XmNtraversalOn , False , 05549 XmNinitialResourcesPersistent , False , 05550 NULL ) ; 05551 XtAddCallback( dmode->misc_purge_pb , XmNactivateCallback , 05552 AFNI_misc_CB , im3d ) ; 05553 MCW_register_hint( dmode->misc_purge_pb , "Purge unused datasets" ) ; 05554 05555 /*--- pushbutton to toggle routine tracing ---*/ 05556 05557 #if defined(USE_TRACING) || defined(USING_MCW_MALLOC) 05558 (void) XtVaCreateManagedWidget( 05559 "dialog" , xmSeparatorWidgetClass , menu , 05560 XmNseparatorType , XmSINGLE_LINE , 05561 NULL ) ; 05562 #endif 05563 05564 #ifdef USE_TRACING 05565 if( !ALLOW_real_time ){ /* 26 Jan 2001: don't do this if realtime is on */ 05566 dmode->misc_tracing_pb = 05567 XtVaCreateManagedWidget( 05568 "dialog" , xmPushButtonWidgetClass , menu , 05569 LABEL_ARG( DBG_label ) , 05570 XmNmarginHeight , 0 , 05571 XmNtraversalOn , False , 05572 XmNinitialResourcesPersistent , False , 05573 NULL ) ; 05574 XtAddCallback( dmode->misc_tracing_pb , XmNactivateCallback , 05575 AFNI_misc_CB , im3d ) ; 05576 MCW_register_hint( dmode->misc_tracing_pb , "A Debugging Option" ) ; 05577 } else { 05578 dmode->misc_tracing_pb = NULL ; 05579 } 05580 #else 05581 dmode->misc_tracing_pb = NULL ; 05582 #endif 05583 05584 /*--- pushbutton to query malloc table ---*/ 05585 #ifdef USING_MCW_MALLOC 05586 if( MCW_MALLOC_enabled ){ /* 06 Mar 1999 */ 05587 dmode->misc_showmalloc_pb = 05588 XtVaCreateManagedWidget( 05589 "dialog" , xmPushButtonWidgetClass , menu , 05590 LABEL_ARG("Malloc Summary") , 05591 XmNmarginHeight , 0 , 05592 XmNtraversalOn , False , 05593 XmNinitialResourcesPersistent , False , 05594 NULL ) ; 05595 XtAddCallback( dmode->misc_showmalloc_pb , XmNactivateCallback , 05596 AFNI_misc_CB , im3d ) ; 05597 05598 dmode->misc_dumpmalloc_pb = 05599 XtVaCreateManagedWidget( 05600 "dialog" , xmPushButtonWidgetClass , menu , 05601 LABEL_ARG("Dump Malloc Table") , 05602 XmNmarginHeight , 0 , 05603 XmNtraversalOn , False , 05604 XmNinitialResourcesPersistent , False , 05605 NULL ) ; 05606 XtAddCallback( dmode->misc_dumpmalloc_pb , XmNactivateCallback , 05607 AFNI_misc_CB , im3d ) ; 05608 05609 MCW_register_hint( dmode->misc_showmalloc_pb , "A Debugging Option" ) ; 05610 MCW_register_hint( dmode->misc_dumpmalloc_pb , "A Debugging Option" ) ; 05611 } else { 05612 dmode->misc_showmalloc_pb = dmode->misc_dumpmalloc_pb = NULL ; 05613 } 05614 #else 05615 dmode->misc_showmalloc_pb = dmode->misc_dumpmalloc_pb = NULL ; 05616 #endif 05617 05618 /*--- done ---*/ 05619 05620 XtManageChild( rc ) ; 05621 EXRETURN ; 05622 } |
|
-- Color pbar to control intensity-to-color mapping --* Definition at line 6091 of file afni_widg.c. Referenced by AFNI_make_widgets(). |
|
Definition at line 312 of file afni_widg.c. References ADDTO_KILL, afni16_pixmap, AFNI_3DDATA_VIEW, AFNI_make_wid1(), AFNI_make_wid2(), AFNI_make_wid3(), AFNI_plugin_button(), AFNI_tophelp, AFNI_yesenv(), AFNI_widget_set::butx, AFNI_widget_set::buty, Three_D_View::dc, DC_find_closest_overlay_color(), MCW_DC::display, AFNI_widget_set::dmode, ENTRY, FatalError, AFNI_widget_set::file_dialog, AFNI_program_widgets::frame, AFNI_datamode_widgets::frame, AFNI_function_widgets::frame, AFNI_marks_widgets::frame, AFNI_viewing_widgets::frame, AFNI_imaging_widgets::frame, AFNI_widget_set::func, getenv(), IM3D_VALID, AFNI_widget_set::imag, MRI_IMAGE::kind, Three_D_View::kl, last_color, logo_pixmap, AFNI_widget_set::marks, MCW_kill_XImage(), MCW_register_help(), mri_clear_data_pointer, mri_fix_data_pointer(), mri_free(), mri_new_vol_empty(), mri_read_just_one(), myXtNew, MCW_DC::ncol_im, MCW_DCOV::ncol_ov, AFNI_widget_set::nplugbut, num_entry, MRI_IMAGE::nx, MRI_IMAGE::ny, MCW_DC::origGC, MCW_DCOV::ov_darkest, MCW_DC::ovc, AFNI_widget_set::parent, MCW_DC::pix_im, MCW_DCOV::pix_ov, MCW_DC::planes, AFNI_widget_set::prog, REFRESH, rgb_to_XImage(), MCW_DC::screen, STATUS, AFNI_widget_set::top_form, AFNI_widget_set::top_shell, Three_D_View::type, vers_pixmap, AFNI_widget_set::view, MCW_DC::visual_class, and Three_D_View::vwid.
00313 { 00314 00315 ENTRY("AFNI_make_widgets") ; 00316 00317 /*---- initialize -----*/ 00318 00319 if( ! IM3D_VALID(im3d) ) 00320 FatalError("illegal call to AFNI_make_widgets") ; 00321 00322 num_entry++ ; 00323 00324 last_color = im3d->dc->ovc->ncol_ov - 1 ; 00325 00326 vwid = im3d->vwid ; 00327 vwid->parent = im3d ; 00328 00329 vwid->butx = vwid->buty = 9 ; /* 17 May 2005 */ 00330 00331 #define AFNI_FORM_SPACING 9 00332 00333 STATUS("creating top_form") ; 00334 00335 vwid->top_form = 00336 XtVaCreateWidget( 00337 "dialog" , xmFormWidgetClass , vwid->top_shell , 00338 XmNborderWidth , 0 , 00339 XmNmarginHeight , AFNI_FORM_SPACING , 00340 XmNmarginWidth , AFNI_FORM_SPACING , 00341 XmNtraversalOn , False , 00342 XmNinitialResourcesPersistent , False , 00343 NULL ) ; 00344 00345 MCW_register_help( vwid->top_form , AFNI_tophelp ) ; 00346 00347 vwid->file_dialog = NULL ; /* Mar 1997 */ 00348 00349 /* create pixmaps, if desired */ 00350 00351 #if defined(WANT_LOGO_BITMAP) || defined(WANT_AFNI_BITMAP) 00352 { Pixel bg_pix , fg_pix ; /* colors: from control window */ 00353 Pixel bot_pix , top_pix ; /* colors: from image windows */ 00354 00355 #ifdef USE_IMPIX /** which colors to use for program icons **/ 00356 # define ICON_bg bot_pix /* use image display pixels */ 00357 # define ICON_fg top_pix 00358 #else 00359 # define ICON_bg bg_pix /* use widget pixels (e.g., FALLback in afni.h) */ 00360 # define ICON_fg fg_pix 00361 #endif 00362 00363 XtVaGetValues( vwid->top_form , 00364 XmNforeground , &bg_pix , /* note reversal of roles here! */ 00365 XmNbackground , &fg_pix , 00366 NULL ) ; 00367 00368 bot_pix = im3d->dc->pix_im[0] ; 00369 top_pix = im3d->dc->pix_im[im3d->dc->ncol_im-1] ; 00370 00371 #ifdef WANT_LOGO_BITMAP 00372 STATUS("WANT_LOGO_BITMAP") ; 00373 if( logo_pixmap == XmUNSPECIFIED_PIXMAP ){ 00374 00375 #ifndef NO_FRIVOLITIES 00376 #include "lll.h" 00377 if( im3d->dc->visual_class == TrueColor ){ /* 23 Sep 2001 */ 00378 MRI_IMAGE *bim ; XImage *xim ; 00379 bim = mri_new_vol_empty( lll_width,lll_height,1 , MRI_rgb ) ; 00380 mri_fix_data_pointer( lll_rgb , bim ) ; 00381 logo_pixmap = XCreatePixmap( im3d->dc->display , 00382 RootWindowOfScreen(im3d->dc->screen) , 00383 lll_width , lll_height , 00384 im3d->dc->planes ) ; 00385 xim = rgb_to_XImage( im3d->dc , bim ) ; 00386 if( xim != NULL ) 00387 XPutImage( im3d->dc->display , 00388 logo_pixmap , 00389 im3d->dc->origGC , 00390 xim , 0,0 , 0,0 , lll_width , lll_height ) ; 00391 MCW_kill_XImage( xim ); 00392 00393 mri_fix_data_pointer( vvv_rgb , bim ) ; /* 08 Aug 2005 */ 00394 vers_pixmap = XCreatePixmap( im3d->dc->display , 00395 RootWindowOfScreen(im3d->dc->screen) , 00396 lll_width , lll_height , 00397 im3d->dc->planes ) ; 00398 xim = rgb_to_XImage( im3d->dc , bim ) ; 00399 if( xim != NULL ) 00400 XPutImage( im3d->dc->display , 00401 vers_pixmap , 00402 im3d->dc->origGC , 00403 xim , 0,0 , 0,0 , lll_width , lll_height ) ; 00404 MCW_kill_XImage( xim ); 00405 mri_clear_data_pointer(bim); mri_free(bim); 00406 } 00407 #endif 00408 00409 if( logo_pixmap == XmUNSPECIFIED_PIXMAP ) /* original code */ 00410 logo_pixmap = XCreatePixmapFromBitmapData( /* B&W pixmap logo */ 00411 XtDisplay(vwid->top_shell) , 00412 RootWindowOfScreen(XtScreen(vwid->top_shell)) , 00413 logo_bits , logo_width , logo_height , 00414 fg_pix , bg_pix , 00415 DefaultDepthOfScreen(XtScreen(vwid->top_shell)) ) ; 00416 } 00417 #endif 00418 00419 #ifdef WANT_AFNI_BITMAP 00420 STATUS("WANT_AFNI_BITMAP") ; 00421 if( afni48_pixmap == XmUNSPECIFIED_PIXMAP ) 00422 afni48_pixmap = XCreatePixmapFromBitmapData( 00423 XtDisplay(vwid->top_shell) , 00424 RootWindowOfScreen(XtScreen(vwid->top_shell)) , 00425 afni48_bits , afni48_width , afni48_height , 00426 ICON_fg , ICON_bg , 00427 DefaultDepthOfScreen(XtScreen(vwid->top_shell)) ) ; 00428 00429 if( afni48cor_pixmap == XmUNSPECIFIED_PIXMAP ) 00430 afni48cor_pixmap = XCreatePixmapFromBitmapData( 00431 XtDisplay(vwid->top_shell) , 00432 RootWindowOfScreen(XtScreen(vwid->top_shell)) , 00433 afni48cor_bits , afni48cor_width , afni48cor_height , 00434 ICON_fg , ICON_bg , 00435 DefaultDepthOfScreen(XtScreen(vwid->top_shell)) ) ; 00436 00437 if( afni48sag_pixmap == XmUNSPECIFIED_PIXMAP ) 00438 afni48sag_pixmap = XCreatePixmapFromBitmapData( 00439 XtDisplay(vwid->top_shell) , 00440 RootWindowOfScreen(XtScreen(vwid->top_shell)) , 00441 afni48sag_bits , afni48sag_width , afni48sag_height , 00442 ICON_fg , ICON_bg , 00443 DefaultDepthOfScreen(XtScreen(vwid->top_shell)) ) ; 00444 00445 if( afni48axi_pixmap == XmUNSPECIFIED_PIXMAP ) 00446 afni48axi_pixmap = XCreatePixmapFromBitmapData( 00447 XtDisplay(vwid->top_shell) , 00448 RootWindowOfScreen(XtScreen(vwid->top_shell)) , 00449 afni48axi_bits , afni48axi_width , afni48axi_height , 00450 ICON_fg , ICON_bg , 00451 DefaultDepthOfScreen(XtScreen(vwid->top_shell)) ) ; 00452 00453 if( afni48gra_pixmap == XmUNSPECIFIED_PIXMAP ) 00454 afni48gra_pixmap = XCreatePixmapFromBitmapData( 00455 XtDisplay(vwid->top_shell) , 00456 RootWindowOfScreen(XtScreen(vwid->top_shell)) , 00457 afni48gra_bits , afni48gra_width , afni48gra_height , 00458 ICON_fg , ICON_bg , 00459 DefaultDepthOfScreen(XtScreen(vwid->top_shell)) ) ; 00460 00461 if( afni48graaxi_pixmap == XmUNSPECIFIED_PIXMAP ) 00462 afni48graaxi_pixmap = XCreatePixmapFromBitmapData( 00463 XtDisplay(vwid->top_shell) , 00464 RootWindowOfScreen(XtScreen(vwid->top_shell)) , 00465 afni48graaxi_bits , afni48graaxi_width , afni48graaxi_height , 00466 ICON_fg , ICON_bg , 00467 DefaultDepthOfScreen(XtScreen(vwid->top_shell)) ) ; 00468 00469 if( afni48grasag_pixmap == XmUNSPECIFIED_PIXMAP ) 00470 afni48grasag_pixmap = XCreatePixmapFromBitmapData( 00471 XtDisplay(vwid->top_shell) , 00472 RootWindowOfScreen(XtScreen(vwid->top_shell)) , 00473 afni48grasag_bits , afni48grasag_width , afni48grasag_height , 00474 ICON_fg , ICON_bg , 00475 DefaultDepthOfScreen(XtScreen(vwid->top_shell)) ) ; 00476 00477 if( afni48gracor_pixmap == XmUNSPECIFIED_PIXMAP ) 00478 afni48gracor_pixmap = XCreatePixmapFromBitmapData( 00479 XtDisplay(vwid->top_shell) , 00480 RootWindowOfScreen(XtScreen(vwid->top_shell)) , 00481 afni48gracor_bits , afni48gracor_width , afni48gracor_height , 00482 ICON_fg , ICON_bg , 00483 DefaultDepthOfScreen(XtScreen(vwid->top_shell)) ) ; 00484 00485 /* 28 Jan 2004: just for fun, background pixmaps for top forms */ 00486 00487 if( im3d->dc->visual_class == TrueColor && 00488 AFNI_yesenv("AFNI_LOGO16") && 00489 afni16_pixmap[num_entry-1] == XmUNSPECIFIED_PIXMAP ){ 00490 00491 MRI_IMAGE *bim ; XImage *xim ; char ename[32], *ept ; 00492 sprintf(ename,"AFNI_LOGO16_IMAGE_%c" , 'A'+num_entry-1 ) ; 00493 ept = getenv(ename) ; 00494 if( ept == NULL ) ept = getenv( "AFNI_LOGO16_IMAGE" ) ; 00495 if( ept != NULL ){ 00496 bim = mri_read_just_one( ept ) ; 00497 if( bim != NULL ){ 00498 if( bim->kind == MRI_rgb ){ 00499 xim = rgb_to_XImage( im3d->dc , bim ) ; 00500 if( xim != NULL ){ 00501 afni16_pixmap[num_entry-1] = XCreatePixmap( im3d->dc->display , 00502 RootWindowOfScreen(im3d->dc->screen) , 00503 bim->nx , bim->ny , im3d->dc->planes ) ; 00504 XPutImage( im3d->dc->display , afni16_pixmap[num_entry-1] , 00505 im3d->dc->origGC , xim , 0,0 , 0,0 , bim->nx , bim->ny ) ; 00506 MCW_kill_XImage( xim ) ; 00507 } 00508 } 00509 mri_free(bim) ; 00510 } 00511 } 00512 } 00513 00514 #if 0 00515 if( afni16_pixmap[num_entry-1] == XmUNSPECIFIED_PIXMAP && AFNI_yesenv("AFNI_LOGO16") ){ 00516 Pixel fg16=ICON_bg, bg16=ICON_fg ; int ic ; char ename[32] ; 00517 char *fgn[7] = { "red", "blue-cyan", "green", "violet", "orange", "gray70", "yellow" }; 00518 00519 sprintf(ename,"AFNI_LOGO16_FOREGROUND_%c" , 'A'+num_entry-1 ) ; 00520 ic = DC_find_closest_overlay_color(im3d->dc, getenv(ename) ) ; 00521 if( ic < 0 ) ic = DC_find_closest_overlay_color(im3d->dc, getenv("AFNI_LOGO16_FOREGROUND")) ; 00522 if( ic < 0 ) ic = DC_find_closest_overlay_color(im3d->dc, fgn[(num_entry-1)%7] ) ; 00523 if( ic >= 0 ) fg16 = im3d->dc->ovc->pix_ov[ic] ; 00524 00525 sprintf(ename,"AFNI_LOGO16_BACKGROUND_%c" , 'A'+num_entry-1 ) ; 00526 ic = DC_find_closest_overlay_color(im3d->dc, getenv(ename) ) ; 00527 if( ic < 0 ) ic = DC_find_closest_overlay_color(im3d->dc, getenv("AFNI_LOGO16_BACKGROUND")) ; 00528 #if 0 00529 if( ic < 0 ) ic = im3d->dc->ovc->ov_darkest ; 00530 #endif 00531 if( ic >= 0 ) bg16 = im3d->dc->ovc->pix_ov[ic] ; 00532 00533 afni16_pixmap[num_entry-1] = XCreatePixmapFromBitmapData( 00534 XtDisplay(vwid->top_shell) , 00535 RootWindowOfScreen(XtScreen(vwid->top_shell)) , 00536 afni16_bits , afni16_width , afni16_height , 00537 fg16 , bg16 , 00538 DefaultDepthOfScreen(XtScreen(vwid->top_shell)) ) ; 00539 } 00540 #endif 00541 00542 #endif /* WANT_AFNI_BITMAP */ 00543 } 00544 #endif /* if WANT any of the BITMAPs */ 00545 00546 if( afni16_pixmap[num_entry-1] != XmUNSPECIFIED_PIXMAP ) 00547 XtVaSetValues( vwid->top_form , XmNbackgroundPixmap,afni16_pixmap[num_entry-1] , NULL ) ; 00548 00549 /* create each control panel, and a container frame for each */ 00550 00551 STATUS("creating control panels") ; 00552 00553 imag =vwid->imag = myXtNew(AFNI_imaging_widgets) ;ADDTO_KILL(im3d->kl,imag); 00554 view =vwid->view = myXtNew(AFNI_viewing_widgets) ;ADDTO_KILL(im3d->kl,view); 00555 marks=vwid->marks= myXtNew(AFNI_marks_widgets) ;ADDTO_KILL(im3d->kl,marks); 00556 func =vwid->func = myXtNew(AFNI_function_widgets);ADDTO_KILL(im3d->kl,func); 00557 prog =vwid->prog = myXtNew(AFNI_program_widgets) ;ADDTO_KILL(im3d->kl,prog); 00558 dmode=vwid->dmode= myXtNew(AFNI_datamode_widgets);ADDTO_KILL(im3d->kl,dmode); 00559 00560 imag->frame = 00561 XtVaCreateWidget( 00562 "dialog" , xmFrameWidgetClass , vwid->top_form , 00563 XmNleftAttachment , XmATTACH_FORM , 00564 XmNtopAttachment , XmATTACH_FORM , 00565 XmNleftOffset , AFNI_FORM_SPACING , 00566 XmNtopOffset , AFNI_FORM_SPACING , 00567 XmNshadowType , XmSHADOW_ETCHED_IN , 00568 XmNshadowThickness , 5 , 00569 XmNtraversalOn , False , 00570 XmNinitialResourcesPersistent , False , 00571 NULL ) ; 00572 00573 view->frame = 00574 XtVaCreateWidget( 00575 "dialog" , xmFrameWidgetClass , vwid->top_form , 00576 XmNleftAttachment , XmATTACH_WIDGET , 00577 XmNleftWidget , imag->frame , 00578 XmNtopAttachment , XmATTACH_FORM , 00579 XmNleftOffset , AFNI_FORM_SPACING , 00580 XmNtopOffset , AFNI_FORM_SPACING , 00581 XmNshadowType , XmSHADOW_ETCHED_IN , 00582 XmNshadowThickness , 5 , 00583 XmNtraversalOn , False , 00584 XmNinitialResourcesPersistent , False , 00585 NULL ) ; 00586 00587 marks->frame = 00588 XtVaCreateWidget( 00589 "dialog" , xmFrameWidgetClass , vwid->top_form , 00590 XmNleftAttachment , XmATTACH_WIDGET , 00591 XmNleftWidget , view->frame , 00592 XmNtopAttachment , XmATTACH_FORM , 00593 XmNleftOffset , AFNI_FORM_SPACING , 00594 XmNtopOffset , AFNI_FORM_SPACING , 00595 XmNshadowType , XmSHADOW_ETCHED_IN , 00596 XmNshadowThickness , 5 , 00597 XmNtraversalOn , False , 00598 XmNinitialResourcesPersistent , False , 00599 NULL ) ; 00600 00601 func->frame = 00602 XtVaCreateWidget( 00603 "dialog" , xmFrameWidgetClass , vwid->top_form , 00604 XmNleftAttachment , XmATTACH_WIDGET , 00605 XmNleftWidget , view->frame , 00606 XmNtopAttachment , XmATTACH_FORM , 00607 XmNleftOffset , AFNI_FORM_SPACING , 00608 XmNtopOffset , AFNI_FORM_SPACING , 00609 XmNshadowType , XmSHADOW_ETCHED_IN , 00610 XmNshadowThickness , 5 , 00611 XmNtraversalOn , False , 00612 XmNinitialResourcesPersistent , False , 00613 NULL ) ; 00614 00615 dmode->frame = 00616 XtVaCreateWidget( 00617 "dialog" , xmFrameWidgetClass , vwid->top_form , 00618 XmNleftAttachment , XmATTACH_WIDGET , 00619 XmNleftWidget , view->frame , 00620 XmNtopAttachment , XmATTACH_FORM , 00621 XmNleftOffset , AFNI_FORM_SPACING , 00622 XmNtopOffset , AFNI_FORM_SPACING , 00623 XmNshadowType , XmSHADOW_ETCHED_IN , 00624 XmNshadowThickness , 5 , 00625 XmNtraversalOn , False , 00626 XmNinitialResourcesPersistent , False , 00627 NULL ) ; 00628 00629 prog->frame = 00630 XtVaCreateWidget( 00631 "dialog" , xmFrameWidgetClass , vwid->top_form , 00632 XmNtopAttachment , XmATTACH_WIDGET , 00633 XmNtopWidget , imag->frame , 00634 XmNleftAttachment , XmATTACH_FORM , 00635 XmNleftOffset , AFNI_FORM_SPACING , 00636 XmNtopOffset , AFNI_FORM_SPACING , 00637 XmNshadowType , XmSHADOW_ETCHED_IN , 00638 XmNshadowThickness , 5 , 00639 XmNtraversalOn , False , 00640 XmNinitialResourcesPersistent , False , 00641 NULL ) ; 00642 00643 /************* call other routines to create rest of widgets *************/ 00644 00645 REFRESH ; 00646 AFNI_make_wid1( im3d ) ; REFRESH ; 00647 AFNI_make_wid2( im3d ) ; REFRESH ; 00648 AFNI_make_wid3( im3d ) ; REFRESH ; 00649 00650 #ifdef ALLOW_PLUGINS 00651 im3d->vwid->nplugbut = 0 ; 00652 AFNI_plugin_button( im3d ) ; /* 07 Oct 1996 */ 00653 #endif 00654 00655 /*---------------------------------------------------*/ 00656 /************** finish up widgets *******************/ 00657 /*---------------------------------------------------*/ 00658 00659 XtManageChild( imag->frame ) ; 00660 if( im3d->type == AFNI_3DDATA_VIEW ){ 00661 XtManageChild( view->frame ) ; 00662 } 00663 XtManageChild( prog->frame ) ; 00664 00665 XtManageChild( vwid->top_form ) ; 00666 00667 EXRETURN ; 00668 } 00669 00670 /*------------------------------------------------------------------*/ 00671 00672 void AFNI_raiseup_CB( Widget w , XtPointer cd , XtPointer cb ) 00673 { 00674 XMapRaised( XtDisplay(w) , XtWindow(XtParent(w)) ) ; 00675 } 00676 00677 /*--------------------------------------------------------------------*/ 00678 00679 void AFNI_make_wid1( Three_D_View * im3d ) 00680 { 00681 int ii ; 00682 00683 ENTRY("AFNI_make_wid1") ; 00684 00685 /*----------------------------------------------------------*/ 00686 /***************** imaging controls *************************/ 00687 /*----------------------------------------------------------*/ 00688 00689 /*--- vertical rowcol to hold all imaging stuff ---*/ 00690 00691 STATUS("making imag->rowcol") ; 00692 00693 imag->rowcol = 00694 XtVaCreateWidget( 00695 "dialog" , xmRowColumnWidgetClass , imag->frame , 00696 XmNpacking , XmPACK_TIGHT , 00697 XmNorientation , XmVERTICAL , 00698 XmNtraversalOn , False , 00699 XmNinitialResourcesPersistent , False , 00700 NULL ) ; 00701 00702 /*--- popup menu to handle special imaging concerns ---*/ 00703 00704 imag->topper = /* invisible widget to be parent of popup */ 00705 XtVaCreateManagedWidget( 00706 "dialog" , xmSeparatorWidgetClass , imag->rowcol , 00707 XmNseparatorType , XmNO_LINE , 00708 NULL ) ; 00709 00710 #ifdef BAD_BUTTON3_POPUPS /* 21 Jul 2003 */ 00711 imag->popmenu = 00712 XmCreatePopupMenu( vwid->top_form, "menu" , NULL , 0 ) ; 00713 #else 00714 imag->popmenu = 00715 XmCreatePopupMenu( imag->topper , "menu" , NULL , 0 ) ; 00716 #endif 00717 00718 SAVEUNDERIZE(XtParent(imag->popmenu)) ; /* 27 Feb 2001 */ 00719 00720 VISIBILIZE_WHEN_MAPPED(imag->popmenu) ; 00721 00722 /*** 00723 XtAddCallback( imag->popmenu , 00724 XmNunmapCallback , AFNI_imag_pop_CB , im3d ) ; 00725 ***/ 00726 00727 XtVaSetValues( imag->popmenu , 00728 XmNradioBehavior , True , 00729 XmNradioAlwaysOne , False , 00730 XmNspacing , 1 , 00731 XmNmarginHeight , 0 , 00732 XmNmarginWidth , 0 , 00733 NULL ) ; 00734 00735 /*--- jumpback button in menu ---*/ 00736 00737 imag->pop_jumpback_pb = 00738 XtVaCreateManagedWidget( 00739 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 00740 LABEL_ARG("Jumpback") , 00741 XmNmarginHeight , 0 , 00742 XmNtraversalOn , False , 00743 XmNinitialResourcesPersistent , False , 00744 NULL ) ; 00745 00746 XtAddCallback( imag->pop_jumpback_pb , XmNactivateCallback , 00747 AFNI_imag_pop_CB , im3d ) ; 00748 00749 /*--- jumpto button in menu ---*/ 00750 00751 if( im3d->type == AFNI_3DDATA_VIEW ){ 00752 imag->pop_jumpto_pb = 00753 XtVaCreateManagedWidget( 00754 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 00755 LABEL_ARG("Jump to (xyz)") , 00756 XmNmarginHeight , 0 , 00757 XmNtraversalOn , False , 00758 XmNinitialResourcesPersistent , False , 00759 NULL ) ; 00760 00761 XtAddCallback( imag->pop_jumpto_pb , XmNactivateCallback , 00762 AFNI_imag_pop_CB , im3d ) ; 00763 } else { 00764 imag->pop_jumpto_pb = NULL ; 00765 } 00766 00767 if( im3d->type == AFNI_3DDATA_VIEW ){ 00768 imag->pop_jumpto_ijk_pb = 00769 XtVaCreateManagedWidget( 00770 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 00771 LABEL_ARG("Jump to (ijk)") , 00772 XmNmarginHeight , 0 , 00773 XmNtraversalOn , False , 00774 XmNinitialResourcesPersistent , False , 00775 NULL ) ; 00776 00777 XtAddCallback( imag->pop_jumpto_ijk_pb , XmNactivateCallback , 00778 AFNI_imag_pop_CB , im3d ) ; 00779 } else { 00780 imag->pop_jumpto_ijk_pb = NULL ; 00781 } 00782 00783 /*--- mnito button in menu [01 May 2002] ---*/ 00784 00785 if( im3d->type == AFNI_3DDATA_VIEW ){ 00786 imag->pop_mnito_pb = 00787 XtVaCreateManagedWidget( 00788 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 00789 LABEL_ARG("Jump to (MNI)") , 00790 XmNmarginHeight , 0 , 00791 XmNtraversalOn , False , 00792 XmNinitialResourcesPersistent , False , 00793 NULL ) ; 00794 00795 XtAddCallback( imag->pop_mnito_pb , XmNactivateCallback , 00796 AFNI_imag_pop_CB , im3d ) ; 00797 } else { 00798 imag->pop_mnito_pb = NULL ; 00799 } 00800 00801 /*--- sumato button in menu ---*/ 00802 00803 if( im3d->type == AFNI_3DDATA_VIEW ){ 00804 imag->pop_sumato_pb = 00805 XtVaCreateManagedWidget( 00806 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 00807 LABEL_ARG("SUMA to (node)") , 00808 XmNmarginHeight , 0 , 00809 XmNtraversalOn , False , 00810 XmNinitialResourcesPersistent , False , 00811 NULL ) ; 00812 00813 XtAddCallback( imag->pop_sumato_pb , XmNactivateCallback , 00814 AFNI_imag_pop_CB , im3d ) ; 00815 } else { 00816 imag->pop_sumato_pb = NULL ; 00817 } 00818 00819 /*--- Talairach To button in menu ---*/ 00820 00821 if( im3d->type == AFNI_3DDATA_VIEW ){ 00822 imag->pop_talto_pb = 00823 XtVaCreateManagedWidget( 00824 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 00825 LABEL_ARG("-Talairach to") , 00826 XmNmarginHeight , 0 , 00827 XmNtraversalOn , False , 00828 XmNinitialResourcesPersistent , False , 00829 NULL ) ; 00830 00831 XtAddCallback( imag->pop_talto_pb , XmNactivateCallback , 00832 AFNI_imag_pop_CB , im3d ) ; 00833 00834 if( TT_load_atlas() > 0 ){ 00835 imag->pop_whereami_pb = /* 10 Jul 2001 */ 00836 XtVaCreateManagedWidget( 00837 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 00838 LABEL_ARG("-Where Am I?") , 00839 XmNmarginHeight , 0 , 00840 XmNtraversalOn , False , 00841 XmNinitialResourcesPersistent , False , 00842 NULL ) ; 00843 00844 XtAddCallback( imag->pop_whereami_pb , XmNactivateCallback , 00845 AFNI_imag_pop_CB , im3d ) ; 00846 00847 imag->pop_ttren_pb = 00848 XtVaCreateManagedWidget( 00849 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 00850 LABEL_ARG("-Atlas Colors") , 00851 XmNmarginHeight , 0 , 00852 XmNtraversalOn , False , 00853 XmNinitialResourcesPersistent , False , 00854 NULL ) ; 00855 00856 XtAddCallback( imag->pop_ttren_pb , XmNactivateCallback , 00857 AFNI_imag_pop_CB , im3d ) ; 00858 00859 } else { 00860 static int first=1 ; 00861 imag->pop_ttren_pb = imag->pop_whereami_pb = NULL ; 00862 if( first ){ 00863 first = 0 ; 00864 fprintf(stderr, 00865 "\n++ WARNING: Can't find TTatlas+tlrc or TTatlas.nii.gz dataset for 'whereami'!\n" 00866 "++--------- See http://afni.nimh.nih.gov/pub/dist/data/\n" ) ; 00867 } 00868 } 00869 imag->pop_whereami_twin = NULL ; 00870 } else { 00871 imag->pop_talto_pb = NULL ; 00872 imag->pop_ttren_pb = imag->pop_whereami_pb = NULL ; /* 10 Jul 2001 */ 00873 imag->pop_whereami_twin = NULL ; 00874 } 00875 00876 /*--- imageonly button in menu ---*/ 00877 00878 imag->pop_imageonly_pb = 00879 XtVaCreateManagedWidget( 00880 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 00881 LABEL_ARG("Image display") , 00882 XmNmarginHeight , 0 , 00883 XmNtraversalOn , False , 00884 XmNinitialResourcesPersistent , False , 00885 NULL ) ; 00886 00887 XtAddCallback( imag->pop_imageonly_pb , XmNactivateCallback , 00888 AFNI_imag_pop_CB , im3d ) ; 00889 00890 /*--- environment button in menu [05 Nov 2003] ---*/ 00891 00892 #ifdef ALLOW_PLUGINS 00893 imag->pop_environment_pb = 00894 XtVaCreateManagedWidget( 00895 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 00896 LABEL_ARG("Edit Environment") , 00897 XmNmarginHeight , 0 , 00898 XmNtraversalOn , False , 00899 XmNinitialResourcesPersistent , False , 00900 NULL ) ; 00901 XtAddCallback( imag->pop_environment_pb , XmNactivateCallback , 00902 AFNI_imag_pop_CB , im3d ) ; 00903 00904 imag->pop_drawdataset_pb = 00905 XtVaCreateManagedWidget( 00906 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 00907 LABEL_ARG("Draw ROI plugin") , 00908 XmNmarginHeight , 0 , 00909 XmNtraversalOn , False , 00910 XmNinitialResourcesPersistent , False , 00911 NULL ) ; 00912 XtAddCallback( imag->pop_drawdataset_pb , XmNactivateCallback , 00913 AFNI_imag_pop_CB , im3d ) ; 00914 #else 00915 imag->pop_environment_pb = NULL ; 00916 imag->pop_drawdataset_pb = NULL ; 00917 #endif 00918 00919 /*--- frame to hold all crosshair stuff ---*/ 00920 00921 imag->crosshair_frame = 00922 XtVaCreateManagedWidget( 00923 "dialog" , xmFrameWidgetClass , imag->rowcol , 00924 XmNshadowType , XmSHADOW_ETCHED_IN , 00925 XmNshadowThickness , 2 , 00926 XmNtraversalOn , False , 00927 XmNinitialResourcesPersistent , False , 00928 NULL ) ; 00929 00930 /*--- rowcol to manage crosshair stuff ---*/ 00931 00932 imag->crosshair_rowcol = 00933 XtVaCreateWidget( 00934 "dialog" , xmRowColumnWidgetClass , imag->crosshair_frame , 00935 XmNpacking , XmPACK_TIGHT , 00936 XmNorientation , XmVERTICAL , 00937 XmNtraversalOn , False , 00938 XmNinitialResourcesPersistent , False , 00939 NULL ) ; 00940 00941 /*--- label to display the crosshair location ---*/ 00942 00943 im3d->vinfo->old_crosshair_label = xstr = AFNI_crosshair_label( im3d ) ; 00944 00945 im3d->vinfo->view_setter = -1 ; /* 20 Feb 2003 */ 00946 00947 imag->crosshair_label = 00948 XtVaCreateManagedWidget( 00949 "dialog" , xmLabelWidgetClass , imag->crosshair_rowcol , 00950 XmNrecomputeSize , False , 00951 XmNlabelString , xstr , 00952 XmNtraversalOn , False , 00953 XmNinitialResourcesPersistent , False , 00954 NULL ) ; 00955 00956 MCW_register_help( imag->crosshair_label , AFNI_crosshair_label_help ) ; 00957 MCW_register_hint( imag->crosshair_label , "Coordinates of crosshair point" ) ; 00958 00959 /*--- 12 Mar 2004: coordinate order popup menu ---*/ 00960 00961 if( im3d->type == AFNI_3DDATA_VIEW ){ 00962 imag->crosshair_menu = 00963 XmCreatePopupMenu( imag->crosshair_label , "menu" , NULL , 0 ) ; 00964 00965 SAVEUNDERIZE(XtParent(imag->crosshair_menu)) ; 00966 VISIBILIZE_WHEN_MAPPED(imag->crosshair_menu) ; 00967 00968 XtInsertEventHandler( imag->crosshair_label , /* handle events in label */ 00969 ButtonPressMask , /* button presses */ 00970 FALSE , /* nonmaskable events? */ 00971 AFNI_crosshair_EV , /* handler */ 00972 (XtPointer) im3d , /* client data */ 00973 XtListTail /* last in queue */ 00974 ) ; 00975 00976 (void) XtVaCreateManagedWidget( 00977 "menu" , xmLabelWidgetClass , imag->crosshair_menu , 00978 LABEL_ARG("-Set Coord Order-") , 00979 XmNrecomputeSize , False , 00980 XmNinitialResourcesPersistent , False , 00981 NULL ) ; 00982 00983 (void) XtVaCreateManagedWidget( 00984 "menu" , xmSeparatorWidgetClass , imag->crosshair_menu , 00985 XmNseparatorType , XmSINGLE_LINE , NULL ) ; 00986 00987 imag->crosshair_dicom_pb = 00988 XtVaCreateManagedWidget( 00989 "menu" , xmPushButtonWidgetClass , imag->crosshair_menu , 00990 LABEL_ARG(" RAI=DICOM order") , 00991 XmNmarginHeight , 0 , 00992 XmNtraversalOn , False , 00993 XmNinitialResourcesPersistent , False , 00994 NULL ) ; 00995 XtAddCallback( imag->crosshair_dicom_pb , XmNactivateCallback , 00996 AFNI_crosshair_pop_CB , im3d ) ; 00997 00998 imag->crosshair_spm_pb = 00999 XtVaCreateManagedWidget( 01000 "menu" , xmPushButtonWidgetClass , imag->crosshair_menu , 01001 LABEL_ARG(" LPI=SPM order") , 01002 XmNmarginHeight , 0 , 01003 XmNtraversalOn , False , 01004 XmNinitialResourcesPersistent , False , 01005 NULL ) ; 01006 XtAddCallback( imag->crosshair_spm_pb , XmNactivateCallback , 01007 AFNI_crosshair_pop_CB , im3d ) ; 01008 01009 } /*- end of crosshair_label popup menu -*/ 01010 01011 /*--- 01 Jan 1997: horizontal rowcol for crosshair stuff ---*/ 01012 01013 STATUS("making imag->xhair_rowcol") ; 01014 01015 imag->xhair_rowcol = 01016 XtVaCreateWidget( 01017 "dialog" , xmRowColumnWidgetClass , imag->crosshair_rowcol , 01018 XmNpacking , XmPACK_TIGHT , 01019 XmNorientation , XmHORIZONTAL , 01020 XmNmarginHeight, 0 , 01021 XmNmarginWidth , 0 , 01022 XmNtraversalOn , False , 01023 XmNinitialResourcesPersistent , False , 01024 NULL ) ; 01025 01026 /*--- arrowval to control crosshair visibility ---*/ 01027 01028 if( im3d->vinfo->crosshair_visible ) 01029 ii = (im3d->vinfo->xhairs_show_montage) ? AFNI_XHAIRS_MULTI 01030 : AFNI_XHAIRS_SINGLE ; 01031 else 01032 ii = AFNI_XHAIRS_OFF ; 01033 01034 im3d->vinfo->xhairs_orimask = ORIMASK_ALL ; /* 31 Dec 1998 */ 01035 01036 STATUS("making imag->crosshair_av") ; 01037 01038 imag->crosshair_av = new_MCW_arrowval( 01039 imag->xhair_rowcol , /* parent Widget */ 01040 "Xhairs" , /* label */ 01041 AVOPT_STYLE , /* option menu style */ 01042 AFNI_XHAIRS_OFF , /* first option */ 01043 AFNI_XHAIRS_LASTOPTION , /* last option */ 01044 ii , /* initial selection */ 01045 MCW_AV_readtext , /* ignored but needed */ 01046 0 , /* ditto */ 01047 AFNI_crosshair_visible_CB , /* callback when changed */ 01048 (XtPointer) im3d , /* data for above */ 01049 MCW_av_substring_CB , /* text creation routine */ 01050 AFNI_crosshair_av_label /* data for above */ 01051 ) ; 01052 01053 if( AVOPT_STYLE == MCW_AV_optmenu ) 01054 AVOPT_columnize( imag->crosshair_av , 3 ) ; 01055 01056 imag->crosshair_av->parent = (XtPointer) im3d ; 01057 imag->crosshair_av->allow_wrap = True ; 01058 01059 MCW_reghelp_children( imag->crosshair_av->wrowcol , AFNI_crosshair_av_help ) ; 01060 MCW_reghint_children( imag->crosshair_av->wrowcol , "Crosshairs style" ) ; 01061 01062 ADDTO_KILL(im3d->kl,imag->crosshair_av) ; 01063 01064 /*--- 01 Jan 1997: buttonbox to control "all" or "one" xhairs in montage ---*/ 01065 01066 STATUS("making imag->xhall_bbox") ; 01067 01068 imag->xhall_bbox = new_MCW_bbox( imag->xhair_rowcol , 01069 1 , AFNI_xhall_bbox_label , 01070 MCW_BB_check , 01071 MCW_BB_noframe , 01072 AFNI_xhall_bbox_CB , (XtPointer) im3d ) ; 01073 01074 MCW_set_bbox( imag->xhall_bbox , im3d->vinfo->xhairs_all ? 1 : 0 ) ; 01075 01076 ADDTO_KILL(im3d->kl , imag->xhall_bbox) ; 01077 01078 MCW_reghelp_children( imag->xhall_bbox->wrowcol , 01079 "IN: Montage will show crosshairs in all slices\n" 01080 "OUT: Montage will show crosshairs in one slice" 01081 ) ; 01082 MCW_reghint_children( imag->xhall_bbox->wrowcol , 01083 "All-or-One Montage crosshairs" ) ; 01084 01085 STATUS("managing imag->xhair_rowcol") ; 01086 01087 XtManageChild( imag->xhair_rowcol ) ; 01088 01089 /*--- arrowval to control crosshair color ---*/ 01090 01091 ii = AVOPT_STYLE ; 01092 01093 STATUS("making imag->crosshair_color_av") ; 01094 01095 if( ii == MCW_AV_downup ){ 01096 imag->crosshair_color_av = 01097 new_MCW_arrowval( imag->crosshair_rowcol , /* parent */ 01098 "Color " , /* label */ 01099 MCW_AV_downup , /* arrow directions */ 01100 1 , /* min value */ 01101 last_color , /* max value */ 01102 im3d->vinfo->crosshair_ovcolor ,/* init value */ 01103 MCW_AV_readtext , /* readonly text */ 01104 0 , /* 0 decimal shift */ 01105 AFNI_crosshair_color_CB , /* click routine */ 01106 (XtPointer) im3d , /* data for above */ 01107 MCW_DC_ovcolor_text , /* text routine */ 01108 (XtPointer) im3d->dc /* data for text */ 01109 ) ; 01110 01111 (void) MCW_DC_ovcolor_text( imag->crosshair_color_av , 01112 im3d->dc ) ; /* set color now! */ 01113 01114 imag->crosshair_color_av->fastdelay = 333 ; /* slow down repeat action */ 01115 imag->crosshair_color_av->allow_wrap = 1 ; 01116 01117 } else { 01118 imag->crosshair_color_av = 01119 new_MCW_colormenu( imag->crosshair_rowcol , "Color " , im3d->dc , 01120 1 , last_color , im3d->vinfo->crosshair_ovcolor , 01121 AFNI_crosshair_color_CB , (XtPointer) im3d ) ; 01122 } 01123 01124 imag->crosshair_color_av->parent = (XtPointer) im3d ; 01125 imag->crosshair_color_av->fastdelay = 333 ; /* slow down repeat action */ 01126 imag->crosshair_color_av->allow_wrap = 1 ; 01127 01128 MCW_reghelp_children( imag->crosshair_color_av->wrowcol , 01129 AFNI_crosshair_color_help ) ; 01130 MCW_reghint_children( imag->crosshair_color_av->wrowcol , "Crosshairs color" ) ; 01131 01132 ADDTO_KILL(im3d->kl,imag->crosshair_color_av) ; 01133 01134 /**** 1 Aug 1996: 01135 put crosshair gap into a horizontal rowcol so 01136 can attach a toggle for periodic montages here, too ****/ 01137 01138 STATUS("making imag->gap_wrap_rowcol") ; 01139 01140 imag->gap_wrap_rowcol = 01141 XtVaCreateWidget( 01142 "dialog" , xmRowColumnWidgetClass , imag->crosshair_rowcol , 01143 XmNpacking , XmPACK_TIGHT , 01144 XmNorientation , XmHORIZONTAL , 01145 XmNmarginHeight, 0 , 01146 XmNmarginWidth , 0 , 01147 XmNtraversalOn , False , 01148 XmNinitialResourcesPersistent , False , 01149 NULL ) ; 01150 01151 /*--- arrowval to control crosshair gap ---*/ 01152 01153 STATUS("making imag->crosshair_gap_av") ; 01154 01155 imag->crosshair_gap_av = 01156 new_MCW_arrowval( imag->gap_wrap_rowcol , /* parent */ 01157 "Gap " , /* label */ 01158 AVOPT_STYLE , /* arrow directions */ 01159 -1 , /* min value */ 01160 MAXOVSIZE , /* max value */ 01161 im3d->vinfo->crosshair_gap , /* init value */ 01162 MCW_AV_editext , /* input/output text */ 01163 0 , /* 0 decimal shift */ 01164 AFNI_crosshair_gap_CB , /* click routine */ 01165 (XtPointer) im3d , /* data */ 01166 NULL , NULL 01167 ) ; 01168 01169 if( AVOPT_STYLE == MCW_AV_optmenu && MAXOVSIZE >= COLSIZE ) 01170 AVOPT_columnize( imag->crosshair_gap_av , 1+(MAXOVSIZE+1)/COLSIZE ) ; 01171 01172 imag->crosshair_gap_av->parent = (XtPointer) im3d ; 01173 imag->crosshair_gap_av->fastdelay = 333 ; /* slow down repeat action */ 01174 01175 MCW_reghelp_children( imag->crosshair_gap_av->wrowcol , 01176 AFNI_crosshair_gap_help ) ; 01177 MCW_reghint_children( imag->crosshair_gap_av->wrowcol , 01178 "Gap in crosshairs" ) ; 01179 01180 ADDTO_KILL(im3d->kl,imag->crosshair_gap_av) ; 01181 01182 /*--- 1 Aug 1996: 01183 toggle button box to control periodic montages ---*/ 01184 01185 STATUS("making imag->wrap_bbox") ; 01186 01187 imag->wrap_bbox = new_MCW_bbox( imag->gap_wrap_rowcol , 01188 1 , AFNI_wrap_bbox_label , 01189 MCW_BB_check , 01190 MCW_BB_noframe , 01191 AFNI_wrap_bbox_CB , (XtPointer) im3d ) ; 01192 01193 MCW_set_bbox( imag->wrap_bbox , im3d->vinfo->xhairs_periodic ? 1 : 0 ) ; 01194 01195 ADDTO_KILL(im3d->kl , imag->wrap_bbox) ; 01196 01197 MCW_reghelp_children( imag->wrap_bbox->wrowcol , 01198 "IN: Montage layout wraps around when slices\n" 01199 " go past an edge of the dataset.\n" 01200 "OUT: Montage layout shows blanks for slices\n" 01201 " past an edge of the dataset." 01202 ) ; 01203 MCW_reghint_children( imag->wrap_bbox->wrowcol , 01204 "Wrap montage past edge of volume?" ) ; 01205 01206 STATUS("managing imag->gap_wrap_rowcol") ; 01207 01208 XtManageChild( imag->gap_wrap_rowcol ) ; 01209 01210 /*--- arrowval to control time index we are viewing ---*/ 01211 01212 STATUS("making imag->time_index_av") ; 01213 01214 imag->time_index_av = 01215 new_MCW_arrowval( imag->crosshair_rowcol , /* parent */ 01216 "Index " , /* label */ 01217 MCW_AV_downup , /* arrow directions */ 01218 0 , /* min value */ 01219 im3d->vinfo->top_index , /* max value */ 01220 im3d->vinfo->time_index , /* init value */ 01221 MCW_AV_editext , /* input/output text */ 01222 0 , /* 0 decimal shift */ 01223 AFNI_time_index_CB , /* click routine */ 01224 (XtPointer) im3d , /* data */ 01225 NULL , NULL 01226 ) ; 01227 imag->time_index_av->parent = (XtPointer) im3d ; 01228 imag->time_index_av->allow_wrap = 1 ; 01229 01230 MCW_reghelp_children( imag->time_index_av->wrowcol , 01231 "Controls the time index\n" 01232 "of the images being viewed.\n" 01233 "[For time-dependent datasets.]" ) ; 01234 MCW_reghint_children( imag->time_index_av->wrowcol , 01235 "Set index in time" ) ; 01236 01237 ADDTO_KILL(im3d->kl,imag->time_index_av) ; 01238 01239 /*--- frame to hold all viewing control stuff ---*/ 01240 01241 STATUS("imag->view_frame") ; 01242 01243 imag->view_frame = 01244 XtVaCreateManagedWidget( 01245 "dialog" , xmFrameWidgetClass , imag->rowcol , 01246 XmNshadowType , XmSHADOW_ETCHED_IN , 01247 XmNshadowThickness , 2 , 01248 XmNinitialResourcesPersistent , False , 01249 NULL ) ; 01250 01251 /*--- rowcol to manage viewing control stuff ---*/ 01252 01253 imag->view_rowcol = 01254 XtVaCreateWidget( 01255 "dialog" , xmRowColumnWidgetClass , imag->view_frame , 01256 XmNpacking , XmPACK_TIGHT , 01257 XmNorientation , XmVERTICAL , 01258 XmNtraversalOn , False , 01259 XmNinitialResourcesPersistent , False , 01260 NULL ) ; 01261 01262 /*--- pushbuttons to turn different views on ---*/ 01263 01264 #define xyz_3DIM "Axial " 01265 #define yzx_3DIM "Sagittal" 01266 #define zxy_3DIM "Coronal " 01267 01268 /*--------------------------------------------------------------*/ 01269 imag->xyz_rowcol = 01270 XtVaCreateWidget( 01271 "dialog" , xmRowColumnWidgetClass , imag->view_rowcol , 01272 XmNpacking , XmPACK_TIGHT , 01273 XmNorientation , XmHORIZONTAL , 01274 XmNmarginHeight, 0 , 01275 XmNmarginWidth , 0 , 01276 XmNtraversalOn , False , 01277 XmNinitialResourcesPersistent , False , 01278 NULL ) ; 01279 01280 imag->name_xyz_lab = 01281 XtVaCreateManagedWidget( 01282 "dialog" , xmLabelWidgetClass , imag->xyz_rowcol , 01283 LABEL_ARG( xyz_3DIM ) , 01284 XmNmarginHeight, 0 , 01285 XmNmarginWidth , 0 , 01286 XmNrecomputeSize , False , 01287 XmNtraversalOn , False , 01288 XmNinitialResourcesPersistent , False , 01289 NULL ) ; 01290 01291 imag->image_xyz_pb = 01292 XtVaCreateManagedWidget( 01293 "dialog" , xmPushButtonWidgetClass , imag->xyz_rowcol , 01294 LABEL_ARG("Image") , 01295 XmNmarginHeight, 0 , 01296 XmNmarginWidth , 0 , 01297 XmNrecomputeSize , False , 01298 XmNtraversalOn , False , 01299 XmNinitialResourcesPersistent , False , 01300 NULL ) ; 01301 01302 imag->graph_xyz_pb = 01303 XtVaCreateManagedWidget( 01304 "dialog" , xmPushButtonWidgetClass , imag->xyz_rowcol , 01305 LABEL_ARG("Graph") , 01306 XmNmarginHeight, 0 , 01307 XmNmarginWidth , 0 , 01308 XmNrecomputeSize , False , 01309 XmNtraversalOn , False , 01310 XmNinitialResourcesPersistent , False , 01311 NULL ) ; 01312 01313 XtManageChild( imag->xyz_rowcol ) ; 01314 /*----------------------------------------------------------------*/ 01315 01316 /*--------------------------------------------------------------*/ 01317 imag->yzx_rowcol = 01318 XtVaCreateWidget( 01319 "dialog" , xmRowColumnWidgetClass , imag->view_rowcol , 01320 XmNpacking , XmPACK_TIGHT , 01321 XmNorientation , XmHORIZONTAL , 01322 XmNmarginHeight, 0 , 01323 XmNmarginWidth , 0 , 01324 XmNtraversalOn , False , 01325 XmNinitialResourcesPersistent , False , 01326 NULL ) ; 01327 01328 imag->name_yzx_lab = 01329 XtVaCreateManagedWidget( 01330 "dialog" , xmLabelWidgetClass , imag->yzx_rowcol , 01331 LABEL_ARG( yzx_3DIM ) , 01332 XmNmarginHeight, 0 , 01333 XmNmarginWidth , 0 , 01334 XmNrecomputeSize , False , 01335 XmNtraversalOn , False , 01336 XmNinitialResourcesPersistent , False , 01337 NULL ) ; 01338 01339 imag->image_yzx_pb = 01340 XtVaCreateManagedWidget( 01341 "dialog" , xmPushButtonWidgetClass , imag->yzx_rowcol , 01342 LABEL_ARG("Image") , 01343 XmNmarginHeight, 0 , 01344 XmNmarginWidth , 0 , 01345 XmNrecomputeSize , False , 01346 XmNtraversalOn , False , 01347 XmNinitialResourcesPersistent , False , 01348 NULL ) ; 01349 01350 imag->graph_yzx_pb = 01351 XtVaCreateManagedWidget( 01352 "dialog" , xmPushButtonWidgetClass , imag->yzx_rowcol , 01353 LABEL_ARG("Graph") , 01354 XmNmarginHeight, 0 , 01355 XmNmarginWidth , 0 , 01356 XmNrecomputeSize , False , 01357 XmNtraversalOn , False , 01358 XmNinitialResourcesPersistent , False , 01359 NULL ) ; 01360 01361 XtManageChild( imag->yzx_rowcol ) ; 01362 /*----------------------------------------------------------------*/ 01363 01364 /*--------------------------------------------------------------*/ 01365 imag->zxy_rowcol = 01366 XtVaCreateWidget( 01367 "dialog" , xmRowColumnWidgetClass , imag->view_rowcol , 01368 XmNpacking , XmPACK_TIGHT , 01369 XmNorientation , XmHORIZONTAL , 01370 XmNmarginHeight, 0 , 01371 XmNmarginWidth , 0 , 01372 XmNtraversalOn , False , 01373 XmNinitialResourcesPersistent , False , 01374 NULL ) ; 01375 01376 imag->name_zxy_lab = 01377 XtVaCreateManagedWidget( 01378 "dialog" , xmLabelWidgetClass , imag->zxy_rowcol , 01379 LABEL_ARG( zxy_3DIM ) , 01380 XmNmarginHeight, 0 , 01381 XmNmarginWidth , 0 , 01382 XmNrecomputeSize , False , 01383 XmNtraversalOn , False , 01384 XmNinitialResourcesPersistent , False , 01385 NULL ) ; 01386 01387 imag->image_zxy_pb = 01388 XtVaCreateManagedWidget( 01389 "dialog" , xmPushButtonWidgetClass , imag->zxy_rowcol , 01390 LABEL_ARG("Image") , 01391 XmNmarginHeight, 0 , 01392 XmNmarginWidth , 0 , 01393 XmNrecomputeSize , False , 01394 XmNtraversalOn , False , 01395 XmNinitialResourcesPersistent , False , 01396 NULL ) ; 01397 01398 imag->graph_zxy_pb = 01399 XtVaCreateManagedWidget( 01400 "dialog" , xmPushButtonWidgetClass , imag->zxy_rowcol , 01401 LABEL_ARG("Graph") , 01402 XmNmarginHeight, 0 , 01403 XmNmarginWidth , 0 , 01404 XmNrecomputeSize , False , 01405 XmNtraversalOn , False , 01406 XmNinitialResourcesPersistent , False , 01407 NULL ) ; 01408 01409 XtManageChild( imag->zxy_rowcol ) ; 01410 /*----------------------------------------------------------------*/ 01411 01412 XtAddCallback( imag->image_xyz_pb , XmNactivateCallback , 01413 AFNI_view_xyz_CB , im3d ) ; 01414 01415 XtAddCallback( imag->image_yzx_pb , XmNactivateCallback , 01416 AFNI_view_xyz_CB , im3d ) ; 01417 01418 XtAddCallback( imag->image_zxy_pb , XmNactivateCallback , 01419 AFNI_view_xyz_CB , im3d ) ; 01420 01421 XtAddCallback( imag->graph_xyz_pb , XmNactivateCallback , 01422 AFNI_view_xyz_CB , im3d ) ; 01423 01424 XtAddCallback( imag->graph_yzx_pb , XmNactivateCallback , 01425 AFNI_view_xyz_CB , im3d ) ; 01426 01427 XtAddCallback( imag->graph_zxy_pb , XmNactivateCallback , 01428 AFNI_view_xyz_CB , im3d ) ; 01429 01430 MCW_reghelp_children( imag->xyz_rowcol , AFNI_view_help ) ; 01431 MCW_reghelp_children( imag->yzx_rowcol , AFNI_view_help ) ; 01432 MCW_reghelp_children( imag->zxy_rowcol , AFNI_view_help ) ; 01433 01434 MCW_reghint_children( imag->xyz_rowcol , "Open/raise viewing window" ) ; 01435 MCW_reghint_children( imag->yzx_rowcol , "Open/raise viewing window" ) ; 01436 MCW_reghint_children( imag->zxy_rowcol , "Open/raise viewing window" ) ; 01437 01438 XtInsertEventHandler( imag->image_xyz_pb , 01439 ButtonPressMask , FALSE , 01440 AFNI_viewbut_EV , (XtPointer)im3d , XtListTail ) ; 01441 XtInsertEventHandler( imag->graph_xyz_pb , 01442 ButtonPressMask , FALSE , 01443 AFNI_viewbut_EV , (XtPointer)im3d , XtListTail ) ; 01444 XtInsertEventHandler( imag->image_yzx_pb , 01445 ButtonPressMask , FALSE , 01446 AFNI_viewbut_EV , (XtPointer)im3d , XtListTail ) ; 01447 XtInsertEventHandler( imag->graph_yzx_pb , 01448 ButtonPressMask , FALSE , 01449 AFNI_viewbut_EV , (XtPointer)im3d , XtListTail ) ; 01450 XtInsertEventHandler( imag->image_zxy_pb , 01451 ButtonPressMask , FALSE , 01452 AFNI_viewbut_EV , (XtPointer)im3d , XtListTail ) ; 01453 XtInsertEventHandler( imag->graph_zxy_pb , 01454 ButtonPressMask , FALSE , 01455 AFNI_viewbut_EV , (XtPointer)im3d , XtListTail ) ; 01456 01457 /* imaging column finished, so manage its pieces */ 01458 01459 XtManageChild( imag->crosshair_rowcol ) ; 01460 XtManageChild( imag->view_rowcol ) ; 01461 XtManageChild( imag->rowcol ) ; 01462 01463 /*-------------------------------------------------------*/ 01464 /************ Controls for which view we see *************/ 01465 /*-------------------------------------------------------*/ 01466 01467 marks->ov_visible = marks->tag_visible = False ; 01468 01469 /*--- vertical rowcol to hold all viewing controls stuff ---*/ 01470 01471 STATUS("making view->rowcol") ; 01472 01473 view->rowcol = 01474 XtVaCreateWidget( 01475 "dialog" , xmRowColumnWidgetClass , view->frame , 01476 XmNpacking , XmPACK_TIGHT , 01477 XmNorientation , XmVERTICAL , 01478 XmNtraversalOn , False , 01479 XmNinitialResourcesPersistent , False , 01480 NULL ) ; 01481 01482 view_count = 0 ; /* count of widgets in this column */ 01483 01484 /*--- radio box to control which view we see ---*/ 01485 01486 view->view_bbox = 01487 new_MCW_bbox( view->rowcol , 01488 LAST_VIEW_TYPE+1 , 01489 VIEW_typestr , 01490 MCW_BB_radio_one , 01491 MCW_BB_frame , 01492 AFNI_switchview_CB , (XtPointer) im3d ) ; 01493 01494 for( id=0 ; id <= LAST_VIEW_TYPE ; id++ ){ 01495 if( im3d->anat_dset[id] == NULL ) 01496 XtSetSensitive( view->view_bbox->wbut[id] , False ) ; 01497 } 01498 01499 MCW_set_bbox( view->view_bbox , 1 << im3d->vinfo->view_type ) ; 01500 01501 ADDTO_KILL(im3d->kl,view->view_bbox) ; 01502 01503 MCW_reghelp_children( view->view_bbox->wrowcol , 01504 "Use these to select the\n" 01505 "type of view for your data" ) ; 01506 01507 { char * hh[] = { "View data in original coordinates" , 01508 "View data in AC-PC aligned coordinates" , 01509 "View data in Talairach coordinates" } ; 01510 MCW_bbox_hints( view->view_bbox , 3 , hh ) ; 01511 } 01512 01513 view_count += LAST_VIEW_TYPE+1 ; 01514 01515 /*--- frame for marks buttons ---*/ 01516 01517 view->marks_frame = 01518 XtVaCreateManagedWidget( 01519 "dialog" , xmFrameWidgetClass , view->rowcol , 01520 XmNshadowType , XmSHADOW_ETCHED_IN , 01521 XmNshadowThickness , 2 , 01522 XmNtraversalOn , False , 01523 XmNinitialResourcesPersistent , False , 01524 NULL ) ; 01525 01526 view->marks_rowcol = 01527 XtVaCreateWidget( 01528 "dialog" , xmRowColumnWidgetClass , view->marks_frame , 01529 XmNpacking , XmPACK_TIGHT , 01530 XmNorientation , XmVERTICAL , 01531 XmNtraversalOn , False , 01532 XmNinitialResourcesPersistent , False , 01533 NULL ) ; 01534 01535 /*--- pushbutton to allow user to define marks ---*/ 01536 01537 view->define_marks_pb = 01538 XtVaCreateManagedWidget( 01539 "dialog" , xmPushButtonWidgetClass , view->marks_rowcol , 01540 LABEL_ARG("Define Markers") , 01541 XmNmarginHeight , 1 , 01542 XmNtraversalOn , False , 01543 XmNinitialResourcesPersistent , False , 01544 NULL ) ; 01545 01546 view->marks_pb_inverted = False ; 01547 01548 XtAddCallback( view->define_marks_pb , XmNactivateCallback , 01549 AFNI_define_CB , im3d ) ; 01550 01551 MCW_register_help( view->define_marks_pb , 01552 "Use this to allow you to define\n" 01553 "the markers for this view type" ) ; 01554 MCW_register_hint( view->define_marks_pb , 01555 "Open/close Talairach markers control panel" ) ; 01556 01557 view_count ++ ; 01558 01559 /*--- bbox to allow the user to turn marks off and on ---*/ 01560 01561 view->see_marks_bbox = 01562 new_MCW_bbox( view->marks_rowcol , 01563 1 , AFNI_see_marks_bbox_label , 01564 MCW_BB_check , 01565 MCW_BB_noframe , 01566 AFNI_see_marks_CB , (XtPointer) im3d ) ; 01567 01568 view->see_marks_bbox->parent = (XtPointer) im3d ; 01569 01570 MCW_set_bbox( view->see_marks_bbox , (marks->ov_visible) ? 0 : 1 ) ; 01571 01572 MCW_reghelp_children( view->see_marks_bbox->wrowcol , 01573 AFNI_see_marks_bbox_help ) ; 01574 MCW_reghint_children( view->see_marks_bbox->wrowcol , 01575 "Visibility of Talairach markers and Tags" ) ; 01576 01577 ADDTO_KILL(im3d->kl,view->see_marks_bbox) ; 01578 01579 view_count ++ ; 01580 01581 /*--- frame for func buttons ---*/ 01582 01583 im3d->vinfo->func_visible = False ; 01584 01585 view->func_frame = 01586 XtVaCreateManagedWidget( 01587 "dialog" , xmFrameWidgetClass , view->rowcol , 01588 XmNshadowType , XmSHADOW_ETCHED_IN , 01589 XmNshadowThickness , 2 , 01590 XmNtraversalOn , False , 01591 XmNinitialResourcesPersistent , False , 01592 NULL ) ; 01593 01594 view->func_rowcol = 01595 XtVaCreateWidget( 01596 "dialog" , xmRowColumnWidgetClass , view->func_frame , 01597 XmNpacking , XmPACK_TIGHT , 01598 XmNorientation , XmVERTICAL , 01599 XmNtraversalOn , False , 01600 XmNinitialResourcesPersistent , False , 01601 NULL ) ; 01602 01603 /*--- pushbutton to allow user to define functions ---*/ 01604 01605 view->define_func_pb = 01606 XtVaCreateManagedWidget( 01607 "dialog" , xmPushButtonWidgetClass , view->func_rowcol , 01608 LABEL_ARG("Define OverLay") , 01609 XmNmarginHeight , 1 , 01610 XmNtraversalOn , False , 01611 XmNinitialResourcesPersistent , False , 01612 NULL ) ; 01613 01614 view->func_pb_inverted = False ; 01615 01616 XtAddCallback( view->define_func_pb , XmNactivateCallback , 01617 AFNI_define_CB , im3d ) ; 01618 01619 MCW_register_help( view->define_func_pb , 01620 "Use this to control the thresholds,\n" 01621 "colors, etc. for overlays" ) ; 01622 MCW_register_hint( view->define_func_pb , 01623 "Open/close overlay control panel" ) ; 01624 01625 view_count ++ ; 01626 01627 /*--- bbox to allow the user to turn function overlay off and on ---*/ 01628 01629 view->see_func_bbox = 01630 new_MCW_bbox( view->func_rowcol , 01631 1 , AFNI_see_func_bbox_label , 01632 MCW_BB_check , 01633 MCW_BB_noframe , 01634 AFNI_see_func_CB , (XtPointer) im3d ) ; 01635 01636 view->see_func_bbox->parent = (XtPointer) im3d ; 01637 01638 MCW_set_bbox( view->see_func_bbox , (im3d->vinfo->func_visible) ? 1 : 0 ) ; 01639 01640 MCW_reghelp_children( view->see_func_bbox->wrowcol , 01641 AFNI_see_func_bbox_help ) ; 01642 MCW_reghint_children( view->see_func_bbox->wrowcol , 01643 "Visibility of color overlay" ) ; 01644 01645 ADDTO_KILL(im3d->kl,view->see_func_bbox) ; 01646 01647 view_count ++ ; 01648 01649 /*--- pushbutton to allow user to define datamode ---*/ 01650 01651 view->define_dmode_pb = 01652 XtVaCreateManagedWidget( 01653 "dialog" , xmPushButtonWidgetClass , view->rowcol , 01654 LABEL_ARG("Define Datamode") , 01655 XmNmarginHeight , 1 , 01656 XmNtraversalOn , False , 01657 XmNinitialResourcesPersistent , False , 01658 NULL ) ; 01659 01660 view->dmode_pb_inverted = False ; 01661 01662 XtAddCallback( view->define_dmode_pb , XmNactivateCallback , 01663 AFNI_define_CB , im3d ) ; 01664 01665 MCW_register_help( view->define_dmode_pb , 01666 "Use this to control the mode in which\n" 01667 "the anatomy data is viewed, and also\n" 01668 "to save 3D datasets to disk" ) ; 01669 MCW_register_hint( view->define_dmode_pb , 01670 "Open/close data manipulation control panel" ) ; 01671 01672 view_count ++ ; 01673 01674 /*--- frame for dataset choosers ---*/ 01675 01676 view->dataset_frame = 01677 XtVaCreateManagedWidget( 01678 "dialog" , xmFrameWidgetClass , view->rowcol , 01679 XmNshadowType , XmSHADOW_ETCHED_IN , 01680 XmNshadowThickness , 2 , 01681 XmNtraversalOn , False , 01682 XmNinitialResourcesPersistent , False , 01683 NULL ) ; 01684 01685 view->dataset_rowcol = 01686 XtVaCreateWidget( 01687 "dialog" , xmRowColumnWidgetClass , view->dataset_frame , 01688 XmNpacking , XmPACK_TIGHT , 01689 XmNorientation , XmVERTICAL , 01690 XmNtraversalOn , False , 01691 XmNinitialResourcesPersistent , False , 01692 NULL ) ; 01693 01694 /*--- pushbuttons for dataset choice ---*/ 01695 01696 view->choose_sess_pb = 01697 XtVaCreateManagedWidget( 01698 "dialog" , xmPushButtonWidgetClass , view->dataset_rowcol , 01699 LABEL_ARG("Switch Session") , 01700 XmNmarginHeight , 1 , 01701 XmNtraversalOn , False , 01702 XmNinitialResourcesPersistent , False , 01703 NULL ) ; 01704 01705 XtAddCallback( view->choose_sess_pb , XmNactivateCallback , 01706 AFNI_choose_dataset_CB , im3d ) ; 01707 01708 MCW_register_help( view->choose_sess_pb , 01709 "Use this to choose from which\n" 01710 "session 3D datasets may be viewed." ) ; 01711 MCW_register_hint( view->choose_sess_pb , 01712 "Switch between session directories" ) ; 01713 01714 view_count ++ ; 01715 01716 view->choose_anat_pb = 01717 XtVaCreateManagedWidget( 01718 "dialog" , xmPushButtonWidgetClass , view->dataset_rowcol , 01719 LABEL_ARG("Switch UnderLay") , 01720 XmNmarginHeight , 1 , 01721 XmNtraversalOn , False , 01722 XmNinitialResourcesPersistent , False , 01723 NULL ) ; 01724 01725 XtAddCallback( view->choose_anat_pb , XmNactivateCallback , 01726 AFNI_choose_dataset_CB , im3d ) ; 01727 01728 MCW_register_help( view->choose_anat_pb , 01729 "Use this to choose which 3D\n" 01730 "dataset to view as the underlay\n" 01731 "(from the current session).\n\n" 01732 "N.B.: Datasets which can be\n" 01733 " graphed are marked with a\n" 01734 " '*' after their names.\n" 01735 " Datasets that are compressed\n" 01736 " have 'z' after their names." 01737 ) ; 01738 MCW_register_hint( view->choose_anat_pb , 01739 "Switch datasets for underlay/graphs" ) ; 01740 01741 view_count ++ ; 01742 01743 view->choose_func_pb = 01744 XtVaCreateManagedWidget( 01745 "dialog" , xmPushButtonWidgetClass , view->dataset_rowcol , 01746 LABEL_ARG("Switch OverLay") , 01747 XmNmarginHeight , 1 , 01748 XmNtraversalOn , False , 01749 XmNinitialResourcesPersistent , False , 01750 NULL ) ; 01751 01752 XtAddCallback( view->choose_func_pb , XmNactivateCallback , 01753 AFNI_choose_dataset_CB , im3d ) ; 01754 01755 MCW_register_help( view->choose_func_pb , 01756 "Use this to choose which\n" 01757 "overlay 3D dataset to view\n" 01758 "(from the current session).\n" 01759 "N.B.: Datasets that are compressed\n" 01760 " have 'z' after their names." 01761 ) ; 01762 MCW_register_hint( view->choose_func_pb , 01763 "Switch datasets for color overlay" ) ; 01764 01765 view_count ++ ; 01766 01767 /* 19 Aug 2002: Surface chooser! */ 01768 01769 view->choose_surf_pb = 01770 XtVaCreateManagedWidget( 01771 "dialog" , xmPushButtonWidgetClass , view->dataset_rowcol , 01772 LABEL_ARG("Control Surface") , 01773 XmNmarginHeight , 1 , 01774 XmNtraversalOn , False , 01775 XmNinitialResourcesPersistent , False , 01776 NULL ) ; 01777 01778 XtAddCallback( view->choose_surf_pb , XmNactivateCallback , 01779 AFNI_choose_surface_CB , im3d ) ; 01780 01781 MCW_register_help( view->choose_surf_pb , 01782 "Use this to control the display of\n" 01783 "overlaid surfaces in image viewers:\n" 01784 "\n" 01785 "Surface nodes will have little boxes\n" 01786 " drawn, when they appear inside a slice.\n" 01787 "Surface triangles will have line segments\n" 01788 " drawn, where they intersect a slice\n" 01789 " center-plane." 01790 ) ; 01791 MCW_register_hint( view->choose_surf_pb , 01792 "Control surface overlay" ) ; 01793 01794 view->swid = NULL ; /* no widgets for surface yet */ 01795 01796 view_count ++ ; 01797 01798 #ifdef POPUP_CHOOSERS 01799 (void) XtVaCreateManagedWidget( 01800 "dialog" , xmSeparatorWidgetClass , imag->popmenu , 01801 XmNseparatorType , XmDOUBLE_LINE , 01802 NULL ) ; 01803 01804 view->popchoose_sess_pb = 01805 XtVaCreateManagedWidget( 01806 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 01807 LABEL_ARG("Switch Session") , 01808 XmNmarginHeight , 0 , 01809 XmNtraversalOn , False , 01810 XmNinitialResourcesPersistent , False , 01811 NULL ) ; 01812 01813 XtAddCallback( view->popchoose_sess_pb , XmNactivateCallback , 01814 AFNI_choose_dataset_CB , im3d ) ; 01815 01816 view->popchoose_anat_pb = 01817 XtVaCreateManagedWidget( 01818 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 01819 LABEL_ARG("Switch UnderLay") , 01820 XmNmarginHeight , 0 , 01821 XmNtraversalOn , False , 01822 XmNinitialResourcesPersistent , False , 01823 NULL ) ; 01824 01825 XtAddCallback( view->popchoose_anat_pb , XmNactivateCallback , 01826 AFNI_choose_dataset_CB , im3d ) ; 01827 01828 view->popchoose_func_pb = 01829 XtVaCreateManagedWidget( 01830 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 01831 LABEL_ARG("Switch OverLay") , 01832 XmNmarginHeight , 0 , 01833 XmNtraversalOn , False , 01834 XmNinitialResourcesPersistent , False , 01835 NULL ) ; 01836 01837 XtAddCallback( view->popchoose_func_pb , XmNactivateCallback , 01838 AFNI_choose_dataset_CB , im3d ) ; 01839 01840 if( im3d->type == AFNI_IMAGES_VIEW ){ 01841 XtUnmanageChild( view->popchoose_func_pb ) ; 01842 XtUnmanageChild( view->popchoose_anat_pb ) ; 01843 XtUnmanageChild( view->popchoose_sess_pb ) ; 01844 } 01845 01846 #else /* don't POPUP_CHOOSERS */ 01847 01848 view->popchoose_func_pb = 01849 view->popchoose_anat_pb = 01850 view->popchoose_sess_pb = NULL ; 01851 01852 #endif /* POPUP_CHOOSERS*/ 01853 01854 /*--- all view controls made, now manage them ---*/ 01855 01856 XtManageChild( view->marks_rowcol ) ; 01857 XtManageChild( view->func_rowcol ) ; 01858 XtManageChild( view->dataset_rowcol ) ; 01859 XtManageChild( view->rowcol ) ; 01860 01861 /** compute height of widgets in the view-> column **/ 01862 01863 xstr = XmStringCreateLtoR("(y[M",XmFONTLIST_DEFAULT_TAG ); 01864 XtVaGetValues( view->choose_func_pb , XmNfontList , &xflist , NULL ) ; 01865 view_height = (10 + XmStringHeight(xflist,xstr)) * view_count ; 01866 XmStringFree( xstr ) ; 01867 01868 EXRETURN ; 01869 } 01870 01871 /*--------------------------------------------------------------------*/ 01872 01873 void AFNI_make_wid2( Three_D_View * im3d ) 01874 { 01875 int ii ; 01876 Widget hrc ; /* 30 Mar 2001 */ 01877 01878 ENTRY("AFNI_make_wid2") ; 01879 01880 /*-------------------------------------------------------*/ 01881 /************ Marker controls (lots of them) ************/ 01882 /*-------------------------------------------------------*/ 01883 01884 /*----- horizontal rowcol to hold the two columns of controls -----*/ 01885 01886 STATUS("making marks->rowcol") ; 01887 01888 marks->rowcol = 01889 XtVaCreateWidget( 01890 "dialog" , xmRowColumnWidgetClass , marks->frame , 01891 XmNpacking , XmPACK_TIGHT , 01892 XmNorientation , XmHORIZONTAL , 01893 XmNtraversalOn , False , 01894 XmNinitialResourcesPersistent , False , 01895 NULL ) ; 01896 01897 /*---------------------------------------------------------------*/ 01898 /*----- COLUMN 1: the toggle switches for selecting markers -----*/ 01899 /*---------------------------------------------------------------*/ 01900 01901 marks->tog_frame = 01902 XtVaCreateManagedWidget( 01903 "dialog" , xmFrameWidgetClass , marks->rowcol , 01904 XmNshadowType , XmSHADOW_ETCHED_IN , 01905 XmNshadowThickness , 2 , 01906 XmNinitialResourcesPersistent , False , 01907 NULL ) ; 01908 01909 /*--- rowcol to manage toggle buttons stuff ---*/ 01910 01911 marks->tog_rowcol = 01912 XtVaCreateWidget( 01913 "dialog" , xmRowColumnWidgetClass , marks->tog_frame , 01914 XmNpacking , XmPACK_TIGHT , 01915 XmNorientation , XmVERTICAL , 01916 XmNtraversalOn , False , 01917 XmNinitialResourcesPersistent , False , 01918 NULL ) ; 01919 01920 /*----- create radio buttons in pairs, 01921 one in the rowcol and one in the popmenu; 01922 N.B.: they are created unmanaged and will be managed 01923 later, depending on defined marks for the view -----*/ 01924 01925 XtVaSetValues( marks->tog_rowcol , 01926 XmNradioBehavior , True , 01927 XmNradioAlwaysOne , False , 01928 XmNspacing , 1 , 01929 XmNmarginHeight , 0 , 01930 XmNmarginWidth , 0 , 01931 NULL ) ; 01932 01933 marks->num_sometimes_popup = 0 ; 01934 marks->num_always_popup = 0 ; 01935 01936 marks->always_popup[(marks->num_always_popup)++] = 01937 XtVaCreateWidget( 01938 "dialog" , xmSeparatorWidgetClass , imag->popmenu , 01939 XmNseparatorType , XmDOUBLE_LINE , 01940 NULL ) ; 01941 01942 { int ib ; 01943 Dimension isiz ; 01944 Pixel fg_pix ; 01945 01946 XtVaGetValues( marks->tog_rowcol , XmNforeground , &fg_pix , NULL ) ; 01947 01948 for( ib=0 ; ib < MARKS_MAXNUM ; ib++ ){ 01949 01950 marks->tog[ib] = 01951 XtVaCreateWidget( 01952 "dialog" , xmToggleButtonWidgetClass , marks->tog_rowcol , 01953 XmNvisibleWhenOff , True , 01954 XmNmarginHeight , 0 , 01955 XmNmarginWidth , 0 , 01956 XmNselectColor , fg_pix , 01957 XmNtraversalOn , False , 01958 XmNinitialResourcesPersistent , False , 01959 NULL ) ; 01960 01961 /* we set XmNindicatorSize resource for the popup to same as the 01962 menu above, since menu default size is tiny and looks bad! */ 01963 01964 if( ib==0 ) 01965 XtVaGetValues( marks->tog[0],XmNindicatorSize,&isiz,NULL ) ; 01966 01967 marks->sometimes_popup[(marks->num_sometimes_popup)++] = 01968 marks->poptog[ib] = 01969 XtVaCreateWidget( 01970 "dialog" , xmToggleButtonWidgetClass , imag->popmenu , 01971 XmNindicatorSize , isiz , 01972 XmNvisibleWhenOff , True , 01973 XmNmarginHeight , 0 , 01974 XmNmarginWidth , 0 , 01975 XmNselectColor , fg_pix , 01976 XmNtraversalOn , False , 01977 XmNinitialResourcesPersistent , False , 01978 NULL ) ; 01979 01980 MCW_register_help( marks->tog[ib],&(marks->tog_help[ib][0]) ) ; 01981 01982 XtAddCallback( marks->tog[ib] , 01983 XmNdisarmCallback , 01984 AFNI_marktog_CB , im3d ) ; 01985 01986 XtAddCallback( marks->poptog[ib] , 01987 XmNvalueChangedCallback , 01988 AFNI_marktog_CB , im3d ) ; 01989 01990 marks->inverted[ib] = False ; 01991 } /* end of loop creating toggle buttons */ 01992 } /* end of radio toggle creation */ 01993 01994 /*----------------------------------------------------*/ 01995 /*----- COLUMN 2: controls to manage the markers -----*/ 01996 /*----------------------------------------------------*/ 01997 01998 marks->control_frame = 01999 XtVaCreateManagedWidget( 02000 "dialog" , xmFrameWidgetClass , marks->rowcol , 02001 XmNshadowType , XmSHADOW_ETCHED_IN , 02002 XmNshadowThickness , 2 , 02003 XmNinitialResourcesPersistent , False , 02004 NULL ) ; 02005 02006 /*--- rowcol to manage marker control stuff ---*/ 02007 02008 marks->control_rowcol = 02009 XtVaCreateWidget( 02010 "dialog" , xmRowColumnWidgetClass , marks->control_frame , 02011 XmNpacking , XmPACK_TIGHT , 02012 XmNorientation , XmVERTICAL , 02013 XmNtraversalOn , False , 02014 XmNinitialResourcesPersistent , False , 02015 NULL ) ; 02016 02017 /*--- bbox to control editability of marks ---*/ 02018 02019 marks->edits_bbox = 02020 new_MCW_bbox( marks->control_rowcol , 02021 1 , AFNI_marks_edits_bbox_label , 02022 MCW_BB_check , 02023 MCW_BB_noframe , 02024 AFNI_marks_edits_CB , (XtPointer) im3d ) ; 02025 02026 marks->edits_bbox->parent = (XtPointer) im3d ; 02027 02028 MCW_reghelp_children( marks->edits_bbox->wrowcol , 02029 AFNI_marks_edits_bbox_help ) ; 02030 MCW_reghint_children( marks->edits_bbox->wrowcol , 02031 "Press IN to allow changes to markers" ) ; 02032 02033 ADDTO_KILL(im3d->kl,marks->edits_bbox) ; 02034 02035 /*----- frame to hold markers display stuff -----*/ 02036 02037 marks->disp_frame = 02038 XtVaCreateManagedWidget( 02039 "frame" , xmFrameWidgetClass , marks->control_rowcol , 02040 XmNshadowType , XmSHADOW_ETCHED_IN , 02041 XmNshadowThickness , 2 , 02042 XmNinitialResourcesPersistent , False , 02043 NULL ) ; 02044 02045 /*----- rowcol to hold markers display stuff -----*/ 02046 02047 marks->disp_rowcol = 02048 XtVaCreateWidget( 02049 "dialog" , xmRowColumnWidgetClass , marks->disp_frame , 02050 XmNpacking , XmPACK_TIGHT , 02051 XmNorientation , XmVERTICAL , 02052 XmNtraversalOn , False , 02053 XmNinitialResourcesPersistent , False , 02054 NULL ) ; 02055 02056 /*--- arrowval to control primary color ---*/ 02057 02058 marks->ov_pcolor = MIN(last_color,INIT_marks1_color) ; 02059 marks->ov_scolor = MIN(last_color,INIT_marks2_color) ; 02060 02061 ii = AVOPT_STYLE ; 02062 02063 if( ii == MCW_AV_downup ){ 02064 marks->disp_pcolor_av = 02065 new_MCW_arrowval( 02066 marks->disp_rowcol , /* parent */ 02067 "Pcolor" , /* label */ 02068 MCW_AV_downup , /* arrow directions */ 02069 0 , /* min value */ 02070 last_color , /* max value */ 02071 marks->ov_pcolor , /* init value */ 02072 MCW_AV_readtext , /* readonly text display */ 02073 0 , /* 0 decimal shift */ 02074 AFNI_marks_disp_av_CB , /* click routine */ 02075 (XtPointer) im3d , /* data */ 02076 MCW_DC_ovcolor_text , /* text routine */ 02077 (XtPointer) im3d->dc /* data */ 02078 ) ; 02079 marks->disp_pcolor_av->fastdelay = 333 ; /* slow down repeat action */ 02080 marks->disp_pcolor_av->allow_wrap = 1 ; 02081 (void) MCW_DC_ovcolor_text( marks->disp_pcolor_av , 02082 im3d->dc ) ; /* set color! */ 02083 } else { 02084 marks->disp_pcolor_av = 02085 new_MCW_colormenu( marks->disp_rowcol , "Pcolor" , im3d->dc , 02086 0 , last_color , marks->ov_pcolor , 02087 AFNI_marks_disp_av_CB , (XtPointer) im3d ) ; 02088 } 02089 02090 marks->disp_pcolor_av->parent = (XtPointer) im3d ; 02091 02092 MCW_reghelp_children( marks->disp_pcolor_av->wrowcol , 02093 AFNI_disp_pcolor_help ) ; 02094 MCW_reghint_children( marks->disp_pcolor_av->wrowcol , 02095 "Color of primary marker" ) ; 02096 02097 ADDTO_KILL(im3d->kl,marks->disp_pcolor_av) ; 02098 02099 /*--- arrowval to control secondary color ---*/ 02100 02101 if( ii == MCW_AV_downup ){ 02102 marks->disp_scolor_av = 02103 new_MCW_arrowval( 02104 marks->disp_rowcol , /* parent */ 02105 "Scolor" , /* label */ 02106 MCW_AV_downup , /* arrow directions */ 02107 0 , /* min value */ 02108 last_color , /* max value */ 02109 marks->ov_scolor , /* init value */ 02110 MCW_AV_readtext , /* readonly text display */ 02111 0 , /* 0 decimal shift */ 02112 AFNI_marks_disp_av_CB , /* click routine */ 02113 (XtPointer) im3d , /* data */ 02114 MCW_DC_ovcolor_text , /* text routine */ 02115 (XtPointer) im3d->dc /* data */ 02116 ) ; 02117 marks->disp_scolor_av->fastdelay = 333 ; /* slow down repeat action */ 02118 marks->disp_scolor_av->allow_wrap = 1 ; 02119 (void) MCW_DC_ovcolor_text( marks->disp_scolor_av , 02120 im3d->dc ) ; /* set color! */ 02121 } else { 02122 marks->disp_scolor_av = 02123 new_MCW_colormenu( marks->disp_rowcol , "Scolor" , im3d->dc , 02124 0 , last_color , marks->ov_scolor , 02125 AFNI_marks_disp_av_CB , (XtPointer) im3d ) ; 02126 } 02127 02128 marks->disp_scolor_av->parent = (XtPointer) im3d ; 02129 02130 MCW_reghelp_children( marks->disp_scolor_av->wrowcol , 02131 AFNI_disp_scolor_help ) ; 02132 MCW_reghint_children( marks->disp_scolor_av->wrowcol , 02133 "Color of secondary markers" ) ; 02134 02135 ADDTO_KILL(im3d->kl,marks->disp_scolor_av) ; 02136 02137 /*--- arrowval to control point size ---*/ 02138 02139 marks->ov_size = INIT_marks_size ; /* initialize overlay mask */ 02140 marks->ov_gap = INIT_marks_gap ; 02141 AFNI_make_ptmask( marks->ov_size , marks->ov_gap , &(marks->ov_mask) ) ; 02142 02143 marks->disp_size_av = 02144 new_MCW_arrowval( 02145 marks->disp_rowcol , /* parent */ 02146 "Size " , /* label */ 02147 AVOPT_STYLE , /* arrow directions */ 02148 1 , /* min value */ 02149 MAXOVSIZE , /* max value */ 02150 marks->ov_size , /* init value */ 02151 MCW_AV_editext , /* input/output text display */ 02152 0 , /* 0 decimal shift */ 02153 AFNI_marks_disp_av_CB , /* routine to call after click */ 02154 (XtPointer) im3d , /* data to pass */ 02155 NULL , /* routine to call for text display */ 02156 NULL /* data for text display routine */ 02157 ) ; 02158 02159 if( AVOPT_STYLE == MCW_AV_optmenu && MAXOVSIZE >= COLSIZE ) 02160 AVOPT_columnize( marks->disp_size_av , 1+(MAXOVSIZE+1)/COLSIZE ) ; 02161 02162 marks->disp_size_av->parent = (XtPointer) im3d ; 02163 marks->disp_size_av->fastdelay = 333 ; /* slow down repeat action */ 02164 02165 MCW_reghelp_children( marks->disp_size_av->wrowcol , 02166 AFNI_disp_size_help ) ; 02167 MCW_reghint_children( marks->disp_size_av->wrowcol , 02168 "Size of markers" ) ; 02169 02170 ADDTO_KILL(im3d->kl,marks->disp_size_av) ; 02171 02172 /*--- arrowval to control point gap ---*/ 02173 02174 marks->disp_gap_av = 02175 new_MCW_arrowval( 02176 marks->disp_rowcol , /* parent */ 02177 "Gap " , /* label */ 02178 AVOPT_STYLE , /* arrow directions */ 02179 1 , /* min value */ 02180 MAXOVSIZE , /* max value */ 02181 marks->ov_gap , /* init value */ 02182 MCW_AV_editext , /* input/output text display */ 02183 0 , /* 0 decimal shift */ 02184 AFNI_marks_disp_av_CB , /* routine to call after click */ 02185 (XtPointer) im3d , /* data to pass */ 02186 NULL , /* routine to call for text display */ 02187 NULL /* data for text display routine */ 02188 ) ; 02189 02190 if( AVOPT_STYLE == MCW_AV_optmenu && MAXOVSIZE >= COLSIZE ) 02191 AVOPT_columnize( marks->disp_gap_av , 1+(MAXOVSIZE+1)/COLSIZE ) ; 02192 02193 marks->disp_size_av->parent = (XtPointer) im3d ; 02194 marks->disp_size_av->fastdelay = 333 ; /* slow down repeat action */ 02195 02196 MCW_reghelp_children( marks->disp_gap_av->wrowcol , 02197 AFNI_disp_gap_help ) ; 02198 MCW_reghint_children( marks->disp_gap_av->wrowcol , 02199 "Size of gap in markers" ) ; 02200 02201 ADDTO_KILL(im3d->kl,marks->disp_size_av) ; 02202 02203 /*----- rowcol to hold action pushbuttons -----*/ 02204 02205 marks->action_rowcol = 02206 XtVaCreateWidget( 02207 "dialog" , xmRowColumnWidgetClass , marks->control_rowcol , 02208 XmNorientation , XmHORIZONTAL , 02209 XmNtraversalOn , False , 02210 XmNinitialResourcesPersistent , False , 02211 NULL ) ; 02212 02213 /*----- set point pushbutton -----*/ 02214 02215 marks->action_set_pb = 02216 XtVaCreateManagedWidget( 02217 "dialog" , xmPushButtonWidgetClass , marks->action_rowcol , 02218 LABEL_ARG("Set") , 02219 XmNtraversalOn , False , 02220 XmNinitialResourcesPersistent , False , 02221 NULL ) ; 02222 02223 XtAddCallback( marks->action_set_pb , XmNactivateCallback , 02224 AFNI_marks_action_CB , im3d ) ; 02225 02226 MCW_register_help( marks->action_set_pb , AFNI_marks_set_help ) ; 02227 MCW_register_hint( marks->action_set_pb , "Set marker at crosshairs" ) ; 02228 02229 /*----- clear point pushbutton -----*/ 02230 02231 marks->action_clear_pb = 02232 XtVaCreateManagedWidget( 02233 "dialog" , xmPushButtonWidgetClass , marks->action_rowcol , 02234 LABEL_ARG("Clear") , 02235 XmNtraversalOn , False , 02236 XmNinitialResourcesPersistent , False , 02237 NULL ) ; 02238 02239 XtAddCallback( marks->action_clear_pb , XmNactivateCallback , 02240 AFNI_marks_action_CB , im3d ) ; 02241 02242 MCW_register_help( marks->action_clear_pb , AFNI_marks_clear_help ) ; 02243 MCW_register_hint( marks->action_clear_pb , "Un-set primary marker" ) ; 02244 02245 /*----- copies of these pushbuttons on the popup menu -----*/ 02246 02247 marks->always_popup[(marks->num_always_popup)++] = 02248 XtVaCreateManagedWidget( 02249 "dialog" , xmSeparatorWidgetClass , imag->popmenu , 02250 XmNseparatorType , XmDOUBLE_LINE , 02251 NULL ) ; 02252 02253 marks->always_popup[(marks->num_always_popup)++] = 02254 marks->pop_set_pb = 02255 XtVaCreateWidget( 02256 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 02257 LABEL_ARG("Set") , 02258 XmNmarginHeight , 0 , 02259 XmNtraversalOn , False , 02260 XmNinitialResourcesPersistent , False , 02261 NULL ) ; 02262 02263 XtAddCallback( marks->pop_set_pb , XmNactivateCallback , 02264 AFNI_marks_action_CB , im3d ) ; 02265 02266 marks->always_popup[(marks->num_always_popup)++] = 02267 marks->pop_clear_pb = 02268 XtVaCreateWidget( 02269 "dialog" , xmPushButtonWidgetClass , imag->popmenu , 02270 LABEL_ARG("Clear") , 02271 XmNmarginHeight , 0 , 02272 XmNtraversalOn , False , 02273 XmNinitialResourcesPersistent , False , 02274 NULL ) ; 02275 02276 XtAddCallback( marks->pop_clear_pb , XmNactivateCallback , 02277 AFNI_marks_action_CB , im3d ) ; 02278 02279 /*----- a "quality" button (not on the popup menu) -----*/ 02280 02281 marks->action_quality_pb = 02282 XtVaCreateManagedWidget( 02283 "dialog" , xmPushButtonWidgetClass , marks->action_rowcol , 02284 LABEL_ARG("Quality?") , 02285 XmNtraversalOn , False , 02286 XmNinitialResourcesPersistent , False , 02287 NULL ) ; 02288 02289 XtAddCallback( marks->action_quality_pb , XmNactivateCallback , 02290 AFNI_marks_action_CB , im3d ) ; 02291 02292 MCW_register_help( marks->action_quality_pb , AFNI_marks_quality_help ) ; 02293 MCW_register_hint( marks->action_quality_pb , "Check markers for consistency" ) ; 02294 02295 /*----- below the line, put the transformation controls -----*/ 02296 02297 (void) XtVaCreateManagedWidget( 02298 "dialog" , xmSeparatorWidgetClass , marks->control_rowcol , 02299 XmNseparatorType , XmDOUBLE_LINE , 02300 NULL ) ; 02301 02302 /*----- the transformation control -----*/ 02303 02304 marks->transform_pb = 02305 XtVaCreateManagedWidget( 02306 "dialog" , xmPushButtonWidgetClass , marks->control_rowcol , 02307 LABEL_ARG("Transform Data") , 02308 XmNtraversalOn , False , 02309 XmNinitialResourcesPersistent , False , 02310 NULL ) ; 02311 02312 XtAddCallback( marks->transform_pb , XmNactivateCallback , 02313 AFNI_marks_transform_CB , im3d ) ; 02314 02315 MCW_register_help( marks->transform_pb , AFNI_marks_transform_help ) ; 02316 MCW_register_hint( marks->transform_pb , "Compute transformation from markers" ) ; 02317 02318 /*----- 3/06/96: the "big Talairach box" button -----*/ 02319 02320 marks->tlrc_big_bbox = 02321 new_MCW_bbox( marks->control_rowcol , 02322 1 , AFNI_tlrc_big_bbox_label , 02323 MCW_BB_check , MCW_BB_noframe , 02324 NULL , NULL ) ; /* no callback */ 02325 02326 marks->tlrc_big_bbox->parent = (XtPointer) im3d ; 02327 02328 MCW_reghelp_children( marks->tlrc_big_bbox->wrowcol , 02329 AFNI_tlrc_big_bbox_help ) ; 02330 MCW_reghint_children( marks->tlrc_big_bbox->wrowcol , 02331 "Use 'big' Talairach bounding box" ) ; 02332 02333 ADDTO_KILL(im3d->kl,marks->tlrc_big_bbox) ; 02334 02335 if( GLOBAL_argopt.tlrc_big ) 02336 MCW_set_bbox( marks->tlrc_big_bbox , 1 ) ; 02337 02338 /*----- manage the managers -----*/ 02339 02340 XtManageChild( marks->tog_rowcol ) ; 02341 XtManageChild( marks->disp_rowcol ) ; 02342 XtManageChild( marks->action_rowcol ) ; 02343 XtManageChild( marks->control_rowcol ) ; 02344 XtManageChild( marks->rowcol ) ; 02345 02346 /*-----------------------------------------------------*/ 02347 /**************** Function controls ********************/ 02348 /*-----------------------------------------------------*/ 02349 02350 /** old hard-wired definition */ 02351 #define SELECTOR_HEIGHT 240 02352 02353 sel_height = view_height - 19 ; 02354 02355 STATUS("making func->rowcol") ; 02356 02357 func->rowcol = 02358 XtVaCreateWidget( 02359 "dialog" , xmRowColumnWidgetClass , func->frame , 02360 XmNorientation , XmHORIZONTAL , 02361 XmNpacking , XmPACK_TIGHT , 02362 XmNtraversalOn , False , 02363 XmNinitialResourcesPersistent , False , 02364 NULL ) ; 02365 02366 /*-- threshold stuff --*/ 02367 02368 func->thr_rowcol = 02369 XtVaCreateWidget( 02370 "dialog" , xmRowColumnWidgetClass , func->rowcol , 02371 XmNorientation , XmVERTICAL , 02372 XmNpacking , XmPACK_TIGHT , 02373 XmNmarginHeight, 0 , 02374 XmNmarginWidth , 0 , 02375 XmNtraversalOn , False , 02376 XmNinitialResourcesPersistent , False , 02377 NULL ) ; 02378 02379 func->thr_label = 02380 XtVaCreateManagedWidget( 02381 "dialog" , xmLabelWidgetClass , func->thr_rowcol , 02382 LABEL_ARG("Thr") , 02383 XmNrecomputeSize , False , 02384 XmNinitialResourcesPersistent , False , 02385 NULL ) ; 02386 02387 #ifdef FIX_SCALE_VALUE_PROBLEM 02388 MCW_register_help( func->thr_label , 02389 "This version of AFNI has been\n" 02390 "compiled to show the slider value\n" 02391 "here, since there is a bug in the\n" 02392 "Motif library for this computer system." 02393 ) ; 02394 #else 02395 #endif 02396 MCW_register_help( func->thr_label , 02397 "Shows the type of threshold\n" 02398 "statistic that is available\n" 02399 "at this moment. Names mean:\n\n" 02400 FUNC_THR_LABEL " = " FUNC_THR_DESCRIPTOR "\n" 02401 FUNC_COR_LABEL " = " FUNC_COR_DESCRIPTOR "\n" 02402 FUNC_TT_LABEL " = " FUNC_TT_DESCRIPTOR "\n" 02403 FUNC_FT_LABEL " = " FUNC_FT_DESCRIPTOR "\n" 02404 FUNC_ZT_LABEL " = " FUNC_ZT_DESCRIPTOR "\n" 02405 FUNC_CT_LABEL " = " FUNC_CT_DESCRIPTOR "\n" 02406 FUNC_BT_LABEL " = " FUNC_BT_DESCRIPTOR "\n" 02407 FUNC_BN_LABEL " = " FUNC_BN_DESCRIPTOR "\n" 02408 FUNC_GT_LABEL " = " FUNC_GT_DESCRIPTOR "\n" 02409 FUNC_PT_LABEL " = " FUNC_PT_DESCRIPTOR "\n" 02410 ) ; 02411 MCW_register_hint( func->thr_label , "Type of threshold statistic" ) ; 02412 02413 FIX_SCALE_VALUE(im3d) ; 02414 02415 #define SCALE_EXTRA 66 02416 02417 {Widget qqq ; int iqqq ; 02418 char thr_str[] = "-----------" ; 02419 char zork[2] ; 02420 02421 int smax , stop , decim , sstep ; /* 30 Nov 1997: */ 02422 decim = THR_TOP_EXPON ; /* compute parameters */ 02423 smax = (int)( pow(10.0,decim) + 0.001 ) ; /* for scale display. */ 02424 stop = smax - 1 ; 02425 sstep = smax / 1000 ; 02426 { char *eee = getenv("AFNI_THRESH_BIGSTEP") ; /* 09 May 2003 */ 02427 if( eee != NULL ){ iqqq=strtol(eee,NULL,10); if(iqqq > 0) sstep=iqqq; } 02428 } 02429 if( sstep < 1 ) sstep = 1 ; else if( sstep > (smax/10) ) sstep = (smax/10) ; 02430 02431 #ifdef BOXUP_SCALE 02432 qqq = XtVaCreateManagedWidget( 02433 "dialog" , xmFrameWidgetClass , func->thr_rowcol , 02434 XmNshadowType , XmSHADOW_ETCHED_IN , 02435 XmNtraversalOn , False , 02436 XmNinitialResourcesPersistent , False , 02437 NULL ) ; 02438 #else 02439 qqq = func->thr_rowcol ; 02440 #endif 02441 02442 func->thr_scale = 02443 XtVaCreateManagedWidget( 02444 "scale" , xmScaleWidgetClass , qqq , 02445 XmNminimum , 0 , /* 30 Nov 1997: changed */ 02446 XmNmaximum , stop , /* range to be computed */ 02447 XmNscaleMultiple , sstep , 02448 XmNdecimalPoints , decim , 02449 #ifdef FIX_SCALE_VALUE_PROBLEM 02450 XmNshowValue , False , 02451 #else 02452 XmNshowValue , True , 02453 #endif 02454 XmNvalue , (int)(smax*im3d->vinfo->func_threshold) , 02455 XmNorientation , XmVERTICAL , 02456 XmNheight , sel_height , 02457 XmNborderWidth , 0 , 02458 XmNtraversalOn , False , 02459 XmNinitialResourcesPersistent , False , 02460 NULL ) ; 02461 02462 #ifdef FIX_SCALE_SIZE_PROBLEM 02463 XtVaSetValues( func->thr_scale , 02464 XmNuserData , (XtPointer) sel_height , 02465 NULL ) ; 02466 #endif 02467 02468 #ifdef USING_LESSTIF 02469 XtVaSetValues( func->thr_scale , XmNscaleWidth,24 , NULL ) ; 02470 #endif 02471 02472 #ifdef FIX_SCALE_VALUE_PROBLEM 02473 for( iqqq=0 ; iqqq < strlen(thr_str) ; iqqq++ ){ 02474 zork[0] = thr_str[iqqq] ; zork[1] = '\0' ; 02475 XtVaCreateManagedWidget( zork,xmLabelWidgetClass,func->thr_scale,NULL ) ; 02476 } 02477 #endif 02478 } 02479 02480 XtAddCallback( func->thr_scale , XmNvalueChangedCallback , 02481 AFNI_thr_scale_CB , im3d ) ; 02482 02483 XtAddCallback( func->thr_scale , XmNdragCallback , 02484 AFNI_thr_scale_drag_CB , im3d ) ; 02485 02486 MCW_reghelp_children( func->thr_scale , 02487 "Drag the slider bar to\n" 02488 "adjust the threshold\n" 02489 "for overlay display.\n\n" 02490 "* Threshold doesn't apply\n" 02491 " if dataset is RGB-format.\n" 02492 "* Threshold applies to 'Thr'\n" 02493 " sub-brick.\n" 02494 ) ; 02495 #if 0 02496 MCW_register_hint( func->thr_scale , "Threshold for color overlay" ) ; 02497 #endif 02498 02499 /** Mar 1996: label for computed p-value, under scale **/ 02500 02501 func->thr_pval_label = 02502 XtVaCreateManagedWidget( 02503 "dialog" , xmLabelWidgetClass , func->thr_rowcol , 02504 LABEL_ARG( THR_PVAL_LABEL_NONE ) , 02505 XmNrecomputeSize , False , 02506 XmNinitialResourcesPersistent , False , 02507 NULL ) ; 02508 02509 MCW_register_help( func->thr_pval_label , 02510 "Shows the estimated significance\n" 02511 "(p value) of the threshold above,\n" 02512 "if possible.\n" 02513 "* If not possible, will display as\n" 02514 " '[N/A]' instead.\n" 02515 "* p's that display as 1.2-7 should\n" 02516 " be interpreted as 1.2 x 10^(-7).\n" 02517 "* This is the significance PER VOXEL." ) ; 02518 MCW_register_hint( func->thr_pval_label , "Nominal p-value per voxel" ) ; 02519 02520 /** Jul 1997: optmenu to choose top value for scale **/ 02521 02522 func->thr_top_av = new_MCW_arrowval( func->thr_rowcol , 02523 "**" , 02524 AVOPT_STYLE , 02525 0,THR_TOP_EXPON,0 , 02526 MCW_AV_notext , 0 , 02527 AFNI_thresh_top_CB , (XtPointer) im3d , 02528 AFNI_thresh_tlabel_CB , NULL ) ; 02529 02530 im3d->vinfo->func_thresh_top = 1.0 ; 02531 02532 MCW_reghelp_children( func->thr_top_av->wrowcol , 02533 "Use this to set\n" 02534 "the power-of-10\n" 02535 "range of the\n" 02536 "threshold slider\n" 02537 "above." 02538 ) ; 02539 02540 MCW_reghint_children( func->thr_top_av->wrowcol , 02541 "Power-of-10 range of slider" ) ; 02542 02543 /*-- intensity threshold stuff --*/ 02544 02545 func->inten_rowcol = 02546 XtVaCreateWidget( 02547 "dialog" , xmRowColumnWidgetClass , func->rowcol , 02548 XmNorientation , XmVERTICAL , 02549 XmNmarginHeight, 0 , 02550 XmNmarginWidth , 0 , 02551 XmNpacking , XmPACK_TIGHT , 02552 XmNtraversalOn , False , 02553 XmNinitialResourcesPersistent , False , 02554 NULL ) ; 02555 02556 func->inten_label = 02557 XtVaCreateManagedWidget( 02558 "dialog" , xmLabelWidgetClass , func->inten_rowcol , 02559 LABEL_ARG("Inten") , 02560 XmNinitialResourcesPersistent , False , 02561 NULL ) ; 02562 02563 /**-- 17 Dec 1997: pbar menu hidden on the inten_label --**/ 02564 02565 #ifdef BAD_BUTTON3_POPUPS /* 21 Jul 2003 */ 02566 func->pbar_menu = XmCreatePopupMenu( func->inten_rowcol, "menu", NULL, 0 ) ; 02567 #else 02568 func->pbar_menu = XmCreatePopupMenu( func->inten_label , "menu", NULL, 0 ) ; 02569 #endif 02570 02571 SAVEUNDERIZE(XtParent(func->pbar_menu)) ; /* 27 Feb 2001 */ 02572 02573 VISIBILIZE_WHEN_MAPPED(func->pbar_menu) ; 02574 02575 XtInsertEventHandler( func->inten_label , /* handle events in label */ 02576 02577 0 02578 | ButtonPressMask /* button presses */ 02579 , 02580 FALSE , /* nonmaskable events? */ 02581 AFNI_pbar_EV , /* handler */ 02582 (XtPointer) im3d , /* client data */ 02583 XtListTail /* last in queue */ 02584 ) ; 02585 02586 #if 0 02587 allow_MCW_optmenu_popup(0) ; /* 12 Dec 2001 */ 02588 #endif 02589 02590 (void) XtVaCreateManagedWidget( 02591 "dialog" , xmLabelWidgetClass , func->pbar_menu , 02592 LABEL_ARG("--- Cancel ---") , 02593 XmNrecomputeSize , False , 02594 XmNinitialResourcesPersistent , False , 02595 NULL ) ; 02596 02597 (void) XtVaCreateManagedWidget( 02598 "dialog" , xmSeparatorWidgetClass , func->pbar_menu , 02599 XmNseparatorType , XmSINGLE_LINE , NULL ) ; 02600 02601 /*--- environment button in menu [10 Feb 2004] ---*/ 02602 02603 #ifdef ALLOW_PLUGINS 02604 func->pbar_environment_pb = 02605 XtVaCreateManagedWidget( 02606 "dialog" , xmPushButtonWidgetClass , func->pbar_menu , 02607 LABEL_ARG("Edit Environment") , 02608 XmNmarginHeight , 0 , 02609 XmNtraversalOn , False , 02610 XmNinitialResourcesPersistent , False , 02611 NULL ) ; 02612 XtAddCallback( func->pbar_environment_pb , XmNactivateCallback , 02613 AFNI_pbar_CB , im3d ) ; 02614 #else 02615 func->pbar_environment_pb = NULL ; 02616 #endif 02617 02618 func->pbar_equalize_pb = 02619 XtVaCreateManagedWidget( 02620 "dialog" , xmPushButtonWidgetClass , func->pbar_menu , 02621 LABEL_ARG("Equalize Spacing") , 02622 XmNmarginHeight , 0 , 02623 XmNtraversalOn , False , 02624 XmNinitialResourcesPersistent , False , 02625 NULL ) ; 02626 02627 XtAddCallback( func->pbar_equalize_pb , XmNactivateCallback , 02628 AFNI_pbar_CB , im3d ) ; 02629 02630 MCW_register_hint( func->pbar_equalize_pb , "Space separators equally" ) ; 02631 02632 func->pbar_settop_pb = 02633 XtVaCreateManagedWidget( 02634 "dialog" , xmPushButtonWidgetClass , func->pbar_menu , 02635 LABEL_ARG("Set Top Value") , 02636 XmNmarginHeight , 0 , 02637 XmNtraversalOn , False , 02638 XmNinitialResourcesPersistent , False , 02639 NULL ) ; 02640 02641 XtAddCallback( func->pbar_settop_pb , XmNactivateCallback , 02642 AFNI_pbar_CB , im3d ) ; 02643 02644 MCW_register_hint( func->pbar_settop_pb , "Is scaled by 'range' controls" ) ; 02645 02646 (void) XtVaCreateManagedWidget( 02647 "dialog" , xmSeparatorWidgetClass , func->pbar_menu , 02648 XmNseparatorType , XmSINGLE_LINE , NULL ) ; 02649 02650 func->pbar_readin_pb = 02651 XtVaCreateManagedWidget( 02652 "dialog" , xmPushButtonWidgetClass , func->pbar_menu , 02653 LABEL_ARG("Read in palette") , 02654 XmNmarginHeight , 0 , 02655 XmNtraversalOn , False , 02656 XmNinitialResourcesPersistent , False , 02657 NULL ) ; 02658 02659 MCW_register_hint( func->pbar_readin_pb , "Read in a palette file" ) ; 02660 02661 XtAddCallback( func->pbar_readin_pb , XmNactivateCallback , 02662 AFNI_pbar_CB , im3d ) ; 02663 02664 func->pbar_writeout_pb = 02665 XtVaCreateManagedWidget( 02666 "dialog" , xmPushButtonWidgetClass , func->pbar_menu , 02667 LABEL_ARG("Write out palette") , 02668 XmNmarginHeight , 0 , 02669 XmNtraversalOn , False , 02670 XmNinitialResourcesPersistent , False , 02671 NULL ) ; 02672 02673 MCW_register_hint( func->pbar_writeout_pb , 02674 "Write out a palette file" ) ; 02675 02676 XtAddCallback( func->pbar_writeout_pb , XmNactivateCallback , 02677 AFNI_pbar_CB , im3d ) ; 02678 02679 /* 15 Jun 2000: image save button */ 02680 02681 func->pbar_saveim_pb = 02682 XtVaCreateManagedWidget( 02683 "dialog" , xmPushButtonWidgetClass , func->pbar_menu , 02684 LABEL_ARG("Save to PPM") , 02685 XmNmarginHeight , 0 , 02686 XmNtraversalOn , False , 02687 XmNinitialResourcesPersistent , False , 02688 NULL ) ; 02689 02690 MCW_register_hint( func->pbar_saveim_pb , 02691 "Write out as image file" ); 02692 02693 XtAddCallback( func->pbar_saveim_pb , XmNactivateCallback , 02694 AFNI_pbar_CB , im3d ) ; 02695 02696 func->pbar_showtable_pb = 02697 XtVaCreateManagedWidget( 02698 "dialog" , xmPushButtonWidgetClass , func->pbar_menu , 02699 LABEL_ARG("Show Palette Table") , 02700 XmNmarginHeight , 0 , 02701 XmNtraversalOn , False , 02702 XmNinitialResourcesPersistent , False , 02703 NULL ) ; 02704 02705 XtAddCallback( func->pbar_showtable_pb , XmNactivateCallback , 02706 AFNI_pbar_CB , im3d ) ; 02707 02708 MCW_register_hint( func->pbar_showtable_pb , "Will popup a listing window" ) ; 02709 02710 (void) XtVaCreateManagedWidget( 02711 "dialog" , xmSeparatorWidgetClass , func->pbar_menu , 02712 XmNseparatorType , XmSINGLE_LINE , NULL ) ; 02713 02714 func->pbar_palette_av = new_MCW_arrowval( 02715 func->pbar_menu , /* parent Widget */ 02716 "Set Pal " , /* label */ 02717 MCW_AV_optmenu , /* option menu style */ 02718 0 , /* first option */ 02719 1 , /* last option */ 02720 0 , /* initial selection */ 02721 MCW_AV_readtext , /* ignored but needed */ 02722 0 , /* ditto */ 02723 AFNI_palette_av_CB , /* callback when changed */ 02724 (XtPointer) im3d , /* data for above */ 02725 MCW_av_substring_CB , /* text creation routine */ 02726 AFNI_dummy_av_label /* data for above */ 02727 ) ; 02728 02729 MCW_reghint_children( func->pbar_palette_av->wrowcol , "Choose a palette" ) ; 02730 02731 if( GPT != NULL && PALTAB_NUM(GPT) > 0 ){ 02732 refit_MCW_optmenu( func->pbar_palette_av , 02733 0 , /* new minval */ 02734 PALTAB_NUM(GPT)-1 , /* new maxval */ 02735 0 , /* new inival */ 02736 0 , /* new decim? */ 02737 AFNI_palette_label_CB , /* text routine */ 02738 NULL /* text data */ 02739 ) ; 02740 } else { 02741 XtUnmanageChild( func->pbar_palette_av->wrowcol ) ; 02742 } 02743 02744 /*-- 15 Jun 2000: 0D func list --*/ 02745 02746 (void) XtVaCreateManagedWidget( 02747 "dialog" , xmSeparatorWidgetClass , func->pbar_menu , 02748 XmNseparatorType , XmSINGLE_LINE , NULL ) ; 02749 02750 func->pbar_transform0D_av = new_MCW_arrowval( 02751 func->pbar_menu , /* parent Widget */ 02752 "Tran 0D " , /* label */ 02753 MCW_AV_optmenu , /* option menu style */ 02754 0 , /* first option */ 02755 1 , /* last option */ 02756 0 , /* initial selection */ 02757 MCW_AV_readtext , /* ignored but needed */ 02758 0 , /* ditto */ 02759 AFNI_palette_tran_CB, /* callback when changed */ 02760 (XtPointer) im3d , /* data for above */ 02761 MCW_av_substring_CB , /* text creation routine */ 02762 AFNI_dummy_av_label /* data for above */ 02763 ) ; 02764 02765 MCW_reghint_children( func->pbar_transform0D_av->wrowcol , 02766 "Transform overlay image values" ) ; 02767 XtUnmanageChild( func->pbar_transform0D_av->wrowcol ) ; 02768 func->pbar_transform0D_index = 0 ; 02769 func->pbar_transform0D_func = NULL ; 02770 02771 /*-- 16 Jun 2000: 2D func list --*/ 02772 02773 (void) XtVaCreateManagedWidget( 02774 "dialog" , xmSeparatorWidgetClass , func->pbar_menu , 02775 XmNseparatorType , XmSINGLE_LINE , NULL ) ; 02776 02777 func->pbar_transform2D_av = new_MCW_arrowval( 02778 func->pbar_menu , /* parent Widget */ 02779 "Tran 2D " , /* label */ 02780 MCW_AV_optmenu , /* option menu style */ 02781 0 , /* first option */ 02782 1 , /* last option */ 02783 0 , /* initial selection */ 02784 MCW_AV_readtext , /* ignored but needed */ 02785 0 , /* ditto */ 02786 AFNI_palette_tran_CB, /* callback when changed */ 02787 (XtPointer) im3d , /* data for above */ 02788 MCW_av_substring_CB , /* text creation routine */ 02789 AFNI_dummy_av_label /* data for above */ 02790 ) ; 02791 02792 MCW_reghint_children( func->pbar_transform2D_av->wrowcol , 02793 "Transform overlay image values" ) ; 02794 XtUnmanageChild( func->pbar_transform2D_av->wrowcol ) ; 02795 func->pbar_transform2D_index = 0 ; 02796 func->pbar_transform2D_func = NULL ; 02797 02798 #if 0 02799 allow_MCW_optmenu_popup(1) ; /* 12 Dec 2001 */ 02800 #endif 02801 02802 /**-- Color pbar to control intensity-to-color mapping --**/ 02803 02804 { float pmin , pmax ; /* posfunc added 3/21/95 */ 02805 02806 pmax = 1.0 ; 02807 pmin = (im3d->vinfo->use_posfunc) ? (0.0) : (-1.0) ; 02808 npane = (im3d->vinfo->use_posfunc) ? INIT_panes_pos 02809 : INIT_panes_sgn ; 02810 02811 #if 0 02812 sel_height -= (8+view_height/view_count) * 1 ; /* 1 = widgets below pbar */ 02813 #else 02814 sel_height -= (8+view_height/view_count) * 0.5 ; 02815 #endif 02816 02817 func->inten_pbar = new_MCW_pbar( 02818 func->inten_rowcol , /* parent */ 02819 im3d->dc , /* display */ 02820 npane , /* number panes */ 02821 sel_height / npane , /* init pane height */ 02822 pmin , pmax , /* value range */ 02823 AFNI_inten_pbar_CB , /* callback */ 02824 (XtPointer) im3d ); /* callback data */ 02825 02826 /* 04 Feb 2002: colorscale-ize? */ 02827 02828 if( im3d->dc->visual_class == TrueColor ){ 02829 char *eee = getenv("AFNI_COLORSCALE_DEFAULT") ; 02830 if( eee == NULL ) eee = getenv("AFNI_COLOR_SCALE_DEFAULT") ; 02831 if( eee == NULL || strcmp(eee,"NO") != 0 ){ 02832 PBAR_set_bigmode( func->inten_pbar , 1 , pmin,pmax ) ; 02833 PBAR_set_bigmap( func->inten_pbar , eee ) ; 02834 } 02835 } 02836 } 02837 02838 func->inten_pbar->parent = (XtPointer) im3d ; 02839 func->inten_pbar->mode = (im3d->vinfo->use_posfunc) ? (1) : (0) ; 02840 func->inten_pbar->npan_save[0] = INIT_panes_sgn ; 02841 func->inten_pbar->npan_save[1] = INIT_panes_pos ; 02842 func->inten_pbar->hide_changes = INIT_panes_hide ; 02843 02844 AFNI_setup_inten_pbar( im3d ) ; /* other setup stuff (afni_func.c) */ 02845 02846 MCW_reghelp_children( func->inten_pbar->panew , 02847 "Drag the separator bars to alter the thresholds.\n" 02848 "Click in a pane to alter the color for that range.\n\n" 02849 "The overlay dataset value that maps to 1.0 is\n" 02850 "determined by the 'autoRange' controls to the right.\n" 02851 "\n" 02852 "In 'continuous' colorscale mode, Button-1 click flips\n" 02853 "colors top-to-bottom; Button-3 click shows a menu of\n" 02854 "available colorscales.\n" 02855 ) ; 02856 02857 MCW_reghelp_children( func->inten_pbar->top , 02858 "Drag the separator bars to alter the thresholds.\n" 02859 "Click in a pane to alter the color for that range.\n\n" 02860 "The overlay dataset value that maps to 1.0 is\n" 02861 "determined by the 'autoRange' controls to the right.\n" 02862 "\n" 02863 "In 'continuous' colorscale mode, Button-1 click flips\n" 02864 "colors top-to-bottom; Button-3 click shows a menu of\n" 02865 "available colorscales.\n" 02866 ) ; 02867 02868 MCW_register_help( func->inten_label , 02869 "Drag the separator bars to alter the thresholds.\n" 02870 "Click in a pane to alter the color for that range.\n\n" 02871 "The overlay dataset value that maps to 1.0 is\n" 02872 "determined by the 'autoRange' controls to the right.\n\n" 02873 "N.B.: A popup menu to control the palette\n" 02874 " setup is 'hidden' under this label." 02875 ) ; 02876 02877 MCW_register_hint( func->inten_label , 02878 "Control overlay colors" ) ; 02879 02880 (void) XtVaCreateManagedWidget( 02881 "dialog" , xmSeparatorWidgetClass , func->inten_rowcol , 02882 XmNseparatorType , XmSINGLE_LINE , 02883 NULL ) ; 02884 02885 func->inten_av = new_MCW_arrowval( 02886 func->inten_rowcol , 02887 "#" , 02888 AVOPT_STYLE , 02889 NPANE_MIN , NPANE_MAX+1 , 02890 (func->inten_pbar->bigmode) ? NPANE_MAX+1 : npane , 02891 MCW_AV_notext , 0 , 02892 AFNI_inten_av_CB , func->inten_pbar , 02893 AFNI_inten_av_texter,NULL ) ; 02894 02895 if( AVOPT_STYLE == MCW_AV_optmenu ) 02896 AVOPT_columnize( func->inten_av , 2 ) ; 02897 02898 func->inten_av->fastdelay = 4000 ; /* slow down repeat action */ 02899 func->inten_av->parent = im3d ; /* Daddy! */ 02900 func->inten_av->allow_wrap = 1 ; 02901 02902 MCW_reghelp_children( func->inten_av->wrowcol , 02903 "Controls the number of panes\n" 02904 "in the intensity color/threshold\n" 02905 "selector above (the 'pbar')" 02906 ) ; 02907 MCW_reghint_children( func->inten_av->wrowcol , 02908 "Number of color panes" ) ; 02909 02910 /*--- toggle button to control posfunc option for pbar ---*/ 02911 02912 func->inten_bbox = 02913 new_MCW_bbox( func->inten_rowcol , 02914 1 , AFNI_inten_bbox_label , 02915 MCW_BB_check , 02916 MCW_BB_noframe , 02917 AFNI_inten_bbox_CB , (XtPointer) im3d ) ; 02918 02919 func->inten_bbox->parent = (XtPointer) im3d ; 02920 02921 MCW_set_bbox( func->inten_bbox , 02922 (im3d->vinfo->use_posfunc) ? (1) : (0) ) ; 02923 02924 MCW_reghelp_children( func->inten_bbox->wrowcol , 02925 "Pressed In: Displays only positive overlay\n" 02926 " values in the 'pbar' above and\n" 02927 " in the color overlays.\n" 02928 " Out: Displays positive and negative\n" 02929 " overlay values.\n\n" 02930 "N.B.: Zero overlay values are never overlaid." ) ; 02931 MCW_reghint_children( func->inten_bbox->wrowcol , 02932 "Use positive-only or signed overlay values" ) ; 02933 02934 ADDTO_KILL(im3d->kl,func->inten_bbox) ; 02935 02936 /*-- options controls --*/ 02937 02938 func->options_rowcol = 02939 XtVaCreateWidget( 02940 "dialog" , xmRowColumnWidgetClass , func->rowcol , 02941 XmNorientation , XmVERTICAL , 02942 XmNpacking , XmPACK_TIGHT , 02943 XmNmarginHeight, 0 , 02944 XmNmarginWidth , 0 , 02945 XmNtraversalOn , False , 02946 XmNinitialResourcesPersistent , False , 02947 NULL ) ; 02948 02949 func->options_label = 02950 XtVaCreateManagedWidget( 02951 "dialog" , xmLabelWidgetClass , func->options_rowcol , 02952 LABEL_ARG("Options") , 02953 XmNinitialResourcesPersistent , False , 02954 NULL ) ; 02955 02956 /*-- underlay type --*/ 02957 02958 func->underlay_bbox = 02959 new_MCW_bbox( func->options_rowcol , 02960 LAST_UNDERLAY_TYPE+1 , UNDERLAY_typestr , 02961 MCW_BB_radio_one , 02962 MCW_BB_frame , 02963 AFNI_underlay_CB , (XtPointer) im3d ) ; 02964 02965 func->underlay_bbox->parent = (XtPointer) im3d ; 02966 02967 MCW_set_bbox( func->underlay_bbox , 1 << im3d->vinfo->underlay_type ) ; 02968 02969 MCW_reghelp_children( func->underlay_bbox->wrowcol , 02970 "Use these buttons to choose\n" 02971 "whether the underlay or\n" 02972 "overlay images appear\n" 02973 "as the background display" ) ; 02974 02975 { char * hh[] = { "Use underlay dataset for background" , 02976 "Use overlay dataset for background" , 02977 "Use thresholded overlay dataset for background" } ; 02978 MCW_bbox_hints( func->underlay_bbox , 3 , hh ) ; 02979 } 02980 02981 ADDTO_KILL(im3d->kl,func->underlay_bbox) ; 02982 02983 /*--- 30 Nov 1997: bucket managers ---*/ 02984 02985 func->buck_frame = 02986 XtVaCreateWidget( 02987 "dialog" , xmFrameWidgetClass , func->options_rowcol , 02988 XmNshadowType , XmSHADOW_ETCHED_IN , 02989 XmNshadowThickness , 2 , 02990 XmNtraversalOn , False , 02991 XmNinitialResourcesPersistent , False , 02992 NULL ) ; 02993 02994 func->buck_rowcol = 02995 XtVaCreateWidget( 02996 "dialog" , xmRowColumnWidgetClass , func->buck_frame , 02997 XmNorientation , XmVERTICAL , 02998 XmNpacking , XmPACK_TIGHT , 02999 XmNtraversalOn , False , 03000 XmNinitialResourcesPersistent , False , 03001 NULL ) ; 03002 03003 /*--- 30 Nov 1997: anatomy bucket arrowval ---*/ 03004 /* (Actual labels are set when used) */ 03005 03006 func->anat_buck_av = new_MCW_arrowval( 03007 func->buck_rowcol , /* parent Widget */ 03008 "ULay" , /* label */ 03009 MCW_AV_optmenu , /* option menu style */ 03010 0 , /* first option */ 03011 1 , /* last option */ 03012 0 , /* initial selection */ 03013 MCW_AV_readtext , /* ignored but needed */ 03014 0 , /* ditto */ 03015 AFNI_bucket_CB , /* callback when changed */ 03016 (XtPointer) im3d , /* data for above */ 03017 MCW_av_substring_CB , /* text creation routine */ 03018 AFNI_dummy_av_label /* data for above */ 03019 ) ; 03020 03021 func->anat_buck_av->parent = (XtPointer) im3d ; 03022 func->anat_buck_av->allow_wrap = True ; 03023 03024 MCW_reghelp_children( func->anat_buck_av->wrowcol , 03025 "Use this to choose which\n" 03026 "sub-brick of the overlay\n" 03027 "dataset to display (='ULay').\n" 03028 "(The sub-brick labels are\n" 03029 " assigned when the dataset\n" 03030 " is created. The [index]\n" 03031 " values show the numerical\n" 03032 " location of the sub-brick\n" 03033 " in the dataset.)" ) ; 03034 MCW_reghint_children( func->anat_buck_av->wrowcol , 03035 "Choose UnderLay sub-brick" ) ; 03036 03037 ADDTO_KILL(im3d->kl,func->anat_buck_av) ; 03038 03039 XtUnmanageChild( func->anat_buck_av->wrowcol ) ; 03040 03041 /*--- 30 Nov 1997: function bucket arrowval ---*/ 03042 03043 func->fim_buck_av = new_MCW_arrowval( 03044 func->buck_rowcol , /* parent Widget */ 03045 "OLay" , /* label */ 03046 MCW_AV_optmenu , /* option menu style */ 03047 0 , /* first option */ 03048 1 , /* last option */ 03049 0 , /* initial selection */ 03050 MCW_AV_readtext , /* ignored but needed */ 03051 0 , /* ditto */ 03052 AFNI_bucket_CB , /* callback when changed */ 03053 (XtPointer) im3d , /* data for above */ 03054 MCW_av_substring_CB , /* text creation routine */ 03055 AFNI_dummy_av_label /* data for above */ 03056 ) ; 03057 03058 func->fim_buck_av->parent = (XtPointer) im3d ; 03059 func->fim_buck_av->allow_wrap = True ; 03060 03061 MCW_reghelp_children( func->fim_buck_av->wrowcol , 03062 "Use this to choose which\n" 03063 "sub-brick of the overlay\n" 03064 "dataset to display (='OLay').\n" 03065 "(The sub-brick labels are\n" 03066 " assigned when the dataset\n" 03067 " is created. The [index]\n" 03068 " values show the numerical\n" 03069 " location of the sub-brick\n" 03070 " in the dataset.)" ) ; 03071 MCW_reghint_children( func->fim_buck_av->wrowcol , 03072 "Choose overlay sub-brick" ) ; 03073 03074 ADDTO_KILL(im3d->kl,func->fim_buck_av) ; 03075 03076 XtUnmanageChild( func->fim_buck_av->wrowcol ) ; 03077 03078 /*--- 30 Nov 1997: threshold bucket arrowval ---*/ 03079 03080 func->thr_buck_av = new_MCW_arrowval( 03081 func->buck_rowcol , /* parent Widget */ 03082 "Thr " , /* label */ 03083 MCW_AV_optmenu , /* option menu style */ 03084 0 , /* first option */ 03085 1 , /* last option */ 03086 0 , /* initial selection */ 03087 MCW_AV_readtext , /* ignored but needed */ 03088 0 , /* ditto */ 03089 AFNI_bucket_CB , /* callback when changed */ 03090 (XtPointer) im3d , /* data for above */ 03091 MCW_av_substring_CB , /* text creation routine */ 03092 AFNI_dummy_av_label /* data for above */ 03093 ) ; 03094 03095 func->thr_buck_av->parent = (XtPointer) im3d ; 03096 func->thr_buck_av->allow_wrap = True ; 03097 03098 MCW_reghelp_children( func->thr_buck_av->wrowcol , 03099 "Use this to choose which\n" 03100 "sub-brick of the overlay\n" 03101 "dataset with which to threshold\n" 03102 "the OLay sub-brick (='Thr').\n" 03103 "(The sub-brick labels are\n" 03104 " assigned when the dataset\n" 03105 " is created. The [index]\n" 03106 " values show the numerical\n" 03107 " location of the sub-brick\n" 03108 " in the dataset.)" ) ; 03109 MCW_reghint_children( func->thr_buck_av->wrowcol , 03110 "Choose Thr sub-brick" ) ; 03111 03112 ADDTO_KILL(im3d->kl,func->thr_buck_av) ; 03113 03114 XtUnmanageChild( func->thr_buck_av->wrowcol ) ; 03115 03116 /*--- range controls ---*/ 03117 03118 func->range_frame = 03119 XtVaCreateManagedWidget( 03120 "dialog" , xmFrameWidgetClass , func->options_rowcol , 03121 XmNshadowType , XmSHADOW_ETCHED_IN , 03122 XmNshadowThickness , 2 , 03123 XmNtraversalOn , False , 03124 XmNinitialResourcesPersistent , False , 03125 NULL ) ; 03126 03127 func->range_rowcol = 03128 XtVaCreateWidget( 03129 "dialog" , xmRowColumnWidgetClass , func->range_frame , 03130 XmNorientation , XmVERTICAL , 03131 XmNpacking , XmPACK_TIGHT , 03132 XmNtraversalOn , False , 03133 XmNinitialResourcesPersistent , False , 03134 NULL ) ; 03135 03136 /*--- label to show the ranges ---*/ 03137 03138 im3d->vinfo->old_range_label = xstr = AFNI_range_label( NULL ) ; 03139 03140 func->range_label = 03141 XtVaCreateManagedWidget( 03142 "dialog" , xmLabelWidgetClass , func->range_rowcol , 03143 XmNrecomputeSize , False , 03144 XmNlabelString , xstr , 03145 XmNtraversalOn , False , 03146 XmNinitialResourcesPersistent , False , 03147 NULL ) ; 03148 03149 MCW_register_help( func->range_label , 03150 "These are the range of values in the\n" 03151 "UnderLay and OverLay 3D datasets.\n" 03152 "The overlay values may be useful\n" 03153 "for choosing the Range for the pbar.\n" 03154 "[If a dataset is warped from a\n" 03155 " 'parent', these statistics are\n" 03156 " taken from the parent dataset.]" ) ; 03157 03158 MCW_register_hint( func->range_label , "Ranges of dataset values" ) ; 03159 03160 /*--- toggle button to control automatic range scaling for pbar ---*/ 03161 03162 im3d->vinfo->autorange_label = 03163 XmStringCreateLtoR( AFNI_range_bbox_label[0] , XmFONTLIST_DEFAULT_TAG ) ; 03164 03165 func->range_bbox = 03166 new_MCW_bbox( func->range_rowcol , 03167 1 , AFNI_range_bbox_label , 03168 MCW_BB_check , 03169 MCW_BB_noframe , 03170 AFNI_range_bbox_CB , (XtPointer) im3d ) ; 03171 03172 func->range_bbox->parent = (XtPointer) im3d ; 03173 03174 MCW_set_bbox( func->range_bbox , 03175 (im3d->vinfo->use_autorange) ? (1) : (0) ) ; 03176 03177 MCW_reghelp_children( func->range_bbox->wrowcol , 03178 "This button determines whether the program\n" 03179 "or the user sets the OLay value that maps\n" 03180 "to the color pbar level 1.0:\n\n" 03181 "Pressed In: use 'autoRange' value for pbar 1.0\n" 03182 " Out: user controls Range value (below)" 03183 ) ; 03184 MCW_reghint_children( func->range_bbox->wrowcol , 03185 "Automatic or user-controlled color range scaling" ) ; 03186 03187 ADDTO_KILL(im3d->kl,func->range_bbox) ; 03188 03189 /*--- 30 Mar 2001: put the next 2 things in a horizontal rowcol ---*/ 03190 03191 hrc = XtVaCreateWidget( 03192 "dialog" , xmRowColumnWidgetClass , func->range_rowcol , 03193 XmNorientation , XmHORIZONTAL , 03194 XmNpacking , XmPACK_TIGHT , 03195 XmNtraversalOn , False , 03196 XmNinitialResourcesPersistent , False , 03197 NULL ) ; 03198 03199 /*--- arrowval to provide user control for pbar scaling ---*/ 03200 03201 func->range_av = 03202 new_MCW_arrowval( 03203 hrc , /* parent */ 03204 NULL , /* label */ 03205 MCW_AV_downup , /* arrow directions */ 03206 0 , /* min value */ 03207 9999999 , /* max value */ 03208 (int) (im3d->vinfo->fim_range) , /* init value */ 03209 MCW_AV_editext , /* input/output text display */ 03210 0 , /* decimal shift */ 03211 AFNI_range_av_CB , /* routine to call when button */ 03212 (XtPointer) im3d , /* is pressed, and its data */ 03213 NULL,NULL /* no special display */ 03214 ) ; 03215 03216 func->range_av->parent = (XtPointer) im3d ; 03217 03218 MCW_reghelp_children( func->range_av->wrowcol , 03219 "When the autoRange button above is Out, this\n" 03220 "selector is used to set the OLay level which\n" 03221 "maps to 1.0 on the color pbar." 03222 ) ; 03223 MCW_reghint_children( func->range_av->wrowcol , 03224 "OLay value that maps to 1.0 for color overlay" ) ; 03225 03226 ADDTO_KILL(im3d->kl,func->range_av) ; 03227 03228 AV_SENSITIZE( func->range_av , ! im3d->vinfo->use_autorange ) ; 03229 03230 /*--- 30 Mar 2001: rotate pbar ---*/ 03231 03232 func->range_rotate_av = new_MCW_arrowval( 03233 hrc , "Rota" , 03234 MCW_AV_downup , 0,0,0 , 03235 MCW_AV_notext , 0 , 03236 AFNI_range_rotate_av_CB , (XtPointer) func->inten_pbar , 03237 NULL,NULL ) ; 03238 03239 func->range_rotate_av->parent = (XtPointer) im3d ; 03240 03241 MCW_reghelp_children( func->range_rotate_av->wrowcol , 03242 "Rotate the colors on\n" 03243 "the 'pbar' up or down.\n" 03244 "[Press with Shift to]\n" 03245 "[rotate in steps of 4]" ) ; 03246 MCW_reghint_children( func->range_rotate_av->wrowcol , 03247 "Rotate pbar colors" ) ; 03248 03249 ADDTO_KILL(im3d->kl,func->range_rotate_av) ; 03250 03251 XtManageChild( hrc ) ; 03252 03253 #ifdef USE_FUNC_FIM 03254 /*--- fim execution controls ---*/ 03255 03256 func->fim_frame = 03257 XtVaCreateManagedWidget( 03258 "dialog" , xmFrameWidgetClass , func->options_rowcol , 03259 XmNshadowType , XmSHADOW_ETCHED_IN , 03260 XmNshadowThickness , 2 , 03261 XmNtraversalOn , False , 03262 XmNinitialResourcesPersistent , False , 03263 NULL ) ; 03264 03265 func->fim_rowcol = 03266 XtVaCreateWidget( 03267 "dialog" , xmRowColumnWidgetClass , func->fim_frame , 03268 XmNorientation , XmHORIZONTAL , 03269 XmNpacking , XmPACK_TIGHT , 03270 XmNtraversalOn , False , 03271 XmNinitialResourcesPersistent , False , 03272 NULL ) ; 03273 03274 func->fim_mbar = 03275 XmCreateMenuBar( func->fim_rowcol, "dialog" , NULL,0 ) ; 03276 XtVaSetValues( func->fim_mbar , 03277 XmNmarginWidth , 0 , 03278 XmNmarginHeight , 0 , 03279 XmNspacing , 3 , 03280 XmNborderWidth , 0 , 03281 XmNtraversalOn , False , 03282 NULL ) ; 03283 XtManageChild( func->fim_mbar ) ; 03284 03285 func->fim_menu = AFNI_new_fim_menu( func->fim_mbar , AFNI_fimmer_menu_CB , 0 ) ; 03286 func->fim_menu->parent = (XtPointer) im3d ; 03287 03288 xstr = XmStringCreateLtoR("1234567890123456789",XmFONTLIST_DEFAULT_TAG ); 03289 func->fim_dset_label = 03290 XtVaCreateManagedWidget( 03291 "dialog" , xmLabelWidgetClass , func->fim_rowcol , 03292 XmNrecomputeSize , False , 03293 XmNlabelString , xstr , 03294 XmNtraversalOn , False , 03295 XmNinitialResourcesPersistent , False , 03296 NULL ) ; 03297 XmStringFree(xstr) ; 03298 MCW_register_help( func->fim_dset_label , 03299 "Shows the name of the\n" 03300 "dataset for which FIM\n" 03301 "is currently set up." 03302 ) ; 03303 MCW_register_hint( func->fim_dset_label , "Dataset to be FIM-ed") ; 03304 #endif 03305 03306 /* 25 Jul 2001: a toggle box to show the TT Atlas */ 03307 03308 { char *see_ttatlas_label[1] = { "See TT Atlas Regions" } ; 03309 func->see_ttatlas_bbox = 03310 new_MCW_bbox( func->options_rowcol , 03311 1 , see_ttatlas_label , 03312 MCW_BB_check , 03313 MCW_BB_frame , 03314 AFNI_see_ttatlas_CB , (XtPointer) im3d ) ; 03315 03316 func->see_ttatlas_bbox->parent = (XtPointer) im3d ; 03317 03318 MCW_set_bbox( func->see_ttatlas_bbox , 03319 (im3d->vinfo->see_ttatlas) ? (1) : (0) ) ; 03320 03321 MCW_reghelp_children( func->see_ttatlas_bbox->wrowcol , 03322 "This button determines whether to show\n" 03323 "the Talairach-Tournoux Atlas regions,\n" 03324 "which are controlled by the 'Atlas Colors'\n" 03325 "item on the image viewing window popup menu." 03326 ) ; 03327 MCW_reghint_children( func->see_ttatlas_bbox->wrowcol , 03328 "Use 'Atlas Colors' from image popup menu" ) ; 03329 03330 ADDTO_KILL(im3d->kl,func->see_ttatlas_bbox) ; 03331 } 03332 03333 xstr = XmStringCreateLtoR( "ULay = xxxxxxxxxxxxxxxx\n" 03334 "OLay = xxxxxxxxxxxxxxxx\n" 03335 "Thr = xxxxxxxxxxxxxxxx" , 03336 XmFONTLIST_DEFAULT_TAG ) ; 03337 03338 func->bkgd_lab = 03339 XtVaCreateWidget( 03340 "dialog" , xmLabelWidgetClass , func->options_rowcol , 03341 XmNrecomputeSize , False , 03342 XmNlabelString , xstr , 03343 XmNmarginHeight, 0 , 03344 XmNtraversalOn , False , 03345 XmNinitialResourcesPersistent , False , 03346 NULL ) ; 03347 XmStringFree( xstr ) ; 03348 03349 im3d->vinfo->anat_val[0] = 03350 im3d->vinfo->func_val[0] = 03351 im3d->vinfo->thr_val[0] = '\0' ; 03352 03353 MCW_register_help( func->bkgd_lab , 03354 "Shows the values at the\n" 03355 "current crosshair voxel.\n" 03356 "\n" 03357 "N.B.: Is only active when\n" 03358 " all 3 image windows are\n" 03359 " open!" 03360 ) ; 03361 MCW_register_hint( func->bkgd_lab , "Values at crosshairs voxel" ) ; 03362 03363 /*-- manage the managers --*/ 03364 03365 XtManageChild( func->thr_rowcol ) ; 03366 XtManageChild( func->inten_rowcol ) ; 03367 XtManageChild( func->range_rowcol ) ; 03368 XtManageChild( func->options_rowcol ) ; 03369 #ifdef USE_FUNC_FIM 03370 XtManageChild( func->fim_rowcol ) ; 03371 #endif 03372 XtManageChild( func->rowcol ) ; 03373 03374 EXRETURN ; 03375 } 03376 03377 /*--------------------------------------------------------------------*/ 03378 03379 void AFNI_make_wid3( Three_D_View * im3d ) 03380 { |
|
Definition at line 7905 of file afni_widg.c. |
|
Popup a message, somewhere, anywhere [05 Mar 2002]. --------------------------------------------------------------------- Definition at line 7190 of file afni_widg.c. Referenced by AFNI_process_NIML_data(), process_NIML_AFNI_dataset(), process_NIML_Node_ROI(), process_NIML_SUMA_ijk(), process_NIML_SUMA_ixyz(), and process_NIML_SUMA_node_normals(). |
|
"AFNI Version Check!" logo * Definition at line 3384 of file afni_widg.c.
03415 { char * hh[] = { "View data direct from brick" , |
|
June 1996: stuff for interactive FIM * Definition at line 7399 of file afni_widg.c. |
|
Definition at line 7233 of file afni_widg.c. Referenced by MAIN_workprocess(). |
Variable Documentation
|
Initial value: { "View ULay Data Brick" , "Warp ULay on Demand" } Definition at line 113 of file afni_widg.c. Referenced by AFNI_make_wid1(). |
|
Initial value: { "Off" , "Single" , "Multi" , " LR+AP", " LR+IS" , " AP+IS", " LR" , " AP" , " IS" } Definition at line 78 of file afni_widg.c. |
|
Definition at line 76 of file afni_widg.c. |
|
Initial value: { "View OLay Data Brick" , "Warp OLay on Demand" } Definition at line 116 of file afni_widg.c. |
|
Definition at line 94 of file afni_widg.c. |
|
Definition at line 90 of file afni_widg.c. |
|
Definition at line 92 of file afni_widg.c. |
|
Definition at line 85 of file afni_widg.c. |
|
Definition at line 83 of file afni_widg.c. |
|
Definition at line 96 of file afni_widg.c. |
|
Definition at line 87 of file afni_widg.c. |
|
Definition at line 88 of file afni_widg.c. |
|
set various widgets and values * Definition at line 7585 of file afni_widg.c. |
|
Definition at line 298 of file afni_widg.c. |
|
Definition at line 296 of file afni_widg.c. |
|
Definition at line 303 of file afni_widg.c. |
|
Definition at line 293 of file afni_widg.c. |
|
Definition at line 303 of file afni_widg.c. Referenced by AFNI_make_wid2(), and AFNI_make_widgets(). |
|
Definition at line 295 of file afni_widg.c. |
|
Definition at line 303 of file afni_widg.c. |
|
Definition at line 65 of file afni_widg.c. Referenced by AFNI_make_widgets(). |
|
Definition at line 297 of file afni_widg.c. |
|
Definition at line 303 of file afni_widg.c. |
|
Definition at line 302 of file afni_widg.c. |
|
Definition at line 294 of file afni_widg.c. |
|
Definition at line 303 of file afni_widg.c. |
|
Definition at line 303 of file afni_widg.c. |
|
Definition at line 292 of file afni_widg.c. |
|
Definition at line 301 of file afni_widg.c. |
|
Definition at line 300 of file afni_widg.c. |