Xmipp
v3.23.11-Nereus
xmippCore
core
rwSPIDER.h
Go to the documentation of this file.
1
/*
2
Based on rwSPIDER.h
3
Header file for reading and writing SPIDER files
4
Format: 3D image file format for the SPIDER package
5
Author: Bernard Heymann
6
Created: 19990410 Modified: 20010928
7
*/
8
9
#ifndef CORE_RWSPIDER_H
10
#define CORE_RWSPIDER_H
11
12
#define SPIDERSIZE 1024 // Minimum size of the SPIDER header (variable)
13
19
struct
SPIDERhead
20
{
// file header for SPIDER data
21
float
nslice
;
// 0 slices in volume (image = 1)
22
float
nrow
;
// 1 rows per slice
23
float
irec
;
// 2 # records in file (unused)
24
float
nhistrec
;
// 3 (obsolete)
25
float
iform
;
// 4 file type specifier
26
float
imami
;
// 5 max/min flag (=1 if calculated)
27
float
fmax
;
// 6 maximum
28
float
fmin
;
// 7 minimum
29
float
av
;
// 8 average
30
float
sig
;
// 9 standard deviation (=-1 if not calculated)
31
float
ihist
;
// 10 (obsolete)
32
float
nsam
;
// 11 pixels per row
33
float
labrec
;
// 12 # records in header
34
float
iangle
;
// 13 flag: tilt angles filled
35
float
phi
;
// 14 tilt angles
36
float
theta
;
// 15
37
float
gamma
;
// 16 (=psi)
38
float
xoff
;
// 17 translation
39
float
yoff
;
// 18
40
float
zoff
;
// 19
41
float
scale
;
// 20 scaling
42
float
labbyt
;
// 21 # bytes in header
43
float
lenbyt
;
// 22 record length in bytes (row length)
44
float
istack
;
// 23 indicates stack of images
45
float
inuse
;
// 24 indicates this image in stack is used (not used)
46
float
maxim
;
// 25 max image in stack used
47
float
imgnum
;
// 26 number of current image
48
float
unused
[2];
// 27-28 (unused)
49
float
kangle
;
// 29 flag: additional angles set
50
float
phi1
;
// 30 additional angles
51
float
theta1
;
// 31
52
float
psi1
;
// 32
53
float
phi2
;
// 33
54
float
theta2
;
// 34
55
float
psi2
;
// 35
56
57
double
fGeo_matrix
[3][3];
// x9 = 72 bytes: Geometric info
58
float
fAngle1
;
// angle info
59
60
float
fr1
;
61
float
fr2
;
// lift up cosine mask parameters
62
64
float
RTflag
;
// 1=RT, 2=FFT(RT)
65
float
Astart
;
66
float
Aend
;
67
float
Ainc
;
68
float
Rsigma
;
// 4*7 = 28 bytes
69
float
Tstart
;
70
float
Tend
;
71
float
Tinc
;
// 4*3 = 12, 12+28 = 40B
72
74
float
weight
;
// For Maximum-Likelihood refinement
75
float
flip
;
// 0=no flipping operation (false), 1=flipping (true)
76
77
char
fNada2
[576];
// empty 700-76-40=624-40-8= 576 bytes
78
79
char
cdat
[12];
// 211-213 creation date
80
char
ctim
[8];
// 214-215 creation time
81
char
ctit
[160];
// 216-255 title
82
} ;
83
84
/************************************************************************
85
@Function: readSPIDER
86
@Description:
87
Reading a SPIDER image file format.
88
@Algorithm:
89
A 3D multi-image format used in electron microscopy.
90
Header size: 1024 bytes (not same as data offset!).
91
Data offset: sizeof(float)*x_size*ceil(1024/x_size)
92
File format extensions: .spi
93
Byte order determination: File type and third dimension values
94
must be less than 256*256.
95
Data type: only float.
96
Transform type: Hermitian
97
The x-dimension contains the x-size
98
of the full transform
99
A multi-image file has a global header followed by a header and data
100
for each sub-image.
101
@Arguments:
102
Bimage* p the image structure.
103
size_t select_img image selection in multi-image file (-1 = all images).
104
@Returns:
105
int error code (<0 means failure).
106
**************************************************************************/
110
int
readSPIDER
(
size_t
select_img);
111
112
/************************************************************************
113
@Function: readSPIDER
114
@Description:
115
Reading a SPIDER image file format in batches.
116
@Arguments:
117
size_t start_img Number of first image in the batch.
118
size_t batch_size Specifies how many sub-images will be read.
119
If batch_size = ALL_IMAGES, then images from `start_img` to the last one will be read.
120
@Returns:
121
int error code (<0 means failure).
122
**************************************************************************/
126
int
readSPIDER
(
size_t
start_img,
size_t
batch_size);
127
128
/************************************************************************
129
@Function: writeSPIDER
130
@Description:
131
Writing a SPIDER image file format.
132
@Algorithm:
133
A 3D image format used in electron microscopy.
134
@Arguments:
135
@Returns:
136
int error code (<0 means failure).
137
**************************************************************************/
141
int
writeSPIDER
(
size_t
select_img =
ALL_IMAGES
,
bool
isStack=
false
,
int
mode
=
WRITE_OVERWRITE
);
142
#endif
SPIDERhead::maxim
float maxim
Definition:
rwSPIDER.cpp:76
SPIDERhead::phi2
float phi2
Definition:
rwSPIDER.cpp:83
SPIDERhead::imami
float imami
Definition:
rwSPIDER.cpp:56
SPIDERhead::Astart
float Astart
Definition:
rwSPIDER.cpp:95
SPIDERhead::lenbyt
float lenbyt
Definition:
rwSPIDER.cpp:73
SPIDERhead::yoff
float yoff
Definition:
rwSPIDER.cpp:69
SPIDERhead::labrec
float labrec
Definition:
rwSPIDER.cpp:63
SPIDERhead::fGeo_matrix
double fGeo_matrix[3][3]
Definition:
rwSPIDER.cpp:87
SPIDERhead::psi1
float psi1
Definition:
rwSPIDER.cpp:82
SPIDERhead::xoff
float xoff
Definition:
rwSPIDER.cpp:68
SPIDERhead::labbyt
float labbyt
Definition:
rwSPIDER.cpp:72
SPIDERhead::ihist
float ihist
Definition:
rwSPIDER.cpp:61
SPIDERhead::fAngle1
float fAngle1
Definition:
rwSPIDER.cpp:88
readSPIDER
int readSPIDER(size_t select_img)
SPIDERhead::scale
float scale
Definition:
rwSPIDER.cpp:71
SPIDERhead::iangle
float iangle
Definition:
rwSPIDER.cpp:64
SPIDERhead::psi2
float psi2
Definition:
rwSPIDER.cpp:85
SPIDERhead::fmin
float fmin
Definition:
rwSPIDER.cpp:58
SPIDERhead::RTflag
float RTflag
Definition:
rwSPIDER.cpp:94
SPIDERhead::ctim
char ctim[8]
Definition:
rwSPIDER.cpp:110
SPIDERhead::Tinc
float Tinc
Definition:
rwSPIDER.cpp:101
WRITE_OVERWRITE
Definition:
xmipp_image_base.h:77
SPIDERhead::fNada2
char fNada2[576]
Definition:
rwSPIDER.cpp:107
SPIDERhead::fr1
float fr1
Definition:
rwSPIDER.cpp:90
SPIDERhead::istack
float istack
Definition:
rwSPIDER.cpp:74
SPIDERhead::nslice
float nslice
Definition:
rwSPIDER.cpp:51
SPIDERhead::Tstart
float Tstart
Definition:
rwSPIDER.cpp:99
SPIDERhead::nhistrec
float nhistrec
Definition:
rwSPIDER.cpp:54
SPIDERhead::phi
float phi
Definition:
rwSPIDER.cpp:65
SPIDERhead::phi1
float phi1
Definition:
rwSPIDER.cpp:80
SPIDERhead::weight
float weight
Definition:
rwSPIDER.cpp:104
SPIDERhead::imgnum
float imgnum
Definition:
rwSPIDER.cpp:77
SPIDERhead::nrow
float nrow
Definition:
rwSPIDER.cpp:52
SPIDERhead::zoff
float zoff
Definition:
rwSPIDER.cpp:70
SPIDERhead::iform
float iform
Definition:
rwSPIDER.cpp:55
SPIDERhead::fmax
float fmax
Definition:
rwSPIDER.cpp:57
SPIDERhead::flip
float flip
Definition:
rwSPIDER.cpp:105
SPIDERhead::kangle
float kangle
Definition:
rwSPIDER.cpp:79
mode
void mode
Definition:
numerical_recipes.cpp:4411
SPIDERhead::sig
float sig
Definition:
rwSPIDER.cpp:60
SPIDERhead::theta2
float theta2
Definition:
rwSPIDER.cpp:84
SPIDERhead::av
float av
Definition:
rwSPIDER.cpp:59
SPIDERhead::fr2
float fr2
Definition:
rwSPIDER.cpp:91
SPIDERhead::Tend
float Tend
Definition:
rwSPIDER.cpp:100
SPIDERhead::theta
float theta
Definition:
rwSPIDER.cpp:66
SPIDERhead::Rsigma
float Rsigma
Definition:
rwSPIDER.cpp:98
SPIDERhead::ctit
char ctit[160]
Definition:
rwSPIDER.cpp:111
ALL_IMAGES
#define ALL_IMAGES
Definition:
xmipp_image_macros.h:37
SPIDERhead::Aend
float Aend
Definition:
rwSPIDER.cpp:96
SPIDERhead::inuse
float inuse
Definition:
rwSPIDER.cpp:75
SPIDERhead::nsam
float nsam
Definition:
rwSPIDER.cpp:62
SPIDERhead::cdat
char cdat[12]
Definition:
rwSPIDER.cpp:109
SPIDERhead::theta1
float theta1
Definition:
rwSPIDER.cpp:81
SPIDERhead::unused
float unused[2]
Definition:
rwSPIDER.cpp:78
SPIDERhead::irec
float irec
Definition:
rwSPIDER.cpp:53
SPIDERhead
Definition:
rwSPIDER.cpp:49
SPIDERhead::gamma
float gamma
Definition:
rwSPIDER.cpp:67
SPIDERhead::Ainc
float Ainc
Definition:
rwSPIDER.cpp:97
writeSPIDER
int writeSPIDER(size_t select_img=ALL_IMAGES, bool isStack=false, int mode=WRITE_OVERWRITE)
Generated by
1.8.13