~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina6/tina-libs/tina/file/fileThirdParty_air.h

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* AIR.h --header file for Automated Image Registration Subroutines AIR 3.00 */
  2 /* Copyright 1995-96 Roger P. Woods, M.D. */
  3 /* Modified 10/26/96 */
  4 
  5 
  6 #ifndef TINA_FILE_THIRDPARTY_AIR_HDR
  7 #define TINA_FILE_THIRDPARTY_AIR_HDR
  8 
  9 /* This header file utilizes a 4 x 4 matrix rather than the older 4 x 3 format*/
 10 
 11 /* The following information is site specific */
 12 
 13 #define PLATF 1                 /* Used to properly define machine dependent constants*/
 14                                 /* Currently supported:                                 */
 15                                 /* 1 IEEE big-endian (Motorola 68000's, Sun 3, SPARC)   */
 16                                 /* 2 IEEE little-endian (doesn't work for DEC alpha) */
 17                                 /* 3 Platform independent solution for C compilers with float.h header file */
 18                                 /* (DEC alpha includes float.h, so use 3 for alphas) */
 19 
 20 #define VERBOSITY 1             /*0 turns off nonessential screen printing*/
 21 
 22 #define PIX_SIZE_ERR .0001      /* Voxel sizes that differ by less than this value are assumed identical */
 23 
 24 #define PIXEL_MAX_SIZE 10       /* warning issued if voxel size exceeds this*/
 25 #define PIXEL_MIN_SIZE .1       /* warning issued if voxel size less than this*/
 26 
 27 #define EDITED 5.0              /* warning issued if MRI contains less than this percentage of zero pixel values*/
 28                                 /* suggesting that it has not been edited--value of 0.0 inactivates this feature*/
 29                                 /* This feature is supported only in the AIR 1.0 programs alignpettomri */
 30                                 /* and alignmritopet. The new program alignlinear does not check to see that */
 31                                 /* files have been edited.                                                      */
 32 
 33 #define OLD_ANALYZE 0           /* if 1, warning will be issued whenever*/
 34                                 /* a file is loaded that has voxels sizes of */
 35                                 /* 1.000 x 1.000 x1.000 suggesting that*/
 36                                 /* file was created by a version of ANALYZE     */
 37                                 /* that sometimes fails to preserve voxel sizes         */
 38                                 /* (particularly when a file has been edited*/
 39                                 /* set to 0 (zero) to inactivate*/
 40 
 41 
 42 
 43 #define COMPRESS 1              /* if nonzero, image files (but not headers) can be decompressed*/
 44                                 /* and recompressed using UNIX compress and uncompress commands */
 45                                 /* This should be set to zero if your operating system does not */
 46                                 /* support the uncompress and compress commands.                */
 47                                 /* Note that only files that are compressed when initially      */
 48                                 /* encountered will be recompressed and that not all programs   */
 49                                 /* support this feature.                                        */
 50                                 /* If your system does not support this feature, you may crash  */
 51                                 /* instead of exiting gracefully when you ask for a nonexistant */
 52                                 /* file to be loaded. Set COMPRESS to 0 to prevent this.        */
 53                                 /* Alternatively, you can modify the subroutines                */
 54                                 /* src/decompress.c and src/recompress.c to make system calls   */
 55                                 /* appropriate for your systems architecture.                   */
 56                                 /* Likewise, if you prefer other compression programs, these    */
 57                                 /* subroutines can be modified to call them instead.            */
 58 
 59 #define CLOCK 0                 /* if nonzero, verbose mode in alignlinear will print elapsed
 60                                  * time with each iteration
 61                                  *
 62                                  * this is a nonessential function and causes trouble with some
 63                                  * compilers. If you get a clock() related error when you compile,
 64                                  * set this variable to zero
 65                                  */
 66 
 67 #define OUTBITS 8               /* Options are 8 and 16 */
 68                                 /* Controls internal representation of data */
 69                                 /* Controls bits/pixel of output data*/
 70                                 /* Data with a different number of bits/pixel can be input*/
 71                                 /* but will be converted to this number of bits/pixel*/
 72                                 /* using bit shifting to increase the number*/
 73                                 /* and using bit shifting, possibly combined with rescaling*/
 74                                 /* to decrease the number of bits/pixel.*/
 75                                 /* (Whether or not to rescale is dictated by the header*/
 76                                 /* global maximum                                       */
 77 
 78 
 79 #define REP16 3                 /* This variable is only relevant when OUTBITS==16      */
 80                                 /* However, its value must always be defined            */
 81                                 /* If 1, 16 bit data will be written to disk as         */
 82                                 /*      unsigned short ints (NOT ANALYZE compatible)    */
 83                                 /*      header minimum will be 0, maximum 65535         */
 84                                 /* If 2, 16 bit data will be written to disk as         */
 85                                 /*      short ints w/o using negative values            */
 86                                 /*      this effectively reduces storage to 15 bits     */
 87                                 /*      and reduction is done via bit shifting          */
 88                                 /*      header minimum will be 0, maximum 32767         */
 89                                 /* If 3, 16 bit data will be written to disk as         */
 90                                 /*      short ints using negative values                */
 91                                 /*      an actual value of zero will be mapped to       */
 92                                 /*      -32768 in short int representation              */
 93                                 /*      header minimum will be -32767                   */
 94                                 /*      header maximum will be 32767                    */
 95 
 96 #if(OUTBITS==8)
 97 
 98 #define THRESHOLD1 10           /* These are the 8 bit thresholds (see below) */
 99 #define THRESHOLD2 10
100 
101 #elif(OUTBITS==16)
102 
103 #define THRESHOLD1 7000         /* These are the 16 bit thresholds (see below) */
104 #define THRESHOLD2 7000
105 
106 #endif
107                                 /* THRESHOLD1 and THRESHOLD2 are the default thresholds
108                                  * that AIR will offer when you register images.
109                                  *
110                                  * You probably want to use the same value for THRESHOLD1 and THRESHOLD2.
111                                  *
112                                  * You can always override the defaults, but it's nice to compile
113                                  * in some reasonable values if you can.
114                                  *
115                                  * Ideally, you should look at some typical data, and pick a default
116                                  * value that will generally separate brain from non-brain structures.
117                                  *
118                                  * In other words, pick a threshold such that values outside the structure
119                                  * of interest have pixel values below that threshold.
120                                  *
121                                  * An 8 bit value of 55 is good for PET data, but you'll probably 
122                                  * want something closer to 10 for 8 bit MRI data
123                                  *
124                                  * For 16 bit data, it's hard to guess what value will be reasonable
125                                  * since the full 16 bit range is often not utilized. A value around
126                                  * 7000 is reasonable for PET data which is often effectively 15 positive bits.
127                                  * For MRI data, as little as 12 bits is commonly used, in which case a
128                                  * reasonable default threshold is probably in the 100-200 range. On the other
129                                  * hand, if all 16 bits are effectively utilized, values in the 1000-2000 range
130                                  * may be more appropriate.
131                                  *
132                                  * Best bet--look at some data before choosing a default and caution users
133                                  * not to rely on the default values unless your site is very consistent
134                                  * about data formats and image intensities.
135                                  */
136 
137 
138 /* The remaining information should not generally require modification */
139 
140 #if(OUTBITS==8)
141 
142 typedef unsigned char my_pixels;
143 #define MAX_POSS_VALUE 255
144 
145 #elif(OUTBITS==16)
146 
147 typedef unsigned short int my_pixels;
148 #define MAX_POSS_VALUE 65535    /* This is true regardless of the value of REP16 above*/
149                                 /* 16-bit data is always represented internally is*/
150                                 /* unsigned short ints, even when it is written to*/
151                                 /* output files in other formats*/
152 
153 #endif
154 
155 
156 #define HDR_SUFF ".hdr"         /* This suffix will be used in trying to open an image header*/
157 #define IMG_SUFF ".img"         /* This suffix will be used in trying to open an image file*/
158 
159 #define LOGFILE "\0"            /* Use "\0" if .img files don't have corresponding .log files*/
160 #define NORM_SUFF ".nrm"        /* Use "\0" if .log files containing ASCII weighting factors are not available*/
161 
162 
163 /* These are the internal structs*/
164 /* The external struct (for image headers as stored on disk)*/
165 /* is stored separately in HEADER.h */
166 
167 struct key_info{
168         int bits;
169         int x_dim;
170         int y_dim;
171         int z_dim;
172         double x_size;
173         double y_size;
174         double z_size;
175 };
176 
177 struct air16{
178         double                  e[4][4];
179         char                    s_file[128];
180         struct key_info         s;
181         char                    r_file[128];
182         struct key_info         r;
183         char                    comment[128];
184         unsigned long int       s_hash;
185         unsigned long int       r_hash;
186         unsigned short          s_volume;       /* Not used in this version of AIR */
187         unsigned short          r_volume;       /* Not used in this version of AIR */
188         char                    reserved[116];
189 };
190 
191 struct oldair{                                  /*Allows AIR 2.0 to read AIR 1.0 .air files*/
192         double                  e[4][3];
193         char                    s_file[128];
194         struct key_info         s;
195         char                    r_file[128];
196         struct key_info         r;
197         char                    comment[128];
198         unsigned long int       s_hash;
199         unsigned long int       r_hash;
200         unsigned short          s_volume;       /* Not used in this version of AIR */
201         unsigned short          r_volume;       /* Not used in this version of AIR */
202         char                    reserved[116];
203 };
204 
205 /* what the fuck is this doing here - a.lacey */
206 #define VOXELS 450
207 
208 #endif /* TINA_FILE_THIRDPARTY_AIR_HDR */
209 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.