iRoCS Toolbox  1.1.0
BlitzAnalyzeType.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2010 Robert Bensch
4  *
5  * Image Analysis Lab, University of Freiburg, Germany
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  * -----------------------------
22  * - Copyright Acknowledgement -
23  * -----------------------------
24  *
25  * The Analyze header type definitions in "BlitzAnalyzeType.hh" and
26  * the methode "saveArrayWithElemSize" in "BlitzAnalyzeFile.icc"
27  * are mainly based on the Analyze 7.5 File Format document
28  * http://www.mayo.edu/bir/PDF/ANALYZE75.pdf
29  * (.../libBlitzAnalyze/docs/ANALYZE75.pdf)
30  *
31  * It contains the following copyright notice regarding the
32  * header file format:
33  *
34  * ANALYZE TM Header File Format
35  * (c) Copyright, 1986-1995
36  * Biomedical Imaging Resource
37  * Mayo Foundation
38  *
39  **************************************************************************/
40 
41 #ifndef BLITZANALYZETYPE_HH
42 #define BLITZANALYZETYPE_HH
43 
44 #ifdef HAVE_CONFIG_H
45 #include <config.hh>
46 #endif
47 
48  /*======================================================================*/
52  /*======================================================================*/
53 
54 struct header_key /* header key */
55 { /* off + size */
56  int sizeof_hdr; /* 0 + 4 */
57  char data_type[10]; /* 4 + 10 */
58  char db_name[18]; /* 14 + 18 */
59  int extents; /* 32 + 4 */
60  short int session_error; /* 36 + 2 */
61  char regular; /* 38 + 1 */
62  char hkey_un0; /* 39 + 1 */
63 }; /* total=40 bytes */
64 
65 struct image_dimension { /* off + size */
66  short int dim[8]; /* 0 + 16 */
67 // short int unused8; /* 16 + 2 */
68 // short int unused9; /* 18 + 2 */
69 // short int unused10; /* 20 + 2 */
70 // short int unused11; /* 22 + 2 */
71 // short int unused12; /* 24 + 2 */
72 // short int unused13; /* 26 + 2 */
73 // short int unused14; /* 28 + 2 */
74  char vox_units[4];
75  char cal_units[8];
76  short int unused1;
77  short int datatype; /* 30 + 2 */
78  short int bitpix; /* 32 + 2 */
79  short int dim_un0; /* 34 + 2 */
80  float pixdim[8]; /* 36 + 32 */
81  /*
82  pixdim[] specifies the voxel dimensitons:
83  pixdim[1] - voxel width
84  pixdim[2] - voxel height
85  pixdim[3] - interslice distance
86  ...etc
87  */
88  float vox_offset; /* 68 + 4 */
89  float funused1; /* 72 + 4 */
90  float funused2; /* 76 + 4 */
91  float funused3; /* 80 + 4 */
92  float cal_max; /* 84 + 4 */
93  float cal_min; /* 88 + 4 */
94  float compressed; /* 92 + 4 */
95  float verified; /* 96 + 4 */
96  int glmax, glmin; /* 100 + 8 */
97 }; /* total=108 bytes */
98 
99 struct data_history { /* off + size */
100  char descrip[80]; /* 0 + 80 */
101  char aux_file[24]; /* 80 + 24 */
102  char orient; /* 104 + 1 */
103  char originator[10]; /* 105 + 10 */
104  char generated[10]; /* 115 + 10 */
105  char scannum[10]; /* 125 + 10 */
106  char patient_id[10]; /* 135 + 10 */
107  char exp_date[10]; /* 145 + 10 */
108  char exp_time[10]; /* 155 + 10 */
109  char hist_un0[3]; /* 165 + 3 */
110  int views; /* 168 + 4 */
111  int vols_added; /* 172 + 4 */
112  int start_field; /* 176 + 4 */
113  int field_skip; /* 180 + 4 */
114  int omax, omin; /* 184 + 8 */
115  int smax, smin; /* 192 + 8 */
116 };
117 
118 struct dsr {
119  struct header_key hk; /* 0 + 40 */
120  struct image_dimension dime; /* 40 + 108 */
121  struct data_history hist; /* 148 + 200 */
122 }; /* total= 348 bytes */
123 
124 /* Acceptable values for datatype */
125 #define DT_NONE 0
126 #define DT_UNKNOWN 0
127 #define DT_BINARY 1
128 #define DT_UNSIGNED_CHAR 2
129 #define DT_SIGNED_SHORT 4
130 #define DT_SIGNED_INT 8
131 #define DT_FLOAT 16
132 #define DT_COMPLEX 32
133 #define DT_DOUBLE 64
134 #define DT_RGB 128
135 #define DT_ALL 255
136 
137 typedef struct {
138  float real;
139  float imag;
140 } COMPLEX;
141 
142 #endif
char data_type[10]
char db_name[18]
short int session_error
Type definitions for Analyze file header.