Doxygen Source Code Documentation
        
Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search   
Imon.h
Go to the documentation of this file.00001 
00002 #ifndef _IMON_H_
00003 #define _IMON_H_
00004 
00005 
00006 
00007 #define IFM_MAX_FLEN       200       
00008 #define IFM_PAD_LEN         20       
00009 #define IFM_EPSILON       0.01       
00010 #define IFM_STAT_ALLOC      20       
00011 #define IFM_MAX_IM_ALLOC    40       
00012 #define IFM_MAX_RUN_NAPS     3       
00013 #define IFM_MAX_GE_FAILURES  3       
00014 #define IFM_MAX_NT       32767       
00015 #define IFM_SUFFIX_LEN      10       
00016 
00017 #define IFM_MIN_NICE_INC   -19       
00018 #define IFM_MAX_NICE_INC    20       
00019 
00020 #define IFM_USE_SHORT        1       
00021 #define IFM_USE_LONG         2
00022 #define IFM_USE_HIST         3
00023 #define IFM_USE_VERSION      4
00024 
00025 #define IFM_IM_FTYPE_NONE    0       
00026 #define IFM_IM_FTYPE_GEMS5   1       
00027 #define IFM_IM_FTYPE_DICOM   4       
00028 
00029 #define IFM_DEBUG_DEFAULT    1       
00030 #define IFM_MAX_DEBUG        5       
00031 
00032 #define IFM_GERT_SCRIPT "GERT_Reco2" 
00033 #define IFM_GERT_DICOM  "GERT_Reco_dicom" 
00034 #define IFM_SLICE_PAT   "alt+z"
00035 
00036 
00037 
00038 #define LSB_FIRST            1
00039 #define MSB_FIRST            2
00040 
00041 
00042                                     
00043 typedef struct                      
00044 {
00045     int   good;                     
00046     int   nx, ny;                   
00047     int   uv17;                     
00048     int   index;                    
00049     float dx,dy,dz, zoff, tr,te;    
00050     char  orients[8];               
00051 } ge_header_info;
00052 
00053 typedef struct                      
00054 {
00055     int   bpp;                      
00056     int   cflag;                    
00057     int   hdroff;                   
00058     int   skip;                     
00059     int   swap;                     
00060     int   kk;                       
00061     float xorg;                     
00062     float yorg;
00063     float xyz[9];
00064 } ge_extras;
00065 
00066 typedef struct
00067 {
00068     ge_header_info   geh;           
00069     ge_extras        gex;           
00070     int              index;         
00071     int              bytes;         
00072     void           * image;         
00073 } finfo_t;
00074 
00075 typedef struct
00076 {
00077     char          ** str;           
00078     int              nalloc;        
00079     int              nused;         
00080 } string_list;
00081 
00082 typedef struct
00083 {
00084     int              nalloc;        
00085     int              nused;         
00086     int              ary_len;       
00087     int              im_size;       
00088     void          ** im_ary;        
00089     void           * x_im;          
00090 } im_store_t;
00091 
00092 typedef struct  
00093 {
00094     char           * start_file;    
00095     char           * start_dir;     
00096     char           * dicom_glob;    
00097     char           * sp;            
00098     char           * gert_outdir;   
00099     char          ** argv;          
00100     int              argc;
00101     int              nt;            
00102     int              nice;          
00103     int              pause;         
00104     int              debug;         
00105     int              gert_reco;     
00106     int              quit;          
00107     int              use_dicom;     
00108     int              dicom_org;     
00109 
00110     
00111     int              rt;            
00112     int              swap;          
00113     int              rev_bo;        
00114     char           * host;          
00115     string_list      drive_list;    
00116     string_list      rt_list;       
00117 } opts_t;
00118 
00119 typedef struct
00120 {
00121     int              ftype;         
00122     int              nused;         
00123     int              nalloc;        
00124     finfo_t        * flist;         
00125     im_store_t       im_store;      
00126 
00127     char           * glob_dir;      
00128     int              nfiles;        
00129     char          ** fnames;        
00130 
00131     opts_t           opts;          
00132 } param_t;
00133 
00134 typedef struct                      
00135 {
00136     int  volumes;                   
00137     int  f1index;                   
00138     char f1name[IFM_MAX_FLEN];      
00139 } run_t;
00140 
00141 typedef struct                  
00142 {
00143     int     slices;             
00144     float   z_first, z_last;    
00145     float   z_delta;            
00146 
00147     int     nalloc;             
00148     int     nused;              
00149     int     nvols;              
00150     run_t * runs;               
00151 } stats_t;
00152 
00153 typedef struct
00154 {
00155     ge_header_info geh;                  
00156     ge_extras      gex;                  
00157     int            nim;                  
00158     int            fl_1;                 
00159     int            fn_1, fn_n;           
00160     char           first_file[IFM_MAX_FLEN]; 
00161     char           last_file [IFM_MAX_FLEN]; 
00162     float          z_first;              
00163     float          z_last;               
00164     float          z_delta;              
00165     int            seq_num;              
00166     int            run;                  
00167 } vol_t;
00168 
00169 typedef struct
00170 {
00171     int level;
00172 } IFM_debug;
00173 
00174 
00175 
00176 
00177 
00178 #define IFM_BIG_ERROR_MESG( I_str, I_file, I_ez, I_az, I_run, I_s1, I_sn )  \
00179         do {                                                            \
00180             fprintf( stderr, "\007\n"                                   \
00181                     "***********************************************\n" \
00182                     "Error: %s\n"                                       \
00183                     "       current file      : %s\n"                   \
00184                     "       expected z-offset : %.4f\n"                 \
00185                     "       actual z-offset   : %.4f\n"                 \
00186                     "       current run       : %d\n"                   \
00187                     "       slice number      : %d (of %d)\n"           \
00188                     "***********************************************\n",\
00189                 I_str, I_file, I_ez, I_az, I_run, I_s1, I_sn );         \
00190         } while (0)
00191 
00192 #endif