param.h 1.83 KB
Newer Older
qon's avatar
qon committed
1
2
3
4
5
6
7
#ifndef BIOEM_PARAM_H
#define BIOEM_PARAM_H

#include "defs.h"
#include "map.h"
#include <complex>
#include <math.h>
8
#include <fftw3.h>
qon's avatar
qon committed
9
10
11
12

class bioem_param_device
{
public:
13
// Grids in center assuming equidistance from 0,0
qon's avatar
qon committed
14
15
16
	int maxDisplaceCenter;
	int GridSpaceCenter;
	int NumberPixels;
17
	int NumberFFTPixels1D;
18
	int NtotDist;
qon's avatar
qon committed
19
20
	myfloat_t Ntotpi;
	myfloat_t volu;
21
22
// If to write Probabilities of Angles from Model
	bool writeAngles;
Pilar Cossio's avatar
Pilar Cossio committed
23
        bool writeCrosscor;
qon's avatar
qon committed
24
25
26
27
28
};

class bioem_param
{
public:
29
30
31
	bioem_param();
	~bioem_param();

32
	int readParameters(const char* fileinput);
33
34
	int CalculateGridsParam();
	int CalculateRefCTF();
35
	void PrepareFFTs();
Pilar Cossio's avatar
Pilar Cossio committed
36
        bool doaaradius;
qon's avatar
qon committed
37
38
39

	bioem_param_device param_device;

40
	int FFTMapSize;
41
	int Alignment;
42
43
	mycomplex_t* refCTF;
	myfloat3_t* CtfParam;
44
45
	size_t getRefCtfCount() {return nTotCTFs * FFTMapSize;}
	size_t getCtfParamCount() {return nTotCTFs;}
qon's avatar
qon committed
46

47
	myfloat_t pixelSize;
qon's avatar
qon committed
48
// Grid Points in Euler angles, assuming uniform sampling d_alpha=d_gamma (in 2pi) & cos(beta)=-1,1
49
50
	int angleGridPointsAlpha;
	int angleGridPointsBeta;
51

52
	int numberGridPointsDisplaceCenter;
qon's avatar
qon committed
53
// Grid sampling for the convolution kernel
54
55
56
57
58
59
60
61
62
63
64
65
	//ENVELOPE
	myfloat_t startGridEnvelop;
	int numberGridPointsEnvelop;
	myfloat_t gridEnvelop;
	//CTF=Amp*cos(phase*x)-sqrt(1-Amp**2)*sin(phase*x)
	myfloat_t startGridCTF_phase;
	int numberGridPointsCTF_phase;
	myfloat_t gridCTF_phase;
	myfloat_t startGridCTF_amp;
	int numberGridPointsCTF_amp;
	myfloat_t gridCTF_amp;
	// Others
David Rohr's avatar
David Rohr committed
66
	myfloat3_t* angles;
67
68
	int nTotGridAngles;
	int nTotCTFs;
69

70
71
72
	bool printModel;
	int printModelOrientation;
	int printModelConvolution;
73
74
75
76

	int fft_plans_created;
	myfftw_plan fft_plan_c2c_forward, fft_plan_c2c_backward, fft_plan_r2c_forward, fft_plan_c2r_backward;

77
78
79
	mycomplex_t** fft_scratch_complex;
	myfloat_t** fft_scratch_real;

80
81
	bool dumpMap, loadMap;

82
83
private:
	void releaseFFTPlans();
qon's avatar
qon committed
84
85
86
};

#endif