Skip to content

AFNI/NIfTI Server

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

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

SUMA_define.h

Go to the documentation of this file.
00001 #ifndef SUMA_DEFINE_INCLUDED
00002 #define SUMA_DEFINE_INCLUDED
00003 
00004 #define SUMA_DEF_GROUP_NAME "DefGroup"
00005 #define SUMA_DEF_STATE_NAME "Default_state"
00006 
00007 #define SUMA_SUMA_NIML_DEBUG 0
00008 #define SUMA_SEPARATE_SURF_CONTROLLERS 0 /*!< 0 if you want surfaces sharing the same LocalDomainParent 
00009                                                 to use the same controller. 
00010                                                 If you choose 1, then the controllers will not be linked
00011                                                 and there will be no parameter update for that colorplane
00012                                                 in the other controllers. The problem is that every little
00013                                                 callback will have to make a call to SUMA_UpdateColPlaneShellAsNeeded
00014                                                 and that's a pain, to say the least.*/
00015 
00016 #define ARRAY 1
00017 #define STRAIGHT 2
00018 #define TRIANGLES 1
00019 #define POINTS 2
00020 
00021 #define DRAW_METHOD ARRAY
00022 #define RENDER_METHOD TRIANGLES
00023 #define DO_MESH
00024 #define DO_MESH_AXIS
00025 /*#define ZERO_CENTER*/
00026 
00027 #define SUMA_DOUBLE_CLICK_MAX_DELAY 250 /*!< Maximum delay in ms to consider a double click */
00028 
00029 #define NODE_COLOR_R 0.35
00030 #define NODE_COLOR_G 0.35
00031 #define NODE_COLOR_B 0.35
00032 #define SUMA_GRAY_NODE_COLOR 0.30
00033 #define SUMA_DIM_AFNI_COLOR_FACTOR 0.5 /*!< 0.4 works well, use higher factors for flashiness scaling factor (0..1) applied to afni's rgb colors, lower values help retain surface shape info */
00034 #define SUMA_AFNI_COLORPLANE_OPACITY 1
00035 #define SUMA_DIM_CONVEXITY_COLOR_FACTOR 0.5
00036 #define SUMA_CONVEXITY_COLORPLANE_OPACITY 1
00037 #define SUMA_BACKGROUND_MODULATION_FACTOR 3   /*!< 0 background does not modulate foreground, 
00038                                                    Color = Fore * avg_Bright * AttenFactor (0 <= avg_Bright <=1)
00039                                                    a good setting is such that SUMA_BACKGROUND_ATTENUATION_FACTOR * SUMA_DIM_AFNI_COLOR_FACTOR = 1
00040                                                     Watch for saturation effects!*/
00041 
00042 #define SUMA_MAT_SHININESS_INIT 0 /*!< Surface object shininess, 0 20, 50 .. 128*/
00043 #define SUMA_MAT_SPECULAR_INIT    0.0, 0.0, 0.0, 1.0 /*!< The specular color of the material, keep this and the exponent (that's MAT_SHININESS) 0 to keep shininess down*/
00044 #define SUMA_MAT_AMBIENT_INIT    0.2, 0.2, 0.2, 1.0 /*!< Fraction of Ambient light reflected.Ambient light has an undetermined direction and is scattered equally in all directions */
00045 #define SUMA_MAT_DIFFUSE_INIT    0.8, 0.8, 0.8, 1.0 /*!<  Fraction of Diffuse light reflected.Diffuse light comes from one direction, but is scattered equally in all directions and appears equally bright no matter where the eye is located*/
00046 #define SUMA_MAT_EMISSION_INIT    0.0, 0.0, 0.0, 1.0 /*!< Emissive color/light emanated from object.
00047                                                            and unaffected by light sources. 
00048                                                            It adds no light to other objects in the scene */
00049 #define SUMA_LMODEL_AMBIENT       1.0, 1.0, 1.0, 1.0 /*!< keep the ambient light high */
00050 #define SUMA_RED_GL 1.0, 0.0, 1.0, 1.0 /*!< red color */
00051 #define SUMA_CLEAR_COLOR_R         0.0 /*!< clear color (viewer background) Red */
00052 #define SUMA_CLEAR_COLOR_G         0.0 /*!< clear color (viewer background) Green */
00053 #define SUMA_CLEAR_COLOR_B         0.0 /*!< clear color (viewer background) Blue */
00054 #define SUMA_CLEAR_COLOR_A         0.0 /*!< clear color (viewer background) Alpha */
00055 
00056 
00057 #define SUMA_BACKFACE_CULL 0 /*!< 1/0 flag for culling backface facesets */
00058 #define SUMA_CHECK_WINDING 0 /*!< 1/0 flag for checking triangle winding */
00059 
00060 #define SUMA_LIGHT0_COLOR_INIT    1.0, 1.0, 1.0,  1.0 
00061 #define SUMA_INTITIAL_LIGHT0_SWITCH 1 /*!< -1 works well for SureFit Surfaces, 1 works well for iv and FreeSurfer surfaces */
00062 #define SUMA_STDERR stderr
00063 #define SUMA_STDOUT stdout
00064 
00065 #define SUMA_CROSS_HAIR_LINE_WIDTH 1.5
00066 #define SUMA_CROSS_HAIR_RADIUS 6
00067 #define SUMA_CROSS_HAIR_GAP 2
00068 #define SUMA_CROSS_HAIR_SPHERE_RADIUS 0.5
00069 #define SUMA_SELECTED_NODE_SPHERE_RADIUS 0.25
00070 
00071 #define SUMA_BEEP_LENGTH_MS 50 /*!< beep time in ms */
00072 #define SUMA_XYZ_XFORM_BOXDIM_MM 5 /*!< search box width (in mm) used to change XYZ to the closest node index. Keep this one small, 5 mm works for me. Otherwise you may get thrown way off of where you should be. It is no guarantee that the closest node is part of the faceset you are looking at*/
00073 #define SUMA_SELECTED_FACESET_LINE_WIDTH 2 /*!< Line Width of highlighting triangles */
00074 #define SUMA_SELECTED_FACESET_OFFSET_FACTOR 0.01 /*!< highlighting is done by drawing two triangles at a fractional distance of the normal vector */
00075 #define SUMA_SELECTED_FACESET_LINE_INTENSITY 0.75 /*!< line gray color intensity */
00076 #define SUMA_NODE_ALPHA 1 /*!< Node Color Intensity 1, max intensity 0 min intensity*/
00077 #define FOV_INITIAL 30
00078 #define FOV_MIN 0.01
00079 #define FOV_MAX 140
00080 #define FOV_IN_FACT 1.05
00081 #define FOV_OUT_FACT 0.95
00082 #define MOUSE_ZOOM_FACT 30 /*!< The larger, the slower the gain on mouse movement */
00083 #define TRANSLATE_GAIN 50 /*!< between 40 and 80 */
00084 #define ARROW_TRANSLATE_DELTAX 30
00085 #define ARROW_TRANSLATE_DELTAY 30
00086 #define ARROW_ROTATION_ANGLE_DEG 15 
00087 #define SUMA_MAX_N_GROUPS 100 /*!< Maximum number of surface groups */
00088 #define SUMA_MAX_MESSAGES 100 /*!< Maximum number of messages stored in list */
00089 #define SUMA_MAX_MEMBER_FACE_SETS 110 /*!< Maximum number of facesets a node can be part of. 
00090                                           Used to be 60 but that was not enough for a few
00091                                           funky FS surfaces. ZSS Mon Mar 24 16:14:12 EST 2003*/
00092 #define SUMA_MAX_FACESET_EDGE_NEIGHB 3 /*!< Maximum number of adjoining FaceSets a triangular faceset can have.*/
00093 #define SUMA_MAX_DISPLAYABLE_OBJECTS 1000 /*!< Maximum number of displayable Objects */
00094 #define SUMA_MAX_SURF_VIEWERS 6 /*!< Maximum number of surface viewers allowed */
00095 #define SUMA_N_STANDARD_VIEWS 2/*!< Maximum number of standard views, see SUMA_STANDARD_VIEWS*/
00096 #define SUMA_DEFAULT_VIEW_FROM 300 /*!< default view from location on Z axis */
00097 #define SUMA_MAX_FP_NAME_LENGTH ( SUMA_MAX_DIR_LENGTH + SUMA_MAX_NAME_LENGTH )
00098 #define SUMA_MAX_COMMAND_LENGTH      2000/*!< Maximum number of characters in a command string */
00099 #define SUMA_MAX_LABEL_LENGTH 300 /*!< Maximum number of characters for labeling and naming suma fields and objects */
00100 #define SUMA_MAX_STRING_LENGTH 1000 /*!< Maximum number of characters in a string */ 
00101 #define SUMA_MAX_COLOR_NAME 50 /*!< Max. length of the name of a color */
00102 #define SUMA_MAX_NUMBER_NODE_NEIGHB   100 /*!< Maximum number of neighbors any one node can have.
00103                                           Used to be 50 but that was not enough for a few
00104                                           funky FS surfaces. ZSS Mon Mar 24 16:14:12 EST 2003*/
00105 #define SUMA_MAX_OVERLAYS 50 /*!< Maximum number of color overlay planes allowed */
00106 #define SUMA_COMMAND_DELIMITER '|'
00107 #define SUMA_COMMAND_TERMINATOR '~'
00108 #define SUMA_PERSPECTIVE_NEAR   1.0   /*!< Z Near, distance from the viewer to the near clipping plane (for gluPerspective)*/
00109 #define SUMA_PERSPECTIVE_FAR      900 /*!< Z Far, distance from the viewer to the far clipping plane (for gluPerspective)*/
00110 #define SUMA_TESSCON_TO_MM       319.7 /*!< The mysterious Tesscon units */
00111 #define SUMA_TESSCON_DIFF_FLAG    1000   /*!< If aMaxDim - aMinDim > SUMA_TESSCON_DIFF_FLAG in a .iv file, scaling by SUMA_TESSCON_TO_MM is applied */
00112 
00113 #define SUMA_WriteCheckWait 400 /*!< Milliseconds to wait for each stream_writecheck call */ 
00114 #define SUMA_WriteCheckWaitMax 2000 /*!< Milliseconds to try and establish a good WriteCheck */
00115 
00116 #define SUMA_MAX_N_SURFACE_SPEC 20/*!< Maximum number of surfaces allowed in a spec file */
00117 
00118 #define SUMA_MEMTRACE_BLOCK 10000 /*!< Number of elements to allocate for when keeping track of allocated memory. If needed more space is reallocated with SUMA_MEMTRACE_BLOCK increments. */
00119 #define SUMA_MEMTRACE_FLAG 1    /*!< Flag to turn on(1) or off (0) the memory tracing capability */
00120 #define SUMA_PI 3.141592653589793 
00121 #define SUMA_EPSILON 0.000001
00122 /*!
00123    Debugging flags
00124 */
00125 #define SUMA_NIML_WORKPROC_IO_NOTIFY 0  /*!< If set to 1 then SUMA_niml_workprocess will send a notification when InOut_Notify is ON
00126                                           You should keep it off unless you suspect a problem in that function. Otherwise
00127                                          you'll get many reports from the function making it difficult to see other messages. */
00128 #define SUMA_WORKPROC_IO_NOTIFY 0  /*!< Same as above but for SUMA_workprocess */
00129 
00130 typedef enum { SUMA_VOX_NEIGHB_FACE, SUMA_VOX_NEIGHB_EDGE, SUMA_VOX_NEIGHB_CORNER } SUMA_VOX_NEIGHB_TYPES;
00131 typedef enum { SUMA_DONT_KNOW = 0, SUMA_IN_TRIBOX_OUTSIDE = 1, SUMA_INTERSECTS_TRIANGLE_OUTSIDE, SUMA_ON_NODE, SUMA_INTERSECTS_TRIANGLE_INSIDE, SUMA_IN_TRIBOX_INSIDE, SUMA_INSIDE_SURFACE } SUMA_SURF_GRID_INTERSECT_OPTIONS;
00132                                     
00133 typedef enum { SUMA_SIDE_ERROR=-1, SUMA_NO_SIDE, SUMA_LEFT, SUMA_RIGHT } SUMA_SO_SIDE; 
00134 typedef enum  { SUMA_NO_ANSWER, SUMA_YES, SUMA_NO, SUMA_HELP, SUMA_CANCEL, SUMA_YES_ALL, SUMA_NO_ALL, SUMA_WHAT_THE_HELL } SUMA_QUESTION_DIALOG_ANSWER; /* DO NOT CHANGE THE ORDER OF THE FIRST 4 */
00135 
00136 typedef enum  { SUMA_FT_ERROR = -1, SUMA_FT_NOT_SPECIFIED, 
00137                SUMA_FREE_SURFER, SUMA_FREE_SURFER_PATCH, SUMA_SUREFIT, 
00138                SUMA_INVENTOR_GENERIC, SUMA_PLY, SUMA_VEC, SUMA_CMAP_SO, SUMA_BRAIN_VOYAGER , 
00139                SUMA_OPENDX_MESH, 
00140                   SUMA_N_SO_FILE_TYPE} SUMA_SO_File_Type; /* add types always between SUMA_FT_NOT_SPECIFIED AND SUMA_N_SO_FILE_TYPE */
00141 typedef enum { SUMA_FF_NOT_SPECIFIED, SUMA_ASCII, SUMA_BINARY, SUMA_BINARY_BE, SUMA_BINARY_LE } SUMA_SO_File_Format;
00142 typedef enum {SO_type, AO_type, ROIdO_type, ROIO_type, GO_type, LS_type} SUMA_DO_Types;   /*!< Displayable Object Types 
00143                                                                                     S: surface, A: axis, G: grid, 
00144                                                                                     ROId: Region of interest drawn type,
00145                                                                                     LS_type: segment*/
00146 typedef enum {SUMA_SCREEN, SUMA_LOCAL} SUMA_DO_CoordType; /*!< Coordinate system that Displayable object is attached to
00147                                                                   SCREEN is for a fixed system, LOCAL is for a mobile system,
00148                                                                   ie one that is rotated by the mouse movements */
00149 typedef enum {SUMA_SOLID_LINE, SUMA_DASHED_LINE} SUMA_STIPPLE;
00150 
00151 typedef enum {SUMA_Button_12_Motion, SUMA_Button_2_Shift_Motion, SUMA_Button_1_Motion, SUMA_Button_2_Motion, SUMA_Button_3_Motion} SUMA_MOTION_TYPES; /*!< Types of mouse motion */
00152 
00153 typedef enum { SE_Empty, 
00154                SE_SetLookAt, SE_SetLookFrom, SE_Redisplay, SE_Home, SE_SetNodeColor, 
00155                SE_FlipLight0Pos, SE_GetNearestNode, SE_SetLookAtNode, SE_HighlightNodes, SE_SetRotMatrix, 
00156                SE_SetCrossHair, SE_ToggleCrossHair, SE_SetSelectedNode, SE_ToggleShowSelectedNode, SE_SetSelectedFaceSet,
00157                SE_ToggleShowSelectedFaceSet, SE_ToggleConnected, SE_SetAfniCrossHair, SE_SetAfniSurf, SE_SetAfniSurfList, SE_SetAfniThisSurf, 
00158                SE_SetForceAfniSurf, SE_BindCrossHair, SE_ToggleForeground, SE_ToggleBackground, SE_FOVreset, SE_CloseStream4All, 
00159                SE_Redisplay_AllVisible, SE_RedisplayNow, SE_ResetOpenGLState, SE_LockCrossHair,
00160                SE_ToggleLockAllCrossHair, SE_SetLockAllCrossHair, SE_ToggleLockView, SE_ToggleLockAllViews, 
00161                SE_Load_Group, SE_Home_AllVisible, SE_Help, SE_Help_Cmap, SE_Log, SE_UpdateLog, SE_SetRenderMode, SE_OpenDrawROI,
00162                SE_RedisplayNow_AllVisible, SE_RedisplayNow_AllOtherVisible,  SE_SetLight0Pos, SE_OpenColFileSelection,
00163                SE_SaveDrawnROIFileSelection, SE_OpenDrawnROIFileSelection, SE_SendColorMapToAfni, SE_SaveSOFileSelection,
00164                SE_SetSOinFocus, SE_StartListening, SE_LoadViewFileSelection, SE_SaveViewFileSelection, SE_LoadSegDO,
00165                SE_OpenDsetFileSelection, SE_OpenCmapFileSelection, 
00166                SE_BadCode} SUMA_ENGINE_CODE; /* DO not forget to modify SUMA_CommandCode */
00167                
00168 typedef enum { SEF_Empty, 
00169                SEF_fm, SEF_im, SEF_fv3, SEF_iv3, SEF_fv15, 
00170                SEF_iv15, SEF_i, SEF_f, SEF_s, SEF_vp, 
00171                SEF_cp, SEF_fp, SEF_ip, SEF_iv200, SEF_fv200, 
00172                SEF_ivec, SEF_fvec,
00173                SEF_BadCode} SUMA_ENGINE_FIELD_CODE; 
00174                
00175 typedef enum { SES_Empty,
00176                SES_Afni,  /*!< command from Afni directly which practically means that Srcp in EngineData is not SUMA_SurfaceViewer * . In the future, some Afni related pointer might get passed here. */
00177                SES_Suma,  /*!< command from Suma, which means that Srcp is a SUMA_SurfaceViewer * to the viewer making the command. */
00178                SES_SumaWidget,  /*!< command from a widget in Suma. Usually means, do not try to update widget ... */
00179                SES_SumaFromAfni,   /*!< command from Suma in response to a request from Afni. Srcp is still a SUMA_SurfaceViewer * but Afni, havin initiated the command should not receive the command back from Suma. Think cyclical cross hair setting... */
00180                SES_SumaFromAny,  /*!< Same concept as SES_SumaFromAfni but from generic program. */
00181                SES_Unknown} SUMA_ENGINE_SOURCE;
00182 
00183 typedef enum { SEI_WTSDS,  
00184                SEI_Head, SEI_Tail, SEI_Before, SEI_After, SEI_In,
00185                SEI_BadLoc } SUMA_ENGINE_INSERT_LOCATION;
00186                
00187 typedef enum {    SOPT_ibbb,  /*!< int, byte, byte, byte, null */
00188                   SOPT_ifff   /*!< int, float, float, float, null */
00189             } SUMA_OVERLAY_PLANE_TYPE; /*!< type of color plane data, letters code for 
00190                                             index red green blue and alpha values */
00191 
00192 
00193 
00194 typedef enum { SW_File, 
00195                SW_FileOpen, SW_FileOpenSpec, SW_FileOpenSurf, SW_FileClose,
00196                SW_FileSaveView, SW_FileLoadView, 
00197                SW_N_File } SUMA_WIDGET_INDEX_FILE; /*!< Indices to widgets under File menu. 
00198                                                       Make sure you begin with SW_File and end
00199                                                       with SW_N_File */
00200 typedef enum { SW_Tools,
00201                SW_ToolsDrawROI,
00202                SW_N_Tools } SUMA_WIDGET_INDEX_TOOLS; /*!< Indices to widgets under Tools menu. 
00203                                                       Make sure you begin with SW_Tools and end
00204                                                       with  SW_N_Tools*/
00205 typedef enum { SW_View, 
00206                SW_ViewSumaCont, SW_ViewSurfCont, SW_ViewViewCont, 
00207                SW_ViewSep1,
00208                SW_ViewCrossHair, SW_ViewNodeInFocus, SW_ViewSelectedFaceset,
00209                SW_N_View } SUMA_WIDGET_INDEX_VIEW; /*!< Indices to widgets under View menu. 
00210                                                       Make sure you begin with SW_View and end
00211                                                       with SW_N_View */
00212 typedef enum { SW_Help, 
00213                SW_HelpUsage,  SW_HelpMessageLog, SW_HelpSep1, 
00214                SW_HelpSUMAGlobal, SW_HelpViewerStruct, SW_HelpSurfaceStruct, SW_HelpSep2, 
00215                SW_HelpIONotify, SW_HelpMemTrace,  
00216                SW_N_Help } SUMA_WIDGET_INDEX_HELP; /*!< Indices to widgets under Help menu.
00217                                                          Make sure you begin with SW_View and end
00218                                                          with SW_N_View */                                                   
00219 typedef enum { SW_SurfCont_Render,
00220                SW_SurfCont_RenderViewerDefault, SW_SurfCont_RenderFill, SW_SurfCont_RenderLine, SW_SurfCont_RenderPoints, 
00221                SW_N_SurfCont_Render } SUMA_WIDGET_INDEX_SURFCONT_RENDER; /*!< Indices to widgets in SurfaceController under
00222                                                                            RenderMode */
00223 typedef enum { SW_DrawROI_SaveMode,
00224                SW_DrawROI_SaveMode1D, SW_DrawROI_SaveModeNIML, 
00225                SW_N_DrawROI_SaveMode } SUMA_WIDGET_INDEX_DRAWROI_SAVEMODE; /*!< Indices to widgets in DrawROI under
00226                                                                            SavingMode */
00227 typedef enum { SW_DrawROI_SaveWhat,
00228                SW_DrawROI_SaveWhatThis, SW_DrawROI_SaveWhatRelated, 
00229                SW_N_DrawROI_SaveWhat } SUMA_WIDGET_INDEX_DRAWROI_SAVEWHAT; /*!< Indices to widgets in DrawROI under SavingWhat */
00230 
00231 typedef enum { SW_DrawROI_WhatDist,
00232                SW_DrawROI_WhatDistNothing, SW_DrawROI_WhatDistTrace, SW_DrawROI_WhatDistAll, 
00233                SW_N_DrawROI_WhatDist } SUMA_WIDGET_INDEX_DRAWROI_WHATDIST; /*!< Indices to widgets in DrawROI under
00234                                                                            WhatDist */
00235 typedef enum { SUMA_NO_ORDER, SUMA_ROW_MAJOR, SUMA_COLUMN_MAJOR }  SUMA_INDEXING_ORDER;
00236 
00237 typedef enum { SW_CoordBias,
00238                SW_CoordBias_None,
00239                SW_CoordBias_X, SW_CoordBias_Y, SW_CoordBias_Z,
00240                SW_CoordBias_N, 
00241                SW_N_CoordBias } SUMA_WIDGET_INDEX_COORDBIAS;
00242 
00243 typedef enum { SW_CmapMode,
00244                   SW_Interp, SW_NN, SW_Direct,
00245                   SW_N_CmapMode } SUMA_WIDGET_CMAP_MODE;
00246                                  
00247 typedef enum {
00248    SUMA_RDC_ERROR = -1,
00249    SUMA_RDC_NOT_SET = 0,
00250    SUMA_RDC_X_START, /*!< flag, Beginning of X reasons */
00251    SUMA_RDC_X_EXPOSE,
00252    SUMA_RDC_X_RESIZE,
00253    SUMA_RDC_X_MAPSTATE,
00254    SUMA_RDC_X_ENTER_WINDOW,
00255    SUMA_RDC_X_END, /*!< flag, End of X reasons */
00256    SUMA_RDC_NEW_CROSSHAIR,
00257    SUMA_RDC_NEW_DATA,  
00258 } SUMA_REDISPLAY_CAUSE; /*!< reasons for requesting a redisplay */
00259                                                                            
00260 typedef struct {
00261    int *i;  /*!< node index */
00262    float *r; /*!< node red */
00263    float *g; /*!< node green */
00264    float *b;/*!< node blue */
00265    int N; /*!< number of elements */
00266 }SUMA_IRGB; /*!< structure containing node colors */
00267 
00268 typedef struct {
00269    SUMA_OVERLAY_PLANE_TYPE Type; /*!< This variable determines the types of the variables below */
00270    SUMA_ENGINE_SOURCE Source; /*!< provenance of plane */
00271    void *i; /*!< Node index */
00272    void *r; /*!< Node red */
00273    void *g; /*!< Node green */
00274    void *b; /*!< Node blue */
00275    void *a; /*!< Node alpha */
00276    int N; /*!< number of elements in each vector above */
00277    float DimFact; /*!< global factor applied to each color */
00278    SUMA_Boolean Show; /*!< show plane ?*/
00279    float GlobalOpacity; /*!< Global opacity factor */
00280    SUMA_Boolean isBackGrnd; /*!< Brightness modulation */
00281 }  SUMA_OVERLAY_PLANE_DATA; /*!< This is a conveninence structure meant to carry data required to fill a color plane. 
00282                                  \sa SUMA_OVERLAYS*/
00283 
00284 typedef enum { SUMA_CMAP_ERROR=-1, SUMA_CMAP_UNDEFINED, /* Begin adding colormaps next: */
00285                SUMA_CMAP_RGYBR20,  SUMA_CMAP_nGRAY20, SUMA_CMAP_GRAY02, SUMA_CMAP_flpGRAY02, 
00286                SUMA_CMAP_GRAY20, SUMA_CMAP_BW20, SUMA_CMAP_BGYR19, 
00287                SUMA_CMAP_MATLAB_DEF_BYR64, SUMA_CMAP_BGYR64, SUMA_CMAP_ROI64, SUMA_CMAP_ROI128,
00288                SUMA_CMAP_ROI256,
00289                SUMA_CMAP_N_MAPS /* Don't add after this one */
00290                } SUMA_STANDARD_CMAP; /*!< Names of standard colormaps. RGYBR20 reads Red, Green, Yellow, Blue, Red, 20 colors total */
00291 
00292 typedef enum { SUMA_ROI_InCreation, SUMA_ROI_Finished, SUMA_ROI_InEdit} SUMA_ROI_DRAWING_STATUS;
00293 
00294 typedef enum { SUMA_ROI_OpenPath,   /*!< A collection of nodes that are topologically connected */
00295                SUMA_ROI_ClosedPath, /*!< A closed OpenPath */
00296                SUMA_ROI_FilledArea, /*!< A filled ClosePath */
00297                                     /* Preserve the order of the above three */
00298                SUMA_ROI_Collection  /*!< A collection of nodes */
00299             } SUMA_ROI_DRAWING_TYPE;  /*!< an ROI created by drawing (or other means)*/
00300 
00301 typedef enum { SUMA_BSA_Undefined, SUMA_BSA_AppendStroke, SUMA_BSA_AppendStrokeOrFill, SUMA_BSA_JoinEnds, SUMA_BSA_FillArea } SUMA_BRUSH_STROKE_ACTION; 
00302 
00303 typedef enum { SUMA_ROI_Undefined,
00304                SUMA_ROI_NodeGroup, /*!< A collection of nodes */
00305                SUMA_ROI_EdgeGroup, /*!< A collection of edges */
00306                SUMA_ROI_FaceGroup, /*!< A collection of Faces */
00307                SUMA_ROI_NodeSegment /*!< A series of connected nodes */
00308              } SUMA_ROI_TYPE; /* a generic types of ROI datums*/
00309 
00310 typedef enum { SXR_default, SXR_Euro, SXR_Afni , SXR_Bonaire} SUMA_XRESOURCES;   /* flags for different X resources */
00311 
00312 typedef enum { SRM_ViewerDefault, SRM_Fill, SRM_Line, SRM_Points , SRM_N_RenderModes} SUMA_RENDER_MODES; /*!< flags for various rendering modes */
00313 
00314 #define SUMA_N_STANDARD_VIEWS  2 /*!< number of useful views enumerated in SUMA_STANDARD_VIEWS */
00315 typedef enum {   SUMA_2D_Z0, SUMA_3D, SUMA_Dunno} SUMA_STANDARD_VIEWS; /*!< Standard viewing modes. These are used to decide what viewing parameters to carry on when switching states 
00316                                                                   SUMA_2D_Z0 2D views, with Z = 0 good for flat surfaces
00317                                                                   SUMA_3D standard 3D view
00318                                                                   SUMA_Dunno used to flag errors leave this at the end 
00319                                                                   Keep in sync with SUMA_N_STANDARD_VIEWS*/
00320 typedef enum {   SUMA_No_Lock, SUMA_I_Lock, SUMA_XYZ_Lock, SUMA_N_Lock_Types}  SUMA_LINK_TYPES; /*!< types of viewer linking. Keep SUMA_N_Lock_Types at the end, it is used to keep track of the number of types*/
00321                                                                  
00322 typedef enum {  SWP_DONT_CARE,
00323                 SWP_TOP_RIGHT, /*!< Position to the top right of reference */
00324                 SWP_BOTTOM_RIGHT_CORNER, 
00325                 SWP_TOP_LEFT,
00326                 SWP_POINTER, /*!< Position centered to the pointer */
00327                 SWP_POINTER_OFF
00328              } SUMA_WINDOW_POSITION; /*!< Types of relative window positions */
00329 
00330 typedef enum {    SAR_Undefined,
00331                   SAR_Fail, /*!< Failed action */
00332                   SAR_Succeed,
00333                }  SUMA_ACTION_RESULT;  
00334 
00335 typedef enum { SAP_Do,
00336                SAP_Undo,
00337                SAP_Redo,
00338             } SUMA_ACTION_POLARITY;               
00339 
00340 typedef enum {
00341    SUMA_ROI_FILL_TO_ALLROI, /*!< Fill until you encounter a node part of any ROI */
00342    SUMA_ROI_FILL_TO_THISROI, /*!< Fill until you encounter a node part of this ROI */
00343 }SUMA_ROI_FILL_MODES; 
00344 
00345 typedef struct {
00346    SUMA_ACTION_RESULT (*ActionFunction)(void *ActionData, SUMA_ACTION_POLARITY Pol); /*!< The function to call for performing the action */
00347    void *ActionData; /*!< The data to be passed to the function performing the action */
00348    void (*ActionDataDestructor)(void *Actiondata); /*!< The function to call that destroys ActionData */
00349 } SUMA_ACTION_STACK_DATA; /*!< a structure containing the data to form the element of the Action Stack element*/
00350 
00351 /*! structure to keep track of allocate memory */
00352 typedef struct {
00353    void **Pointers; /*!< vector of pointers for which memory was allocated */
00354    int *Size; /*!< vector of sizes of allocated memory blocks. Pointers[i] has Size[i] bytes allocated for it */
00355    int N_alloc; /*!< number of meaningful entries in Pointers and Size */
00356    int N_MaxPointers; /*!< Maximum number of elements allocated for in Pointers and Size */
00357 } SUMA_MEMTRACE_STRUCT;
00358 
00359 /*! structure containing a data block information */
00360 typedef struct {
00361    void *data;   /*!< pointer to data location */
00362    int N_link; /*!< number of links to data location */
00363    char ParentIDcode[SUMA_IDCODE_LENGTH]; /* IDcode of the creator of data */
00364 } SUMA_INODE;
00365 
00366 
00367 /*! structure containing an ROI Plane's infor */ 
00368 typedef struct {
00369    char *name; /*!< name of plane and the indices of the ROIs that belong to it */
00370    DList *ROI_index_lst;   /*!< list of indices (into SUMA_DO * SUMAg_DOv) of 
00371                                SUMA_DRAWN_ROI * objects that belong to a certain 
00372                                plane. That sounds confusing now, I'm sure it'll 
00373                                sound clear a year from now */  
00374 } SUMA_ROI_PLANE;
00375 
00376 typedef enum { SUMA_UNDEFINED_MODE, 
00377                SUMA_DIRECT, /*!< no interpolation on the colormap, node value is typecast to int and directly used
00378                                       to access color map */
00379                SUMA_NO_INTERP,   /*!< no interpolation on the colormap (like in afni with paned colormaps) but ranging
00380                                        is applied */  
00381                SUMA_INTERP       /*!< interpolation on the colormap, SUMA's default */
00382             } SUMA_COLORMAP_INTERP_MODE;
00383                
00384 typedef enum {
00385                SUMA_LESS_THAN,   /*!< Mask if T[i] < Opt->ThreshRange[0] */
00386                SUMA_ABS_LESS_THAN, /*!< Mask if T[i] < Opt->ThreshRange[0] || T[i] > -Opt->ThreshRange[0] */
00387                SUMA_THRESH_OUTSIDE_RANGE, /*!< Mask if T[i] < Opt->ThreshRange[0] || T[i] > Opt->ThreshRange[1] */
00388                SUMA_THRESH_INSIDE_RANGE, /*!< Mask if T[i] > Opt->ThreshRange[0] || T[i] < Opt->ThreshRange[1] */
00389             }  SUMA_THRESH_MODE;
00390 /*! a structure holding the options for the function SUMA_ScaleToMap 
00391 \sa SUMA_ScaleToMapOptInit to allocate and initialize such a structure 
00392 to free this structure use the free function
00393 */
00394 typedef struct {
00395    SUMA_Boolean ApplyMask; /*!< if YUP then values that fall in MaskRange are assigned the color in MaskColor */
00396    float MaskRange[2]; /*!< values between MaskRange[0] and MaskRange[1] (inclusive) are assigned MaskColor */
00397    float MaskColor[3]; /*!< color to assign to masked nodes */
00398    SUMA_Boolean ApplyClip; /*!< if YUP then range clipping using Range is applied */
00399    
00400    /* fields used in the _Interactive scale to map mode */
00401    float BrightFact; /*!< a brightness factor to apply to the color map. 
00402                            This factor is applied to the colors in the colormap and the mask colors
00403                            This overrides DimFact in SUMA_OVERLAYS*/
00404    SUMA_Boolean MaskZero; /*!< values equal to zero will be masked no matter what */
00405    float ThreshRange[2]; /*!< Thresholding range. Only first value will be used */
00406    float IntRange[2]; /*!< nodes with values <= Range[0] are given the first color in the color map, 
00407                            values >= Range[1] get the last color in the map (USED to be called ClipRange*/
00408    float BrightRange[2]; /*!< Same as IntRange but for brightness modulating column */
00409    float BrightMap[2]; /*!< BrightRange[0] is mapped to BrightMap[0], BrightRange[1] is mapped to BrightMap[1] */
00410    SUMA_Boolean alaAFNI; /*!< If yes, use ScaleToMap_alaAFNI, if NOPE, use ScaleToMap */
00411    SUMA_COLORMAP_INTERP_MODE interpmode; /*!< see typedef.*/
00412    int find;   /*!< index of function sub-brick */
00413    int tind;   /*!< index of thresholf sub-brick */
00414    int bind;   /*!< index of attenuation sub-brick */
00415    SUMA_Boolean UseThr; /*!< use or ignore tind */
00416    SUMA_THRESH_MODE ThrMode;  /*!< how to apply the thresholding */
00417    SUMA_Boolean UseBrt; /*!< use or ignore bind */
00418    SUMA_WIDGET_INDEX_COORDBIAS DoBias;  /*!< use coordinate bias */
00419    float CoordBiasRange[2]; /*!< Same as IntRange but for brightness modulating column */
00420    float *BiasVect; /*!< A vector of values to add to the coordinates of the mesh */
00421    int AutoIntRange;
00422    int AutoBrtRange;
00423 } SUMA_SCALE_TO_MAP_OPT;
00424 
00425 /*! Structure containing one color overlay */
00426 typedef struct {
00427    int LinkedPtrType; /*!< Indicates the type of linked pointer */
00428    int N_links;   /*!< Number of links to this pointer */
00429    char owner_id[SUMA_IDCODE_LENGTH];   /*!< The id of whoever created that pointer. Might never get used.... */
00430 
00431    SUMA_Boolean Show; /*!< if YUP then this overlay enters the composite color map */
00432    char *Name; /*!< name of ovelay, CONVEXITY or Functional or areal boundaries perhaps. The Name can be a filename with path*/
00433    char *Label; /*!< Usually the same as Name without any existing path */
00434       /* These can't just come from dset_link because as you change the threshold, and other parameters 
00435       some nodes may not get colored so the NodeDef list will differ from that in dset.
00436       The macros COLP_NODEDEF, COLP_N_NODEDEF and COLP_N_ALLOC will be redefined
00437       to point to fields inside the overlays structure                           Mon Mar 29 15:11:01 EST 2004*/
00438    int *NodeDef; /*!< nodes over which the colors are defined*/
00439    int N_NodeDef; /*!< total number of nodes specified in NodeDef*/
00440    #if 0
00441       /* That one is still borrowed from dset structure */
00442    int N_Alloc; /*!< You'd think this should be equal to NodeDef, but in instances where you may be receiving
00443              varying numbers of colors to the same plane, it's a pain to have to free and realloc space.
00444              So, while the juice is only up to N_NodeDef, the allocation is for N_Alloc */
00445    
00446    #endif
00447    int FullList; /*!< if 1 then it indicates that a full listing of node colors exists.
00448                      i.e. nodes need not be defined explicitly, in that case 
00449                      NodeDef is stil explicitly defined. I have my reasons.*/
00450                      
00451    float *ColVec; /*!< N_NodeDef x 3 vector containing colors of nodes specified in NodeDef, Replaces ColMat, Wed Mar 17 04*/
00452    float GlobalOpacity; /*!< Opacity factor between 0 and 1 to apply to all values in ColMat */
00453    float *LocalOpacity; /*!< Opacity factor vector between 0 and 1 to apply to each individual node color */
00454    int PlaneOrder; /*!< Order of the overlay plane, 1st plane is 0 and is farthest away from the top */  
00455    SUMA_Boolean isBackGrnd; /*!< if YUP then colors overlaid on top of this plane have their 
00456                               brightness modulated by the average intensity of the colors in that 
00457                               plane see the function SUMA_Overlays_2_GLCOLAR4 for details. 
00458                               In other obscure words, if YUP then plane is part of background.*/ 
00459    float DimFact;    /*!< a scaling factor applied to the colors in ColVec 
00460                            This is overriden by BrightFact in OptScl which is
00461                            defined for non-explicitly colored planes*/
00462    float ForceIntRange[2]; /*!< Use values here to set OptScl->IntRange instead of the true
00463                                  range of values in the dataset.
00464                                  The idea is to allow particular settings for the autoranging 
00465                                  options that are not from the dset's min to max.
00466                                  Usually, this field is not used and both values are set to 0.0
00467                                  */
00468    /* New additions, Fri Feb 20 13:21:28 EST 2004 */
00469    SUMA_DSET *dset_link; /*!< A COPY OF THE POINTER to the dataset this plane is 
00470                               attached to. DO NOT FREE THIS POINTER MANUALLY.
00471                               This is done in the functions for creating and destroying
00472                               overlay planes */ 
00473    char *cmapname; /*!< name of colormap (must be in SUMAg_CF->scm)  */
00474    SUMA_SCALE_TO_MAP_OPT *OptScl;   /* Options for mapping values in dset to colormap */
00475    int SymIrange;
00476 } SUMA_OVERLAYS;
00477 
00478 
00479 typedef enum { SUMA_BAD_MODE=-1, 
00480                SUMA_ORIG_MIX_MODE,  /*!< The original mode for color overlaying: 
00481                                  if (Col1) Col = (1-opacity) Col1 + opacity Col2 */
00482                SUMA_4AML,  /*!< A modified mixing mode to keep colors from getting dimmed 
00483                               (as with opacity of 0.5 on Col1 = 0.3 0 0 and Col2 = 0 0.3 0)
00484                               resultant is a very dim yellow 0.15 0.15 0 
00485                               Named after the eminent A. M. L.*/
00486                SUMA_MAX_MODES /*!< The limit, used for cycling */
00487                } SUMA_COL_MIX_MODE;
00488 
00489 /*! structure containing the color mapping of a vector */
00490 typedef struct {
00491    /* float **cM; Prior to Mar 17 03*//*!< N_Node x 3 matrix containing the colors at each node*/
00492    float *BiasCoordVec; /*!< A vector of coordinate bias */
00493    float *cV; /*!< N_Node x 3 vector containing the colors at each node*/
00494    int N_Node; /*!< obvious */
00495    SUMA_Boolean *isMasked; /*!< if isMasked[i] then node i has a mask color associated with it */ 
00496 } SUMA_COLOR_SCALED_VECT;
00497 
00498 
00499 
00500 
00501 /*! TRY TO MAKE DO WITHOUT THIS THING, IF POSSIBLE. 
00502 It is a pain to work with two types of ROI structues 
00503 structure to hold an ROI */
00504 typedef struct { 
00505    SUMA_ROI_TYPE Type;   /*!< The type of ROI */
00506    
00507    char *idcode_str;    /*!< unique idcode for ROI */
00508    char *Parent_idcode_str; /*!< idcode of parent surface */
00509    char *Label; /*!< ascii label for ROI */
00510 
00511    int *ElInd; /*!< pointer to vector containing indices into the parent surface (SO has Parent_idcode_str) of ROI elements.
00512                            If Type is SUMA_ROI_NodeGroup then ElementIndex contains indices to SO->NodeList .
00513                            If Type is SUMA_ROI_FaceGroup then ElementIndex contains indices to SO->FaceList.
00514                            If Type is SUMA_ROI_EdgeGroup then ElementIndex contains indices to SO->EL->EL. */
00515    int N_ElInd; /*!< Number of elements in ElementIndex */ 
00516 } SUMA_ROI; 
00517 
00518 
00519 
00520 typedef struct {
00521    SUMA_ROI_TYPE Type; /*!< Type of ROI in datum */
00522    int N_n; /*!< Number of elements in nPath */
00523    int N_t; /*!< Number of elements in tPath */
00524    int *nPath; /*!< Vector of N node indices. These nodes must be immediate (linked) neighbours of each other */
00525    int *tPath; /*!< Vector of N triangle indices. These triangles must be connected to each other */
00526    float tDistance; /*!< distance from the first node to the last taken along the surface (geodesic)*/
00527    float nDistance; /*!< distance from the first node to the last by summing the length of segments between nodes */
00528    SUMA_BRUSH_STROKE_ACTION action; /*!< a record of the action that went with this datum. 
00529                                        This field is used to recreate the ROI drawing history from a saved
00530                                        niml file */
00531 } SUMA_ROI_DATUM; /*!< elementary datum of a drawn ROI */
00532 
00533 
00534 #define SUMA_MAX_ROI_CTRL_NODES 100 /*!< Maximum number of control nodes in an ROI */
00535 #define SUMA_MAX_ROI_CTRL_NODES3 300 
00536 #define SUMA_MAX_ROI_ON_SURFACE 100 /*!< Maximum number of ROIs Drawn on a surface */
00537 
00538 typedef struct {   
00539    int n1;  /*!<index of edge's first node */
00540    int n2; /*!<index of edge's second node */
00541 } SUMA_CONTOUR_EDGES; /*<! structure defining an edge by the nodes forming it*/
00542 
00543 /*! structure to hold the drawing of an ROI */
00544 typedef struct {   
00545    SUMA_ROI_DRAWING_TYPE Type;   /*!< The type of ROI drawn, that would be closed path, etc, etc, */
00546 
00547    char *idcode_str;    /*!< unique idcode for ROI */
00548    char *Parent_idcode_str; /*!< idcode of parent surface */
00549    char *Label; /*!< ascii label for ROI */ 
00550    char *ColPlaneName;  /*!< Name of color plane that the ROI is painted in.
00551                      If this field is set to NULL then the ROI will be painted
00552                      in the generic ROI_Plane plane. For the moment, NULL is the only
00553                      option */
00554    float FillColor[3];  /*!< RGB fill color */
00555    float EdgeColor[3];  /*!< RGB edge color */
00556    int EdgeThickness;   /*!< thickness of edge */
00557    int iLabel; /*!< An integer value, another way to represent a Label */
00558    SUMA_Boolean ColorByLabel; /*!< flag indicating that ROI node colors should
00559                                    be based on the value in iLabel and not the 
00560                                    one specified in FillColor */
00561    SUMA_ROI_DRAWING_STATUS DrawStatus; /*!< Status of the ROI being drawn, finished, being drawn, being edited, etc. */
00562 
00563    DList *ROIstrokelist;   /*!< a doubly linked list with the data element being a (void *)SUMA_ROI_DATUM * */
00564 
00565    DList *ActionStack; /*!< a stack containing the various actions performed*/
00566    DListElmt *StackPos; /*!< The element of ActionStack that represents the current position */
00567    
00568    int N_CE; /*!< number of contour edges */
00569    SUMA_CONTOUR_EDGES *CE; /*!< a vector of edges that form the contour of the ROI */
00570 } SUMA_DRAWN_ROI;
00571 
00572 typedef struct {
00573    int Type;         /*!< The final type of the DrawnROI, see SUMA_ROI_DRAWING_TYPE*/
00574    char *idcode_str;
00575    char *Parent_idcode_str;
00576    char *Label;
00577    int *iNode; /*!< A node's index */
00578    int *iLabel; /*!< A node's value */
00579    int N; /*!< NUmber of elements in iNode and iLabel */
00580 } SUMA_1D_DRAWN_ROI; /*!< a version of SUMA_DRAWN_ROI struct that can be used by 1D functions.
00581                      Fields are a reflection of those in SUMA_DRAWN_ROI*/
00582 
00583 typedef struct {
00584    SUMA_ROI_DATUM *ROId;
00585    SUMA_DRAWN_ROI *DrawnROI;
00586 } SUMA_ROI_ACTION_STRUCT;  /*!< a structure packaging data for the routines acting on drawn ROIs */
00587 
00588 
00589 
00590 
00591 /*! 
00592 Stucture to hold the contents of the specs file 
00593 */
00594 typedef struct {
00595    char SurfaceType[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_LABEL_LENGTH];    /*!< Type of surface loaded: 
00596                                                                         FreeSurfer, SureFit/Caret, 1D format, inventor, Ply */ 
00597    char SurfaceFormat[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_LABEL_LENGTH];  /*!< ASCII or Binary */
00598    char TopoFile[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_FP_NAME_LENGTH]; /*!< Surface Topology (mesh) file 
00599                                                                      renamed from SureFitTopo because 1D uses it too */ 
00600    char CoordFile[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_FP_NAME_LENGTH]; /*!< Surface Coordinate (XYZ) file
00601                                                                       renamed from SureFitCoord because 1D uses it too  */ 
00602    char MappingRef[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_FP_NAME_LENGTH]; /*!< Becoming obsolete. Jan 2 03 */
00603    char SureFitVolParam[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_FP_NAME_LENGTH]; /*!< For SureFit only: Name of file containing anatomical
00604                                                                              coordinates modification. */
00605    char SurfaceFile[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_FP_NAME_LENGTH];  /*!< File containing topology and geometry of surface. */
00606    char VolParName[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_FP_NAME_LENGTH];   /*!< Now known as surface volume in the documentation 
00607                                                                           This is the volume from which the surface was created,
00608                                                                           aligned to the experiment's data. Alignment transforms
00609                                                                           added by 3dVolreg or 3dAnatNudge that are stored in this 
00610                                                                           volume ar applied to the surface. Also, tlrc transforms of
00611                                                                           this volume can be applied to the surface. */
00612    char *IDcode[SUMA_MAX_N_SURFACE_SPEC];                            /*!< Unique identifier for the surface object */
00613    char State[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_LABEL_LENGTH];       /*!< Geometrical state of the surface. For example:
00614                                                                            pial, white, inflated, spherical, etc... */
00615                                                                            
00616    char Group[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_LABEL_LENGTH];        /*!< Some identifier, best thought of as the name of 
00617                                                                            the subject */
00618    char SurfaceLabel[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_LABEL_LENGTH]; /*!< A user defined "short" label to use in GUI */
00619    int EmbedDim[SUMA_MAX_N_SURFACE_SPEC];                            /*!< 2 for flat surfaces, 3 for 3D dwelling ones. */
00620    
00621    /* modifications to the lame MappingRef field */
00622    char AnatCorrect[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_LABEL_LENGTH];    /*!< Does surface geometry match the anatomy ?*/
00623    char Hemisphere[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_LABEL_LENGTH];     /*!< Left/Right */
00624    char DomainGrandParentID[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_LABEL_LENGTH];   /*!< Grandparent's mesh ID 
00625                                                                                     (icosahedron's for std-meshes) */
00626    char OriginatorID[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_LABEL_LENGTH];   /*!<  ID common to surfaces from one subject that are created
00627                                                                               at one point in time. Surfaces of the same subject,
00628                                                                               created at different points in time (like in a longitudinal
00629                                                                               study) will have differing OriginatorID fields */
00630    char LocalCurvatureParent[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_FP_NAME_LENGTH];   /*!<  Name of surface (in current spec file)
00631                                                                                  from which the curvature will be borrowed.
00632                                                                                  The LocalCurvatureParent must be isotopic to 
00633                                                                                  the child surface. This Parent used to be
00634                                                                                  the MappingRef field*/
00635    char LocalDomainParent[SUMA_MAX_N_SURFACE_SPEC][SUMA_MAX_FP_NAME_LENGTH];       /*!< Name of surface (in current spec file)
00636                                                                                  from which EdgeLists and other shared information
00637                                                                                  will be borrowed. This field used to be 
00638                                                                                  the MappingRef field. Naturally, Parent and 
00639                                                                                  Child must be isotopic.
00640                                                                                  You must have at least one of the surfaces loaded
00641                                                                                  into SUMA be the Parent. Use SAME for this field when
00642                                                                                  a surface is a LocalDomainParent.
00643                                                                                  */
00644    #if 0
00645    /* Not being used yet, but in the SurfaceObject structure */
00646    int NodeDim; /*!< 3 for nodes specified in 3D, 2 for X,Y only (not really supported...) */
00647    int MeshDim; /*!< 3 for triangles, 4 for quadrilaterals (not quite supported) */
00648    /* you can also envision ID fields that point to surface attributes that are time consuming 
00649    to calculate and do not change often. I use none at the moment, but will do so, perhaps in the future.
00650    For example:
00651    A sorted EdgeList (for fast topological shenanigans, I swear by this one)
00652    A node curvature list,
00653    Interpolation weights,
00654    Datasets containing ROI or parcellation information  
00655    etc...
00656    */  
00657    #endif
00658    
00659    int N_Surfs;                                                      /*!< Number of surfaces, in the spec file */
00660    int N_States;                                                     
00661    int N_Groups;
00662    char StateList[SUMA_MAX_N_SURFACE_SPEC*100];
00663    char SpecFilePath[SUMA_MAX_DIR_LENGTH];
00664    char SpecFileName[SUMA_MAX_NAME_LENGTH];
00665 } SUMA_SurfSpecFile;
00666 
00667 /*! structure that containing node's first order neighbors */
00668 typedef struct {
00669    int LinkedPtrType; /*!< Indicates the type of linked pointer */
00670    int N_links;   /*!< Number of links to this pointer */
00671    char owner_id[SUMA_IDCODE_LENGTH];   /*!< The id of whoever created that pointer. Might never get used.... */
00672 
00673 
00674    char *idcode_str; /*!< identifier of element containing node's first order neighbors */
00675    int N_Node; /*!< Number of nodes whose neighbors are listed in this structure */
00676    int *NodeId; /*!< Id of each node whose neighbors are listed in this structure 
00677                      *** WARNING: *** A lot of functions do not use this field and assume
00678                      N_Node = number of nodes in the surface! */
00679    int **FirstNeighb; /*!< N_Node x N_Neighb_max matrix with each row specifying the indices of neighboring nodes.
00680                         After Tue Jan  7 18:13:44 EST 2003: The nodes are now ordered to form a path on the surface.
00681                         Note: There is no guarantee that the path is closed. */
00682    int *N_Neighb; /*!< maximum number of neighbors for a particular node */
00683    int N_Neighb_max; /*!< maximum number of neighbors of all nodes */
00684 } SUMA_NODE_FIRST_NEIGHB;
00685 
00686 /*! structure that contains faceset's first order neighbors */
00687 typedef struct {
00688    int N_FaceSet; /*!< Number of nodes whos neighbors are listed in this structure */
00689    int **FirstNeighb; /*!< N_Node x N_Neighb_max matrix with each row specifying the indices of neighboring facesets */
00690    int *N_Neighb; /*!< maximum number of neighbors for a particular faceset */
00691    int N_Neighb_max; /*!< maximum number of neighbors of all facesets */
00692    int N_Neighb_min; /*!< minimum number of neighbors of all facesets */
00693 } SUMA_FACESET_FIRST_EDGE_NEIGHB;
00694 
00695 /*!
00696    structure containing surface curvature parameters
00697 */
00698 typedef struct {
00699    int N_Node; /*!< Number of nodes in the surface */
00700    float **T1; /*!< N_Node x 3 matrix with each row specifying the 1st principal direction of the surface */
00701    float **T2; /*!< N_Node x 3 matrix with each row specifying the 2nd principal direction of the surface */
00702    float *Kp1; /*!< N_Node x 1 vector with each row specifying the curvature along the 1st principal direction */
00703    float *Kp2; /*!< N_Node x 1 vector with each row specifying the curvature along the 2nd principal direction */
00704    int N_SkipNode; /*!< number of nodes for which the curvature could not be computed */
00705 } SUMA_SURFACE_CURVATURE;
00706 
00707 
00708 /*! 
00709    structure containing the edges that make up a triangular faceset list
00710 
00711 */
00712 typedef struct {
00713    int LinkedPtrType; /*!< Indicates the type of linked pointer */
00714    int N_links;   /*!< Number of links to this pointer */
00715    char owner_id[SUMA_IDCODE_LENGTH];   /*!< The id of whoever created that pointer. Might never get used.... */
00716 
00717    
00718    char *idcode_str; /*!< ID of this particular edge list */
00719    int ** EL; /*!< pointer to where the Edge List ( N_EL x 2 ) will be placed
00720                         each row is an edge, i1 i2 where i1 is always <= i2
00721                         EL is sorted by row */
00722    int ** ELps; /*!< pointer to where the Edge List Property matrix ( N_EL x 2 )will be placed 
00723                         1st column, row i = 1 means edge i: i1,i2 was encountered as i2->i1 in the triangle J (so it was flipped when stored in EL)
00724                                           = -1 means edge i: i1,i2 was encountered as i1->i2 in the triangle J (so no flipping was done to store it in EL)
00725                         2nd column, row i = J is the triangle ( FL[J] ) that the segment belongs to. 
00726                         3rd column, row i = Numer of triangles that contain this edge. This number is positive for the first occurence
00727                         of the edge in EL, it is -1 afterwards. A decent edge has 2 hosting triangles, an edge edge
00728                         has 1 hosting triangle. Bad edges come in all other colors*/
00729                         
00730    int *ELloc; /*!< k x 1 vector that stores where each node's listing begins. 
00731                      ELloc is used to quickly find a certain edge in EL
00732                      to find the edge formed by nodes na-nb
00733                      find the minimum of na and nb (say it's nb)
00734                      the first reference of an edge containing nb starts at EL(ELloc(nb),:)
00735                      NOTE: ELloc contains an entry for each node in FaceSetList, except the 
00736                      largest node index since that's never in the 
00737                      first column of EL */
00738                      
00739    int N_EL; /*!< Number of segments = 3 * N_Facesets */
00740    int N_Distinct_Edges; /*! Number of distinct edges (no multiple counts as in N_EL) */
00741    int max_N_Hosts; /*!< Maximum number of triangle hosts any one edge has (max ( ELps(:,2) != -1 ) )*/
00742    int  min_N_Hosts; /*!< Minimum version of max_N_Hosts */
00743    
00744    int **Tri_limb; /*!< each row j of Tri_limb contains the indices into EL (and ELps) of the edges that make it up */
00745    float *Le; /*!< Vector N_EL elements long containing the length of each edge in EL */
00746    
00747 } SUMA_EDGE_LIST;
00748 
00749 /*! structure that contains array pointers from function SUMA_isinbox */
00750 #define SUMA_isinbox_struct
00751 typedef struct {
00752    int *IsIn; /*!< Indices of nodes inside the box */
00753    int nIsIn; /*!< Number of nodes inside the box */
00754    float *d; /*!< Distance of each node to the center of the box */
00755    float **dXYZ; /*!< Not implemented */
00756 } SUMA_ISINBOX;
00757 
00758 /*! structure that contains array pointers from function isinsphere */
00759 #define SUMA_isinsphere_struct
00760 typedef struct {
00761    int *IsIn;  /*!< Indices of nodes inside the sphere */
00762    int nIsIn; /*!< Number of nodes inside the sphere */
00763    float *d;  /*!< Not implemented Distance of each node to the center of the shpere */
00764    float **dXYZ; /*!< Not implemented */
00765 } SUMA_ISINSPHERE;
00766 
00767 /*! Displayable Object Type */
00768 typedef struct {
00769    void *OP;   /*!< Object Pointer */
00770    SUMA_DO_Types ObjectType; /*!< Type of displayable object */
00771    SUMA_DO_CoordType CoordType; /*!< Type of coordinate system that the object is attached to
00772                                     This is used to determine whether the object is drawn before or 
00773                                     or after the shift and rotation matrices are applied */
00774 } SUMA_DO;
00775 
00776 
00777 typedef struct {
00778    Widget toplevel;  /*!< toplevel widget of the text display window */
00779    Widget text_w; /*!<  text widget containing string to be displayed */
00780    Widget search_w;  /*!< widget of string search field */
00781    Widget text_output;  /*!< widget of search result field */
00782    SUMA_Boolean case_sensitive;  /*!< Case sensitive widget search */
00783    SUMA_Boolean allow_edit; /*!< allow editing of text displayed*/
00784    void (*OpenCallBack)(void *data); /*!< call back performed when SUMA_CreateTextShell is entered */
00785    void * OpenData;  /*!< data sent along with OpenCallBack */
00786    void (*DestroyCallBack)(void *data);   /*!< call back performed when SUMA_DestroyTextShell is entered */
00787    void * DestroyData; /*!< data sent along with DestroyCallBack */
00788    SUMA_Boolean CursorAtBottom; /*!< If YUP then cursor is positioned at end of text field */
00789 } SUMA_CREATE_TEXT_SHELL_STRUCT; /*!< structure containing options and widgets for the text shell window */
00790 
00791 typedef enum {SUMA_OK_BUTTON, SUMA_APPLY_BUTTON, 
00792                SUMA_CLEAR_BUTTON, SUMA_CANCEL_BUTTON, 
00793                SUMA_HELP_BUTTON, SUMA_N_PROMPT_BUTTONS }SUMA_PROMPT_BUTTONS;
00794 
00795 typedef enum { SUMA_OK, SUMA_OK_HELP, 
00796                SUMA_OK_CANCEL, SUMA_OK_CANCEL_HELP,
00797                SUMA_OK_CLEAR_CANCEL, SUMA_OK_CLEAR_CANCEL_HELP,
00798                SUMA_OK_APPLY_CANCEL, SUMA_OK_APPLY_CANCEL_HELP,
00799                SUMA_OK_APPLY_CLEAR_CANCEL, SUMA_OK_APPLY_CLEAR_CANCEL_HELP} SUMA_PROMPT_MODE;
00800                
00801 typedef enum {
00802    SUMA_LSP_SINGLE, SUMA_LSP_BROWSE, SUMA_LSP_MULTIPLE, SUMA_LSP_EXTENDED
00803 }  SUMA_ListSelectPolicy; /*!< Flags for motif list selection policy */
00804 
00805 typedef struct {
00806    char ** clist; /*!< strings displayed in the Scrolled list window */
00807    int N_clist; /*!< Number of strings in clist */
00808    void **oplist; /*!< list of pointers to objects in the scrolled list */
00809 } SUMA_ASSEMBLE_LIST_STRUCT;
00810 
00811 /*!
00812    Structure containing widgets and settings for a list widget 
00813 */
00814 typedef struct {
00815    Widget toplevel; /*!< top level shell for list */
00816    Widget rc;  /*!< rowcolumn containing all the widgets of the scrolled list */
00817    Widget list; /*!< list widget */
00818    
00819    Widget PosRef; /*!< Widget relative to which list is positioned */
00820    SUMA_WINDOW_POSITION Pos; /*! Position of list relative to PosRef*/
00821    SUMA_ListSelectPolicy SelectPolicy; /*!< Sets the XmNselectionPolicy resource:
00822                           SUMA_LSP_SINGLE: XmSINGLE_SELECT, 
00823                           SUMA_LSP_BROWSE: XmBROWSE_SELECT, 
00824                           SUMA_LSP_MULTIPLE: XmMULTIPLE_SELECT, 
00825                           SUMA_LSP_EXTENDED: XmEXTENDED_SELECT */
00826    SUMA_Boolean ShowSorted; /*!< Sort the list in alphabetical order */
00827    SUMA_Boolean RemoveDups; /*!< Remove duplicates in list */                        
00828    void (*Default_cb)(Widget w, XtPointer data, XtPointer calldata); /*!< callback to make when a default selection mode is made */ 
00829    void *Default_Data; /*!< pointer to data to go with Default_cb. If you pass NULL, the pointer to the List Widget is sent */
00830    void (*Select_cb)(Widget w, XtPointer data, XtPointer calldata); /*!< callback to make when a selection is made */ 
00831    void *Select_Data; /*!< pointer to data to go with Select_cb. If you pass NULL, the pointer to the List Widget is sent */
00832    void (*CloseList_cb)(Widget w, XtPointer data, XtPointer calldata); /*!< callbak to make when a selection is made */
00833    void *CloseList_Data; /*!< pointer to data to go with CloseList_cb. If you pass NULL, the pointer to the List Widget is sent */
00834    char *Label;
00835    SUMA_Boolean isShaded; /*!< YUP if the window is minimized or shaded, NOPE if you can see its contents */
00836    
00837    SUMA_ASSEMBLE_LIST_STRUCT *ALS; /*!< structure containing the list of strings shown in the widget and the pointers 
00838                                        of the objects the list refers to*/  
00839 } SUMA_LIST_WIDGET;
00840 
00841 /*! structure containing widgets for surface viewer controllers ViewCont */
00842 typedef struct {
00843    Widget TopLevelShell;/*!< Top level shell for a viewer's controller */
00844    Widget Mainform; 
00845    Widget ViewerInfo_pb;
00846    Widget Info_lb;
00847    SUMA_LIST_WIDGET *SwitchGrouplst; /*!< a structure containing widgets and options for the switch Group list */
00848    SUMA_LIST_WIDGET *SwitchStatelst; /*!< a structure containing widgets and options for the switch State list */
00849    SUMA_CREATE_TEXT_SHELL_STRUCT * ViewerInfo_TextShell; /*!< structure containing widgets and options of the viewer info text shell */
00850 }SUMA_X_ViewCont;
00851 
00852 typedef struct {
00853    SUMA_PROMPT_MODE Mode;
00854    SUMA_PROMPT_BUTTONS default_button; /*!< button to call when return key is hit in the text field.*/
00855    void (*SelectCallback)(char *selection, void *data); /*!< function called when a selection is made 
00856                                             See note for Preserve field*/
00857    void *SelectData; /*!< data sent along to SelectCallback */
00858    void (*CancelCallback)(void *data); /*!< function called when cancel or kill is called */
00859    void *CancelData; /*!< data sent along to CancelCallback */
00860    void (*HelpCallback)(void *data);
00861    void (*HelpData);
00862    int (*VerifyFunction)(char *word, void *data);
00863    void (*VerifyData); 
00864    Widget actionarea;
00865    Widget pane;
00866    Widget dialog; /*!< widget of dialog */
00867    Widget daddy; /*!< widget of parent */ 
00868    Widget text_w; /*!< Text entry widget */
00869    char *selection; /*!< What the lame user wrote */
00870    char *label; /*!< Label for the text field */
00871    SUMA_Boolean preserve; 
00872 } SUMA_PROMPT_DIALOG_STRUCT; /*!< \sa similar fields in SUMA_SELECTION_DIALOG_STRUCT */
00873 
00874 typedef enum { SUMA_FILE_OPEN, SUMA_FILE_SAVE } SUMA_FILE_SELECT_MODE; /*!< mode of file selection dialog */
00875 
00876 typedef struct {
00877    SUMA_FILE_SELECT_MODE Mode; 
00878    void (*SelectCallback)(char *filename, void *data); /*!< function called when a selection is made 
00879                                             See note for Preserve field*/
00880    void *SelectData; /*!< data sent along to SelectCallback */
00881    void (*CancelCallback)(void *data); /*!< function called when cancel or kill is called */
00882    void *CancelData; /*!< data sent along to CancelCallback */
00883    Widget dlg_w; /*!< widget of dialog */
00884    Widget daddy; /*!< widget of parent */
00885    char *filename; /*!< selected filename. 
00886                NOTE: This is only valid when a selection has been made */
00887    char *FilePattern; /*!< Pattern for filename filtering
00888                            Only relevant when window is opened */
00889    SUMA_Boolean preserve; /*!< If YUP, then widget is only unmanaged when 
00890                               selection is made or cancel is pressed. In 
00891                               this case, you should take care of dlg's safekeeping
00892                               and eventual destruction.
00893                               If Nope, then the widget is destroyed after selection
00894                               and/or cancel and the dlg structure is destroyed.
00895                               Be careful, if Preserve is NOPE, that your callbacks
00896                               do not return before being done with this structure*/ 
00897 } SUMA_SELECTION_DIALOG_STRUCT;
00898 
00899 /*!
00900    Structure containing widgets and settings of an arrow and or a text field
00901    
00902    - When adding fields to this stucture, make sure you initialize them
00903    appropriately in the functions SUMA_CreateTextField and SUMA_CreateArrowField
00904 */ 
00905 typedef struct {
00906    Widget rc;  /*!< rowcolumn containing all the widgets of the arrow field */
00907    Widget textfield;  /*! text label */
00908    Widget up;     /*!< up arrow */
00909    Widget down;   /*!< down arrow */
00910    Widget label;  /*!< label widget */
00911    
00912    float step; /*!< increment */
00913    float min;  /*!< minimum value */
00914    float max;  /*!< maximum value */
00915    SUMA_Boolean wrap; /*!< YUP: wrap value in min-max range, else clip it*/
00916    float value;   /*!< current value */
00917    int cwidth; /*!< charcter spaces to save for widget */
00918    SUMA_VARTYPE type; /*!< SUMA_int or SUMA_float or SUMA_string */
00919    int direction; /*!< +1 up, -1 down */
00920    
00921    XtIntervalId arrow_timer_id; /*!< time out process id */
00922    
00923    void (*NewValueCallback)(void *data); /*!< callback to make when a new value is set */
00924    void *NewValueCallbackData; 
00925    SUMA_Boolean modified; /*!< set to YUP when user edits the value field */
00926    SUMA_Boolean arrow_action; /*!< set to YUP when user clicks one of the arrows */
00927 } SUMA_ARROW_TEXT_FIELD; 
00928 
00929 typedef enum { SUMA_ERROR_CELL, SUMA_ROW_TIT_CELL, SUMA_COL_TIT_CELL, SUMA_ENTRY_CELL } SUMA_CELL_VARIETY;
00930 
00931 typedef struct{
00932    Widget rc;
00933    Widget *cells; /* table cells, Ncol x Nrow total */
00934    SUMA_Boolean HasColTit; /*!< YUP = table's 1st row is titles */
00935    SUMA_Boolean HasRowTit; /*!< YUP = table's 1st col is titles */
00936    int Ni;   /*!< Number of rows = Number of elements PER COLUMN (1st dim)*/
00937    int Nj;   /*!< Number of columns = Number of elements PER ROW (2nd dim)*/
00938    int *cwidth; /*!< charcter spaces to save for widget per column */
00939    float *num_value;   /*!< current value at each cell (for numeric cells)*/
00940    char **str_value;   /*!< current string at each cell (for string cells) */
00941    SUMA_Boolean editable;
00942    SUMA_VARTYPE type; /*!< SUMA_int or SUMA_float or SUMA_string */
00943    void (*NewValueCallback)(void *data); /*!< callback to make when a new value is set */
00944    void *NewValueCallbackData;
00945    void (*TitLabelEVHandler)(Widget w , XtPointer cd , XEvent *ev , Boolean *ctd); 
00946    void *TitLabelEVHandlerData; 
00947    void (*CellEVHandler)(Widget w , XtPointer cd , XEvent *ev , Boolean *ctd); 
00948    void *CellEVHandlerData;
00949    int cell_modified; /*!< set to 1D index (column major) of cell_value edited, 
00950                            i = cell_modified % Ni, j = cell_modified / Ni 
00951                            cell_modified = j * Ni + i */
00952 } SUMA_TABLE_FIELD;
00953 
00954 typedef struct {
00955    Widget cmap_wid;  /*! GLXAREA widget for displaying colormap */
00956    float FOV;  /*! FOV for viewing colormap */
00957    GLXContext cmap_context;   /* graphic context for cmap */
00958    float translateVec[3];
00959 } SUMA_CMAP_RENDER_AREA;
00960 
00961 /*! structure containing widgets for surface  controllers SurfCont */
00962 typedef struct {
00963    /* *** DO NOT ADD ANYTHING BEFORE THESE FIELDS
00964           DO NOT CHANGE THE ORDER OF THESE FIELDS
00965           These fields are use for tracking copies
00966           (links) to a pointer.
00967           ANY CHANGES HERE SHOULD BE REFLECTED IN 
00968           SUMA_LinkedPtr structure 
00969    */
00970    int LinkedPtrType; /*!< Indicates the type of linked pointer */
00971    int N_links;   /*!< Number of links to this pointer */
00972    char owner_id[SUMA_IDCODE_LENGTH];   /*!< The id of whoever created that pointer. Might never get used.... */
00973    
00974    Widget TopLevelShell;/*!< Top level shell for a Surface's controller */
00975    Widget PosRef; /*!< reference position widget */
00976    Widget Mainform; /*!< main form, child of TopLevelShell */
00977    Widget SurfInfo_pb; /*!< More info push button */
00978    Widget SurfInfo_label; /*!< Le label */
00979    SUMA_CREATE_TEXT_SHELL_STRUCT * SurfInfo_TextShell; /*!< structure containing widgets and options of the surface info text shell */
00980    Widget RenderModeMenu[SW_N_SurfCont_Render]; /*!< vector of widgets controlling the rendering mode menu */
00981    Widget ColPlane_fr; /*!< the frame controlling the colorplanes */
00982    Widget DsetMap_fr; /*!< the frame for mapping Dset to colormap */
00983    Widget Xhair_fr; /*!< The frame for cross hair Info and controls */ 
00984    SUMA_ARROW_TEXT_FIELD *ColPlaneOrder; /*!< structure for arrow/text field widget controlling color plane order */
00985    SUMA_ARROW_TEXT_FIELD *ColPlaneOpacity; /*!< structure for arrow/text field widget controlling color plane opacity */
00986    SUMA_ARROW_TEXT_FIELD *ColPlaneDimFact; /*!< structure for arrow/text field widget controlling color plane DimFact */
00987    SUMA_TABLE_FIELD *SetRangeTable; /*!< structure for range setting table */
00988    SUMA_TABLE_FIELD *RangeTable; /*!< structure for range  table */
00989    SUMA_TABLE_FIELD *XhairTable; /*!< structure for Cross hair  table */
00990    SUMA_TABLE_FIELD *NodeTable; /*!< structure for node index  table */
00991    SUMA_TABLE_FIELD *FaceTable;
00992    SUMA_TABLE_FIELD *DataTable;
00993    SUMA_TABLE_FIELD *LabelTable;
00994    SUMA_TABLE_FIELD *SetThrScaleTable; 
00995    Widget ColPlaneShow_tb; /*!< show/hide color plane */
00996    Widget ColPlaneShowOne_tb; /*!< show only one color plane at a time*/
00997    Widget SymIrange_tb; /*!< Symmetric intensity range */
00998    Widget AbsThresh_tb; /*!< absolute threshold */
00999    Widget ShowZero_tb; /*!< Show zero values */
01000    SUMA_LIST_WIDGET *SwitchDsetlst; /*!< a structure containing widgets and options for the switch color plane list */
01001    SUMA_TABLE_FIELD *ColPlaneLabelTable; 
01002    SUMA_OVERLAYS *curColPlane; /*!< a copy of the pointer to the selected color plane */
01003    SUMA_Boolean ShowCurOnly; /*!< Show current plane only out of the entire stack */
01004    void **curSOp; /*!< a copy of the pointer to the surface object for which the controller is open */
01005    SUMA_CMAP_RENDER_AREA *cmp_ren;   /* data for cmap rendering zone */
01006    Widget thr_sc;   /*! scale for threshold data */
01007    Widget brt_sc;   /*! scale for brightness data */
01008    Widget thr_lb;  /*! threshold title 
01009                         No longer used, 
01010                         using SetThrScaleTable instead */ 
01011    Widget thrstat_lb;  /*! pvalue associated with threshold */
01012    Widget cmaptit_lb;  /*! title of cmap */
01013    Widget cmapswtch_pb; /*! button for switching color map */
01014    Widget *SwitchIntMenu; /* vector of widgets controlling the switch intensity widgets */
01015    Widget *SwitchThrMenu; /* vector of widgets controlling the switch brightness widgets */
01016    Widget *SwitchBrtMenu; /* vector of widgets controlling the switch brightness widgets */
01017    Widget *SwitchCmapMenu; /* vector of widgets controlling the switch cmap widgets */
01018    Widget rc_CmapCont; /* rc container to contain Cmap menu */
01019    int N_CmapMenu; /* Number of widgets in SwitchCmapMenu */
01020    Widget CoordBiasMenu[SW_N_CoordBias]; /* vector of widgets controlling the switch coord bias widgets */
01021    Widget CmapModeMenu[SW_N_CmapMode];
01022    Widget opts_rc; /*!< rowcolumn containing color map, color bar and the switch buttons */
01023    Widget opts_form; /*!< rowcolumn containing all options for colormapping */
01024    Widget rcvo; /*!< vertical rowcol for colormapping options */
01025    Widget rcsw;   /*!<  rowcol for switching intensity, threshold and brightness */
01026    Widget rcsw_v1;   /*!< rowcol containing Menu for Int. Thr. and Brt. */
01027    Widget rcsw_v2;   /*!< rowcol containing toggle buttons for Int. Thr. and Brt. */
01028    Widget rcswr;   /*!< horizontal rowcol for Intensity column range label */
01029    Widget rccm;   /*!< rowcol containing colormap selectors and ranging options */
01030    Widget rccm_swcmap;
01031    Widget IntRange_lb; /*!< label widget containing range values */
01032    Widget Int_tb; /* Toggle buttons for intensity, threshold and brightness toys */
01033    Widget Thr_tb;
01034    Widget Brt_tb;
01035    Widget CmapLoad_pb;
01036    int IntRangeLocked;
01037    int BrtRangeLocked;
01038 }SUMA_X_SurfCont;
01039 
01040 typedef struct {
01041    int N_rb_group; /*!< number of radio buttons in group */
01042    int N_but; /*!< number of buttons per radio button group */
01043    Widget *tb; /*!< vector of N_rb_group * N_but toggle button widgets */
01044    Widget *rb; /*!< vetor of N_rb_group radio box widget */
01045    Widget arb; /*!< widget of radiobox for all lock buttons */
01046    Widget *atb; /*!< widget of toggle buttons in arb */
01047 }SUMA_rb_group;
01048 
01049 /*! structure containing widgets for Suma's controller SumaCont */
01050 typedef struct {
01051    Widget AppShell; /*!< AppShell widget for Suma's controller */
01052    Widget quit_pb; /*!< quit push button */
01053    SUMA_Boolean quit_first;   /*!< flag indicating first press of done button */
01054    SUMA_rb_group *Lock_rbg; /*!< pointer to structure contining N radio button groups */
01055    Widget *LockView_tbg;   /*!< vector of toggleview buttons */
01056    Widget LockAllView_tb;  /*!< widget of toggleAllview button */
01057    SUMA_CREATE_TEXT_SHELL_STRUCT *SumaInfo_TextShell;
01058 }SUMA_X_SumaCont;
01059 
01060 
01061 /*! structure containing widgets and data for the DrawROI window*/
01062 typedef struct {
01063    Widget AppShell; /*!< AppShell widget for the DrawROI window*/ 
01064    Widget DrawROImode_tb; /*!< widget for toggling draw ROI mode */
01065    Widget Penmode_tb;   /*!< widget for toggling draw with Pen mode */
01066    Widget AfniLink_tb; /*!< widget for toggling link to Afni */
01067    Widget ParentLabel_lb; /*!< widget for specifying a label for the parent surface */ 
01068    Widget Redo_pb;
01069    Widget Undo_pb;
01070    Widget Save_pb;
01071    Widget Load_pb;
01072    Widget Close_pb;
01073    Widget Finish_pb;
01074    Widget Join_pb;
01075    Widget Delete_pb;
01076    SUMA_Boolean Delete_first; /*! Flag indicating putton has been pressed for the first time */
01077    SUMA_ARROW_TEXT_FIELD *ROIval; /*!< pointer to arrow field */
01078    SUMA_ARROW_TEXT_FIELD *ROIlbl; /*!< pointer to text field */
01079    SUMA_DRAWN_ROI *curDrawnROI; /*!< A pointer to the DrawnROI structure currently in use by window.
01080                                     This is a copy of another pointer, NEVER FREE IT*/
01081    SUMA_LIST_WIDGET *SwitchROIlst; /*!< a structure containing widgets and options for the switch ROI list */
01082    int SaveWhat;  /*!< option for determining what ROI to save, acceptable values are in SUMA_WIDGET_INDEX_DRAWROI_SAVEWHAT */
01083    int SaveMode;  /*!< option for determining format of ROI to save, acceptable values are in SUMA_WIDGET_INDEX_DRAWROI_SAVEMODE */ 
01084    int WhatDist;  /*!< option for determining format of ROI to save, acceptable values are in SUMA_WIDGET_INDEX_DRAWROI_SAVEMODE */ 
01085    Widget SaveModeMenu[SW_N_DrawROI_SaveMode]; /*!< set of widgets for SaveMode menu */
01086    Widget SaveWhatMenu[SW_N_DrawROI_SaveWhat]; /*!< set of widgets for SaveWhat menu */
01087    Widget WhatDistMenu[SW_N_DrawROI_WhatDist]; /*!< set of widgets for SaveWhat menu */
01088 } SUMA_X_DrawROI;
01089 
01090                
01091                
01092 /*! structure containg X vars for surface viewers*/
01093 typedef struct {
01094    Display *DPY; /*!< display of toplevel widget */
01095    Widget TOPLEVEL, FORM, FRAME, GLXAREA;
01096    XVisualInfo *VISINFO;
01097    GLXContext GLXCONTEXT;
01098    Colormap CMAP;
01099    Bool DOUBLEBUFFER;
01100    char *Title; 
01101    int REDISPLAYPENDING;
01102    int WIDTH, HEIGHT;
01103    XtWorkProcId REDISPLAYID;
01104    XtIntervalId MOMENTUMID;
01105    GC gc;
01106    SUMA_X_ViewCont *ViewCont; /*!< pointer to structure containing viewer controller widget structure */
01107    Widget ToggleCrossHair_View_tglbtn; /*!< OBSOLETE Toggle button in View-> menu */
01108    Widget FileMenu[SW_N_File]; /*!< Vector of widgets under File Menu */       
01109    Widget ToolsMenu[SW_N_Tools]; /*!< Vector of widgets under File Menu */       
01110    Widget ViewMenu[SW_N_View]; /*!< Vector of widgets under View Menu */
01111    Widget HelpMenu[SW_N_Help]; /*!< Vector of widgets under Help Menu */
01112    SUMA_PROMPT_DIALOG_STRUCT *LookAt_prmpt; /*!< structure for the LookAt dialog */
01113    SUMA_PROMPT_DIALOG_STRUCT *JumpIndex_prmpt; /*!< structure for the Jump To Index dialog */
01114    SUMA_PROMPT_DIALOG_STRUCT *JumpXYZ_prmpt; /*!< structure for the Jump To XYZ dialog */
01115    SUMA_PROMPT_DIALOG_STRUCT *JumpFocusNode_prmpt; /*!< structure for setting the Focus Node dialog */
01116    SUMA_PROMPT_DIALOG_STRUCT *JumpFocusFace_prmpt; /*!< structure for setting the Focus FaceSet dialog */
01117    SUMA_PROMPT_DIALOG_STRUCT *HighlightBox_prmpt; /*!<  structure for highlighting nodes in Box dialog */ 
01118 }SUMA_X;
01119 
01120 /*! structure containg X vars common to all viewers */
01121 typedef struct {
01122    SUMA_X_SumaCont *SumaCont; /*!< structure containing widgets for Suma's controller */
01123    SUMA_X_DrawROI *DrawROI; /*!< structure containing widgets for DrawROI window */
01124    XtAppContext App; /*!< Application Context for SUMA */
01125    Display *DPY_controller1; /*!< Display of 1st controller's top level shell */
01126    SUMA_XRESOURCES X_Resources; /*!< flag specifying the types of resources to use */
01127    SUMA_CREATE_TEXT_SHELL_STRUCT *Help_TextShell; /*!< structure containing widgets and options of SUMA_help window */
01128    SUMA_CREATE_TEXT_SHELL_STRUCT *Help_Cmap_TextShell; /*!< structure containing widgets and options of colormap help window */
01129    SUMA_CREATE_TEXT_SHELL_STRUCT *Log_TextShell; /*!<  structure containing widgets and options of SUMA_log window */
01130    SUMA_SELECTION_DIALOG_STRUCT *FileSelectDlg; /*!< structure containing widgets and options of a generic file selection dialog */
01131    SUMA_PROMPT_DIALOG_STRUCT *N_ForeSmooth_prmpt; /*!< structure for the number of foreground smoothingLookAt dialog */
01132    int NumForeSmoothing;   /*!< Number of steps for smoothing the foreground colors 
01133                                  prior to mixing with background. Default is set
01134                                  by environment variable SUMA_NumForeSmoothing which 
01135                                  is set to 0 (No smoothing). */
01136    SUMA_Boolean WarnClose; /*!< Pops up a window to double check before SUMA quits */
01137    SUMA_LIST_WIDGET *SwitchCmapLst; /*!< list widget for switching colormaps */
01138 }SUMA_X_AllView;
01139 
01140 /*! structure defining a cross hair */
01141 typedef struct {   
01142    GLfloat XaxisColor[4] ;
01143    GLfloat YaxisColor[4] ;
01144    GLfloat ZaxisColor[4] ;
01145    
01146    GLfloat LineWidth;
01147    SUMA_STIPPLE Stipple; /*!< dashed or solid line */
01148 
01149    GLfloat c[3]; /*!< Cross Hair center */
01150    GLfloat r; /*!< Cross Hair radius */
01151    GLfloat g; /*!< 1/2 of gap between center and ray (should be less than radius/2) */
01152    
01153    SUMA_Boolean ShowSphere; /*!< YUP/NOPE, starting to regret this. */
01154    GLUquadricObj *sphobj; /*!< quadric object, representing central sphere */
01155    GLfloat sphcol[4]; /*!< Sphere color */
01156    GLdouble sphrad; /*!< Sphere radius */
01157    GLint slices; /*!< think pizza */
01158    GLint stacks; /*!< think lattitudes */
01159    
01160    int SurfaceID; /*!< If the cross hair is tied to a surface, SurfaceID contains the index into SUMAg_DOv of that surface. -1 if that cross hair is wild and loose */
01161    int NodeID; /*!< a node from SurfaceID can be associated with the cross hair (-1 for nothing) */
01162 }SUMA_CrossHair;   
01163 
01164 typedef struct {      
01165    GLUquadricObj *sphobj; /*!< quadric object, representing central sphere */
01166    GLfloat sphcol[4]; /*!< Sphere color */
01167    GLdouble sphrad; /*!< Sphere radius */
01168    GLint slices; /*!< think pizza */
01169    GLint stacks; /*!< think lattitudes */
01170    GLfloat c[3]; /*!< center of Sphere Marker */
01171 }SUMA_SphereMarker;   
01172 
01173 typedef struct {
01174    GLfloat n0[3]; /*!< Node 1 XYZ*/
01175    GLfloat n1[3]; /*!< Node 2 XYZ*/
01176    GLfloat n2[3]; /*!< Node 3 XYZ*/
01177    GLfloat LineWidth; /*!< LineWidth of Edge*/
01178    GLfloat LineCol[4]; /*!< LineColor of Edge*/
01179    GLfloat NormVect[3]; /*!< normal vector of faceset, two triangles are drawn at a small distance from the selected FaceSet */
01180 }SUMA_FaceSetMarker;
01181 
01182 /*!
01183    Structure containg a bunch of segments defined between n0 and n1
01184 */
01185 typedef struct {
01186    char *idcode_str;    /*!< unique idcode for DO */
01187    char *Label; /*!< ascii label for DO */ 
01188 
01189    GLfloat *n0; /*!< vector containing XYZ of nodes 1 (3*N_n elements long)*/
01190    GLfloat *n1; /*!< vector containing XYZ of nodes 2 (3*N_n elements long)*/
01191    int N_n; /*!< Number of elements in n0 and n1 */
01192    GLfloat LineWidth; /*!< LineWidth of all segment*/
01193    GLfloat LineCol[4]; /*!< LineColor of all segments*/
01194    SUMA_STIPPLE Stipple; /*!< dashed or solid line */
01195 }SUMA_SegmentDO;
01196 
01197 /*! Structure containing the communication info and status with AFNI */
01198 typedef struct {
01199    SUMA_Boolean Connected;   /*!< flag indicating connection state */
01200    int ConSock;
01201    
01202 } SUMA_AfniCom;
01203 
01204 /* structure defining the former state of a surface viewer window */
01205 typedef struct {
01206    int N_DO;      /*!< Total number of surface objects registered with the viewer */
01207    int *RegisteredDO;    /*!< ShowSO[i] (i=0..N_DO) contains Object indices into DOv for DOs visible in the surface viewer*/
01208    float ViewFrom[3]; /*!< Location of observer's eyes */
01209    float ViewFromOrig[3]; /*!< Original Location of observer's eyes */
01210    float ViewCenter[3];   /*!< Center of observer's gaze */
01211    float ViewCenterOrig[3];   /*!< Original Center of observer's gaze */
01212    float ViewCamUp[3];   /*!< Camera Up direction vector */
01213    float ViewDistance; /*!< Viewing distance */
01214    float FOV; /*!< Field of View (affects zoom level)*/
01215    float Aspect;   /*!< Aspect ratio of the viewer*/
01216 } SUMA_ViewState_Hist;
01217 
01218 
01219 /*! structure defining the viewing state of the viewer window */
01220 typedef struct {
01221    char *Name; /*!< The name of the viewing state, fiducial, inflated, etc .. */
01222    char *Group; /*!< The group to which the viewing state belongs. */
01223    int *MembSOs; /*!< Indices into DOv of SOs that are members of the viewing state */
01224    int N_MembSOs; /*!< Number of members in MembSOs. Only SOs that are in MembSOs can
01225                      be placed into RegisteredDO of the viewer in a particular viewing state.*/                  
01226    SUMA_ViewState_Hist *Hist; /*!< Pointer to structure containing various parameter settings for that viewing state */            
01227 } SUMA_ViewState;
01228 
01229 /*! structure containing the geometric settings for viewing the surface */
01230 typedef struct {
01231    float ViewFrom[3]; /*!< Location of observer's eyes */
01232    float ViewFromOrig[3]; /*!< Original Location of observer's eyes */
01233    float ViewCenter[3];   /*!< Center of observer's gaze */
01234    float ViewCenterOrig[3];   /*!< Original Center of observer's gaze */
01235    float ViewCamUp[3];   /*!< Camera Up direction vector */
01236    float ViewDistance; /*!< Viewing distance */
01237    
01238    float translateBeginX; /*!< User Input (mouse) X axis current position for translation */
01239    float translateBeginY; /*!< User Input (mouse) Y axis current position for translation */
01240    float translateDeltaX;   /*!< User Input (mouse) X axis position increment for translation */
01241    float translateDeltaY;   /*!< User Input (mouse) Y axis position increment for translation */
01242    float TranslateGain;   /*!< gain applied to mouse movement */
01243    float ArrowtranslateDeltaX;   /*!< User Input (Keyboard) X axis position increment for translation */
01244    float ArrowtranslateDeltaY;   /*!< User Input (Keyboard) X axis position increment for translation */
01245    GLfloat translateVec[2];      /*!< translation vector, in screen coordinates, equal to [translateDeltaX translateDeltaY]. The third translation (Z dimension) is 0.0*/
01246    GLfloat RotaCenter[3];   /*!<Center of Rotation */
01247    float zoomDelta;       /*!< Zoom increment */
01248    float zoomBegin;    /*!< Current zoom level*/
01249    float spinDeltaX;            /*!< User Input (mouse) X axis position increment for spinning*/
01250    float spinDeltaY;            /*!< User Input (mouse) Y axis position increment for spinning*/
01251    float spinBeginX;            /*!< User Input (mouse) X axis current position for spinning */
01252    float spinBeginY;            /*!< User Input (mouse) Y axis current position for spinning */
01253    int MinIdleDelta;       /*!< minimum spinDeltaX or spinDeltaY to initiate momentum rotation */
01254    float deltaQuat[4];   /*!< Quaternion increment */
01255    float currentQuat[4]; /*!< Current quaternion */
01256    Boolean ApplyMomentum;   /*!< Turn momentum ON/OFF */
01257 } SUMA_GEOMVIEW_STRUCT;
01258 
01259 /*! structure holding the pointer the node color assignment and a bit more */
01260 typedef struct {
01261    GLfloat *glar_ColorList; /*!< pointer to the 1D ColorList array */
01262    int N_glar_ColorList; /*!< Number of elements in glar_ColorList 4xNumber of nodes in the surface */
01263    char *idcode_str; /*!< string containing the idcode of the surface to which glar_ColorList belongs*/
01264    SUMA_Boolean Remix; /*!< flag indicating that colors need to be remixed */ 
01265 } SUMA_COLORLIST_STRUCT;
01266 
01267 typedef enum { SUMA_STD_ZERO_CENTERED, SUMA_SCALE_BOX } SUMA_AxisType;
01268 
01269 /*! structure defining an axis object */
01270 typedef struct {
01271    SUMA_AxisType type;
01272    GLfloat XaxisColor[4] ;
01273    GLfloat YaxisColor[4] ;
01274    GLfloat ZaxisColor[4] ;
01275    
01276    GLfloat LineWidth;
01277    SUMA_STIPPLE Stipple; /*!< dashed or solid line */
01278    
01279    GLfloat XYZspan[3]; /*!< the axis will span +/- span[i] in the three dimensions */
01280    GLfloat Center[3]; /*!< origin of axis */
01281    GLfloat BR[3][2]; /*!< Box Range values */
01282    double MTspace;   /*!< Major tick spacing */
01283    double MTsize;    /*!< Major tick size */
01284    double mTspace;   /*!< Minor tick spacing */
01285    double mTsize;    /*!< Minor tick size */
01286    int DoCross;      /*!< if 1 then ticks are centered on line. (total length is same as *Tsize value)*/
01287    char *Name; /*!< name of axis */
01288    char *idcode_str; /*! idcode of axis */
01289 }SUMA_Axis;
01290 
01291 typedef struct {
01292    int N;   /*!< Number of points in vectors x and y */
01293    int Nalloc; /*!< Number of elements allocated for in x and y */
01294    int *x;  /*!< vector containing x coordinates */
01295    int *y;  /*!< vector containing y coordinates */
01296    float *NPv; /*!< vector containing x y z triplets of near plane selection points */
01297    float *FPv; /*!< vector containing x y z triplets of far plane selection points */   
01298    int *SurfNodes; /*!< vector containing indices of nodes corresponding to the 
01299                         intersection between line [ NPv[j] FPv[j] ] and surface object */   
01300    int *SurfTri; /*!< vector containing indices of triangles corresponding to the 
01301                         intersection between line [ NPv[j] FPv[j] ] and surface object */
01302    int *ProjectionOf; /*!< if ProjectionOf[31] = 78; it means SurfNodes[31] 
01303                            is the intersection between line [ NPv[78] FPv[78] ] and the surface object. */
01304    int N_SurfNodes;  /*!< NUmber of SurfNodes in SurfNodes (always <= N) */
01305    
01306 } SUMA_OLD_BRUSH_STROKE; /*!< Structure containing the path of the mouse in the viewer window. 
01307                         See functions SUMA_CreateBrushStroke(), SUMA_AddToBrushStroke(), 
01308                         SUMA_ClearBrushStroke(), SUMA_ShowBrushStroke()*/
01309 
01310 
01311 typedef struct {
01312    float x; /*!< x screen coordinate. This is typically an integer value except in places of interpolation*/
01313    float y; /*!< y screen coordinate. This is typically an integer value except in places of interpolation*/
01314    
01315    float NP[3];   /*!< x y z triplet of near plane selection point */
01316    float FP[3];   /*!< x y z triplet of far plane selection point */
01317    
01318    int SurfNode;  /*!< index of node corresponding to the 
01319                         intersection between line [NP FP] and surface object.
01320                         initialized to -1 */
01321    int SurfTri;   /*!< index of triangle corresponding to the 
01322                         intersection between line [NP FP] and surface object.
01323                         initialized to -1 */  
01324    SUMA_Boolean Decimated; /*!< Flag to indicate if datum was obtained by a mouse trace (NOPE)
01325                                or through decimation (YUP)*/                      
01326 } SUMA_BRUSH_STROKE_DATUM; /*!< Data structure for the doubly linked version of brushstroke.  */
01327 
01328 typedef enum {  SUMA_NO_WAX, SUMA_THREE_WAX, SUMA_THREE_TEXT_WAX, SUMA_BOX_WAX, SUMA_BOX_TEXT_WAX, SUMA_N_WAX_OPTIONS } SUMA_WORLD_AXIS_TOGGLE_METHODS;
01329 /*! structure defining the state of a viewer window */
01330 typedef struct {
01331    int N_DO;      /*!< Total number of surface objects registered with the viewer */
01332    int *RegisteredDO;    /*!< RegisteredDO[i] (i=0..N_DO) contains Object indices into DOv for DOs visible in the surface viewer*/
01333    
01334    SUMA_Boolean Record; /*!< Set record mode */
01335    SUMA_Boolean ShowLeft; /*!< Show left side surfaces */
01336    SUMA_Boolean ShowRight; /*!< Show right side surfaces */
01337    
01338    SUMA_COLORLIST_STRUCT *ColList; /*!< pointer to structures containing NodeColorLists for surfaces listed in RegisteredDO */
01339    int N_ColList; /*!< Number of structures in ColList */
01340    
01341    SUMA_STANDARD_VIEWS StdView; /*!< viewing mode, for 2D or 3D */
01342    SUMA_GEOMVIEW_STRUCT *GVS; /*! pointer to structures containing geometric viewing settings */
01343    int N_GVS; /*!< Number of different geometric viewing structures */
01344    
01345    short verbose;   /*!< Verbosity of viewer */
01346 
01347    SUMA_X *X; /*!< structure containing X widget midgets */
01348 
01349    int ortho; /*!< Orthographic (1) or perspective (0, default) projection */
01350    float Aspect;   /*!< Aspect ratio of the viewer*/
01351    int WindWidth;   /*!< Width of window */
01352    int WindHeight;   /*!< Height of window */
01353    float ZoomCompensate; /*!< Compensate mouse movements by zoom factor */
01354    float *FOV; /*!< Field of View (affects zoom level, there is a separate FOV for each ViewState)*/
01355    float ArrowRotationAngle; /*!< Angle to rotate surface by when arrows are used.
01356                                  Units are in radians */
01357    SUMA_Boolean BF_Cull; /*!< flag for backface culling */
01358    SUMA_RENDER_MODES PolyMode; /*!< polygon viewing mode, SRM_Fill, SRM_Line, SRM_Points
01359                                     There is a similar field for each surface object to 
01360                                     allow independent control for each surface. If the rendering mode
01361                                     is specified for a certain surface, it takes precedence over the
01362                                     one specified here*/
01363 
01364    float Back_Modfact; /*!< Factor to apply when modulating foreground color with background intensity
01365                            background does not modulate foreground, 
01366                            Color = Fore * avg_Bright * AttenFactor; (w/ 0 <= avg_Bright <=1)
01367                            a good setting is such that SUMA_BACKGROUND_ATTENUATION_FACTOR * SUMA_DIM_AFNI_COLOR_FACTOR = 1
01368                             Watch for saturation effects!  */
01369 
01370    GLfloat light0_position[4]; /*!< Light 0 position: 1st 3 vals --> direction of light . Last value is 0 -->  directional light*/
01371    GLfloat light1_position[4]; /*!< Light 1 position: 1st 3 vals --> direction of light. Last value is 0 -->  directional light*/
01372    
01373    GLfloat clear_color[4]; /*!< viewer background color */
01374       
01375    SUMA_Boolean Open; /*! Viewer visible to the human eye */
01376    int ShowEyeAxis ; /*!< ShowEyeAxis */
01377    int ShowMeshAxis; /*!< ShowMeshAxis (attached to each surface)*/
01378    int ShowWorldAxis; /*!< ShowWorldAxis */
01379    SUMA_Axis *WorldAxis;   /*!< pointer to world coordinate axis  */
01380    int ShowCrossHair; /*!< ShowCrossHair */
01381    SUMA_Boolean ShowForeground;    /*!< Flag for showing/not showing foreground colors */
01382    SUMA_Boolean ShowBackground; /*!< Flag for showing/not showing background colors */   
01383    SUMA_Boolean UsePatchDims; /*!< Flag for using patch based dimensions (rather than entire nodelist) */
01384    
01385    int Focus_SO_ID; /*!< index into SUMAg_DOv of the surface currently in focus, -1 for nothing*/
01386    int Focus_DO_ID; /*!< index into SUMAg_DOv of the Displayabl Object currently in focus -1 for nothing*/
01387    
01388    GLdouble Pick0[3];   /*!< Click location in World coordinates, at z = 0 (near clip plane)*/
01389    GLdouble Pick1[3];   /*!< Click location in World coordinates, at z = 1.0 (far clip plane)*/
01390    GLdouble Pcenter_close[3];  /*!< Center of screen in World coordinates , at z = 0 (near clip plane)*/
01391    GLdouble Pcenter_far[3];    /*!< Center of screen in World coordinates , at z = 1 (near far plane)*/
01392    GLdouble Plist_close[3];    /*!< lists of points on screen in world coordinates  at z = 0 
01393                                     it holds N/3 points where N is the array length
01394                                     At the moment, all I need is one point, the lower left
01395                                     Should more be needed, I will add them to the list and
01396                                     document them here.*/
01397    SUMA_CrossHair *Ch; /*!< Pointer to Cross Hair structure */
01398    SUMA_Axis *WAx;  /*!< Pointer to world axis */   
01399    
01400    SUMA_ViewState *VSv; /*!< Vector of Viewing State Structures */
01401    int N_VSv; /*!< Number of Viewing State structures */
01402    char *State; /*!< The current state of the viewer. This variable should no be freed since it points to locations within VSv*/
01403    int iState; /*!< index into VSv corresponding to State */
01404    int LastNonMapStateID; /*!< Index into the state in VSv from which a toggle to the mappable state was initiated */ 
01405    
01406    SUMA_Boolean isShaded; /*!< YUP if the window is minimized or shaded, NOPE if you can see its contents */
01407 
01408    SUMA_Boolean LinkAfniCrossHair; /*!< YUP if the cross hair location is to be sent (and accepted from AFNI, when the stream is open) */
01409    SUMA_Boolean ResetGLStateVariables; /*!< YUP if you need to run the function that resets the Eye Axis before display. 
01410                                           see functions SUMA_display and SUMA_OpenGLStateReset for more info */
01411    SUMA_Boolean NewGeom;   /*!< YUP if viewer has new geometry in it and needs to have its default viewing settings updated */                                  
01412    DList *BS; /*!< The new version of BrushStroke, in doubly linked list form */
01413    
01414    char *CurGroupName; /*!< current name of group */
01415    int iCurGroup; /*!< index into GroupList (stored in SUMAg_CF) of current group of Surface Viewer */
01416    SUMA_REDISPLAY_CAUSE rdc;  /*!< Why has a redisplay been requested */
01417 }SUMA_SurfaceViewer;
01418 
01419 /*! structure defining an EngineData structure */
01420 typedef struct {
01421    SUMA_ENGINE_CODE CommandCode; /*!< Code of command to be executed by SUMA_Engine function, 
01422                                     this is the same as the _Dest fields for each variable type.
01423                                     However, the _Dest fields are left as a way to make sure that
01424                                     the user has correctly initialized EngineData for a certain command.*/
01425    
01426    void *Srcp; /*!< Pointer to data structure of the calling source, typically, a typecast version of SUMA_SurfaceViewer * */
01427    SUMA_ENGINE_SOURCE Src; /*!< Source of command. This replaces the _Source fields in the older version of the structure */
01428    
01429    float fv3[3]; /*!< Float vector, 3 values */
01430    SUMA_ENGINE_CODE fv3_Dest; /*!<  float3 vector destination */
01431    SUMA_ENGINE_SOURCE fv3_Source; /*!< OBSOLETE float3 vector source */
01432    
01433    int iv3[3];      /*!< Integer vector, 3 values */
01434    SUMA_ENGINE_CODE iv3_Dest;  /*!<  Integer3 vector destination */
01435    SUMA_ENGINE_SOURCE iv3_Source;  /*!<OBSOLETE  Integer3 vector source */
01436    
01437    float fv15[15]; /*!< Float vector, 15 values */
01438    SUMA_ENGINE_CODE fv15_Dest; /*!<  float15 vector destination */
01439    SUMA_ENGINE_SOURCE fv15_Source; /*!< OBSOLETE float15 vector source */
01440    
01441    float fv200[200]; /*!< Float vector, 200 values */
01442    SUMA_ENGINE_CODE fv200_Dest; /*!<  float200 vector destination */
01443    SUMA_ENGINE_SOURCE fv200_Source; /*!< OBSOLETE float15 vector source */
01444   
01445    int iv15[15];/*!< Integer vector, 15 values */
01446    SUMA_ENGINE_CODE iv15_Dest;/*!<  Integer15 vector destination */
01447    SUMA_ENGINE_SOURCE iv15_Source; /*!< OBSOLETE Integer15 vector source */
01448 
01449    int iv200[200];/*!< Integer vector, 200 values */
01450    SUMA_ENGINE_CODE iv200_Dest;/*!<  Integer200 vector destination */
01451    SUMA_ENGINE_SOURCE iv200_Source; /*!< OBSOLETE Integer200 vector source */
01452    
01453    int i;      /*!< integer */
01454    SUMA_ENGINE_CODE i_Dest;   /*!<  integer destination */
01455    SUMA_ENGINE_SOURCE i_Source; /*!< OBSOLETE integer source */
01456    
01457    float f; /*!< float, ingenious ain't it! */
01458    SUMA_ENGINE_CODE f_Dest; /*!<  float destination */
01459    SUMA_ENGINE_SOURCE f_Source; /*!< OBSOLETE float source */
01460    
01461    char s[SUMA_MAX_STRING_LENGTH]; /*!< string */
01462    SUMA_ENGINE_CODE s_Dest; /*!<  string destination */
01463    SUMA_ENGINE_SOURCE s_Source; /*!< OBSOLETE string source */
01464    
01465    int *ip; /*!< integer pointer */
01466    SUMA_ENGINE_CODE ip_Dest; /*!<  integer pointer destination */
01467    
01468    float *fp; /*!< float pointer */
01469    SUMA_ENGINE_CODE fp_Dest; /*!< float pointer destination */
01470    
01471    char *cp; /*!< char pointer */
01472    SUMA_ENGINE_CODE cp_Dest; /*!< character pointer destination */
01473    
01474    float **fm; /*!< float matrix pointer */
01475    SUMA_Boolean fm_LocalAlloc; /*!< Locally allocated matrix pointer ? (if it is then it is freed in SUMA_ReleaseEngineData ) */
01476    SUMA_ENGINE_CODE fm_Dest; /*!<  destination of fm */
01477    SUMA_ENGINE_SOURCE fm_Source; /*!< OBSOLETE source of fm*/
01478    
01479    int **im; /*!< Same dance as fm but for integers */
01480    SUMA_Boolean im_LocalAlloc;
01481    SUMA_ENGINE_CODE im_Dest; /*!<  destination of im */
01482    SUMA_ENGINE_SOURCE im_Source; /*!< OBSOLETE source of im */
01483 
01484    SUMA_IVEC *ivec; /*!< Same dance as fm but for integers */
01485    SUMA_Boolean ivec_LocalAlloc;
01486    SUMA_ENGINE_CODE ivec_Dest; /*!<  destination of im */
01487    SUMA_ENGINE_SOURCE ivec_Source; /*!< OBSOLETE source of im */
01488 
01489    SUMA_FVEC *fvec; /*!< Same dance as fm but for integers */
01490    SUMA_Boolean fvec_LocalAlloc;
01491    SUMA_ENGINE_CODE fvec_Dest; /*!<  destination of im */
01492    SUMA_ENGINE_SOURCE fvec_Source; /*!< OBSOLETE source of im */
01493    
01494    void *vp; /*!< pointer to void */
01495    SUMA_ENGINE_CODE vp_Dest; /*!<  destination of fm */
01496    SUMA_ENGINE_SOURCE vp_Source; /*!< OBSOLETE source of fm*/
01497    
01498    int N_rows; /*!< Number of rows in fm or im */
01499    int N_cols; /*!< Number of colums in fm or im */
01500    
01501 } SUMA_EngineData;
01502 
01503 
01504 
01505 /*! structure that contains the output of SurfNorm function */
01506 #define SUMA_SurfNorm_struct
01507 typedef struct {
01508    int N_Node; /*!< Number of nodes, 1st dim of NodeNormList*/
01509    int N_Face;/*!< Number of facesets, 1st dim of FaceNormList*/
01510    float *FaceNormList ; /*!< N_Face x 3 vector (was matrix prior to SUMA 1.2) containing normalized normal vectors for each triangular faceset*/ 
01511    float *NodeNormList ; /*!< N_Node x 3 vector (was matrix prior to SUMA 1.2) containing normalized normal vectors for each node*/
01512 } SUMA_SURF_NORM; /*!< structure that contains the output of SurfNorm function */
01513 
01514 /*! structure that contains the output of SUMA_MemberFaceSets function */
01515 #define SUMA_MemberFaceSets_struct
01516 typedef struct {
01517    int LinkedPtrType; /*!< Indicates the type of linked pointer */
01518    int N_links;   /*!< Number of links to this pointer */
01519    char owner_id[SUMA_IDCODE_LENGTH];   /*!< The id of whoever created that pointer. Might never get used.... */
01520 
01521    char *idcode_str;
01522    int N_Memb_max;/*!< Maximum number of Facesets any node belonged to*/
01523    int Nnode; /*! Total number of nodes examined (0..Nnode-1) */
01524    int **NodeMemberOfFaceSet ; /*!< Nnode x N_Memb_max matrix containing for each row i, the indices of the facesets containing node i*/ 
01525    int *N_Memb ; /*!< Nnode x 1 vetor containing for each node i, the number of facesets that contain it*/
01526 } SUMA_MEMBER_FACE_SETS; /*!< structure that contains the output of SurfNorm function */
01527 
01528 
01529 /*! structure containing results of intersection of a ray with triangles */
01530 typedef struct {
01531    int N_el; /*!< Number of elements in each vector */
01532    SUMA_Boolean *isHit;   /*!< Is the triangle hit ? */
01533    float *t;   /*!< SIGNED Distance from ray source to triangle */
01534    float *u;   /*!< location of intersection in triangle in Barycentric coordinates, V0P = u V0V1 + vV0V2*/
01535    float *v;   /*!< location of intersection in triangle */
01536    int ifacemin; /*!< index of the faceset closest (NOT SIGNED, abs(t)) to the ray's origin */
01537    int ifacemax; /*!< index of the faceset farthest (NOT SIGNED, abs(t)) from the ray's origin */
01538    int N_hits; /*!< Number of intersections between ray and surface */
01539    int N_poshits; /*!< Number of intersections such that t is positive */
01540    float P[3]; /*!< XYZ of intersection with ifacemin */
01541    float d; /*!< Distance from the closest node in ifacemin to P */
01542    int inodemin; /*!< node index (into NodeList)that is closest to P  */
01543    int inodeminlocal; /*!< node in FaceSet[ifacemin] that is closest to P , 
01544                   inodemin = FaceSet[ifacemin][inodeminlocal]*/
01545 } SUMA_MT_INTERSECT_TRIANGLE;
01546 
01547 /*! Structure defining the surface's volume parent info */
01548 typedef struct {
01549    char *idcode_str; /*!< the id of the vol par element */
01550    int isanat; /*!< 1 if parent volume is of type anat */
01551    int nx, ny, nz; /*!< number of voxels in the three dimensions */
01552    float dx, dy, dz; /*!< delta x, y, z in mm */
01553    float xorg, yorg, zorg; /*!< voxel origin in three dimensions */
01554    char *prefix; /*!< parent volume prefix */
01555    char *filecode; /*!< parent volume prefix + view */
01556    char *dirname; /*!< parent volume directory name */
01557    char *vol_idcode_str; /*!< idcode string OF parent volume*/
01558    char *vol_idcode_date; /*!< idcode date */
01559    int xxorient, yyorient, zzorient; /*!< orientation of three dimensions*/ 
01560    float *VOLREG_CENTER_OLD; /*!< pointer to the named attribute (3x1) in the .HEAD file of the experiment-aligned Parent Volume */
01561    float *VOLREG_CENTER_BASE; /*!< pointer to the named attribute (3x1) in the .HEAD file of the experiment-aligned Parent Volume */
01562    float *VOLREG_MATVEC; /*!< pointer to the named attribute (12x1) in the .HEAD file of the experiment-aligned Parent Volume */
01563    float *TAGALIGN_MATVEC; /*!< pointer to the named attribute (12x1) in the .HEAD file of the tag aligned Parent Volume */
01564    float *ROTATE_MATVEC; /*!< pointer to the named attribute (12x1) in the .HEAD file of the tag aligned Parent Volume */
01565    float *ROTATE_CENTER_OLD; 
01566    float *ROTATE_CENTER_BASE; 
01567    int Hand; /*!< Handedness of axis 1 RH, -1 LH*/
01568 } SUMA_VOLPAR;
01569 
01570 typedef struct {
01571    SUMA_OVERLAYS *Overlay; /*!< pointer to color overlay structures */
01572 } SUMA_OVERLAY_LIST_DATUM;   /*!< a structure used to create linked lists of SO->Overlays and co */ 
01573 
01574 
01575 
01576 /*! structure defining a Surface Object */
01577 typedef struct {
01578    SUMA_SO_File_Type FileType; /*!< Type of Surface file */
01579    SUMA_SO_File_Format FileFormat; /*!< Format of Surface file ascii or binary*/
01580    SUMA_FileName Name; /*!< Directory and Name of surface object file (SO) */
01581    SUMA_FileName Name_coord; /*!< Directory and Name of surface coordinate file (for SureFit files) */
01582    SUMA_FileName Name_topo; /*!< Directory and Name of surface topology file  (for SureFit files)*/
01583    SUMA_FileName SpecFile; /*!< To be added for use in AFNI's mapping interface */
01584    
01585    char *idcode_str; /*!< string containing the idcode of the surface */
01586    char *parent_vol_idcode_str; /*!< IDcode of the volume from which the surface was created. Called SurfVol (NOT SurfVol_AlndExp) 
01587                                     That ID does not usually refer to the volume from which VolPar is created. Except in the case 
01588                                     where you are viewing the surfaces on the orignal volume (SurfVol) then this field and
01589                                     SurfVol (afni dset *) ->idcode.str and VolPar->vol_idcode_str should be identical*/
01590    char *facesetlist_idcode_str;   /*!< ID of facesets element */
01591    char *nodelist_idcode_str; /*!< ID of nodelist element */
01592    char *facenormals_idcode_str; /*!< ID of facenormals element */
01593    char *nodenormals_idcode_str; /*!< ID of nodenormals element */
01594    char *polyarea_idcode_str; /*!< ID of polygon areas element */
01595    char *Label; /*!< string containing a label for the surface. Used for window titles and saved image names */
01596    char *Name_NodeParent; /*!< Node parent of the SO.   Node Indices of SO are into NodeList matrix of the NodeParent SO*/               
01597    char *Group_idcode_str;  /*!< IDcode of group */
01598    char *StandardSpace;   /*!< standard space of surface (orig, tlrc, stdxxx, etc.*/
01599    char *Group;   /*!< Group the surface belongs to, like Simpsons H. (aka. SubjectLabel)*/
01600    char *State; /*!< State of SO (like inflated, bloated, exploded) */
01601    char *ModelName; /*!< cerebellum, hippocampus, cerebrum, etc. */
01602    /* modifications to the lame MappingRef field */
01603    SUMA_SO_SIDE Side; /*!< Left/right */
01604    SUMA_Boolean AnatCorrect;    /*!< Does surface geometry matches anatomy ? (YUP/NOPE)*/
01605    char *DomainGrandParentID;        /*!< Grandparent's mesh ID (icosahedron's for std-meshes) */
01606    char *OriginatorID;          /*!<  ID common for surfaces from one subject that are created
01607                                       at one point in time. Surfaces of the same subject,
01608                                       created at different points in time (like in a longitudinal
01609                                       study) will have differing OriginatorID fields (aka InstanceID)*/
01610    char *OriginatorLabel;        /*!< aka InstanceLabel */
01611    char *LocalCurvatureParent;   /*!< \sa same field in SUMA_SurfSpecFile structure */
01612    char *LocalCurvatureParentID;        /*!< \sa idcode_str of LocalCurvatureParent*/
01613    char *LocalDomainParent;   /*!< \sa same field in SUMA_SurfSpecFile structure */
01614    char *LocalDomainParentID;      /*!< \sa idcode_str of LocalDomainParent */
01615    #if 0
01616    /* in the old days */
01617    char *MapRef_idcode_str; /*!< if NULL, then it is not known whether surface is mappable or not
01618                                  if equal to idcode_str then surface surface is Mappable, 
01619                                  otherwise it specifies the idcode of the Mapping reference surface */
01620    #endif
01621    SUMA_Boolean SUMA_VolPar_Aligned; /*!< Surface aligned to Parent Volume data sets ?*/
01622    SUMA_Boolean VOLREG_APPLIED; /*!< YUP if VP->VOLREG_CENTER_BASE, VP->VOLREG_CENTER_OLD, VP->VOLREG_MATVEC were successfully applied*/
01623    SUMA_Boolean TAGALIGN_APPLIED; /*!< YUP if VP->TAGALIGN_MATVEC was successfully applied */
01624    SUMA_Boolean ROTATE_APPLIED; /*!< YUP if VP->ROTATE_MATVEC was successfully applied */
01625    SUMA_Boolean SentToAfni; /*!< YUP if the surface has been niml-sent to AFNI */
01626    SUMA_Boolean Show; /*!< YUP then the surface is visible in the viewer. Not used that much I'd say*/
01627    
01628    SUMA_RENDER_MODES PolyMode; /*!< polygon viewing mode, SRM_Fill, SRM_Line, SRM_Points */
01629    
01630    int N_Node; /*!< Number of nodes in the SO */
01631    int NodeDim; /*!< Dimension of Node coordinates 3 for 3D only 3 is used for now, with flat surfaces having z = 0*/
01632    int EmbedDim; /*!< Embedding dimension of the surface, 2 for flat surfaces 3 for ones with non zero curvature other. */ 
01633    float *NodeList; /*!< N_Node x 3 vector containing the XYZ node coordinates. 
01634                         If NodeDim is 2 then the third column is all zeros
01635                         Prior to SUMA  1.2 this used to be a 2D matrix (a vector of vectors) */
01636    
01637    int N_FaceSet; /*!< Number of polygons defining the surface  */
01638    int FaceSetDim; /*!< Number of sides on the polygon */
01639    int *FaceSetList; /*!< N_FaceSetList x FaceSetDim vector describing the polygon set that makes up the SO.
01640                      Each row contains the indices (into NodeList) of the nodes that make up a polygon 
01641                      Prior to SUMA  1.2 this used to be a 2D matrix (a vector of vectors) */
01642    
01643    float *NodeNormList ; /*!< N_Node x 3 vector (used to be matrix prior to SUMA 1.2) containing normalized normal vectors for each node*/
01644    float *FaceNormList ; /*!< N_FaceSet x 3 vector (used to be matrix prior to SUMA 1.2) containing normalized normal vectors for each polygon*/ 
01645    
01646    float Center[3];       /*!< The centroid of the surface (using all the nodes in NodeList)*/
01647    float MaxDims[3];      /*!< The maximum along each of the XYZ dimensions */
01648    float MinDims[3];      /*!< The minimum along each of the XYZ dimensions */
01649    float aMinDims;      /*!< The maximum across all dimensions*/
01650    float aMaxDims;      /*!< The minimum across all dimensions*/
01651    
01652    int N_patchNode; /*!< Number of nodes used in the mesh. For patches, this number is < SO->N_Node */
01653    float patchCenter[3];  /*!< The centroid of the surface (using all the nodes in FaceSetList)*/
01654    float patchMaxDims[3];      /*!< The maximum along each of the XYZ dimensions (using all the nodes in FaceSetList)*/
01655    float patchMinDims[3];      /*!< The minimum along each of the XYZ dimensions (using all the nodes in FaceSetList)*/
01656    float patchaMinDims;      /*!< The maximum across all dimensions(using all the nodes in FaceSetList)*/
01657    float patchaMaxDims;      /*!< The minimum across all dimensions(using all the nodes in FaceSetList)*/
01658    
01659    int RotationWeight; /*!< Contribution to center of rotation calculation. 
01660                            set to 0 if not contributing.
01661                             set to N_Node to have the number of nodes weigh into the center's location, center of mass effect
01662                            set to 1 to give each object equal weight */
01663    int ViewCenterWeight; /*!< Contribution to center of gaze and viewfrom location */
01664    
01665 
01666    GLfloat *glar_NodeList;         /*!< pointer to the 1D NodeList array - DO NOT FREE IT, it is a pointer copy of NodeList*/
01667    GLint  *glar_FaceSetList;      /*!< pointer to the 1D FaceSetList array - DO NOT FREE IT, it is a pointer copy of FaceSetList*/
01668    GLfloat *glar_FaceNormList;    /*!< pointer to the 1D FaceNormList array - DO NOT FREE IT, it is a pointer copy of NodeNormList*/
01669    #if 0
01670    /* This pointer is now a part of the surface viewer structure. Wed Nov  6 10:23:05 EST 2002
01671    Node color assignment is not a property of the surface alone, it also depends on the settings of the viewer. */
01672    GLfloat *glar_ColorList;       /*!< pointer to the 1D ColorList array*/
01673    #endif
01674    GLfloat *PermCol; /*!< pointer to a 1D ColorList array. If this vector is not null then it specifies the colors
01675                            of the nodes on the surface. It is illegal to have this if Overlays != NULL */ 
01676    GLfloat *glar_NodeNormList;    /*!< pointer to the 1D NodeNormList array - DO NOT FREE IT, it is a pointer copy of NodeNormList*/
01677    
01678    int ShowMeshAxis; /*!< flag to show Mesh Axis if it is created */
01679    SUMA_Axis *MeshAxis;   /*!< pointer to XYZ axis  */
01680    
01681    SUMA_MEMBER_FACE_SETS *MF; /*!< structure containing the facesets containing each node */
01682    SUMA_NODE_FIRST_NEIGHB *FN; /*!< structure containing the first order neighbors of each node */
01683    SUMA_EDGE_LIST *EL; /*!< structure containing the edge list */
01684    float *PolyArea; /*!< N_FaceSet x 1 vector containing the area of each polygon in FaceSetList */
01685    SUMA_SURFACE_CURVATURE *SC; /*!< Structure containing the surface curvature info */
01686    
01687    
01688    /* selection stuff */
01689    SUMA_Boolean ShowSelectedNode; /*!< flag for an obvious reason */
01690    int SelectedNode; /*!< index of one selected node, -1 if no node is selected */
01691    SUMA_SphereMarker *NodeMarker; /*!< Node Marker object structure*/
01692    
01693    SUMA_Boolean ShowSelectedFaceSet; /*!< you know what I mean */
01694    int SelectedFaceSet; /*!< index of one selected faceset, -1 if no faceset is selected */
01695    SUMA_FaceSetMarker *FaceSetMarker; /*!< Aha, I hear ya */
01696    
01697    SUMA_VOLPAR *VolPar; /*!< Parent Volume structure */
01698    
01699    SUMA_OVERLAYS **Overlays; /*!< vector of pointers to color overlay structures */
01700    int N_Overlays; /*!< number of pointers to overlay structures */
01701    
01702    SUMA_X_SurfCont *SurfCont;/*!< pointer to structure containing surface controller widget structure */
01703    
01704 }SUMA_SurfaceObject; /*!< \sa Alloc_SurfObject_Struct in SUMA_DOmanip.c
01705                      \sa SUMA_Free_Surface_Object in SUMA_Load_Surface_Object.c
01706                      \sa SUMA_Print_Surface_Object in SUMA_Load_Surface_Object.c
01707                      \sa SUMA_Load_Surface_Object in SUMA_Load_Surface_Object.c
01708                */  
01709                    
01710 /*! Structure containing a color map */
01711 typedef struct {
01712    float ** M; /*!< N_Col x 3 matrix of R G B values (0..1) */
01713    char **cname; /*!< N_Col pointers to strings containing name of 
01714                        each color. This can be NULL when no names are 
01715                        assigned*/
01716    int N_Col; /*!< number of colors in the color map */
01717    float *frac; /*!< N_col x 1 vector containing the fraction of scale 
01718                      assigned to each color, these are
01719                      the values shown on the right of the colorbar in 
01720                      AFNI.
01721                      This field is NULL if the map is linear*/
01722    int Sgn; /*!         +1  colormap is positive ranging (a la afni)  
01723                          0  field is not set
01724                          -1 colormap is negative ranging (a la afni)*/
01725    char *Name; /*!< Name of colormap */
01726    
01727    SUMA_SurfaceObject *SO;    /*!< Surface object used to represent map */
01728 } SUMA_COLOR_MAP;
01729 
01730 /*! structure containing a mapping of one surface to another*/
01731 typedef struct {
01732    float *NewNodeList; /*!< N_Node x 3 vector containing new mapping of node coordinates */
01733    int N_Node; /*!< Number of nodes in NodeList */
01734    float *NodeVal; 
01735    float *NodeCol;
01736    float *NodeDisp;
01737 } SUMA_SO_map;
01738 
01739 /*! structure containing SureFit Surface*/
01740 typedef struct {
01741    /* coord files */
01742    char name_coord[SUMA_MAX_NAME_LENGTH];
01743    int N_Node; /*!< Number of nodes */
01744    float *NodeList; /*!< N_Node x 3 vector containing node coordinates */
01745    int *NodeId; /*!< Node ID, that's normaly from 0..N_Nodes-1 but since it's in .coord file, I keep it anyway */
01746    char encoding_coord[100];
01747    char configuration_id[100];
01748    char coordframe_id[100];
01749    /* Topo files */
01750    char name_topo[SUMA_MAX_NAME_LENGTH];
01751    char encoding_topo[100];
01752    char date[100];
01753    char perimeter_id[100];
01754    int N_Node_Specs; /*!< Number of nodes with listed node specs */
01755    int **Specs_mat; /*!< Node Specs matrix. Columns appear to be arraged as such NodeId #Neighbors ? ? NodeId ? */
01756    SUMA_NODE_FIRST_NEIGHB FN; /*!< First order neighbor structure */
01757    int N_FaceSet; /*!< Number of polygons making up surface */
01758    int *FaceSetList; /*!< definition of polygons. Became a vector in SUMA 1.2*/
01759    /* Param Files */
01760    char name_param[SUMA_MAX_NAME_LENGTH];
01761    float AC_WholeVolume[3]; /*!< XYZ (from .Orient.params file) of Anterior Comissure of whole volume */
01762    float AC[3]; /*!< XYZ of Anterior Comissure of cropped volume */
01763 } SUMA_SureFit_struct;
01764 
01765 /* structure containing FreeSurfer Surface */
01766 typedef struct {
01767    char name[SUMA_MAX_NAME_LENGTH];
01768    int N_Node; /*!< Number of nodes */
01769    int *NodeId; /*!< Node ID, that's normaly from 0..N_Nodes-1 unless the surface is a patch of another surface see FaceSetIndexInParent*/
01770    float *NodeList; /*!< N_Node x 3 vector containing node coordinates */
01771    int N_FaceSet; /*!< Number of polygons making up surface */
01772    int *FaceSetList; /*!< definition of polygons. For a complete surface, these are indices into NodeList's rows
01773                            For a patch, these are indices into NodeList of the parent surface.
01774                         Became a vector in SUMA 1.2*/
01775    char comment[SUMA_MAX_STRING_LENGTH]; /*!< comment at beginning of patch or surface */
01776    SUMA_Boolean isPatch; /*!< is the surface a patch of another ? */
01777    int *FaceSetIndexInParent; /*!< for a FaceSet in patch, this represents its index in FaceSetList of the parent surface.
01778                                     This is the FaceSet equivalent of NodeId*/ 
01779 } SUMA_FreeSurfer_struct;
01780 
01781 /* structure containing SureFit name*/
01782 typedef struct {
01783    char name_coord[SUMA_MAX_DIR_LENGTH+SUMA_MAX_NAME_LENGTH];
01784    char name_topo[SUMA_MAX_DIR_LENGTH+SUMA_MAX_NAME_LENGTH]; 
01785    char name_param[SUMA_MAX_DIR_LENGTH+SUMA_MAX_NAME_LENGTH];
01786 } SUMA_SFname;
01787 
01788 typedef enum {    SMT_Nothing, 
01789                   SMT_Notice, SMT_Warning, SMT_Error, SMT_Critical, SMT_Text, 
01790                   SMT_N }  SUMA_MESSAGE_TYPES; /*!< different types of messages */
01791 
01792 typedef enum {    SMA_Nothing, 
01793                   SMA_Log, SMA_LogAndPopup,  
01794                   SMA_N }  SUMA_MESSAGE_ACTION; /*!< different actions to perform with messages */
01795 
01796  
01797                                  
01798 /*! structure containing a SUMA Message structure */
01799 typedef struct {
01800    SUMA_MESSAGE_TYPES Type;   /*!< type of message */
01801    SUMA_MESSAGE_ACTION  Action; /*!< what to do with message*/
01802    char *Message; /*!< null terminated message string */
01803    char *Source;  /*!< source of message, usually calling function */
01804 }  SUMA_MessageData;
01805 
01806 
01807 /* *** Niml defines */
01808 
01809 #define SUMA_TCP_PORT 53211      /*!< AFNI listens to SUMA on this port */
01810 #define SUMA_TCP_LISTEN_PORT0 53220 /*!< SUMA's 1st listening port */
01811 #define SUMA_FLAG_WAITING    1   /*!< Waiting for connection flag */
01812 #define SUMA_FLAG_CONNECTED  2   /*!< Connected flag */
01813 #define SUMA_FLAG_SKIP       4   /*!< Skip flag */
01814 
01815 typedef enum { SUMA_AFNI_STREAM_INDEX = 0, /*!< Index of SUMA<-->AFNI stream , afni listen line 1*/ 
01816                SUMA_AFNI_STREAM_INDEX2 ,  /*!< Index of SUMA<-->AFNI 2nd stream, afni listen line 2 */  
01817                SUMA_GENERIC_LISTEN_LINE, /*!< Using socket  SUMA_TCP_LISTEN_PORT0, generic suma listen line*/
01818                SUMA_GEOMCOMP_LINE, /*!<  Using socket  SUMA_TCP_LISTEN_PORT0 + 1*/
01819                SUMA_BRAINWRAP_LINE, /*!<  Using socket SUMA_TCP_LISTEN_PORT0 + 2*/
01820                SUMA_MAX_STREAMS /*!< Maximum number of streams, KEEP AT END */
01821             } SUMA_STREAM_INDICES;
01822             
01823 #if 0
01824    #define SUMA_AFNI_STREAM_INDEX 0  /*!< Index of SUMA<-->AFNI stream */ 
01825    #define SUMA_AFNI_STREAM_INDEX2 1  /*!< Index of SUMA<-->AFNI stream */       
01826    #define SUMA_GEOMCOMP_LINE 2 /*!<  Using socket SUMA_TCP_PORT + SUMA_GEOMCOMP_LINE 
01827                                  Make sure SUMA_GEOMCOMP_LINE < SUMA_MAX_STREAMS*/
01828    #define SUMA_BRAINWRAP_LINE 3 /*!<  Using socket SUMA_TCP_PORT + SUMA_BRAINWRAP_LINE 
01829                                  Make sure SUMA_BRAINWRAP_LINE < SUMA_MAX_STREAMS*/
01830    #define SUMA_MAX_STREAMS       5  /*!< Maximum number of streams, >= SUMA_INITIATED_STREAMS */
01831 #endif
01832 /* *** Niml defines end */
01833 
01834               
01835 /*! structure containing a surface patch */
01836 typedef struct {
01837    int N_FaceSet; /*!< Number of Facesets forming patch */
01838    int *FaceSetList; /*!< vector (was a matrix prior to SUMA 1.2) (N_FaceSet x 3) containing indices of nodes forming triangles making up the patch */
01839    int *FaceSetIndex; /*!< vector (N_FaceSet x 1) containing indices of triangles in FaceSetList in the FaceSetList of the surface that the patch was taken from */
01840    int *nHits; /*!< (N_FaceSet x 1) If patch is created from a set of nodes,
01841                   nHits[i] is the number of nodes refering to this Faceset */
01842 } SUMA_PATCH; /*!< A surface patch, typically created from a set of nodes */
01843 
01844 /*! structure containing ClientData 
01845 This remains to be used somewhere ... */
01846 typedef struct {
01847    SUMA_SurfaceViewer *sv; /*!< pointer to surface viewer from which the callback was made */
01848    int svi; /*!< index of sv into SUMAg_SVv */
01849 }SUMA_CLIENT_DATA;
01850 
01851 /*! Maximum nuber of branches that can be found in the intersection 
01852    of a plane with the surface model */
01853 #define SUMA_BRANCHMAX 500   
01854 
01855 /*! Maximum nuber of nodes that can form one branch */
01856 #define SUMA_NODEINLISTMAX 500
01857 
01858 /*!
01859 \brief Structure forming a branch 
01860 
01861 A branch is a protruded part of a tree often resulting in chainsaw accidents.
01862 It is used in determining the intersection of a plane with a surface
01863 */
01864 typedef struct {
01865    int begin, start;   /*!< first node of the branch */
01866    int last;   /*!< last node of the branch */
01867    int closed; /*!< flag. 0--> open, 1--> closed */
01868    int list[SUMA_NODEINLISTMAX]; /*!< list of nodes per branch */
01869    int listsz; /*!< Number of nodes in list*/
01870 } SUMA_BRANCH;
01871 
01872 /*!
01873 \brief Structure forming a triangle branch 
01874 
01875 A Tiangle branch represents a strip of connected triangles.
01876 
01877 */
01878 typedef struct {
01879    int begin, start;   /*!< first node of the branch */
01880    int last;   /*!< last node of the branch */
01881    int iBranch; /*!< index identifying branch */
01882    SUMA_Boolean closed; /*!< flag. 0--> open, 1--> closed */
01883    int * list; /*!< list of nodes per branch */
01884    int N_list; /*!< Number of nodes in list*/
01885 } SUMA_TRI_BRANCH;
01886 
01887 /*!
01888 \brief Structure defining the intersection of a surface with a plane 
01889 */
01890 typedef struct {
01891    int N_IntersEdges; /*!< Number of edges intersected by the plane */
01892    int *IntersEdges;  /*!< Vector containing indices of edges intersected by the plane. The indices
01893                         are into SO->EL->EL matrix. The space allocate for this vector is SO->EL->N_EL
01894                         But that is way more than ususally needed. For this vector and others in
01895                         this structure, reallocation is not done to save time. Useful values for IntersEdges
01896                         are between IntersEdges[0]  and IntersEdges[N_IntersEdges-1]*/
01897    SUMA_Boolean *isEdgeInters; /*!< Vector specifying if an edge i (index into SO->EL->EL) was intersected. */
01898    #if 0
01899    /* old way, less memory usage, slower access - pre Wed Dec  4 16:57:03 EST 2002*/
01900    float *IntersNodes;  /*!< Vector containing XYZ coordinates of the intersection point on each 
01901                            intersected segment. Allocated space is for 3*SO->EL->N_EL, useful space is 
01902                            between IntersNodes[0] and IntersNodes[3*(N_IntersEdges-1) + 2]. Intersection point 
01903                            of edge IntersEdges[k] has  X = IntersNodes[3*k], Y = IntersNodes[3*k+1] and
01904                            Z = IntersNodes[3*k+2] */
01905    #endif
01906    float *IntersNodes;  /*!< Vector containing XYZ coordinates of the intersection point on each 
01907                            intersected segment. Allocated space is for 3*SO->EL->N_EL, meaningful values are
01908                            for intersected segments only. Intersection point 
01909                            of edge SO->EL->EL[k][:] has  X = IntersNodes[3*k], Y = IntersNodes[3*k+1] and
01910                            Z = IntersNodes[3*k+2] */
01911    int *IntersTri; /*!< Vector containing indices of triangles intersected by the plane (i.e. containing
01912                         and edge that was intersected. Allocation is done for SO->N_FaceSet. 
01913                         But meaningful values are between IntersETri[0] and IntersTri[N_IntersTri-1]. */
01914    int N_IntersTri; /*!< Number of intersected triangles. */
01915    SUMA_Boolean *isNodeInMesh;   /*!< Vector of SO->N_Node elements indicating whether a certain node
01916                                     belongs to an intersected seqment or not */
01917    int N_NodesInMesh;  /*!< Total number of nodes belonging to intersected segments */
01918    
01919    SUMA_Boolean *isTriHit; /*!< Vector of SO->N_FaceSet elements indicating whether a triangle was intersected by the plane.
01920                      if isTriHit[j] then triangle SO->FaceSetList[3*j], [3*j+1], [3*j+2] was intersected. You should
01921                      have a total of N_IntersTri YUP values in this vector*/
01922                         
01923 } SUMA_SURF_PLANE_INTERSECT;
01924 
01925 
01926 
01927 
01928 /*! Structure to contain the path between one node and the next. The path is defined in terms of the previous one, plus an edge from
01929 the previous to the current */
01930 typedef struct {
01931    int node; /*!< Index of current node*/ 
01932    float le;   /*!< Length of edge between current node and previous one. 0 for starting node. */ 
01933    int order; /*!< Path order to node. A path order of i means i segments are needed to reach node from the starting node. 0 for starting node*/
01934    void *Previous; /*!< pointer to path leading up to the previous node. NULL for starting node. This pointer is to be typecast to SUMA_DIJKSTRA_PATH_CHAIN **/
01935 } SUMA_DIJKSTRA_PATH_CHAIN;
01936 
01937 /*!
01938    Structure for passing info to function SUMA_SaveSOascii
01939 */
01940 typedef struct {
01941    SUMA_SurfaceObject *SO;
01942    SUMA_SurfaceViewer *sv;
01943 } SUMA_SAVESO_STRUCT;
01944 
01945 /*!
01946    Structure containing a named color 
01947 */
01948 typedef struct {
01949    float r;
01950    float g;
01951    float b;
01952    float a;
01953    char Name[SUMA_MAX_COLOR_NAME];
01954 } SUMA_RGB_NAME;
01955 
01956 /*!
01957    Structure containing the colormaps used by AFNI 
01958 */
01959 typedef struct {
01960    SUMA_COLOR_MAP **CMv;   /* a vector of pointers to colormap structures */
01961    int N_maps;             /* the number of colormaps in CMv */
01962    SUMA_RGB_NAME *Cv;      /* a vector of RGB_Name structures containing the named colors used by AFNI */
01963    int N_cols;             /* the number of defined colors in Cv */
01964 } SUMA_AFNI_COLORS;
01965 
01966 typedef struct {              
01967    int N_Neighb;           /*!< Number of neighbors for a particular node */
01968    int *Neighb_ind;        /*!< N_Neighb x 1 vector containing  nodes neighboring node i */
01969    float *Neighb_dist;     /*!< N_Neighb x 1 vector containing node distances from node i. 
01970                                These are the shortes distances ON THE GRAPH. */
01971 } SUMA_OFFSET_STRUCT;      /*!< The structure returned by SUMA_FormNeighbOffset */
01972 
01973 typedef struct {
01974    int *NodesInLayer;      /*!< Vector containing nodes that are neighbors to node n 
01975                                (Vector contains N_NodesInLayer useful values but has N_AllocNodesInLayer allocated spots)
01976                                Those neighbors can be of any order (see below and structure SUMA_GET_OFFSET_STRUCT) */
01977    int N_NodesInLayer;     /*!< Number of nodes in this layer */
01978    int N_AllocNodesInLayer;   /*!< Number of nodes allocated for in this layer. Allocation is done in chunks of 200 at a time */
01979 } SUMA_NODE_NEIGHB_LAYER;  /*!< Structure containing the layers neighboring a node n.
01980                                 The 0th order layer contain n only
01981                                 The 1st order layer contains the first order neighbors of n
01982                                 etc.. */
01983 
01984 typedef struct {
01985    int N_layers;           /*!< Number of node neighborhoods of a certain node n 
01986                                 The 0th order layer contain n only
01987                                 The 1st order layer contains the first order neighbors of n
01988                                 etc.. */
01989    SUMA_NODE_NEIGHB_LAYER *layers;  /*!<  layers[0] is the zeroth order layer
01990                                           layers[1] is the 1st order layer, etc.
01991                                           See  SUMA_NODE_NEIGHB_LAYER */
01992    
01993    int N_Nodes;            /*!< Number of nodes in mesh */
01994    int *LayerVect;         /*!< vector containing the neighborhood layer of a certain node from node n
01995                                  LayerVect[5] = 2; means node 5 is a 2nd order neighbor to node n
01996                                  LayerVect[5] = -1; means node 5 is not within the limit distance from node n
01997                                  All values in LayerVect are initialized to -1 */
01998    float *OffVect;         /*!< vector containing the distance of nodes in the mesh from node n
01999                                  d = OffVect[5]; is the geodesic distance of node 5 from node n
02000                                  OffVect is N_Nodes long. 
02001                                  OffVect[k] is meaningless if LayerVect[k] < 0 */
02002 } SUMA_GET_OFFSET_STRUCT;  /*!< Structure containing nodes that are within a certain geodesic distance (lim) from 
02003                                 a certain node. */
02004 
02005 typedef struct {
02006    int talk_suma;
02007    int comm_NI_mode;
02008    float rps;
02009    float nelps;  /*!<   number of NI elements to send per second 
02010                         -1 for going as fast as possible */
02011    int TrackID;            /*!<  ID of next element to be sent 
02012                                  NI_element StartTracking has an ID of 1 */
02013    SUMA_Boolean GoneBad;   /*!< Flag indicating that stream went bad */
02014    SUMA_Boolean Send;      /*!< Flag indicating that elements should be sent 
02015                                 As long as GoneBad is NOPE */
02016    SUMA_Boolean afni_GoneBad;
02017    SUMA_Boolean afni_Send;
02018    int istream; /*!< index of the stream used in SUMAg_CF->ns_v */
02019    int afni_istream; /*!< index of stream used to connect to afni */
02020    char *suma_host_name;
02021    char *afni_host_name; 
02022    int ElInd[SUMA_N_DSET_TYPES]; /* index of elements of a certain type to be sent to SUMA */
02023    int kth;    /* send kth element to SUMA */
02024    int Feed2Afni;
02025 } SUMA_COMM_STRUCT;
02026 
02027 typedef enum {
02028    SUMA_DOMAINS_ERROR = -1,
02029    SUMA_DOMAINS_NOT_RELATED = 0,  /*!< Surfaces are not related 
02030                                        Above that flag, surfaces are related*/
02031    SUMA_SO1_is_SO2,           /*!< Surface1 is the same as Surface2 */
02032    SUMA_SO1_is_LDPSO2,        /*!< SO1 is the local domain parent of SO2 */
02033    SUMA_SO2_is_LDPSO1,        /*!< SO2 is the local domain parent of SO1 */
02034    SUMA_LDPSO1_is_LDPSO2,     /*!< SO1 and SO2 have the same local domain parent */
02035    SUMA_NUCELAR_FAMILY,       /*!< A flag to indicate limit of immediate kinship
02036                                   (Don't blame me, official syntax in use) 
02037                                   Above that flag, kinship is distant */
02038    SUMA_SO1_is_GPSO2,         /*!< SO1 is the granddaddy of SO2 */
02039    SUMA_SO2_is_GPSO1,         /*!< SO2 is the granddaddy of SO1 */
02040    SUMA_GPSO1_is_GPSO2,     /*!< SO1 and SO2 have the same  granddaddy*/
02041 } SUMA_DOMAIN_KINSHIPS; /*!< The type of relationships between surfaces, modify 
02042                               function SUMA_DomainKinships_String; */
02043 /*! structure containing information global to all surface viewers */
02044 typedef struct {
02045    SUMA_Boolean Dev; /*!< Flag for developer option (allows the use of confusing or kludge options) */
02046    SUMA_Boolean InOut_Notify; /*!< prints to STDERR a notice when a function is entered or exited */ 
02047    int InOut_Level; /*!< level of nested function calls */
02048    
02049    int N_OpenSV; /*!< Number of open (visible) surface viewers.
02050                      Do not confuse this with the number of surface viewers
02051                      created (SUMAg_N_SVv)*/
02052    
02053    SUMA_MEMTRACE_STRUCT *Mem; /*!< structure used to keep track of memory usage */
02054    SUMA_Boolean MemTrace; /*!< Flag for keeping track of memory usage (must also set SUMA_MEMTRACE_FLAG ) */
02055 
02056    char HostName_v[SUMA_MAX_STREAMS][SUMA_MAX_NAME_LENGTH];   /*!<  name or ipaddress of hosts maximum allowed name is 20
02057                                                                       chars less than allocated for, see SUMA_Assign_AfniHostName
02058                                                                       *** Dec. 19 03: This field used to be called AfniHostName
02059                                                                       It is now a vector of hostnmes allowing for multiple
02060                                                                       connections. 
02061                                                                       AfniHostName = HostName_v[SUMA_AFNI_STREAM_INDEX]*/ 
02062    char NimlStream_v[SUMA_MAX_STREAMS][SUMA_MAX_NAME_LENGTH]; /*!< niml stream name for communicating with other programs 
02063                                                                  *** Dec. 19 03: This field used to be called AfniNimlStream
02064                                                                  AfniNimlStream = NimlStream_v[SUMA_AFNI_STREAM_INDEX]*/
02065    NI_stream ns_v[SUMA_MAX_STREAMS]; /*!< 
02066                      *** Pre: Dec 19 03:
02067                      Stream used to communicate with AFNI. 
02068                      It is null when no communication stream is open. 
02069                      The stream can be open with Connected set to NOPE.
02070                      In that case no communication between the two programs
02071                      but resuming communication is easy since surfaces need
02072                      not be sent to AFNI again as would be the case if the stream 
02073                      was completely closed 
02074                      *** Dec. 19 03
02075                      Used to be called ns for connecting to AFNI.
02076                      ns = ns_v[SUMA_AFNI_STREAM_INDEX]*/
02077    int ns_flags_v[SUMA_MAX_STREAMS];
02078    int TCP_port[SUMA_MAX_STREAMS];
02079    
02080    SUMA_Boolean Connected_v[SUMA_MAX_STREAMS]; /*!< YUP/NOPE, if SUMA is sending (or accepting) communication from AFNI 
02081                                                    *** Dec. 19 03
02082                                                    Vectorized Connected like fields above*/
02083    int TrackingId_v[SUMA_MAX_STREAMS]; /*!<  for keeping track of serial number of incoming nels 
02084                                              0 if not keeping track. So start numbering at 1*/
02085    
02086    SUMA_Boolean Listening; /*!< SUMA is listening for connections */
02087    SUMA_Boolean niml_work_on; /*!< Flag indicating that niml workprocess is ON */
02088    SUMA_LINK_TYPES Locked[SUMA_MAX_SURF_VIEWERS]; /*!< All viewers i such that Locked[i] != SUMA_No_Lock have their cross hair locked together */   
02089    SUMA_Boolean ViewLocked[SUMA_MAX_SURF_VIEWERS]; /*!< All viewers i such that ViewLocked[i] = YUP have their view point locked together */    
02090    SUMA_Boolean SwapButtons_1_3; /*!< YUP/NOPE, if functions of mouse buttons 1 and 3 are swapped */
02091    SUMA_X_AllView *X; /*!< structure containing widgets and other X related variables that are common to all viewers */ 
02092    DList *MessageList; /*!< a doubly linked list with data elements containing notices, warnings and error messages*/
02093    SUMA_Boolean ROI_mode; /*!< Flag specifying that SUMA is in ROI drawing mode */
02094    SUMA_Boolean Pen_mode;  /*!< Flag specifying that a pen is being used for drawing */
02095    SUMA_COLOR_MAP *ROI_CM; /*!< Color map used to map an ROI's index to a color */
02096    SUMA_ROI_FILL_MODES ROI_FillMode; /*!< flag indicating how to fill a closed contour */
02097    SUMA_COL_MIX_MODE ColMixMode; /*!< controls the way colors from multiple planes are mixed together */
02098    SUMA_Boolean ROI2afni; /*!< Send ROIs to afni as you draw them*/
02099    int nimlROI_Datum_type; /*!< the code for nimlROI_Datum_type */
02100 
02101    char **GroupList; /*!< Names of surface groups */
02102    int N_Group;   /*!< number of groups  available */
02103 
02104    SUMA_AFNI_COLORS *scm;  /*!< a structure containing all the colormaps available to SUMA */
02105    DList *DsetList;  /*!< List containing datasets */
02106    
02107    int SUMA_ThrScalePowerBias; 
02108    SUMA_Boolean IgnoreVolreg; /*!< if YUP then ignore any Volreg or TagAlign transform in the header of the surface volume */
02109    SUMA_Boolean isGraphical; /*!< if YUP then Named afni colors will get resolved when creating color maps. 
02110                                   Otherwise they are set to gray. Only suma and ScaleToMap will need to set 
02111                                   this variable to YUP, for the moment June 3 05 */
02112                                     
02113 } SUMA_CommonFields;
02114 
02115 typedef enum { SUMA_NO_SORT, SUMA_BY_PLANE_DISTANCE, SUMA_BY_SEGMENT_DISTANCE, SUMA_SORT_BY_LLC_DISTANCE, SUMA_SORT_BY_LL_QUAD } SUMA_SORT_BOX_AXIS_OPTION;
02116 typedef enum { SUMA_LOWER_LEFT_SCREEN, SUMA_UPPER_LEFT_SCREEN, SUMA_UPPER_RIGHT_SCREEN, SUMA_LOWER_RIGHT_SCREEN } SUMA_SCREEN_CORNERS;
02117 typedef struct {
02118    double world_length;
02119    double screen_length_x;
02120    double screen_length_y;
02121    double P1[3];
02122    double P2[3];
02123    int SegIndex;
02124    int PointIndex[2];
02125    int FaceIndex[2];
02126    int Quad[2];
02127    double tick1_dir[3];
02128    double tick2_dir[3];
02129    double MidFaceDist;
02130    double MidSegDist;
02131    int AxisDim;
02132    int LLCclosestPoint;
02133    double LLCclosestDist;
02134    double TxOff[3];
02135 }  SUMA_AxisSegmentInfo;
02136 
02137 
02138 
02139   
02140 typedef struct {
02141    char *master;
02142    char *mask;
02143    char *prefix;
02144    char *prefix_path;
02145    char *orcode;
02146    int do_ijk;
02147    int dimen_ii;
02148    int dimen_jj;
02149    int dimen_kk;
02150    int datum;
02151    float dval;
02152    float fval;
02153    byte *mmask;
02154    int full_list;
02155    THD_3dim_dataset *mset;
02156 }  SUMA_FORM_AFNI_DSET_STRUCT;
02157  
02158 #endif
 

Powered by Plone

This site conforms to the following standards: