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  

file_tool.h

Go to the documentation of this file.
00001 
00002 #define MAX_STR_LEN     1024
00003 
00004 #define MOD_INVALID       -1
00005 #define MOD_STR            0
00006 #define MOD_CHAR           1            /* char mods */
00007 #define MOD_U1            21            /* int mods  */
00008 #define MOD_S1            22
00009 #define MOD_U2            23
00010 #define MOD_S2            24
00011 #define MOD_U4            25
00012 #define MOD_S4            26
00013 #define MOD_F4            30            /* real mods */
00014 #define MOD_F8            31
00015 
00016 #define USE_SHORT          0
00017 #define USE_LONG           1
00018 #define USE_VERSION        2
00019 #define USE_GE             3
00020 #define USE_HISTORY        4
00021 
00022 /* GE diplay bit values */
00023 #define GE_NONE            0
00024 #define GE_ALL          0xff
00025 #define GE_HEADER       0x01
00026 #define GE_EXTRAS       0x02
00027 #define GE_UV17         0x10
00028 #define GE_OFF          0x20
00029 
00030 #define NDISP_NONE         0
00031 #define NDISP_INT2      0x01
00032 #define NDISP_INT4      0x02
00033 #define NDISP_REAL4     0x04
00034 #define NDISP_ALL       0xff
00035 
00036 #define CHECK_NULL_STR(str) ( str ? str : "(nil)" )
00037 
00038                                   /* from Ifile.c ...                  */
00039 typedef struct                    /* stuff extracted from GE 5.x image */
00040 {
00041   int   good;                     /* is this a good image?             */
00042   int   nx, ny;                   /* image matrix                      */
00043   int   uv17;                     /* apparently codes for scan index   */
00044   float dx,dy,dz, zoff, tr,te;    /* various dimensions                */
00045   char  orients[8];               /* orientation string                */
00046 } ge_header_info;
00047 
00048 typedef struct                    /* extra stuff from mri_read.c       */
00049 {
00050   int   bpp;                      /* bits per pixel                    */
00051   int   cflag;                    /* compression flag (0=compressed)   */
00052   int   hdroff;                   /* offset of image header            */
00053   int   skip;                     /* offset of image data into file    */
00054   int   swap;                     /* did we do byte swapping?          */
00055   float xyz[9];
00056 } ge_extras;
00057 
00058 typedef struct
00059 {
00060     int     num_files;        /* number of files to work with       */
00061     char ** flist;           /* list of files to work with         */
00062     int     debug;          /* debug level = 0, 1 or 2            */
00063     int     data_len;      /* bytes of data in mod_data          */
00064     int     ge_disp;      /* do we display ge_values            */
00065     int     ge4_disp;    /* option bits for GEMS 4.x type      */
00066     int     ndisp;      /* option bits for numeric display    */
00067 
00068     int     swap;             /* do we need to swap bytes   */
00069     int     modify;          /* do we modify the data?     */
00070     int     mod_type;       /* a string or repeated value */
00071     long    offset;        /* starting location          */
00072     int     length;       /* bytes to display or modify */
00073     int     quiet;       /* do not display header info */
00074     char  * mod_data;   /* new data                   */
00075 } param_t;
00076 
00077 typedef struct                    /* file offsets for various fields   */
00078 {
00079     int nx, ny;
00080     int uv17;
00081     int dx, dy, dz;
00082     int tr, te;
00083     int xyz;                      /* 3x3 float matrix from extras      */
00084 } ge_off;
00085 
00086 /* local protos */
00087 int  attack_files      ( param_t * p );
00088 int  check_mod_type    ( char * name );
00089 int  check_usage       ( int argc, char * argv[] );
00090 int  disp_numeric_data ( char * data, param_t * p, FILE * fp );
00091 int  disp_param_data   ( param_t * p );
00092 int  mtype_size        ( int type );
00093 
00094 int  read_ge_header    ( char * pathname, ge_header_info * hi, ge_extras * E,
00095                          ge_off * off );
00096 int  process_file      ( char * pathname, param_t * p );
00097 int  process_ge        ( char * pathname, param_t * p );
00098 int  process_ge4       ( char * pathname, param_t * p );
00099 int  set_params        ( param_t * p, int argc, char * argv[] );
00100 
00101 int  help_full         ( char * prog );
00102 int  help_ge_structs   ( char * prog );
00103 int  usage             ( char * prog, int level );
00104 int  write_data_to_file( FILE * fp, char * filename, param_t * p );
00105 
00106 unsigned long THD_filesize  ( char * pathname );
00107 
00108 int  disp_ge_offsets        ( char * info, ge_off         * D );
00109 int  r_idisp_ge_extras      ( char * info, ge_extras      * E );
00110 int  r_idisp_ge_header_info ( char * info, ge_header_info * I );
00111 
 

Powered by Plone

This site conforms to the following standards: