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  

vol2surf.h

Go to the documentation of this file.
00001 #ifndef _VOL2SURF_H_
00002 #define _VOL2SURF_H_
00003 
00004 #define V2S_MAX_SURFS             2
00005 
00006 #define V2S_INDEX_VOXEL           0
00007 #define V2S_INDEX_NODE            1
00008 
00009 #define V2S_STEPS_TOOOOO_BIG      10000
00010 
00011 #define V2S_NORM_DEFAULT          0
00012 #define V2S_NORM_KEEP             1
00013 #define V2S_NORM_REVERSE          2
00014 
00015 #define V2S_EPSILON               0.0001
00016 
00017 #define V2S_SKIP_NONE             0
00018 #define V2S_SKIP_NODES            1
00019 #define V2S_SKIP_VOLIND           2
00020 #define V2S_SKIP_I                4
00021 #define V2S_SKIP_J                8
00022 #define V2S_SKIP_K               16
00023 #define V2S_SKIP_NVALS           32
00024 #define V2S_SKIP_VALS            64     /* never skip first result value */
00025 #define V2S_SKIP_ALL            127
00026 
00027 #define CHECK_NULL_STR(str)  ( str ? str : "<NULL>" )
00028 #define CHECK_EMPTY_STR(str) ( str[0] ? str : "<empty>" )
00029 
00030 /* surface to voxel mapping codes, along with command-line strings */
00031 typedef enum
00032 {
00033     E_SMAP_INVALID = 0,                 /* do not change INVALID (from 0) */
00034     E_SMAP_MASK,    E_SMAP_MIDPT,
00035     E_SMAP_MASK2,
00036     E_SMAP_AVE,     E_SMAP_COUNT,
00037     E_SMAP_MIN,     E_SMAP_MAX,
00038     E_SMAP_MAX_ABS, E_SMAP_SEG_VALS,
00039     /* sorted ones: */
00040     E_SMAP_MEDIAN,  E_SMAP_MODE,
00041     E_SMAP_FINAL                        /* leave FINAL at the end */
00042 } v2s_map_nums;
00043 
00044 typedef struct
00045 {
00046     int   show;
00047     int   index;
00048     float value;
00049 } v2s_oob_t;
00050 
00051 typedef struct
00052 {
00053     int      nalloc;
00054     int      nused;
00055     int      max_vals;
00056     int      memory;
00057     int    * nodes;
00058     int    * volind;
00059     int    * i;
00060     int    * j;
00061     int    * k;
00062     int    * nvals;
00063     float ** vals;
00064 } v2s_results;
00065 
00066 typedef struct
00067 {
00068     int         map;                    /* type of mapping from surfs    */
00069     int         gp_index;               /* grid parent sub-brick (or -1) */
00070     int         debug;                  /* for printing extra output     */
00071     int         dnode;                  /* node watched for debug        */
00072     int         no_head;                /* do not write output headers   */
00073     int         skip_cols;              /* which output columns to skip  */
00074     int         first_node;             /* skip nodes before this index  */
00075     int         last_node;              /* skip nodes after this index   */
00076     int         use_norms;              /* use normals for segments      */
00077     float       norm_len;               /* signed length of normal       */
00078     int         norm_dir;               /* default, keep or reverse      */
00079     int         f_index;                /* node or voxel index type      */
00080     int         f_steps;                /* # int steps for mask2 map     */
00081     float       f_p1_fr;                /* fractional dist: add to p1    */
00082     float       f_pn_fr;                /* fractional dist: add to pn    */
00083     float       f_p1_mm;                /* mm distance to add to p1      */
00084     float       f_pn_mm;                /* mm distance to add to pn      */
00085     char      * outfile_1D;             /* filename for ascii output     */
00086     char      * outfile_niml;           /* filename for NIML output      */
00087     v2s_oob_t   oob;                    /* display info for oob nodes    */
00088     v2s_oob_t   oom;                    /* display info for oom nodes    */
00089 } v2s_opts_t;
00090 
00091 typedef struct
00092 {
00093     int        ready, use0, use1;
00094     int        s0A, s0B;
00095     int        s1A, s1B;
00096     v2s_opts_t sopt;
00097 } v2s_plugin_opts;
00098 
00099 /* computational parameters */
00100 typedef struct
00101 {
00102     THD_3dim_dataset * gpar;            /* input dataset               */
00103     byte             * cmask;           /* computed mask               */
00104     int                nvox;            /* gpar nxyz                   */
00105     int                over_steps;      /* vals computed over steps    */
00106     int                nsurf;           /* number of surfaces to apply */
00107     SUMA_surface       surf[V2S_MAX_SURFS]; /* surface structure info  */
00108 } v2s_param_t;
00109 
00110 /* ---- export function prototypes ---- */
00111 
00112 v2s_results * afni_vol2surf     ( THD_3dim_dataset * gpar, int gp_index,
00113                                   SUMA_surface * sA, SUMA_surface * sB,
00114                                   byte * mask, int use_defaults );
00115 v2s_results * vol2surf          ( v2s_opts_t * sopt, v2s_param_t * p );
00116 
00117 int disp_mri_imarr      ( char * info, MRI_IMARR * dp );
00118 int disp_v2s_opts_t     ( char * info, v2s_opts_t * sopt );
00119 int disp_v2s_param_t    ( char * info, v2s_param_t * p );
00120 int disp_v2s_plugin_opts( char * mesg, v2s_plugin_opts * d );
00121 int disp_v2s_results    ( char * mesg, v2s_results * d );
00122 int free_v2s_results    ( v2s_results * sd );
00123 int v2s_is_good_map     ( int map, int from_afni );
00124 int v2s_map_type        ( char * map_str );
00125 int v2s_vals_over_steps ( int map );
00126 int v2s_write_outfile_1D( v2s_opts_t * sopt, v2s_results * sd, char * label );
00127 int v2s_write_outfile_niml( v2s_opts_t * sopt, v2s_results * sd, int free_vals);
00128 
00129 
00130 /* special thd function - might be moved from vol2surf.[ch] */
00131 int thd_mask_from_brick(THD_3dim_dataset * dset, int volume, float thresh,
00132                         byte ** mask, int absolute);
00133 
00134 /* ---- define globals for everyone but vol2surf.c ---- */
00135 #ifndef _VOL2SURF_C_
00136     extern v2s_plugin_opts   gv2s_plug_opts;
00137     extern char            * gv2s_map_names[];
00138     extern char              gv2s_history[];
00139 #endif
00140 
00141 
00142 #endif   /* _VOL2SURF_H_ */
 

Powered by Plone

This site conforms to the following standards: