File: dbh.h

package info (click to toggle)
vips 8.14.1-3%2Bdeb12u2
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 35,912 kB
  • sloc: ansic: 165,449; cpp: 10,987; python: 4,462; xml: 4,212; sh: 471; perl: 40; makefile: 23
file content (105 lines) | stat: -rw-r--r-- 4,092 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
 * 
 * (c) Copyright, 1986-1991
 * Biodynamics Research Unit
 * Mayo Foundation
 *
 * dbh.h
 *
 *
 * database sub-definitions
 */

/*
 *
 * The previous-generation header for Analyze images. Although (c) Mayo
 * Foundation, it has been in the public domain for many years.
 *
 * Analyze images have a 348 byte header stored in a file with a .hdr suffix,
 * and a corresponding .img file containing just the pixel data.
 *
 */

struct header_key                 /*      header_key       */
    {                                  /* off + size*/
        int sizeof_hdr;                /* 0 + 4     */
        char data_type[10];            /* 4 + 10    */
        char db_name[18];              /* 14 + 18   */
        int extents;                   /* 32 + 4    */
        short int session_error;       /* 36 + 2    */
        char regular;                  /* 38 + 1    */
        char hkey_un0;                 /* 39 + 1    */
    };           		       /* total=40  */

struct image_dimension           /*      image_dimension  */
    {                                  /* off + size*/
        short int dim[8];              /* 0 + 16    */
        char vox_units[4];	       /* 16 + 4    */
        char cal_units[8];	       /* 20 + 4    */
        short int unused1;	       /* 24 + 2    */
        short int datatype;	       /* 30 + 2    */
        short int bitpix;              /* 32 + 2    */
        short int dim_un0;             /* 34 + 2    */
        float pixdim[8];               /* 36 + 32   */
        		 
        		/*	pixdim[] specifies the voxel dimensions:
        			pixdim[1] - voxel width
        			pixdim[2] - voxel height
        			pixdim[3] - interslice distance
        				..etc
        		*/
        float vox_offset;              /* 68 + 4    */
        float funused1;                /* 72 + 4    */
        float funused2;                /* 76 + 4    */
        float funused3;                /* 80 + 4    */
        float cal_max;                 /* 84 + 4    */
        float cal_min;                 /* 88 + 4    */
        int compressed;                /* 92 + 4    */
        int verified;                  /* 96 + 4    */
        int glmax, glmin;              /* 100 + 8   */
    };          

struct data_history               /*      data_history     */
    {                                  /* off + size*/
        char descrip[80];              /* 0 + 80    */
        char aux_file[24];             /* 80 + 24   */
        char orient;                   /* 104 + 1   */
        char originator[10];           /* 105 + 10  */
        char generated[10];            /* 115 + 10  */
        char scannum[10];              /* 125 + 10  */
        char patient_id[10];           /* 135 + 10  */
        char exp_date[10];             /* 145 + 10  */
        char exp_time[10];             /* 155 + 10  */
        char hist_un0[3];              /* 165 + 3   */
        int views;                     /* 168 + 4   */
        int vols_added;                /* 172 + 4   */
        int start_field;               /* 176 + 4   */
        int field_skip;                /* 180 + 4   */
        int omax,omin;                 /* 184 + 8   */
        int smax,smin;                 /* 192 + 8   */
    };                     	       /* total=200 */

struct dsr                        /*      dsr              */
    {                                  /* off + size*/
        struct header_key hk;          /* 0 + 40    */
        struct image_dimension dime;   /* 40 + 108  */
        struct data_history hist;      /* 148 + 200 */
    };                     	       /* total=348 */

/* Acceptable values for hdr.dime.datatype */

/*
 * commented this one out: we don't use it, and dirent.h defines this on some
 * platforms.
 *
#define DT_UNKNOWN			0
 */

#define DT_BINARY			1
#define DT_UNSIGNED_CHAR		2
#define DT_SIGNED_SHORT			4
#define DT_SIGNED_INT			8
#define DT_FLOAT			16
#define DT_COMPLEX			32
#define DT_DOUBLE			64
#define DT_RGB				128