param.h 1.88 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;
19
      
qon's avatar
qon committed
20
21
	myfloat_t Ntotpi;
	myfloat_t volu;
22
23
// If to write Probabilities of Angles from Model
	bool writeAngles;
24
        bool writeCC;
Pilar Cossio's avatar
Pilar Cossio committed
25
26
        bool flipped;
	int CCdisplace;
27

qon's avatar
qon committed
28
29
30
31
32
};

class bioem_param
{
public:
33
34
35
	bioem_param();
	~bioem_param();

36
	int readParameters(const char* fileinput);
37
38
	int CalculateGridsParam();
	int CalculateRefCTF();
39
	void PrepareFFTs();
Pilar Cossio's avatar
Pilar Cossio committed
40
        bool doaaradius;
qon's avatar
qon committed
41
42
43

	bioem_param_device param_device;

44
	int FFTMapSize;
45
	int Alignment;
46
47
	mycomplex_t* refCTF;
	myfloat3_t* CtfParam;
48
49
	size_t getRefCtfCount() {return nTotCTFs * FFTMapSize;}
	size_t getCtfParamCount() {return nTotCTFs;}
qon's avatar
qon committed
50

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

56
	int numberGridPointsDisplaceCenter;
qon's avatar
qon committed
57
// Grid sampling for the convolution kernel
58
59
60
61
62
63
64
65
66
67
68
69
	//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
70
	myfloat3_t* angles;
71
72
	int nTotGridAngles;
	int nTotCTFs;
73
	int nTotCC;
74

75
76
77
	bool printModel;
	int printModelOrientation;
	int printModelConvolution;
78
79
80
81

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

82
83
84
	mycomplex_t** fft_scratch_complex;
	myfloat_t** fft_scratch_real;

85
86
	bool dumpMap, loadMap;

87
88
private:
	void releaseFFTPlans();
qon's avatar
qon committed
89
90
91
};

#endif