1 #ifndef SUMA_DISPLAY_INCLUDED
2 #define SUMA_DISPLAY_INCLUDED
3 
4 /*
5 
6    Historical Note from Fri Jan  3 10:21:52 EST 2003:
7    the method for hiding a surface viewer (and other controllers), used to have      three options prior to Fri Jan  3 10:21:52 EST 2003
8    Now only SUMA_WITHDRAW and NOT SUMA_DESTROY should be used.
9 
10    As of Wed Sep 23 14:45:59 EDT 2009
11    ----------------------------------
12    On Mac OS X 10.5, and at least early 10.6, using XWithdrawWindow,
13    followed by XMapRaised, SUMA would crash with a GLX_BadDrawable error.
14    One way around this is to go back to XtUnrealizeWidget/XtRealizeWidget pair.
15    It appears that GLX implementation is full of uninitialzation errors,
16    according to Valgrind.
17 
18    So now one can choose between three closing modes. For widgets with GLX
19    drawables (Viewers, and SurfaceControllers) use SUMA_UNREALIZE.
20    For other, stick with SUMA_WITHDRAW as previously done.
21 */
22 
23 #define SUMA_DESTROY    1
24 #define SUMA_WITHDRAW   2
25 #define SUMA_UNREALIZE  3
26 
27 /* Flags to move sub-bricks up or down using
28    same functions to set a particular index
29    Values must be < 0 and != -1 */
30 #define SUMA_FORWARD_ONE_SUBBRICK    -444
31 #define SUMA_BACK_ONE_SUBBRICK       -555
32 
33 #define SUMA_XmArrowFieldMenu -123
34 
35 #define SUMA_CLOSE_MODE       SUMA_WITHDRAW
36 #define SUMA_GL_CLOSE_MODE    SUMA_UNREALIZE
37 
38 #define SUMA_HOLD_IT  { \
39    SUMA_S_Note("Waiting...");\
40    glXWaitGL();glXWaitX(); glFinish();\
41    SUMA_S_Note("Done.");}
42 
43 #define SUMA_CHECK_GL_ERROR(str)                                           \
44 {                                                                  \
45     GLenum error;                                                  \
46     while((error = glGetError()) != GL_NO_ERROR)                   \
47        fprintf(stderr,"**************GL Error: %s (%s)\n", \
48          gluErrorString(error), str);  \
49 }
50 
51 
52 
53 
54 typedef struct suma_menu_item {
55     char        *label;         /*!< the label for the item */
56     WidgetClass *class;         /*!< pushbutton, label, separator... */
57     char         mnemonic;      /*!< mnemonic; NULL if none */
58     char        *accelerator;   /*!< accelerator; NULL if none */
59     char        *accel_text;    /*!< to be converted to compound string */
60     void       (*callback)();   /*!< routine to call; NULL if none */
61     XtPointer    callback_data; /*!< client_data for callback().
62                         This ends up being the index
63                         of the widget in the menu, in addition
64                         to being the callback value.
65                         Specify it even if callback is NULL
66                         because it is needed to index into
67                         the vector of widgets. The callback value
68                         is actually a bit more complicated than what
69                         is stored in callback_data. The call back ends
70                         up receiving a pointer to a structure of the
71                         type SUMA_MenuCallBackData. That structure contains
72                         callback_data in a field of the same name, in addition
73                         to an identifier of the controller containing that menu.
74                         This way you can tell from which controller the menu
75                         had been activated.*/
76     struct suma_menu_item *subitems; /*!< pullright menu items, if not NULL */
77 } SUMA_MenuItem; /*!< Structure to hold descriptions of menu items.
78                   This structure is mostly based on the build_option.c example
79                   of the "Motif Programming Manual". */
80 
81 typedef struct {
82    XtPointer callback_data; /*!< usually the item number in the menu */
83    void       (*callback)();/*!< routine to call; This is only used when
84                                  and arrow field is usurping a menu's job */
85    void *ContID; /*!< some identifier of the controller */
86    SUMA_MENU_WIDGET *SMW; /*!< This is needed for handling arrow fields */
87 } SUMA_MenuCallBackData;/*!< a structure to help in the creation of menus. The main problem is that I may have the same
88 menu item in different controllers and one needs a way to know from which controller the menu was
89 activated.
90 */
91 
92 /*!
93    macro that converts a callback data from a File Menu widget into the
94    index of the viewer containing it and the widget's SUMA_WIDGET_INDEX_FILE type
95 */
96 #define SUMA_VIEWER_FROM_FILEMENU_CALLBACK(data, isv, widtype) {\
97          SUMA_MenuCallBackData *datap; \
98          datap = (SUMA_MenuCallBackData *)data;  \
99          isv = (INT_CAST)datap->ContID; \
100          widtype = (INT_CAST)datap->callback_data; }
101 
102 
103 #define SUMA_VIEWER_FROM_VIEWMENU_CALLBACK(data, isv, widtype) {\
104          SUMA_MenuCallBackData *datap; \
105          datap = (SUMA_MenuCallBackData *)data;  \
106          isv = (INT_CAST)datap->ContID; \
107          widtype = (INT_CAST)datap->callback_data; }
108 /*!
109 sets the select color of the widget to its foreground color */
110 #define SUMA_SET_SELECT_COLOR(m_w) {\
111       Pixel m_fg_pix=0;  \
112       XtVaGetValues (m_w, XmNforeground, &m_fg_pix, NULL);  \
113       XtVaSetValues (m_w, XmNselectColor, m_fg_pix, NULL);  \
114 }
115 
116 /*! set the string of a label , sa: SUMA_SET_LABEL_MAX*/
117 #define SUMA_SET_LABEL(m_w, m_s) {\
118    /* XmStringCreateLocalized does not work well with \n chars */ \
119    /*XmString m_str = XmStringCreateLocalized(m_s); */\
120    XmString m_str = XmStringCreateLtoR (m_s, XmSTRING_DEFAULT_CHARSET); \
121    XtVaSetValues (m_w, XmNlabelString, m_str, NULL); \
122    XmStringFree (m_str);   \
123 }
124 
125 /*! set the string of a label, use a maximum of m_max chars*/
126 #define SUMA_SET_LABEL_MAX(m_w, m_s, m_max) {\
127    char m_tmp = '\0'; \
128    XmString m_str ;   \
129    if (strlen(m_s) >= m_max) { m_tmp = m_s[m_max-1]; m_s[m_max-1] = '\0'; } \
130    /* XmStringCreateLocalized does not work well with \n chars */ \
131    /* m_str = XmStringCreateLocalized(m_s); */ \
132    m_str = XmStringCreateLtoR (m_s, XmSTRING_DEFAULT_CHARSET); \
133    XtVaSetValues (m_w, XmNlabelString, m_str, NULL); \
134    XmStringFree (m_str);   \
135    if (m_tmp != '\0') m_s[m_max-1] = m_tmp;  \
136 }
137 
138 #define SUMA_SET_TEXT_FIELD(m_w, m_s) {\
139    XtVaSetValues (m_w, XmNvalue, m_s, NULL); \
140 }
141 
142 /*! m_s is a char *. Do not allocate space for it, do not free it afterwards
143 */
144 #define SUMA_GET_TEXT_FIELD(m_w, m_s) {\
145    void *n=NULL; \
146    XtVaGetValues (m_w, XmNvalue, &n, NULL); \
147    m_s = (char *)n;  \
148 }
149 
150 #define SUMA_SET_GL_PROJECTION(csv, ortho) {  \
151    if (!ortho) { \
152       SUMA_LH("Setting up matrix mode and perspective\n"\
153               "iState=%d, Apsect=%f, FOV=%p...\n",\
154               csv->iState, csv->Aspect, csv->FOV); \
155       if (csv->FOV[csv->iState] < 0.00001) { \
156          /* This can happen when only Non-SO objects are loaded
157             Just do nothing  without fanfare */ \
158          SUMA_LHv("Fov (%f) seems messed up, ignoring call\n",\
159             csv->FOV[csv->iState]);   \
160       }  else {\
161          glMatrixMode (GL_PROJECTION); \
162          glLoadIdentity ();   \
163          gluPerspective((GLdouble)csv->FOV[csv->iState], csv->Aspect, \
164                         SUMA_PERSPECTIVE_NEAR, SUMA_PERSPECTIVE_FAR); \
165                         /*lower angle is larger zoom,*/   \
166       }  \
167    }  else { \
168       GLdouble m_sz = \
169          0.5 *tan(SUMA_PI * csv->FOV[csv->iState] / 180.0) * \
170          csv->GVS[csv->StdView].ViewFrom[2];  \
171       GLdouble m_szx = m_sz * csv->Aspect;   \
172       GLdouble m_szy = m_sz ;   \
173       SUMA_LH("Setting up matrix mode and orthographic projection "\
174               "(m_szx = %g, m_szy=%g)...\n", m_szx, m_szy); \
175       glMatrixMode (GL_PROJECTION); \
176       glLoadIdentity ();   \
177       glOrtho( -m_szx, m_szx, \
178                -m_szy, m_szy, \
179                SUMA_PERSPECTIVE_NEAR, SUMA_PERSPECTIVE_FAR); /*lower angle is  \
180                                                                larger zoom,*/   \
181    }  \
182 }
183 
184 #define SUMA_SET_GL_MODELVIEW(csv) {   \
185    if (LocalHead) {  \
186       int m_i; \
187       fprintf(stdout,"Translation Vector: %f %f\n", \
188          csv->GVS[csv->StdView].translateVec[0], \
189          csv->GVS[csv->StdView].translateVec[1]); \
190       fprintf(stdout,"Rotation Matrix:\n");  \
191       for (m_i=0; m_i<4; ++m_i){ fprintf(stdout, "%f\t%f\t%f\t%f\n",   \
192          rotationMatrix[m_i][0], rotationMatrix[m_i][1], \
193          rotationMatrix[m_i][2], rotationMatrix[m_i][3]); }   \
194    }  \
195    glMatrixMode(GL_MODELVIEW);   \
196    glPushMatrix();   \
197    glTranslatef ( csv->GVS[csv->StdView].translateVec[0], \
198                   csv->GVS[csv->StdView].translateVec[1], 0.0);   \
199    glTranslatef ( csv->GVS[csv->StdView].RotaCenter[0], \
200                   csv->GVS[csv->StdView].RotaCenter[1], \
201                   csv->GVS[csv->StdView].RotaCenter[2]); \
202    glMultMatrixf(&rotationMatrix[0][0]);  \
203    glTranslatef (-csv->GVS[csv->StdView].RotaCenter[0], \
204                   -csv->GVS[csv->StdView].RotaCenter[1], \
205                   -csv->GVS[csv->StdView].RotaCenter[2]); \
206 }
207 
208 #define SUMA_GL_MAT_SHOW(mm,str) {\
209    int m_i; double m_dmatrix[16];  \
210    glGetDoublev(mm, m_dmatrix); \
211    SUMA_S_Note(str); \
212    for (m_i=0; m_i<4; ++m_i) {   \
213       fprintf(stderr,"\t");  \
214       fprintf(stderr,"%+3.3f\t%+3.3f\t%+3.3f\t%+3.3f\t", \
215          m_dmatrix[m_i],m_dmatrix[4+m_i],m_dmatrix[8+m_i],m_dmatrix[12+m_i]); \
216       fprintf(stderr,"\n");  \
217    }\
218 }
219 
220 
221 #define SUMA_SET_AS_NEEDED_2D_VIEW_ANGLE(sv) {  \
222    int m_j = SUMA_BestStandardView(sv, SUMAg_DOv, SUMAg_N_DOv); \
223    float m_a[3]; \
224    if (m_j == SUMA_2D_Z0) {   \
225       m_a[0] = 1.0; m_a[1] = 0.0; m_a[2] = 0.0; \
226       axis_to_quat(m_a, 0, sv->GVS[m_j].currentQuat); \
227    } else if (m_j == SUMA_2D_Z0L) { \
228       m_a[0] = 0.0; m_a[1] = 0.0; m_a[2] = 1.0; \
229       axis_to_quat(m_a, SUMA_PI, sv->GVS[m_j].currentQuat); \
230    } else if (m_j == SUMA_3D_Z0) { \
231       SUMA_HOME_QUAT(SUMA_3D_Z0, sv->GVS[m_j].currentQuat); \
232    } \
233 }
234 
235 #define SUMA_MARGIN  1
236 
237 /* return the character for a viewer struct */
238 #define SUMA_SV_CHAR(csv) \
239    (char)( csv ? (65+SUMA_WhichSV((csv), SUMAg_SVv, SUMA_MAX_SURF_VIEWERS)):'-' )
240 
241 #define SV_IN_PRYING(sv) (((sv) && \
242                            (((sv)->GVS[(sv)->StdView].vLHpry[0] != 0.0f ) || \
243                             ((sv)->GVS[(sv)->StdView].vLHpry[1] != 0.0f ) || \
244                             ((sv)->GVS[(sv)->StdView].vLHpry[2] != 0.0f )) ) \
245                            ? 1:0)
246 
247 /* Make sure recording path is legit */
248 #define SUMA_VALIDATE_RECORD_PATH(autorecord) {\
249    if (!THD_mkdir((autorecord)->Path)) {  \
250       SUMA_PARSED_NAME *pn2=NULL;   \
251       SUMA_S_Errv(   \
252    "Failed to create directory %s, resorting to local directory.\n", \
253          (autorecord)->Path); \
254       pn2 = SUMA_ParseFname((autorecord)->FileName, NULL);  \
255       SUMA_Free_Parsed_Name((autorecord)); \
256       (autorecord) = pn2; pn2=NULL; \
257    }  \
258 }
259 
260 /* Get the box corner points from an Axis's range values */
261 #define SUMA_BOX_CORNER_POINTS_FROM_AXIS(Ax, P) {   \
262    P[0][0] = Ax->BR[0][0]; P[0][1] = Ax->BR[1][0]; P[0][2] = Ax->BR[2][0];      \
263                                                          /*xmin, ymin, zmin */  \
264    P[1][0] = Ax->BR[0][1]; P[1][1] = Ax->BR[1][0]; P[1][2] = Ax->BR[2][0];      \
265                                                           /*xmax, ymin, zmin */ \
266    P[2][0] = Ax->BR[0][0]; P[2][1] = Ax->BR[1][1]; P[2][2] = Ax->BR[2][0];      \
267                                                           /*xmin, ymax, zmin */ \
268    P[3][0] = Ax->BR[0][1]; P[3][1] = Ax->BR[1][1]; P[3][2] = Ax->BR[2][0];      \
269                                                           /*xmax, ymax, zmin */ \
270    P[4][0] = Ax->BR[0][0]; P[4][1] = Ax->BR[1][0]; P[4][2] = Ax->BR[2][1];      \
271                                                           /*xmin, ymin, zmax */ \
272    P[5][0] = Ax->BR[0][1]; P[5][1] = Ax->BR[1][0]; P[5][2] = Ax->BR[2][1];      \
273                                                           /*xmax, ymin, zmax */ \
274    P[6][0] = Ax->BR[0][0]; P[6][1] = Ax->BR[1][1]; P[6][2] = Ax->BR[2][1];      \
275                                                           /*xmin, ymax, zmax */ \
276    P[7][0] = Ax->BR[0][1]; P[7][1] = Ax->BR[1][1]; P[7][2] = Ax->BR[2][1];      \
277                                                           /*xmax, ymax, zmax */ \
278 }
279 
280 String *SUMA_get_fallbackResources ();
281 void SUMA_CullOption(SUMA_SurfaceViewer *, const char *action);
282 SUMA_Boolean SUMA_glXMakeCurrent(Display *dpy, Window wdw, GLXContext cont,
283       char *fname, char *wlab, int force);
284 Boolean SUMA_handleRedisplay (XtPointer w);
285 void SUMA_postRedisplay(Widget w, XtPointer clientData, XtPointer call);
286 GLenum SUMA_index_to_clip_plane(int iplane) ;
287 int SUMA_PixelsToDisk(SUMA_SurfaceViewer *csv, int w, int h, GLvoid *pixels,
288                       int colordepth, int verb, char *ufname,
289                       int autoname, int over);
290 int SUMA_SnapToDisk(SUMA_SurfaceViewer *csv, int verb, int getback);
291 SUMA_DO_LOCATOR *SUMA_SV_SortedRegistDO(SUMA_SurfaceViewer *csv, int *N_regs,
292                                         SUMA_DO *dov);
293 void SUMA_display(SUMA_SurfaceViewer *csv, SUMA_DO *dov);
294 void SUMA_display_one(SUMA_SurfaceViewer *csv, SUMA_DO *dov);
295 Colormap SUMA_getShareableColormap_Eng(XVisualInfo * vi, Display *dpy);
296 Colormap SUMA_getShareableColormap(SUMA_SurfaceViewer * csv);
297 void SUMA_graphicsInit(Widget w, XtPointer clientData, XtPointer call);
298 void SUMA_expose(Widget w, XtPointer clientData, XtPointer call);
299 void SUMA_resize(Widget w, XtPointer clientData, XtPointer call);
300 SUMA_Boolean SUMA_SV_DrawAreaDims_From_WindDims(SUMA_SurfaceViewer *sv);
301 SUMA_Boolean SUMA_SV_WindDims_From_DrawAreaDims(SUMA_SurfaceViewer *sv);
302 SUMA_Boolean SUMA_SV_InitDrawAreaOffset(SUMA_SurfaceViewer *sv);
303 int SUMA_XErrHandler( Display *d , XErrorEvent *x );
304 SUMA_Boolean SUMA_X_SurfaceViewer_Create (void);
305 void SUMA_ButtOpen_pushed (Widget w, XtPointer cd1, XtPointer cd2);
306 void SUMA_ButtClose_pushed (Widget w, XtPointer cd1, XtPointer cd2);
307 int SUMA_generateEPS(char *filename, int inColor,
308                      unsigned int width, unsigned int height);
309 GLvoid *SUMA_grabPixels(int ColorDepth, unsigned int width, unsigned int height);
310 GLvoid *SUMA_grabRenderedPixels(SUMA_SurfaceViewer *sv,
311            int ColorDepth, unsigned int width, unsigned int height, int getback);
312 SUMA_Boolean SUMA_RenderToPixMap (SUMA_SurfaceViewer *csv, SUMA_DO* dov);
313 void SUMA_context_Init(SUMA_SurfaceViewer *sv);
314 SUMA_Boolean SUMA_NormScreenToWorld(SUMA_SurfaceViewer *sv,
315                                     double xn, double yn,
316                                     GLdouble *pfront, GLdouble *pback,
317                                     int xform);
318 SUMA_Boolean SUMA_GetSelectionLine (SUMA_SurfaceViewer *sv, int x, int y,
319                                     GLdouble *Pick0, GLdouble *Pick1,
320                                     int N_List, int *xList, int *yList,
321                                     GLdouble *Pick0List);
322 SUMA_Boolean SUMA_isSurfContWidgetCreated(SUMA_X_SurfCont  *SurfCont);
323 int SUMA_OpenCloseSurfaceCont(Widget w,
324                               SUMA_ALL_DO *ado,
325                               SUMA_SurfaceViewer *sv);
326 int SUMA_OpenSurfCont_if_other(Widget w,
327                               SUMA_ALL_DO *ado,
328                               SUMA_SurfaceViewer *sv);
329 int SUMA_viewSurfaceCont(Widget w, SUMA_ALL_DO *SO,
330                          SUMA_SurfaceViewer *sv);
331 SUMA_Boolean SUMA_MarkSurfContOpen(int Open, SUMA_ALL_DO *SO);
332 SUMA_ALL_DO **SUMA_DOsInSurfContNotebook(Widget NB);
333 void SUMA_cb_viewSurfaceCont(Widget w, XtPointer data, XtPointer callData);
334 void SUMA_cb_viewViewerCont(Widget w, XtPointer data, XtPointer callData);
335 void SUMA_cb_toggle_crosshair(Widget w, XtPointer data, XtPointer callData);
336 void SUMA_cb_toggle_node_in_focus(Widget w, XtPointer data, XtPointer callData);
337 void SUMA_cb_toggle_selected_faceset(Widget w,
338                                      XtPointer data, XtPointer callData);
339 int SUMA_viewSumaCont(int flag);
340 void SUMA_cb_viewSumaCont(Widget w, XtPointer data, XtPointer callData);
341 void SUMA_cb_createSumaCont(Widget w, XtPointer data, XtPointer callData);
342 void SUMA_cb_closeSumaCont(Widget w, XtPointer data, XtPointer callData);
343 Widget SUMA_GetTopShell(Widget w);
344 void SUMA_cb_createViewerCont(Widget w, XtPointer data, XtPointer callData);
345 void SUMA_cb_closeViewerCont(Widget w, XtPointer data, XtPointer callData);
346 void SUMA_cb_XHlock_toggled(Widget w, XtPointer data, XtPointer callData);
347 void SUMA_cb_XHviewlock_toggled(Widget w, XtPointer data, XtPointer callData);
348 void SUMA_cb_closeSurfaceCont(Widget w, XtPointer data, XtPointer callData);
349 SUMA_Boolean SUMA_WriteCont_Help(SUMA_DO_Types do_type, TFORM targ, char *fname);
350 SUMA_Boolean SUMA_Snap_AllCont(SUMA_DO_Types do_type, char *fname);
351 void SUMA_cb_createSurfaceCont(Widget w, XtPointer data, XtPointer callData);
352 void SUMA_cb_createSurfaceCont_SO(Widget w, XtPointer data, XtPointer callData);
353 void SUMA_cb_createSurfaceCont_TDO(Widget w, XtPointer data, XtPointer callData);
354 void SUMA_cb_createSurfaceCont_VO(Widget w, XtPointer data, XtPointer callData);
355 void SUMA_cb_createSurfaceCont_CO(Widget w, XtPointer data, XtPointer callData);
356 void SUMA_cb_createSurfaceCont_GLDO(Widget w, XtPointer data,
357                                      XtPointer callData);
358 void SUMA_cb_createSurfaceCont_MDO(Widget w, XtPointer data,
359                                      XtPointer callData);
360 void SUMA_cb_newSumaCont(Widget w, XtPointer client_data, XtPointer callData);
361 void  SUMA_cb_doneSumaCont(Widget wcall, XtPointer cd1, XtPointer cbs);
362 void SUMA_quit_timeout_CB( XtPointer client_data , XtIntervalId * id );
363 void SUMA_set_Lock_rb (SUMA_rb_group * Lock_rbg, int irb, int but);
364 void SUMA_set_Lock_arb (SUMA_rb_group * Lock_rbg);
365 void SUMA_cb_XHaviewlock_toggled (Widget w, XtPointer client_data,
366                                   XtPointer callData);
367 void SUMA_cb_XHalock_toggled (Widget w, XtPointer client_data,
368                               XtPointer callData);
369 void SUMA_set_LockView_atb (void);
370 int SUMA_BuildMenu(Widget parent, int menu_type, char *menu_title,
371                    char menu_mnemonic,  SUMA_Boolean tear_off,
372                    SUMA_MenuItem *items, void *ContID,
373                    char *wname, char *hint, char *help,
374                    SUMA_MENU_WIDGET *SMW);
375 void SUMA_cb_FileOpenSpec (Widget w, XtPointer client_data, XtPointer callData);
376 void SUMA_cb_FileOpenSurf (Widget w, XtPointer client_data, XtPointer callData);
377 void SUMA_cb_FileClose (Widget w, XtPointer client_data, XtPointer callData);
378 void SUMA_cb_FileSaveView (Widget w, XtPointer client_data, XtPointer callData);
379 void SUMA_cb_FileLoadView (Widget w, XtPointer client_data, XtPointer callData);
380 void SUMA_cb_moreSumaInfo (Widget w, XtPointer client_data, XtPointer callData);
381 void SUMA_cb_moreSurfInfo (Widget w, XtPointer client_data, XtPointer callData);
382 void SUMA_cb_moreViewerInfo (Widget w, XtPointer client_data,
383                                                             XtPointer callData);
384 void SUMA_ViewerInfo_destroyed (void *p);
385 void SUMA_ViewerInfo_open (void *p);
386 void SUMA_SumaInfo_destroyed (void *p);
387 void SUMA_SumaInfo_open (void *p);
388 SUMA_CREATE_TEXT_SHELL_STRUCT * SUMA_CreateTextShellStruct (
389    void (*opencallback)(void *data), void *opendata, char *opendatatype,
390    void (*closecallback)(void*data), void *closedata, char *weblink);
391 SUMA_CREATE_TEXT_SHELL_STRUCT * SUMA_CreateTextShell (char *s, char *title, SUMA_CREATE_TEXT_SHELL_STRUCT *TextShellStruct);
392 void SUMA_cb_search_text(Widget widget, XtPointer client_data,
393                          XtPointer call_data);
394 char * SUMA_WriteStringToFile(char *fname, char *s, int, int);
395 void SUMA_SaveTextShell(Widget w, XtPointer ud, XtPointer cd);
396 void SUMA_RefreshTextShell(Widget w, XtPointer ud, XtPointer cd);
397 void SUMA_DestroyTextShell (Widget w, XtPointer ud, XtPointer cd);
398 void SUMA_WebTextShell(Widget w, XtPointer ud, XtPointer cd);
399 void SUMA_SurfInfo_open (void *SO);
400 void SUMA_SurfInfo_destroyed (void *SO);
401 void SUMA_cb_ToggleCaseSearch (Widget widget, XtPointer client_data,
402                                XtPointer call_data);
403 void SUMA_cb_Mask (Widget w, XtPointer client_data, XtPointer callData);
404 void SUMA_cb_helpUsage (Widget w, XtPointer data, XtPointer callData);
405 void SUMA_cb_helpWeb (Widget w, XtPointer data, XtPointer callData);
406 void SUMA_cb_helpIO_notify(Widget w, XtPointer data, XtPointer callData);
407 void SUMA_cb_helpEchoKeyPress(Widget w, XtPointer data, XtPointer callData);
408 void SUMA_cb_helpMemTrace(Widget w, XtPointer data, XtPointer callData);
409 char * SUMA_FormatMessage (SUMA_MessageData *MD);
410 void SUMA_PopUpMessage (SUMA_MessageData *MD);
411 void SUMA_cb_helpMessageLog (Widget w, XtPointer data, XtPointer callData);
412 void SUMA_cb_helpSUMAGlobal (Widget w, XtPointer data, XtPointer callData);
413 void SUMA_cb_helpViewerStruct (Widget w, XtPointer data, XtPointer callData);
414 void SUMA_cb_helpSurfaceStruct (Widget w, XtPointer data, XtPointer callData);
415 void SUMA_cb_SetRenderMode(Widget widget, XtPointer client_data,
416                            XtPointer call_data);
417 void SUMA_cb_SetTransMode(Widget widget, XtPointer client_data,
418                            XtPointer call_data);
419 void SUMA_cb_SetATransMode(Widget widget, XtPointer client_data,
420                            XtPointer call_data);
421 int SUMA_SetDsetViewMode(SUMA_ALL_DO *ado, int imenu, int update_menu) ;
422 int SUMA_SetDsetFont(SUMA_ALL_DO *ado, int imenu, int updatemenu);
423 int SUMA_SetDsetNodeRad(SUMA_ALL_DO *ado, int imenu, int updatemenu);
424 int SUMA_SetDsetThrough(SUMA_ALL_DO *ado, int imenu, int updatemenu);
425 int SUMA_SetDsetNodeCol(SUMA_ALL_DO *ado, int imenu, int updatemenu);
426 void SUMA_cb_SetDsetViewMode(Widget widget, XtPointer client_data,
427                               XtPointer call_data);
428 void SUMA_cb_SetDsetFont(Widget widget, XtPointer client_data,
429                            XtPointer call_data);
430 void SUMA_cb_SetDsetNodeCol(Widget widget, XtPointer client_data,
431                            XtPointer call_data);
432 void SUMA_cb_SetDsetNodeRad(Widget widget, XtPointer client_data,
433                            XtPointer call_data);
434 void SUMA_cb_SetDsetThrough(Widget widget, XtPointer client_data,
435                            XtPointer call_data);
436 void SUMA_cb_SetDsetGmatBord(Widget widget, XtPointer client_data,
437                            XtPointer call_data);
438 int SUMA_SetDsetGmatBord(SUMA_ALL_DO *ado, int imenu, int updatemenu);
439 int SUMA_SetDsetTxtShad(SUMA_ALL_DO *ado, int imenu, int updatemenu);
440 void SUMA_cb_SetDsetTxtShad(Widget widget, XtPointer client_data,
441                            XtPointer call_data);
442 void SUMA_cb_ToolsDrawROI (Widget w, XtPointer client_data, XtPointer call_data);
443 void SUMA_cb_CloseDrawROIWindow(Widget w, XtPointer client_data,
444                                 XtPointer call_data);
445 void SUMA_CreateDrawROIWindow(void);
446 SUMA_Boolean SUMA_InitializeDrawROIWindow (SUMA_DRAWN_ROI *DrawnROI);
447 SUMA_Boolean SUMA_OpenDrawROIWindow (SUMA_DRAWN_ROI *DrawnROI);
448 SUMA_Boolean SUMA_OpenDrawROIController(SUMA_SurfaceViewer *sv);
449 void SUMA_cb_DrawROImode_toggled (Widget w, XtPointer data, XtPointer call_data);
450 void SUMA_cb_ContROImode_toggled (Widget w, XtPointer data, XtPointer call_data);
451 void SUMA_cb_DrawROIPen_toggled (Widget w, XtPointer data, XtPointer call_data);
452 void SUMA_cb_AfniLink_toggled (Widget w, XtPointer data, XtPointer call_data);
453 void SUMA_cb_DrawROI_Undo (Widget w, XtPointer data, XtPointer client_data);
454 void SUMA_cb_DrawROI_Redo (Widget w, XtPointer data, XtPointer client_data);
455 void SUMA_cb_DrawROI_Save (Widget w, XtPointer data, XtPointer client_data);
456 void SUMA_cb_DrawROI_Load (Widget w, XtPointer data, XtPointer client_data);
457 void SUMA_cb_DrawROI_setlabel (Widget w, XtPointer data, XtPointer client_data);
458 int SUMA_AllowArrowFieldMenus(int N, char *t);
459 void SUMA_CreateArrowField ( Widget pw, char *label,
460                               float value, float vmin, float vmax, float vstep,
461                               int cwidth, SUMA_VARTYPE type,
462                               SUMA_Boolean wrap,
463                               void (*NewValueCallback)(void * data),
464                               void *cb_data,
465                               char *wname, char *hint, char *help,
466                               SUMA_ARROW_TEXT_FIELD *AF);
467 void SUMA_CreateTextField ( Widget pw, char *label,
468                               int cwidth,
469                               void (*NewValueCallback)(void *data),
470                               char *wname, char *hint, char *help,
471                               SUMA_ARROW_TEXT_FIELD *AF);
472 void SUMA_DrawROI_NewLabel (void * data);
473 void SUMA_ATF_change_value (XtPointer client_data, XtIntervalId *id);
474 void SUMA_ATF_start_stop (Widget w, XtPointer client_data, XtPointer call_data);
475 void SUMA_DrawROI_NewValue (void * data);
476 void SUMA_ATF_cb_label_change (Widget w, XtPointer client_data,
477                                XtPointer call_data);
478 void SUMA_ATF_SetString (SUMA_ARROW_TEXT_FIELD * AF);
479 void SUMA_ATF_GetString (SUMA_ARROW_TEXT_FIELD * AF, char *sbuf);
480 void SUMA_ATF_SetValue (SUMA_ARROW_TEXT_FIELD * AF);
481 void SUMA_ATF_cb_label_Modify (Widget w, XtPointer client_data, XtPointer call_data);
482 void SUMA_leave_EV( Widget w , XtPointer client_data ,
483                   XEvent * ev , Boolean * continue_to_dispatch );
484 void SUMA_press_EV( Widget w , XtPointer client_data ,
485                     XEvent * ev , Boolean * continue_to_dispatch );
486 void SUMA_ATF_cb_label_Focus (Widget w, XtPointer client_data,
487                     XtPointer call_data);
488 void SUMA_PositionWindowRelative (Widget New, Widget Ref, SUMA_WINDOW_POSITION Loc);
489 void SUMA_cb_DrawROI_Finish (Widget w, XtPointer data, XtPointer client_data);
490 void SUMA_cb_DrawROI_Join (Widget w, XtPointer data, XtPointer client_data);
491 void SUMA_cb_DrawROI_SwitchROI (Widget w, XtPointer data, XtPointer call_data);
492 void SUMA_cb_DrawROI_Delete(Widget wcall, XtPointer cd1, XtPointer cbs);
493 void SUMA_delete_timeout_CB( XtPointer client_data , XtIntervalId * id );
494 SUMA_LIST_WIDGET * SUMA_FreeScrolledList (SUMA_LIST_WIDGET *LW);
495 SUMA_LIST_WIDGET * SUMA_AllocateScrolledList (
496                      char *Label, int SelectPolicy,
497                      SUMA_Boolean RemoveDups,
498                      SUMA_Boolean ShowSorted,
499                      Widget PosRef,
500                      SUMA_WINDOW_POSITION Pos,
501                      int width,
502                      void (*Default_cb)(  Widget w, XtPointer data,
503                                           XtPointer calldata),
504                      void *DefaultData,
505                      void (*Select_cb)(   Widget w, XtPointer data,
506                                           XtPointer calldata),
507                      void *SelectData,
508                      void (*CloseList_cb)(Widget w, XtPointer data,
509                                           XtPointer calldata),
510                      void *CloseListData);
511 SUMA_Boolean SUMA_UpdateScrolledListData(SUMA_LIST_WIDGET *LW, void *Default_Data, void *Select_Data, void *CloseList_Data);
512 void SUMA_CreateScrolledList (char **clist, int N_clist, SUMA_Boolean Partial,
513                               SUMA_LIST_WIDGET *LW);
514 void SUMA_cb_CloseSwitchROI(Widget w, XtPointer data, XtPointer call_data);
515 void SUMA_cb_SelectSwitchROI(Widget w, XtPointer data, XtPointer call_data);
516 void SUMA_FileSelection_popdown_cb (Widget w, XtPointer client_data,
517                                     XtPointer call_data);
518 void SUMA_FileSelection_file_select_cb(Widget dialog, XtPointer client_data,
519                                     XtPointer call_data);
520 SUMA_SELECTION_DIALOG_STRUCT *SUMA_CreateFileSelectionDialog (char *title,
521                                           SUMA_SELECTION_DIALOG_STRUCT **dlg);
522 SUMA_SELECTION_DIALOG_STRUCT *SUMA_CreateFileSelectionDialogStruct (
523    Widget daddy, SUMA_FILE_SELECT_MODE Mode, SUMA_Boolean preserve,
524    void (*SelectCallback)(char *filename, void *data), void *SelectData,
525    void (*CancelCallback)(void *data), void *CancelData,
526    char *FilePattern,
527    SUMA_SELECTION_DIALOG_STRUCT *dlg);
528 void SUMA_FileSelection_Unmap_cb (Widget w, XtPointer client_data,
529                                   XtPointer call_data);
530 void SUMA_FreeFileSelectionDialogStruct(SUMA_SELECTION_DIALOG_STRUCT *dlg);
531 SUMA_PROMPT_DIALOG_STRUCT *SUMA_CreatePromptDialogStruct (
532    SUMA_PROMPT_MODE Mode, char *TextFieldLabel,
533    char *init_selection,
534    Widget daddy, SUMA_Boolean preserve,
535    SUMA_PROMPT_BUTTONS Return_button,
536    void(*SelectCallback)(char *selection, void *data), void *SelectData,
537    void(*CancelCallback)(void *data), void *CancelData,
538    void(*HelpCallback)(void *data), void *HelpData,
539    int(*VerifyFunction)(char *selection, void *data), void *VerifyData,
540    SUMA_PROMPT_DIALOG_STRUCT *oprmpt);
541 SUMA_PROMPT_DIALOG_STRUCT *SUMA_CreatePromptDialog(
542                char *title_extension, SUMA_PROMPT_DIALOG_STRUCT *prmpt);
543 const char * SUMA_PromptButtonLabel(SUMA_PROMPT_BUTTONS code);
544 SUMA_Boolean SUMA_CreatePromptActionArea (SUMA_PROMPT_DIALOG_STRUCT *prmpt);
545 void SUMA_PromptOk_cb (Widget w, XtPointer data, XtPointer calldata);
546 void SUMA_PromptClear_cb (Widget w, XtPointer data, XtPointer calldata);
547 void SUMA_PromptApply_cb (Widget w, XtPointer data, XtPointer calldata);
548 void SUMA_PromptCancel_cb (Widget w, XtPointer data, XtPointer calldata);
549 void SUMA_PromptHelp_cb (Widget w, XtPointer data, XtPointer calldata);
550 void SUMA_PromptActivate_cb (Widget w, XtPointer data, XtPointer calldata);
551 void SUMA_PromptUnmap_cb (Widget w, XtPointer data, XtPointer calldata);
552 void SUMA_FreePromptDialogStruct(SUMA_PROMPT_DIALOG_STRUCT *prmpt);
553 void  SUMA_cb_ToggleManagementColPlaneWidget(Widget w, XtPointer data,
554                                                       XtPointer client_data);
555 void SUMA_cb_AllConts(Widget w, XtPointer data, XtPointer client_data);
556 void SUMA_cb_SurfCont_SwitchPage (void *data);
557 void SUMA_cb_ColPlane_NewOrder (void *data);
558 int SUMA_ColPlane_NewOrder     (SUMA_ALL_DO *ado, SUMA_OVERLAYS *colp,
559                                int neworder, int cb_direct);
560 int SUMA_ColPlane_NewOrder_one (SUMA_ALL_DO *ado, SUMA_OVERLAYS *colp,
561                                int neworder, int cb_direct);
562 void SUMA_cb_ColPlane_NewOpacity (void *data);
563 int SUMA_ColPlane_NewOpacity     (SUMA_ALL_DO *ado, SUMA_OVERLAYS *colp,
564                                  float newopa, int cb_direct);
565 int SUMA_ColPlane_NewOpacity_one (SUMA_ALL_DO *ado, SUMA_OVERLAYS *colp,
566                                  float newopa, int cb_direct);
567 int SUMA_Tract_NewGray (SUMA_ALL_DO *ado,
568                            float newgray, int cb_direct );
569 void SUMA_cb_Tract_NewGray(void *data);
570 int SUMA_ColPlane_NewAlphaThresh_one (SUMA_ALL_DO *ado, SUMA_OVERLAYS *colp,
571                                   float newAlphaThresh, int cb_direct);
572 int SUMA_ColPlane_NewAlphaThresh (SUMA_ALL_DO *ado, SUMA_OVERLAYS *colp,
573                               float newAlphaThresh, int cb_direct);
574 void SUMA_cb_ColPlane_NewAlphaThresh (void *data);
575 void SUMA_cb_ColPlane_NewDimFact (void *data);
576 int SUMA_ColPlane_NewDimFact     (SUMA_ALL_DO *ado, SUMA_OVERLAYS *colp,
577                                  float newdimfact, int cb_direct);
578 int SUMA_ColPlane_NewDimFact_one (SUMA_ALL_DO *ado, SUMA_OVERLAYS *colp,
579                                  float newdimfact, int cb_direct);
580 int SUMA_ColPlane_NewNodeRadGain_one (SUMA_ALL_DO *ado, SUMA_OVERLAYS *colp,
581                                        float newdimfact, int cb_direct);
582 int SUMA_ColPlane_NewNodeRadGain (SUMA_ALL_DO *ado, SUMA_OVERLAYS *colp,
583                               float newdimfact, int cb_direct);
584 void SUMA_cb_ColPlane_NewNodeRadGain (void *data);
585 
586 void SUMA_cb_ColPlaneShow_toggled (Widget w, XtPointer data,
587                                    XtPointer client_data);
588 void SUMA_cb_ColPlaneShowOneFore_toggled (Widget w, XtPointer data,
589                                           XtPointer client_data);
590 int SUMA_ColPlaneShowOneFore_Set (SUMA_ALL_DO *ado, SUMA_Boolean state,
591                                   int direct);
592 int SUMA_ColPlaneShowOneFore_Set_one (SUMA_ALL_DO *ado, SUMA_Boolean state,
593                                       int direct);
594 void SUMA_cb_ColPlane_Delete(Widget w, XtPointer data, XtPointer client_data);
595 void SUMA_cb_ColPlane_Load(Widget w, XtPointer data, XtPointer client_data);
596 void SUMA_cb_Dset_Load(Widget w, XtPointer data, XtPointer client_data);
597 void SUMA_cb_SurfCont_SwitchColPlane(Widget w, XtPointer data,
598                                                          XtPointer client_data);
599 void SUMA_cb_CloseSwitchColPlane(Widget w, XtPointer data, XtPointer call_data);
600 void SUMA_cb_SelectSwitchColPlane(Widget w, XtPointer data, XtPointer call_data);
601 int SUMA_SelectSwitchColPlane(SUMA_ALL_DO *ado,
602                                   SUMA_LIST_WIDGET *LW,
603                                   int ichoice, SUMA_Boolean CloseShop,
604                                   int setmen);
605 int SUMA_SelectSwitchColPlane_one(SUMA_ALL_DO *ado,
606                                   SUMA_LIST_WIDGET *LW,
607                                   int ichoice, SUMA_Boolean CloseShop,
608                                   int setmen);
609 void SUMA_cb_ViewerCont_SwitchState (Widget w, XtPointer data,
610                                      XtPointer call_data);
611 void SUMA_cb_ViewerCont_SwitchGroup (Widget w, XtPointer data,
612                                      XtPointer call_data);
613 void SUMA_cb_SelectSwitchGroup(Widget w, XtPointer data, XtPointer call_data);
614 void SUMA_cb_CloseSwitchGroup(Widget w, XtPointer data, XtPointer call_data);
615 SUMA_Boolean SUMA_InitializeColPlaneShell(SUMA_ALL_DO *SO,
616                                           SUMA_OVERLAYS *ColPlane);
617 SUMA_Boolean SUMA_InitializeColPlaneShell_SO(SUMA_SurfaceObject *SO,
618                                              SUMA_OVERLAYS *ColPlane);
619 SUMA_Boolean SUMA_InitializeColPlaneShell_GLDO(SUMA_ALL_DO *ado,
620                                              SUMA_OVERLAYS *ColPlane);
621 SUMA_Boolean SUMA_InitializeColPlaneShell_TDO(SUMA_ALL_DO *ado,
622                                              SUMA_OVERLAYS *ColPlane);
623 SUMA_Boolean SUMA_InitializeColPlaneShell_VO(SUMA_ALL_DO *ado,
624                                              SUMA_OVERLAYS *ColPlane);
625 SUMA_Boolean SUMA_InitializeColPlaneShell_CO (
626                   SUMA_ALL_DO *ado,
627                   SUMA_OVERLAYS *ColPlane);
628 SUMA_Boolean SUMA_InitializeColPlaneShell_MDO (SUMA_ALL_DO *ado,
629                                                SUMA_OVERLAYS *ColPlane);
630 SUMA_Boolean SUMA_UpdateColPlaneShellAsNeeded(SUMA_ALL_DO *SO);
631 SUMA_Boolean SUMA_Remixedisplay (SUMA_ALL_DO *ado);
632 void SUMA_cb_SetDrawROI_SaveMode(Widget w, XtPointer data, XtPointer call_data);
633 void SUMA_cb_SetDrawROI_SaveWhat(Widget w, XtPointer data, XtPointer call_data);
634 void SUMA_response(Widget widget, XtPointer client_data, XtPointer call_data);
635 int SUMA_PauseForUser(Widget parent, char *question,
636                       SUMA_WINDOW_POSITION pos, XtAppContext    *app,
637                       int withpause, float timeoutsec);
638 int SUMA_ForceUser_YesNo(Widget parent, char *question, int default_ans, SUMA_WINDOW_POSITION pos);
639 int AskUser(Widget parent, char *question, char *ans1, char *ans2, int default_ans);
640 char * SUMA_ClassOf(int c);
641 char * SUMA_Format(int n, int w);
642 void SUMA_ShowAllVisuals (void);
643 int SUMA_ShowVisual (Display *dpy, XVisualInfo *vi, SUMA_Boolean ShowHead);
644 int SUMA_AskUser_File_replace(Widget parent, char *question, int default_ans);
645 void SUMA_WidgetResize (Widget New, int width, int height);
646 void SUMA_LoadVisualState(char *fname, void *csvp);
647 int SUMA_ApplyVisualState(NI_element *nel, SUMA_SurfaceViewer *csv);
648 void SUMA_SaveVisualState(char *fname, void *csvp);
649 void SUMA_LoadMaskDO (char *s, void *csvp);
650 void SUMA_LoadSegDO (char *s, void *csvp);
651 SUMA_Boolean SUMA_LoadVolDO (char *fname,
652                         SUMA_DO_CoordUnits coord_type, SUMA_VolumeObject **VOp,
653 			byte PutVOinList);
654 int SUMA_Set_VO_Slice_Params(char *params, SUMA_VolumeObject *VO);
655 void SUMA_SiSi_I_Insist(void);
656 void SUMA_BuildMenuReset(int nchar);
657 void SUMA_MenuArrowFieldCallback (void *CB);
658 int SUMA_PageWidgetToNumber(Widget NB, Widget page);
659 #define SUMA_IS_CONTPAGE_ON_TOP(SC) ( (SC) && (SC)->Page \
660                                       &&  SUMAg_CF->X->UseSameSurfCont \
661                 && SUMA_isCurrentContPage(SUMAg_CF->X->SC_Notebook,(SC)->Page) )
662 int SUMA_isCurrentContPage(Widget NB, Widget page);
663 SUMA_Boolean SUMA_SetSurfContPageNumber(Widget NB, int i);
664 int SUMA_NotebookLastPageNumber(Widget NB);
665 SUMA_Boolean SUMA_Init_SurfCont_SurfParam(SUMA_ALL_DO *SO);
666 SUMA_Boolean SUMA_Init_SurfCont_SurfParam_SO(SUMA_SurfaceObject *SO);
667 SUMA_Boolean SUMA_Init_SurfCont_SurfParam_GLDO(SUMA_ALL_DO *ado);
668 SUMA_Boolean SUMA_Init_SurfCont_SurfParam_TDO(SUMA_ALL_DO *ado);
669 SUMA_Boolean SUMA_Init_SurfCont_SurfParam_VO(SUMA_ALL_DO *ado);
670 SUMA_Boolean SUMA_Init_SurfCont_SurfParam_CO(SUMA_ALL_DO *ado);
671 SUMA_Boolean SUMA_Init_SurfCont_SurfParam_MDO(SUMA_ALL_DO *ado);
672 SUMA_Boolean SUMA_Init_SurfCont_SurfParam_ADO(SUMA_ALL_DO *ado);
673 int SUMA_NodeNeighborAlongScreenDirection(SUMA_SurfaceViewer *sv,
674                                           SUMA_SurfaceObject *SO,
675                                           int inode, double *dd);
676 SUMA_Boolean SUMA_World2ScreenCoords (SUMA_SurfaceViewer *sv, int N_List,
677                               double *WorldList, double *ScreenList, int *Quad,
678                               SUMA_Boolean ApplyXform, SUMA_Boolean ScreenY);
679 SUMA_Boolean SUMA_World2ScreenCoordsF (
680                      SUMA_SurfaceViewer *sv, int N_List, float *WorldList,
681                      float *ScreenList, int *Quad,
682                      SUMA_Boolean ApplyXform, SUMA_Boolean ScreenY);
683 int * SUMA_DepthSort(float *NodeList, int N_Node, char **names,
684                      int cpxform, float *scrxyz);
685 SUMA_Boolean SUMA_DrawWindowLine(SUMA_SurfaceViewer *sv, int x0, int y0,
686                                                 int x1, int y1, int meth);
687 void SUMA_cb_SetDrawROI_WhatDist(Widget widget, XtPointer client_data,
688                                  XtPointer call_data);
689 SUMA_Boolean SUMA_display_edge_striplist(DList *striplist,
690             SUMA_SurfaceViewer *sv, SUMA_SurfaceObject *SO, char *DispOptions);
691 Widget SUMA_CloseBhelp_Frame( Widget parent,
692                               XtCallbackProc close_callback,
693                               XtPointer close_data,
694                               char *wname,
695                               char *close_hint,
696                               char *close_help,
697                               XtCallbackProc help_callback,
698                               XtPointer help_data,
699                               char *help_hint,
700                               char *help_help);
701 void SUMA_cb_XformPreProc_Save (Widget w, XtPointer data,
702                              XtPointer client_data);
703 void SUMA_cb_XformOpts_Apply (Widget w, XtPointer data,
704                              XtPointer client_data);
705 void SUMA_setIO_notify(int val);
706 int SUMA_RenderMode2RenderModeMenuItem(int Mode);
707 int SUMA_TransMode2TransModeMenuItem(int Mode);
708 SUMA_TRANS_MODES SUMA_ATransMode2TransMode(SUMA_ATRANS_MODES ii);
709 SUMA_ATRANS_MODES SUMA_TransMode2ATransMode(SUMA_TRANS_MODES ii);
710 int SUMA_ATransMode2ATransModeMenuItem(int Mode);
711 int SUMA_ShowMode2ShowModeMenuItem(int Mode);
712 int SUMA_ShowModeStr2ShowModeMenuItem(char *str);
713 int SUMA_Font2FontMenuItem(int Mode);
714 int SUMA_FontStr2FontMenuItem(char *str);
715 void * SUMA_Font2GLFont(int Mode);
716 int SUMA_Through2ThroughMenuItem(int Mode);
717 int SUMA_ThroughStr2ThroughMenuItem(char *str);
718 int SUMA_NodeRad2NodeRadMenuItem(int Mode);
719 int SUMA_NodeRadStr2NodeRadMenuItem(char *str);
720 int SUMA_NodeCol2NodeColMenuItem(int Mode);
721 int SUMA_NodeColStr2NodeColMenuItem(char *str);
722 float *SUMA_NodeCol2Col(int Mode, float *here);
723 void SUMA_cb_SetDsetEdgeStip(Widget widget, XtPointer client_data,
724                            XtPointer call_data);
725 int SUMA_SetDsetEdgeStip(SUMA_ALL_DO *ado, int imenu, int updatemenu);
726 void SUMA_cb_SetDsetAlphaVal(Widget widget, XtPointer client_data,
727                            XtPointer call_data);
728 int SUMA_SetDsetAlphaVal(SUMA_ALL_DO *ado, int imenu, int updatemenu);
729 void SUMA_cb_SetTractMask(Widget widget, XtPointer client_data,
730                            XtPointer call_data);
731 int SUMA_SetTractMask(SUMA_ALL_DO *ado, int imenu, int updatemenu);
732 void SUMA_cb_SetDsetEdgeThick(Widget widget, XtPointer client_data,
733                            XtPointer call_data);
734 int SUMA_SetDsetEdgeThick(SUMA_ALL_DO *ado, int imenu, int updatemenu);
735 int SUMA_ColPlane_NewEdgeThickGain_one (SUMA_ALL_DO *ado, SUMA_OVERLAYS *colp,
736                                        float newdimfact, int cb_direct);
737 int SUMA_ColPlane_NewEdgeThickGain (SUMA_ALL_DO *ado, SUMA_OVERLAYS *colp,
738                               float newdimfact, int cb_direct);
739 void SUMA_cb_ColPlane_NewEdgeThickGain (void *data);
740 int SUMA_GDSET_ShowBundles ( SUMA_ALL_DO *ado,
741                                 SUMA_Boolean state, int cb_direct);
742 void SUMA_cb_GDSET_ShowBundles_toggled (Widget w, XtPointer data,
743                                           XtPointer client_data);
744 int SUMA_GDSET_ShowUncon ( SUMA_ALL_DO *ado,
745                                 SUMA_Boolean state, int cb_direct);
746 void SUMA_cb_GDSET_ShowUncon_toggled (Widget w, XtPointer data,
747                                           XtPointer client_data);
748 int SUMA_FlushPickBufferForDO(SUMA_ALL_DO *curDO);
749 SUMA_TRANS_MODES SUMA_1dig_to_T(int i);
750 int SUMA_T_to_1dig(SUMA_TRANS_MODES stm);
751 float SUMA_1dig_to_A(int i);
752 int SUMA_A_to_1dig(float v);
753 SUMA_Boolean SUMA_DispExpr_To_EvalExpr(char *expr, char *evale, char *tight);
754 
755 
756 #define SUMA_MAX_XFCB_OBJS 32       /*!< Max number of callbacks or xforms
757                                          that may act on dsets or SOs */
758 
759 #define SUMA_SPECT_AXIS(TR,NSAMP,fs, fmax,fstep) {\
760    fs=1.0/(TR); fmax = fs/2.0; fstep=fs/(float)(NSAMP);   \
761 }
762 
763 typedef struct {
764 
765    Widget AppShell;
766    Widget Active_tb;
767 
768    Widget ParentLabel_lb;
769 
770    SUMA_ARROW_TEXT_FIELD *AF0;
771    SUMA_ARROW_TEXT_FIELD *AF1;
772    SUMA_ARROW_TEXT_FIELD *AF2;
773 
774    Widget SaveOpts_pb;
775    Widget SavePreProc_pb;
776    Widget ShowPreProc_tb;
777    Widget ApplyOpts_pb;
778    Widget LoadOrtFile_pb;
779    Widget OrtFileLabel_lb;
780 
781 } SUMA_GENERIC_XFORM_INTERFACE;
782 
783 typedef struct {
784    char name[128];
785    char idcode_str[SUMA_IDCODE_LENGTH]; /*!< A unique identifier for xform */
786    char parents[SUMA_MAX_XFCB_OBJS][SUMA_IDCODE_LENGTH]; /*!< IDs of parents
787                      upon which the xform is applied.
788                      These could be SOs or DSETS*/
789    char parents_domain[SUMA_MAX_XFCB_OBJS][SUMA_IDCODE_LENGTH]; /*!< IDs of SO
790                    defining the domain of the parent. This is meaningful when
791                    the parent is a dset */
792    int  N_parents;
793    char children[SUMA_MAX_XFCB_OBJS][SUMA_IDCODE_LENGTH]; /*!< IDs of children
794                   created by application of xform.
795                   These could be SOs or DSETS*/
796    int N_children;
797    int active;
798    int ShowPreProc;
799    NI_group *XformOpts;
800 
801    SUMA_GENERIC_XFORM_INTERFACE *gui;
802 } SUMA_XFORM;  /*!< See Comments in ZSS labbook NIH-5, pp30-... */
803 
804 void SUMA_cb_CloseXformInterface(Widget w, XtPointer data, XtPointer call_data);
805 SUMA_Boolean SUMA_InitializeXformInterface (SUMA_XFORM *xf);
806 void SUMA_CreateXformInterface(SUMA_XFORM *xf);
807 void SUMA_DotXform_NewOrtName(  SUMA_XFORM *xf,
808                                char * ortname,
809                                int fromgui);
810 void SUMA_OpenXformOrtFile (char *filename, void *data);
811 SUMA_Boolean SUMA_WildcardChoice(int filetype,
812                   SUMA_SurfaceObject *SO, char wild[]);
813 SUMA_Boolean SUMA_Set_Menu_Widget(SUMA_MENU_WIDGET *men, int i);
814 void SUMA_MaskTableCell_EV ( Widget w , XtPointer cd ,
815                 XEvent *ev , Boolean *continue_to_dispatch );
816 void SUMA_cb_createSurfaceCont_MDO(Widget w, XtPointer data,
817                                      XtPointer callData);
818 void SUMA_cb_SetMaskTableValue (void *data);
819 void SUMA_MaskTableLabel_EV ( Widget w , XtPointer cd ,
820                       XEvent *ev , Boolean *continue_to_dispatch );
821 void SUMA_MaskTableCell_EV ( Widget w , XtPointer cd ,
822                       XEvent *ev , Boolean *continue_to_dispatch );
823 void SUMA_MaskEvalTableCell_EV ( Widget w , XtPointer cd ,
824                       XEvent *ev , Boolean *continue_to_dispatch );
825 void SUMA_MaskEvalTableLabel_EV ( Widget w , XtPointer cd ,
826                       XEvent *ev , Boolean *continue_to_dispatch );
827 int SUMA_SetMaskEvalTableValueNew(  int row, int col,
828                                 char *s1,
829                                 int setmen,
830                                 int redisplay,
831                                 SUMA_NUMERICAL_UNITS num_units);
832 char *SUMA_GetMaskEvalExpr(void);
833 void SUMA_cb_SetMaskEvalTableValue (void *data);
834 void SUMA_cb_UseMaskEval_toggled(Widget w, XtPointer data,
835                                  XtPointer client_data);
836 SUMA_Boolean SUMA_Set_UseMaskEval(int v, int redisp, int setmen);
837 void SUMA_MaskLenTableCell_EV ( Widget w , XtPointer cd ,
838                       XEvent *ev , Boolean *continue_to_dispatch );
839 void SUMA_MaskLenTableLabel_EV ( Widget w , XtPointer cd ,
840                       XEvent *ev , Boolean *continue_to_dispatch );
841 int SUMA_SetMaskLenTableValueNew(  int row, int col,
842                                 float,
843                                 int setmen,
844                                 int redisplay,
845                                 SUMA_NUMERICAL_UNITS num_units);
846 void SUMA_cb_SetMaskLenTableValue (void *data);
847 void SUMA_cb_UseMaskLen_toggled(Widget w, XtPointer data,
848                                  XtPointer client_data);
849 SUMA_Boolean SUMA_Set_UseMaskLen(int v, int redisp, int setmen);
850 SUMA_Boolean SUMA_ModifyTable(SUMA_TABLE_FIELD *TF, int Nrows);
851 void SUMA_delete_mask_timeout_CB( XtPointer client_data , XtIntervalId * id);
852 void SUMA_cb_Mask_Delete(Widget wcall, XtPointer cd1, XtPointer cbs);
853 SUMA_Boolean SUMA_DeleteMask(char *ado_id);
854 SUMA_Boolean SUMA_DeleteAllMasks(char *labeled, SUMA_DO *dov, int N_dov);
855 SUMA_MaskDO * SUMA_findanyMDOp_inDOv(SUMA_DO *dov, int N_dov, int *dov_id);
856 SUMA_MaskDO * SUMA_findanyMDOp(int *dov_id);
857 DList *SUMA_AssembleMasksList(int withShadow);
858 DList *SUMA_AssembleMasksList_inDOv(SUMA_DO *dov, int N_dov, int withShadow);
859 SUMA_Boolean  SUMA_InitMasksTable(SUMA_X_SurfCont *SurfCont);
860 SUMA_Boolean  SUMA_InitMasksTable_row(SUMA_X_SurfCont *SurfCont,
861                                       SUMA_MaskDO *mdo, int row);
862 int SUMA_NewSymMaskDO(SUMA_ALL_DO *ado);
863 int SUMA_ShadowMaskDO(SUMA_MaskDO **mdop);
864 int SUMA_SetTractStyle(SUMA_ALL_DO *ado, int imenu, int updatemenu);
865 void SUMA_cb_SetTractStyle(Widget widget, XtPointer client_data,
866                            XtPointer call_data);
867 void SUMA_CreateVrFields(  Widget parent,
868                         char *tit, char *hint, char *help,
869                         int Nslc, SUMA_ALL_DO *ado,
870                         void (*NewValueCallback)(void * data), void *cb_data,
871                         SUMA_VR_FIELD *VrF);
872 void SUMA_cb_ShowVrF_toggled(Widget w, XtPointer data, XtPointer client_data);
873 void SUMA_cb_VrSelect_toggled(Widget w, XtPointer data, XtPointer client_data);
874 void SUMA_cb_VSliceAtXYZ_toggled(Widget w, XtPointer data,XtPointer client_data);
875 void SUMA_leave_NslcField( Widget w , XtPointer client_data ,
876                             XEvent * ev , Boolean * continue_to_dispatch );
877 void SUMA_VrF_cb_N_slc_change (  Widget w, XtPointer client_data,
878                                     XtPointer call_data);
879 void SUMA_VrF_SetNslcString(SUMA_VR_FIELD * VrF);
880 int SUMA_SetMaskTableValueNew(int row, int col,
881                               char *s1,
882                               int setmen,
883                               int redisplay,
884                               SUMA_NUMERICAL_UNITS num_units);
885 SUMA_Boolean SUMA_Set_ADO_TransMode(SUMA_ALL_DO *ado, int i,
886                                     int delta, int update_widgets);
887 SUMA_Boolean SUMA_Set_ADO_RenderMode(SUMA_ALL_DO *ado, int i, int delta,
888                                     int update_widgets );
889 int SUMA_Get_ADO_TransMode(SUMA_ALL_DO *ado);
890 void SUMA_cb_Masks_Save (Widget w, XtPointer data, XtPointer client_data);
891 void SUMA_cb_Masks_Load(Widget w, XtPointer data, XtPointer client_data);
892 SUMA_Boolean SUMA_LoadMultiMasks_eng (char *filename,
893                               int SetupOverlay,
894                               int LaunchDisplay);
895 void SUMA_LoadMultiMasks (char *filename, void *data);
896 void SUMA_SaveMultiMasks (char *filename, void *data);
897 SUMA_Boolean SUMA_SaveMultiMasks_eng (char *filename);
898 SUMA_Boolean SUMA_wait_till_visible(Widget w, int maxms);
899 
900 /*
901    *************** Convolution utilities ***************
902    based on example in glut's convolve.c by
903    Tom McReynolds, SGI
904    *****************************************************
905 */
906 void SUMA_C_identity(SUMA_C_FILTER *mat);
907 SUMA_C_FILTER * SUMA_C_newfilter(int rows, int cols);
908 void SUMA_C_free(SUMA_C_FILTER *mat);
909 void SUMA_C_resize(SUMA_C_FILTER *mat, int rows, int cols);
910 void SUMA_C_box(SUMA_C_FILTER *mat);
911 void SUMA_C_sobel(SUMA_C_FILTER *mat);
912 void SUMA_C_laplace(SUMA_C_FILTER *mat);
913 void SUMA_C_convolve(SUMA_SurfaceViewer *csv, SUMA_DO *dov, SUMA_C_FILTER *mat);
914 
915 /* *************** End Convolution utilities *************** */
916 #define SUMA_XformOrtFile_Load_help   \
917    "Load an ort file"
918 
919 #define SUMA_XformPreProc_Save_help \
920    "Save preprocessed dsets to disk"
921 
922 #define SUMA_XformOpts_Apply_help   \
923    "Apply changes to transform options now"
924 
925 #define SUMA_XformOpts_Save_help \
926    "Save options structure to disk"
927 
928 #define SUMA_ShowPreProcXform_help  \
929    "Show in SUMA pre-processed time series"
930 
931 #define SUMA_ActivateXform_help  \
932    "Activate/Suspend xform"
933 
934 #define SUMA_DotXform_AF0_hint \
935    "Bottom pass frequency in Hz."
936 
937 #define SUMA_DotXform_AF0_help   \
938    "Bottom pass frequency in Hz."
939 
940 #define SUMA_DotXform_AF1_hint \
941    "Top pass frequency in Hz."
942 
943 #define SUMA_DotXform_AF1_help   \
944    "Top pass frequency in Hz."
945 
946 #define SUMA_DotXform_AF2_hint \
947    "Baseline model polynomial degree."
948 
949 #define SUMA_DotXform_AF2_help   \
950    "Baseline model polynomial degree\n"   \
951    "-1 for no baseline model.\n"
952 
953 #define SUMA_DotXform_ParentLabel_help  \
954    "Label of time series dsets transformed."
955 
956 #define SUMA_DrawROI_ParentLabel_help  \
957    "Label of the ROI's parent surface."
958 
959 #define SUMA_DrawROI_DrawROIMode_help \
960    "Toggles ROI drawing mode.\n" \
961    "If turned on, then drawing is enabled \n"   \
962    "and the cursor changes to a target. \n"  \
963    "To draw, use the right mouse button. \n" \
964    "If you want to pick a node without causing \n" \
965    "a drawing action, use shift+right button.\n\n"\
966    "After the draw ROI window is open, you can toggle \n"\
967    "this button via :ref:`ctrl+d<LC_Ctrl+d>` also."
968 
969 #define SUMA_DrawROI_ContROIMode_help \
970    "Toggles ROI contour drawing \n" \
971    "If turned on, then contours are drawn around filled ROIs.\n" \
972    "Contours will *float* over other displayed datasets\n"
973 
974 #define SUMA_DrawROI_PenMode_help \
975    "Toggles Pen drawing mode\n"\
976    "If turned on, the cursor changes shape to a pen. \n" \
977    "In the pen mode, drawing is done with button 1. \n"  \
978    "This is for coherence with AFNI's pen drawing mode, \n" \
979    "which is meant to work pleasantly with a stylus directly \n"  \
980    "on the screen. In pen mode, you draw with the left mouse \n"  \
981    "button and move the surface with the right button. \n"  \
982    "To pick a node, use shift+left button. \n"  \
983    "Pen mode only works when Draw Mode is enabled."
984 
985    #define SUMA_DrawROI_AfniLink_help \
986 "Toggles Afni Link for ROI drawing.\n" \
987 "If turned on, then ROIs drawn on the surface are\n" \
988 "sent to AFNI. \n"   \
989 "Surface ROIs that are sent to AFNI are turned\n"  \
990 "into volume ROIs (VOIs) on the fly and displayed \n" \
991 "in a functional volume with the same colormap used in SUMA.\n"   \
992 "The mapping from the surface domain (ROI) to the volume \n"   \
993 "domain (VOI) is done by intersection of the first with \n" \
994 "the latter. The volume used for the VOI has the same \n"   \
995 "resolution (grid) as the Surface Volume (-sv option) \n"   \
996 "used when launching SUMA. The color map used for ROIs \n"  \
997 "is set by the environment variable :ref:`SUMA_ROIColorMap<SUMA_ROIColorMap>`."
998 
999 #define SUMA_DrawROI_Label_help  \
1000    "Label of ROI being drawn.\n" \
1001    "It is very advisable that you use \n" \
1002    "different labels for different ROIs. \n"  \
1003    "If you don't, you won't be able to \n"   \
1004    "differentiate between them afterwards."
1005 
1006 #define SUMA_DrawROI_Value_help  \
1007    "Integer value associated with ROI.\n" \
1008    "This value controls the color of the \n" \
1009    "ROI per the ROI colormap."
1010 
1011 #define SUMA_DrawROI_Undo_help   \
1012    "Undo the last action on the stack."
1013 
1014 #define SUMA_DrawROI_Redo_help   \
1015    "Redo the last undone action."
1016 
1017 #define SUMA_DrawROI_Join_help   \
1018    "Join the first node of the ROI to the last,\n"   \
1019    "thereby creating a close contour ROI.\n" \
1020    "This is a necessary step before the filling\n" \
1021    "operation. Joining is done by cutting the surface\n"   \
1022    "with a plane formed by the two nodes\n"  \
1023    "and the projection of the center of your window.\n"  \
1024    "You could double click at the last node, if you don't\n"   \
1025    "want to use the 'Join' button."
1026 
1027 #define SUMA_DrawROI_Finish_help \
1028    "Mark ROI as finished.\n" \
1029    "Allows you to start drawing a new one.\n"   \
1030    "Once marked as finished, an ROI's label\n" \
1031    "and value can no longer be changed.\n"   \
1032    "To do so, you will need to 'Undo' the \n"   \
1033    "finish action."
1034 
1035 #define SUMA_DrawROI_SwitchROI_help \
1036    "Allows you to switch between ROIs.\n"   \
1037    "This is where you'll suffer if ROIs \n"  \
1038    "on topologically isomorphic surfaces \n" \
1039    "share identical labels."
1040 
1041 #define SUMA_DrawROI_Load_help   \
1042    "Load a Drawn ROI.\n"   \
1043    "See BHelp for 'Save' below."
1044 
1045 #define SUMA_DrawROI_DeleteROI_help   \
1046    "Delete a drawn ROI.\n" \
1047    "This operation is not reversible,\n"  \
1048    "(no Undo here) so you'll have to click twice."
1049 
1050 #define SUMA_SurfCont_DeleteMask_help   \
1051    "Deletes a Mask.\n" \
1052    "This operation is not reversible,\n"  \
1053    "(no Undo here) so you'll have to click twice."
1054 
1055 #define SUMA_DrawROI_SaveFormat_help   \
1056    "File format for saving ROI:\n"  \
1057    "Format options are 1D and NIML.:LR:\n"   \
1058    "   The 1D format is the same one used in AFNI.:LR:\n"   \
1059    "It is an ASCII file with 2 values per line. The first \n"  \
1060    "value is a node index, the second is the node's value. \n" \
1061    "Needless, to say, this format does not support the storage \n"   \
1062    "of ROI auxiliary information such as Label and \n"   \
1063    "Parent Surface, etc., nor does it preserve the order in which \n"   \
1064    "nodes are traversed during a tracing. "\
1065    "For that you'll have to use :term:NIML.:LR:\n" \
1066    ": :NIML is a whole different story which will be documented \n"  \
1067    "(if necessary) in the future. Suffice it to say that in NIML \n" \
1068    "format you can store all the auxiliary information about \n"  \
1069    "each ROI, unlike with the .1D format.:LR:\n"   \
1070    ":SPX:"\
1071    "**But more importantly**, the NIML format allows you to preserve "  \
1072    "the order in which you traced the ROI. You can actually use \n" \
1073    ":ref:`Undo<ROICont->ROI->Undo>`/ref:`Undo<ROICont->ROI->Redo>` on "\
1074    "ROIs save in NIML format."\
1075    ":DEF:"\
1076    "But more importantly, the NIML format allows you to preserve\n"  \
1077    "--------------------  the order in which you traced the ROI. \n" \
1078    ":SPX:"\
1079    "This information can be later used for the purpose of sampling \n"  \
1080    "cortical activity along a particular path. This would be accomplished \n" \
1081    "with the aid of ROI2dataset's -nodelist:SPX:\\:SPX:* options, along with \n"\
1082    "ConvertDset's -node_select_1D option.:LR:\n"
1083 
1084 #define SUMA_DrawROI_SaveWhat_help  \
1085    "Which ROIs to save?:LR:\n" \
1086    "   This: saves the current ROI. \n"   \
1087    "   All: saves all ROIs on surfaces related to the Parent \n"  \
1088    ":       :surface of the current ROI."
1089 
1090 #define SUMA_DrawROI_WhatDist_help  \
1091    "Report length of drawn segments?:LR:\n" \
1092    "   -----: No distance calculations.:LR:\n"   \
1093    "   trace: Calculate distance along last \n"  \
1094    ":        :traced segment.\n" \
1095    "   all:   In addition to output from \n"  \
1096    ":        :'trace', calculate the shortest \n"   \
1097    ":        :distance between the first and \n"   \
1098    ":        :last node of the trace.:LR:\n"  \
1099    "   The results are output to the Message Log \n"  \
1100    ": :window (Help --> Message Log) with the following\n" \
1101    ": :information::LR:\n"  \
1102    "   n0, n1: Indices of first and last node forming \n" \
1103    ":         :the traced path.:LR:\n"  \
1104    "   N_n:    Number of nodes forming the trace.:LR:\n"  \
1105    "   lt:     Trace length calculated as the sum \n"  \
1106    ":         :of the distances from node to node.\n"   \
1107    ":         :This length is a slight overestimation \n"  \
1108    ":         :of the geodesic length. \n" \
1109    ":         :Units for all distances is the same as \n" \
1110    ":         :the units for surface coordinates. Usually \n"   \
1111    ":         :and hopefully in mm.:LR:\n" \
1112    "   lt_c:   Trace length corrected by a scaling factor\n"  \
1113    ":         :from [1] to better approximate geodesic \n"  \
1114    ":         :distances. Factor is 2/(1+sqrt(2)). \n" \
1115    ":         :Do not use this factor when N_n is small. \n"\
1116    ":         :Think of the extreme case when N_n is 2.:LR:\n"   \
1117    "   sd:     Shortest distance on the mesh (graph) \n" \
1118    ":         :between n0 and n1 using Dijkstra's algorithm.:LR:\n"   \
1119    "   sd_c:   Corrected shortest distance as for lt_c.:LR:\n"  \
1120    "\n"  \
1121    "   Note 1: sd and sd_c take some time to compute. That is \n"  \
1122    ":         :why they are only calculated when you select 'all'.:LR:\n"   \
1123    "   Note 2: The output is formatted to be cut and pasted into \n"  \
1124    ":         :a .1D file for ease of processing. \n"  \
1125    ":         :You can include all the comment lines that \n"   \
1126    ":         :start with '#'. But you cannot combine entries \n"  \
1127    ":         :from the output obtained using 'all' option with \n" \
1128    ":         :those from 'trace' since they produce different \n"  \
1129    ":         :numbers of values.\n"  \
1130    "\n"  \
1131    "   [1] Fischl et al, Neuroimage 9, 195-207 1999, \n" \
1132    ":     :Cortical Surface-Based Analysis."
1133 
1134 #define SUMA_DrawROI_Save_help \
1135    "Save the Drawn ROI to disk.\n"  \
1136    "Choose the file format and what is to be\n"   \
1137    "saved from the two menus ahead.\n"  \
1138    ":LR:\n"  \
1139    SUMA_DrawROI_SaveFormat_help  \
1140    ":LR:\n"  \
1141    SUMA_DrawROI_SaveWhat_help
1142 
1143 #define SUMA_closeDrawROI_help  \
1144    "Close Draw ROI window.\n" \
1145    "Current settings are preserved for the \n"   \
1146    "next time you reopen this window."
1147 
1148 
1149 
1150 #define SUMA_help_help \
1151    "Click the hand\n"   \
1152    "on any button or \n"\
1153    "label, menu, etc. to\n"  \
1154    "get a little help. See also WHelp!"
1155 
1156 #define SUMA_webhelp_help \
1157    "Click the coffee cup on any button \n"   \
1158    "label, menu, etc. to go to the corresponding online help.\n"  \
1159    "Clicking on table cells might take you to the help for the\n" \
1160    "entire table or the GUI section the table is in. You might\n" \
1161    "get a more focused result by clicking on the table's headings.\n"   \
1162    "At the moment, this button will not deliver any puppies."
1163 
1164 
1165 #define SUMA_closeSumaCont_help \
1166    "Close SUMA controller window.\n"   \
1167    "Current settings are preserved\n"\
1168    "when controller is reopened."
1169 
1170    #define SUMA_LockSumaCont_help   \
1171 "Set the crosshair lock \n"  \
1172 "between viewers.:LR:\n" \
1173 "   **-** No Lock: Crosshair only moves in viewer where you clicked.:LR:\n"  \
1174 "   **i** Node index Lock: Crosshair jumps to the same node index on related "\
1175 "surfaces (or objects) in other viewers. "\
1176 "Linking in this case is topology based.:LR:\n"   \
1177 "  **c** Coordinate Lock: Crosshair jumps to the same XYZ mm coordinate in "\
1178 "other viewers. Linking in this case is geometry based)."
1179 
1180 #define SUMA_LockViewSumaCont_help  \
1181    "Lock the view point of all viewers. Depress toggle button to link view "   \
1182    "point across viewers.:LR:\n" \
1183    "   * Surface rotation and translation in one viewer is reflected in all " \
1184    "linked viewers.:LR:\n"\
1185    "   * Liking is NOT done across viewers that are displaying objects of "\
1186    "different :ref:`embedding dimensions<Spec_EmbedDimension>` such as 3D "\
1187    "and 2D surfaces.\n"
1188 
1189 #define SUMA_viewerSumaCont_help   \
1190    "Opens a new Surface viewer window."
1191 
1192 #define SUMA_closeSurfaceCont_help   \
1193    "Close Surface controller window.\n"   \
1194    "Current settings are preserved\n"\
1195    "when controller is reopened.\n"
1196 
1197 #define SUMA_closeXformCont_help   \
1198    "Close Xform controller window.\n"   \
1199    "Current settings are preserved\n"\
1200    "when controller is reopened.\n"
1201 
1202 #define SUMA_helpXformCont_help   \
1203    "Open a searchable help window\n"   \
1204    "about using this interface.\n"
1205 
1206 #define SUMA_closeViewerCont_help   \
1207    "Close Viewer controller window. "   \
1208    "Current settings are preserved "\
1209    "when controller is reopened."
1210 
1211 
1212 #define  SUMA_moreViewerInfo_help  \
1213    "Opens a dialog with detailed " \
1214    "information about the surface "\
1215    "viewer."
1216 
1217 #define SUMA_SurfCont_ColPlaneDim_hint \
1218    "Dimming factor to apply to colormap or color datasets." \
1219 
1220 #define SUMA_SurfCont_NodeRadGain_hint \
1221    "Gain factor to apply to node radius." \
1222 
1223 #define SUMA_SurfCont_EdgeThickGain_hint \
1224    "Gain factor to apply to edge thickness." \
1225 
1226 #define SUMA_SurfCont_TractMask_hint \
1227    "Gray level (0--100) of tracts outside of mask (only for Msk --> Gry)" \
1228 
1229 #define SUMA_SurfCont_ColPlaneOrder_hint \
1230    "Order of Dset's colorplane." \
1231 
1232 #define SUMA_SurfCont_ColPlaneAlphaThresh_hint \
1233    "Threshold for voxel alpha value." \
1234 
1235 #define SUMA_SurfCont_ColPlaneOpacity_hint \
1236    "Opacity of Dset's colorplane." \
1237 
1238    #define SUMA_VR_help \
1239 "Set the number of slices used to render the volume. "\
1240 "Volume rendering is done by slicing the volume from the far end along "\
1241 "your vieweing direction to the front, blending successive images along "\
1242 "the way. The more slices you use the better the result, something comparable "\
1243 "to the maximum number of voxels in any of the directions would be a good "\
1244 "start. Of course, the more slices, the slower the rendering.:LR:\n"\
1245 "Blending is affected by :ref:`Avl<VolCont->Dset_Controls->Avl>` and "\
1246 ":ref:`Ath<VolCont->Dset_Controls->Ath>` settings."
1247 
1248 
1249 #define SUMA_VR_hint \
1250    "Volume Rendering Settings (use BHelp for details)"
1251 
1252 #define SUMA_SliceSelect_axial_help \
1253    "Select axial slice(s) to render.\n"\
1254    "If the dataset is oblique, that would be the slice that is closest\n"\
1255    "to the axial plane.\n"\
1256    "Move slider bar or enter slice number directly in adjoining field.\n"\
1257    "To show a stack of axial slices set the second text field to N:S\n"\
1258    "where N is the number of slices in the stack and S is the spacing\n"\
1259    "in number of slices between consecutive slices. The stack is centered\n"   \
1260    "on the chosen slice number. So when N > 1 and even, the 'selected' slice\n" \
1261    "is not rendered. In that case, set N to the next odd number to see it.\n"   \
1262    "To hide/show all displayed axial slices, use right-side toggle button."
1263 
1264 #define SUMA_SliceSelect_axial_hint \
1265    "Select axial slice(s) to render (use BHelp for details)"
1266 
1267 #define SUMA_SliceSelect_sagittal_help \
1268    "Select sagittal slice(s) to render.\n"\
1269    "If the dataset is oblique, that would be the slice that is closest\n"\
1270    "to the sagittal plane.\n"\
1271    "Move slider bar or enter slice number directly in adjoining field.\n"\
1272    "To show a stack of sagittal slices set the second text field to N:S\n"\
1273    "where N is the number of slices in the stack and S is the spacing\n"\
1274    "in number of slices between consecutive slices. The stack is centered\n"   \
1275    "on the chosen slice number. So when N > 1 and even, the 'selected' slice\n" \
1276    "is not rendered. In that case, set N to the next odd number to see it.\n"  \
1277    "To hide/show all displayed sagittal slices, use right-side toggle button."
1278 
1279 #define SUMA_SliceSelect_sagittal_hint \
1280    "Select sagittal slice(s) to render (use BHelp for details)"
1281 
1282 #define SUMA_SliceSelect_coronal_help \
1283    "Select coronal slice(s) to render.\n"\
1284    "If the dataset is oblique, that would be the slice that is closest\n"\
1285    "to the coronal plane.\n"\
1286    "Move slider bar or enter slice number directly in adjoining field.\n"\
1287    "To show a stack of coronal slices set the second text field to N:S\n"\
1288    "where N is the number of slices in the stack and S is the spacing\n"\
1289    "in number of slices between consecutive slices. The stack is centered\n"   \
1290    "on the chosen slice number. So when N > 1 and even, the 'selected' slice\n" \
1291    "is not rendered. In that case, set N to the next odd number to see it.\n"   \
1292    "To hide/show all displayed coronal slices, use right-side toggle button."
1293 
1294 #define SUMA_SliceSelect_coronal_hint \
1295    "Select coronal slice(s) to render (use BHelp for details)"
1296 
1297 #endif
1298