aboutsummaryrefslogtreecommitdiff
path: root/src/mrc.h
blob: ff5f0f790d566891a7f64bdb834e7f8e3695c305 (plain)
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*
 * mrc.h
 *
 * Read the MRC tomography format
 *
 * (c) 2007 Thomas White <taw27@cam.ac.uk>
 *
 *  dtr - Diffraction Tomography Reconstruction
 *
 */


#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#ifndef MRC_H
#define MRC_H

#include <stdint.h>

#include "control.h"

typedef struct struct_mrcheader {
	
	int32_t		nx;
	int32_t		ny;
	int32_t		nz;
	int32_t		mode;
	int32_t		nxstart;
	int32_t		nystart;
	int32_t		nzstart;
	int32_t		mx;
	int32_t		my;
	int32_t		mz;
	float		xlen;
	float		ylen;
	float		zlen;
	float		alpha;
	float		beta;
	float		gamma;
	int32_t		mapc;
	int32_t		mapr;
	int32_t		maps;
	float		amin;
	float		amax;
	float		amean;
	int16_t		ispg;		/* Space group number */
	int16_t		nsymbt;
	int32_t		next;
	int16_t		dvid;
	char		extra[30];
	int16_t		numintegers;
	int16_t		numfloats;
	int16_t		sub;
	int16_t		zfac;
	float		min2;
	float		max2;
	float		min3;	
	float		max3;	
	float		min4;	
	float		max4;
	int16_t		idtype;
	int16_t		lens;
	int16_t		nd1;
	int16_t		nd2;
	int16_t		vd1;
	int16_t		vd2;
	float		tiltangles[9];
	float		zorg;
	float		xorg;
	float		yorg;
	int32_t		nlabl;
	char		data[10][80];
	
} MRCHeader;

typedef struct struct_mrcextheader {

	float		a_tilt;
	float		b_tilt;
	float		x_stage;
	float		y_stage;
	float		z_stage;
	float		x_shift;
	float		y_shift;
	float		defocus;
	float		exp_time;
	float		mean_int;
	float		tilt_axis;
	float		pixel_size;
	float		magnification;
	float		mic_type;
	float		gun_type;
	float		d_number;
	float		voltage;
	float		focus_spread;
	float		mtf;
	float		df_start;
	float		focus_step;
	float		dac_setting;
	float		cs;
	float		semi_conv;
	float		info_limit;
	float		num_images;
	float		num_in_series;
	float		coma1;
	float		coma2;
	float		astig21;
	float		astig22;
	float		astig31;
	float		astig32;
	float		cam_type;
	float		cam_pos;
	float		padding[64];	/* Need to guarantee that reading an extended header (of any size)
						will never write beyond the boundary of this structure... */
	
} MRCExtHeader;

extern int mrc_read(ControlContext *ctx);
extern unsigned int mrc_is_mrcfile(const char *filename);

#endif	/* MRC_H */