param.h 1.79 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
13
14
15

class bioem_param_device
{
public:
	int maxDisplaceCenter;
	int GridSpaceCenter;
	int NumberPixels;
16
	int NumberFFTPixels1D;
17
	int NtotDist;
qon's avatar
qon committed
18
19
20
21
22
23
24
	myfloat_t Ntotpi;
	myfloat_t volu;
};

class bioem_param
{
public:
25
26
27
28
29
30
31
	bioem_param();
	~bioem_param();

	int readParameters();
	int CalculateGridsParam();
	int CalculateRefCTF();
	int InitializeArrays();
qon's avatar
qon committed
32
33
34

	bioem_param_device param_device;

35
	int FFTMapSize;
36
	int Alignment;
37
38
	mycomplex_t* refCTF;
	myfloat3_t* CtfParam;
qon's avatar
qon committed
39
40

// File names
41
42
	const char* fileinput;
	char logFile;
qon's avatar
qon committed
43
// If to write Probabilities of Angles from Model
44
45
46
	bool writeAngles;
	//int NumberPixels; //in device class
	myfloat_t pixelSize;
qon's avatar
qon committed
47
// Grid Points in Euler angles, assuming uniform sampling d_alpha=d_gamma (in 2pi) & cos(beta)=-1,1
48
49
	int angleGridPointsAlpha;
	int angleGridPointsBeta;
qon's avatar
qon committed
50
// Grids in center assuming equidistance from 0,0
51
52
	//int maxDisplaceCenter; //in device class
	int numberGridPointsDisplaceCenter;
qon's avatar
qon committed
53
54
	//int GridSpaceCenter; //in device class
// Grid sampling for the convolution kernel
55
56
57
58
59
60
61
62
63
64
65
66
67
	//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
	//myfloat_t volu;//in device class
David Rohr's avatar
David Rohr committed
68
	myfloat3_t* angles;
69
70
71
	int nTotGridAngles;
	int nTotCTFs;
	//myfloat_t Ntotpi;//in device class
72
73
74
75

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

76
77
78
	const char* filemap;
	bool dumpMap, loadMap;

79
80
private:
	void releaseFFTPlans();
qon's avatar
qon committed
81
82
83
};

#endif