| Bsoft 2.0.5 Bernard's software package

rwPIF.h
Go to the documentation of this file.
1
11 #include "rwimg.h"
12
13 #define PIFSIZE 1024 // Minimum size of the PIF header
14
15 struct PIFhead { // file header for PIF data
16 char file_id[8]; // 0 0 magic bytes
17 char realscalefactor[16]; // 1 8 floatint -> real
18 int numimages; // 2 24 number of images
19 int endianness; // 3 28 0=little, 1=big
20 char genprogram[32]; // 4 32 last program
21 int htype; // 5 64 1=all images same dimensions
22 int nx; // 6 68 image size
23 int ny; // 7 72
24 int nz; // 8 76
25 int mode; // 9 80 data type (large number)
26 // char label[428]; // 10 84 extra to 512
27 int even; // 11 84
28 int mrcX; // 12 88
29 int mrcY; // 13 92
30 int mrcZ; // 14 96
31 char floatScaleStr[16]; // 15 100
32 char a0[13]; // 16 116
33 char a1[13]; // 17 129
34 char a2[13]; // 18 142
35 char a3[13]; // 19 155
36 char a4[13]; // 20 168
37 char a5[13]; // 21 181
38 char dummy[62]; // 22 194 extra to 256
39 char label[256]; // 23 256 extra to 512
40 };
41
42 struct PIFcolor { // colormap
43 short r[256];
44 short g[256];
45 short b[256];
46 } ;
47
48 struct PIFimagehead { // header for each image
49 int nx; // 0 0 size
50 int ny; // 1 4
51 int nz; // 2 8
52 int mode; // 3 12 data type
53 int bkgnd; // 4 16 background value
54 int packradius; // 5 20 radius of boxed image
55 int nxstart; // 6 unit cell offset
56 int nystart; // 7
57 int nzstart; // 8
58 int mx; // 9 unit cell size in voxels
59 int my; // 10 40
60 int mz; // 11
61 int xlength; // 12 cell dimensions in A
62 int ylength; // 13 (converted to floating point)
63 int zlength; // 14
64 int alpha; // 15 cell angles in degrees
65 int beta; // 16 (converted to floating point)
66 int gamma; // 17
67 int mapc; // 18 column axis
68 int mapr; // 19 row axis
69 int maps; // 20 80 section axis
70 int min; // 21 minimum density value (->fp)
71 int max; // 22 maximum density value (->fp)
72 int mean; // 23 average density value (->fp)
73 int stddev; // 24 standard deviation (->fp)
74 int ispg; // 25 100 space group number
75 int nsymbt; // 26 bytes used for sym. ops. table
76 int xorigin; // 27 x origin
77 int yorigin; // 28 y origin
78 char title[80]; // 29 116 title/description (628)
79 char timestamp[32]; // 30 196 date & time last modified (708)
80 char micrograph[16]; // 31 228 unique micrograph number (740)
81 char scannumber[8]; // 32 244 scan number of micrograph (756)
82 int aoverb; // 33 252
83 int map_abang; // 34 256
84 int dela; // 35 260
85 int delb; // 36
86 int delc; // 37
87 int t_matrix[6]; // 38
88 int dthe; // 39
89 int dphi_90; // 40 300
90 int symmetry; // 41
91 int binfactor; // 42 image compression factor
92 int a_star; // 43 reciprocal space unit cell
93 int b_star; // 44
94 int c_star; // 45
95 int alp_star; // 46
96 int bet_star; // 47
97 int gam_star; // 48
98 int zorigin; // 49 z origin
99 int pixelsize_x; // 50 340 (converted to floating point)
100 int pixelsize_y; // 51
101 int pixelsize_z; // 52
102 int view_x; // 53 View vector
103 int view_y; // 54 (converted to floating point)
104 int view_z; // 55
105 int view_angle; // 56 View rotation angle (->fp)
106 char extra[144]; // 57 368
107 } ;
108
109 struct PIFimagehead_new { // header for each image - new PIF specification
110 int nx; // 0 0 size
111 int ny; // 1 4
112 int nz; // 2 8
113 int mode; // 3 12 data type
114 int bkgnd; // 4 16 background value
115 int packradius; // 5 20 radius of boxed image
116 int nxstart; // 6 unit cell offset
117 int nystart; // 7
118 int nzstart; // 8
119 int mx; // 9 unit cell size in voxels
120 int my; // 10 40
121 int mz; // 11
122 int xlength; // 12 cell dimensions in A
123 int ylength; // 13 (converted to floating point)
124 int zlength; // 14
125 int alpha; // 15 cell angles in degrees
126 int beta; // 16 (converted to floating point)
127 int gamma; // 17
128 int mapc; // 18 column axis
129 int mapr; // 19 row axis
130 int maps; // 20 80 section axis
131 int min; // 21 minimum density value (->fp)
132 int max; // 22 maximum density value (->fp)
133 int mean; // 23 average density value (->fp)
134 int stddev; // 24 standard deviation (->fp)
135 int ispg; // 25 100 space group number
136 int nsymbt; // 26 bytes used for sym. ops. table
137 int xorigin; // 27 x origin
138 int yorigin; // 28 y origin
139 char title[80]; // 29 116 title/description (628)
140 char timestamp[32]; // 30 196 date & time last modified (708)
141 char micrograph[16]; // 31 228 unique micrograph number (740)
142 char scannumber[8]; // 32 244 scan number of micrograph (756)
143 int aoverb; // 33 252
144 int map_abang; // 34 256
145 int dela; // 35 260
146 int delb; // 36
147 int delc; // 37
148 int t_matrix[6]; // 38
149 int dthe; // 39
150 int dphi_90; // 40 300
151 int symmetry; // 41
152 int binfactor; // 42 image compression factor
153 int a_star; // 43 reciprocal space unit cell
154 int b_star; // 44
155 int c_star; // 45
156 int alp_star; // 46
157 int bet_star; // 47
158 int gam_star; // 48
159 int pixelSize; // 49
160 int pixSizUnits; // 50
161 int res_out; // 51
162 int ctfMode; // 52
163 int tempFactor; // 53
164 int wiener; // 54
165 int borderType; // 55
166 int borderWidth; // 56
167 int datar4_min; // 57
168 int datar4_max; // 58
169 int rad_lo; // 59
170 int rad_hi; // 60
171 int transX; // 61
172 int transY; // 62
173 int transZ; // 63
174 int isTrunc; // 64
175 int origX; // 65 400
176 int origY; // 66
177 int origZ; // 67
178 char extra[72]; // 68 412
179 int pixelsize_x; // 69 484 (converted to floating point)
180 int pixelsize_y; // 70
181 int pixelsize_z; // 71
182 int view_x; // 72 View vector
183 int view_y; // 73 (converted to floating point)
184 int view_z; // 74
185 int view_angle; // 75 508 View rotation angle (->fp)
186 } ;
187
188 // I/O prototypes
189 int readPIF(Bimage* p, int readdata, int img_select);
190 int writePIF(Bimage* p);
191
PIFhead::dummy
char dummy[62]
Definition: rwPIF.h:38
PIFhead::label
char label[256]
Definition: rwPIF.h:39
PIFimagehead_new::view_x
int view_x
Definition: rwPIF.h:182
PIFhead::file_id
char file_id[8]
Definition: rwPIF.h:16
PIFimagehead::ylength
int ylength
Definition: rwPIF.h:62
PIFimagehead_new::maps
int maps
Definition: rwPIF.h:130
PIFimagehead_new::nsymbt
int nsymbt
Definition: rwPIF.h:136
PIFhead::floatScaleStr
char floatScaleStr[16]
Definition: rwPIF.h:31
PIFimagehead::xlength
int xlength
Definition: rwPIF.h:61
PIFimagehead::ny
int ny
Definition: rwPIF.h:50
PIFimagehead_new::origZ
int origZ
Definition: rwPIF.h:177
PIFimagehead::a_star
int a_star
Definition: rwPIF.h:92
PIFimagehead_new::dphi_90
int dphi_90
Definition: rwPIF.h:150
PIFimagehead_new::pixelsize_y
int pixelsize_y
Definition: rwPIF.h:180
PIFimagehead_new::ny
int ny
Definition: rwPIF.h:111
PIFcolor
Definition: rwPIF.h:42
PIFimagehead_new::mapr
int mapr
Definition: rwPIF.h:129
PIFimagehead_new::pixelsize_z
int pixelsize_z
Definition: rwPIF.h:181
PIFimagehead::mapc
int mapc
Definition: rwPIF.h:67
PIFhead::nz
int nz
Definition: rwPIF.h:24
PIFhead::endianness
int endianness
Definition: rwPIF.h:19
PIFimagehead::dela
int dela
Definition: rwPIF.h:84
PIFimagehead::view_z
int view_z
Definition: rwPIF.h:104
PIFhead::genprogram
char genprogram[32]
Definition: rwPIF.h:20
PIFimagehead_new::c_star
int c_star
Definition: rwPIF.h:155
PIFimagehead::title
char title[80]
Definition: rwPIF.h:78
PIFimagehead::b_star
int b_star
Definition: rwPIF.h:93
PIFimagehead::alpha
int alpha
Definition: rwPIF.h:64
PIFimagehead_new::gamma
int gamma
Definition: rwPIF.h:127
PIFimagehead::yorigin
int yorigin
Definition: rwPIF.h:77
PIFimagehead_new::transX
int transX
Definition: rwPIF.h:171
PIFimagehead_new::yorigin
int yorigin
Definition: rwPIF.h:138
PIFimagehead_new::nx
int nx
Definition: rwPIF.h:110
PIFimagehead::nx
int nx
Definition: rwPIF.h:49
PIFimagehead_new::max
int max
Definition: rwPIF.h:132
PIFimagehead::pixelsize_y
int pixelsize_y
Definition: rwPIF.h:100
PIFhead::nx
int nx
Definition: rwPIF.h:22
PIFhead
Definition: rwPIF.h:15
PIFhead::mrcZ
int mrcZ
Definition: rwPIF.h:30
PIFimagehead::aoverb
int aoverb
Definition: rwPIF.h:82
PIFimagehead::nystart
int nystart
Definition: rwPIF.h:56
PIFimagehead_new::tempFactor
int tempFactor
Definition: rwPIF.h:163
PIFimagehead_new::alp_star
int alp_star
Definition: rwPIF.h:156
PIFimagehead_new::xlength
int xlength
Definition: rwPIF.h:122
PIFimagehead_new::zlength
int zlength
Definition: rwPIF.h:124
PIFimagehead::alp_star
int alp_star
Definition: rwPIF.h:95
PIFimagehead::view_x
int view_x
Definition: rwPIF.h:102
PIFimagehead_new::mapc
int mapc
Definition: rwPIF.h:128
PIFimagehead_new::delc
int delc
Definition: rwPIF.h:147
PIFimagehead::zorigin
int zorigin
Definition: rwPIF.h:98
PIFimagehead::bet_star
int bet_star
Definition: rwPIF.h:96
PIFimagehead_new::mx
int mx
Definition: rwPIF.h:119
PIFhead::mrcY
int mrcY
Definition: rwPIF.h:29
PIFhead::a0
char a0[13]
Definition: rwPIF.h:32
PIFimagehead::ispg
int ispg
Definition: rwPIF.h:74
PIFimagehead::nsymbt
int nsymbt
Definition: rwPIF.h:75
PIFimagehead_new::datar4_max
int datar4_max
Definition: rwPIF.h:168
Bimage
General image parameter class.
Definition: Bimage.h:163
PIFimagehead_new::nystart
int nystart
Definition: rwPIF.h:117
PIFimagehead_new::alpha
int alpha
Definition: rwPIF.h:125
PIFimagehead::nzstart
int nzstart
Definition: rwPIF.h:57
PIFimagehead::pixelsize_z
int pixelsize_z
Definition: rwPIF.h:101
PIFimagehead::mean
int mean
Definition: rwPIF.h:72
PIFimagehead::maps
int maps
Definition: rwPIF.h:69
PIFimagehead::min
int min
Definition: rwPIF.h:70
PIFimagehead::nz
int nz
Definition: rwPIF.h:51
PIFimagehead::extra
char extra[144]
Definition: rwPIF.h:106
PIFimagehead_new::ctfMode
int ctfMode
Definition: rwPIF.h:162
PIFhead::htype
int htype
Definition: rwPIF.h:21
PIFimagehead_new::aoverb
int aoverb
Definition: rwPIF.h:143
PIFhead::realscalefactor
char realscalefactor[16]
Definition: rwPIF.h:17
PIFimagehead_new::datar4_min
int datar4_min
Definition: rwPIF.h:167
PIFhead::a1
char a1[13]
Definition: rwPIF.h:33
PIFimagehead_new::ispg
int ispg
Definition: rwPIF.h:135
PIFcolor::g
short g[256]
Definition: rwPIF.h:44
PIFimagehead::dthe
int dthe
Definition: rwPIF.h:88
PIFimagehead_new::pixelSize
int pixelSize
Definition: rwPIF.h:159
PIFimagehead::pixelsize_x
int pixelsize_x
Definition: rwPIF.h:99
PIFimagehead::my
int my
Definition: rwPIF.h:59
PIFcolor::r
short r[256]
Definition: rwPIF.h:43
readPIF
int readPIF(Bimage *p, int readdata, int img_select)
Reading a PIF image and structure factor file format. A 2D and 3D image format used in electron micro...
Definition: rwPIF.cpp:60
PIFimagehead::view_angle
int view_angle
Definition: rwPIF.h:105
PIFhead::ny
int ny
Definition: rwPIF.h:23
PIFimagehead::nxstart
int nxstart
Definition: rwPIF.h:55
PIFimagehead::scannumber
char scannumber[8]
Definition: rwPIF.h:81
PIFimagehead_new::scannumber
char scannumber[8]
Definition: rwPIF.h:142
PIFimagehead_new::ylength
int ylength
Definition: rwPIF.h:123
PIFimagehead_new::bkgnd
int bkgnd
Definition: rwPIF.h:114
PIFimagehead_new::title
char title[80]
Definition: rwPIF.h:139
PIFhead::a3
char a3[13]
Definition: rwPIF.h:35
PIFimagehead::dphi_90
int dphi_90
Definition: rwPIF.h:89
PIFimagehead_new::wiener
int wiener
Definition: rwPIF.h:164
PIFimagehead_new::nz
int nz
Definition: rwPIF.h:112
PIFimagehead::delb
int delb
Definition: rwPIF.h:85
PIFimagehead::map_abang
int map_abang
Definition: rwPIF.h:83
PIFimagehead_new::delb
int delb
Definition: rwPIF.h:146
PIFimagehead::packradius
int packradius
Definition: rwPIF.h:54
PIFimagehead_new::pixSizUnits
int pixSizUnits
Definition: rwPIF.h:160
PIFimagehead_new::nzstart
int nzstart
Definition: rwPIF.h:118
PIFimagehead::symmetry
int symmetry
Definition: rwPIF.h:90
PIFimagehead_new::symmetry
int symmetry
Definition: rwPIF.h:151
PIFimagehead_new::binfactor
int binfactor
Definition: rwPIF.h:152
PIFimagehead::zlength
int zlength
Definition: rwPIF.h:63
PIFimagehead_new::transZ
int transZ
Definition: rwPIF.h:173
PIFimagehead_new::rad_hi
int rad_hi
Definition: rwPIF.h:170
PIFimagehead_new::isTrunc
int isTrunc
Definition: rwPIF.h:174
PIFimagehead_new::res_out
int res_out
Definition: rwPIF.h:161
PIFimagehead_new::beta
int beta
Definition: rwPIF.h:126
PIFimagehead::bkgnd
int bkgnd
Definition: rwPIF.h:53
PIFimagehead::gamma
int gamma
Definition: rwPIF.h:66
PIFimagehead_new::pixelsize_x
int pixelsize_x
Definition: rwPIF.h:179
PIFimagehead_new::view_y
int view_y
Definition: rwPIF.h:183
PIFimagehead_new::transY
int transY
Definition: rwPIF.h:172
PIFimagehead_new::dela
int dela
Definition: rwPIF.h:145
PIFimagehead_new::rad_lo
int rad_lo
Definition: rwPIF.h:169
PIFhead::numimages
int numimages
Definition: rwPIF.h:18
PIFimagehead_new::view_angle
int view_angle
Definition: rwPIF.h:185
PIFimagehead_new::t_matrix
int t_matrix[6]
Definition: rwPIF.h:148
PIFimagehead_new::my
int my
Definition: rwPIF.h:120
PIFimagehead::mapr
int mapr
Definition: rwPIF.h:68
PIFimagehead_new::b_star
int b_star
Definition: rwPIF.h:154
PIFimagehead::delc
int delc
Definition: rwPIF.h:86
PIFimagehead::stddev
int stddev
Definition: rwPIF.h:73
PIFimagehead::xorigin
int xorigin
Definition: rwPIF.h:76
PIFimagehead::beta
int beta
Definition: rwPIF.h:65
PIFhead::even
int even
Definition: rwPIF.h:27
PIFimagehead_new::xorigin
int xorigin
Definition: rwPIF.h:137
PIFhead::a5
char a5[13]
Definition: rwPIF.h:37
PIFimagehead_new::borderType
int borderType
Definition: rwPIF.h:165
PIFimagehead
Definition: rwPIF.h:48
writePIF
int writePIF(Bimage *p)
Writing a PIF image file format. A 2D and 3D image format used in electron microscopy.
Definition: rwPIF.cpp:370
PIFimagehead::mx
int mx
Definition: rwPIF.h:58
PIFimagehead_new::view_z
int view_z
Definition: rwPIF.h:184
PIFimagehead_new::timestamp
char timestamp[32]
Definition: rwPIF.h:140
PIFimagehead_new::packradius
int packradius
Definition: rwPIF.h:115
PIFimagehead_new::gam_star
int gam_star
Definition: rwPIF.h:158
PIFimagehead_new::bet_star
int bet_star
Definition: rwPIF.h:157
PIFimagehead_new::min
int min
Definition: rwPIF.h:131
PIFimagehead_new::mode
int mode
Definition: rwPIF.h:113
PIFimagehead::micrograph
char micrograph[16]
Definition: rwPIF.h:80
PIFimagehead::timestamp
char timestamp[32]
Definition: rwPIF.h:79
PIFimagehead::c_star
int c_star
Definition: rwPIF.h:94
rwimg.h
Header file for 2D and 3D image I/O.
PIFimagehead_new::origX
int origX
Definition: rwPIF.h:175
PIFimagehead::max
int max
Definition: rwPIF.h:71
PIFimagehead::view_y
int view_y
Definition: rwPIF.h:103
PIFhead::mode
int mode
Definition: rwPIF.h:25
PIFimagehead_new
Definition: rwPIF.h:109
PIFimagehead::mz
int mz
Definition: rwPIF.h:60
PIFimagehead_new::extra
char extra[72]
Definition: rwPIF.h:178
PIFcolor::b
short b[256]
Definition: rwPIF.h:45
PIFimagehead::t_matrix
int t_matrix[6]
Definition: rwPIF.h:87
PIFimagehead_new::map_abang
int map_abang
Definition: rwPIF.h:144
PIFimagehead_new::mz
int mz
Definition: rwPIF.h:121
PIFimagehead_new::micrograph
char micrograph[16]
Definition: rwPIF.h:141
PIFimagehead_new::dthe
int dthe
Definition: rwPIF.h:149
PIFimagehead_new::origY
int origY
Definition: rwPIF.h:176
PIFimagehead_new::nxstart
int nxstart
Definition: rwPIF.h:116
PIFimagehead_new::stddev
int stddev
Definition: rwPIF.h:134
PIFimagehead_new::mean
int mean
Definition: rwPIF.h:133
PIFhead::a4
char a4[13]
Definition: rwPIF.h:36
PIFimagehead::mode
int mode
Definition: rwPIF.h:52
PIFhead::mrcX
int mrcX
Definition: rwPIF.h:28
PIFimagehead::binfactor
int binfactor
Definition: rwPIF.h:91
PIFimagehead_new::a_star
int a_star
Definition: rwPIF.h:153
PIFimagehead_new::borderWidth
int borderWidth
Definition: rwPIF.h:166
PIFimagehead::gam_star
int gam_star
Definition: rwPIF.h:97
PIFhead::a2
char a2[13]
Definition: rwPIF.h:34