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  

surface_domain.h

Go to the documentation of this file.
00001 #ifndef _SURFACE_DOMAIN_HEADER_
00002 #define _SURFACE_DOMAIN_HEADER_
00003 
00004 #define AFNI_SURFACE_DOMAIN_TYPE 53001
00005 
00006 /*---------------------------------------------------------------*/
00007 /* Struct to hold a surface domain: node, triangles, etc. */
00008 
00009 typedef struct {
00010    int  type ;             /*!< Integer code indicating type of struct.
00011                                 Should always be AFNI_SURFACE_DOMAIN_TYPE. */
00012 
00013    char idcode[32];        /*!< String containing the idcode of the surface. */
00014    char idcode_volpar[32]; /*!< String containing the idcode of the dataset
00015                                 to which this surface is attachable. */
00016 
00017    char label[32];         /*!< String containing a label for the surface.
00018                                 Used for window titles and saved image names.
00019                                 May be NULL. */
00020 
00021    int N_Node;             /*!< Number of nodes in the surface object */
00022 
00023    int *NodeId;            /*!< N_Node x 1 vector containing the nodes'
00024                                 indices or IDs.
00025                               * If not NULL, then the [ X Y Z ] coordinates for
00026                                 a node with ID n are:
00027                          [ NodeList[3*k]  NodeList[3*k+1]  NodeList[3*k+2] ],
00028                                 where k is such that NodeId[k] = n.
00029                               * If NULL, then we assume that NodeId[k] = k.
00030                                 This means that the [ X Y Z ] coordinates for
00031                                 node n are:
00032                          [ NodeList[3*n]  NodeList[3*n+1]  NodeList[3*n+2] ]. */
00033 
00034    int NodeId_sorted ;     /*! Flag indicating if the NodeID array has been
00035                                sorted into increasing order.  If it is sorted,
00036                                then NodeList will have been sorted similarly. */
00037 
00038    float *NodeList;        /*!< (3*N_Node) x 1 vector containing the
00039                                 XYZ node coordinates. */
00040 
00041    int N_FaceSet;          /*!< Number of triangles defining the surface  */
00042 
00043    int *FaceSetList;       /*!< (3*N_FaceSetList) x 1 vector specifying the
00044                                 triangles constituting the surface mesh.
00045                                 The triplet
00046                       [ FaceSetList[3*k] FaceSetList[3*k+1] FaceSetList[3*k+2] ]
00047                                 indicates the node indices forming the kth
00048                                 triangle in the mesh. */
00049 
00050    float *NodeNormList ; /*!< (3*N_Node) x 1 vector containing
00051                               unit normal vectors for each node in
00052                               NodeList.  May be NULL. */
00053 
00054    float *FaceNormList ; /*!< (3*N_FaceSet) x 1 vector containing
00055                               unit normal vectors for each triangle
00056                               in FaceSetList.  May be NULL. */
00057 
00058 } AFNI_Surface_Domain ;  /* aka SUDOM */
00059 
00060 /*-----------------------------------------------------------------*/
00061 /*! Macro to test if a pointer to an AFNI_Surface_Domain is valid. */
00062 
00063 #define ISVALID_SUDOM(p)                                   \
00064   ( (p) != NULL && (p)->type == AFNI_SURFACE_DOMAIN_TYPE )
00065 
00066 /*----------------------------------------------*/
00067 /*! Macro to return 'k' such that NodeId[k] = n */
00068 
00069 #define SUDOM_NODE_ID(sd,n)                                       \
00070   ( ((sd)->NodeId == NULL) ? (n) : SUDOM_find_node_id((sd),(n)) )
00071 
00072 /*------------------------------------------------------------------*/
00073 /* Prototypes for utility functions on AFNI_Surface_Domain structs. */
00074 
00075 extern int SUDOM_find_node_id( AFNI_Surface_Domain *sd , int n ) ;
00076 
00077 extern void SUDOM_sort_node_id( AFNI_Surface_Domain *sd ) ;
00078 
00079 #endif /* _SURFACE_DOMAIN_HEADER_ */
 

Powered by Plone

This site conforms to the following standards: