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  

multivector.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002    Major portions of this software are copyrighted by the Medical College
00003    of Wisconsin, 1994-2000, and are released under the Gnu General Public
00004    License, Version 2.  See the file README.Copyright for details.
00005 ******************************************************************************/
00006    
00007 #ifndef _MULTIVECTOR_HEADER_
00008 #define _MULTIVECTOR_HEADER_
00009 
00010 #include <ctype.h>
00011 #include "mrilib.h"
00012 
00013 #define MV_FLOAT  1
00014 #define MV_STRING 2
00015 
00016 #define MV_TYPELABEL(i) (((i)==MV_FLOAT)  ? "FLOAT"  :           \
00017                          ((i)==MV_STRING) ? "STRING" : "unknown")
00018 
00019 typedef struct {
00020    int nvec , ndim ;
00021    char * name ;
00022    int * type ;      /* [nvec] */
00023    char ** label ;   /* [nvec] */
00024    void ** vec ;     /* [nvec][ndim] */
00025 } multivector ;
00026 
00027 #define MV_NVEC(m)           ((m)->nvec)
00028 #define MV_NDIM(m)           ((m)->ndim)
00029 
00030 #define MV_FLOAT_VEC(m,i)    ((float *)(m)->vec[(i)])
00031 #define MV_FLOAT_VAL(m,i,j)  (((float *)(m)->vec[(i)])[(j)])
00032 
00033 #define MV_STRING_VEC(m,i)   ((char **)(m)->vec[(i)])
00034 #define MV_STRING_VAL(m,i,j) (((char **)(m)->vec[(i)])[(j)])
00035 
00036 #define MV_TYPE(m,i)         ((m)->type[(i)])
00037 #define MV_LABEL(m,i)        (((m)->label != NULL) ? (m)->label[(i)] : NULL)
00038 #define MV_NAME(m)           ((m)->name)
00039 
00040 extern multivector * multivector_read( char * ) ;
00041 extern int           multivector_write( char * , multivector * ) ;
00042 extern void          multivector_free( multivector * mv ) ;
00043 extern void          multivector_set_name( multivector * , char * ) ;
00044 
00045 extern char * MV_format_fval( float ) ;  /* 12 July 01999 */
00046 extern char * MV_format_fval2( float, int ) ;  /* May 28 04, ZSS */
00047 
00048 #define MV_FREE(m) do{ multivector_free((m)); (m)=NULL; }while(0)
00049 
00050 #endif /* _MULTIVECTOR_HEADER_ */
 

Powered by Plone

This site conforms to the following standards: