param.h 1.54 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;
qon's avatar
qon committed
23 24 25 26 27
};

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

31
	int readParameters(const char* fileinput);
32 33
	int CalculateGridsParam();
	int CalculateRefCTF();
34
	void PrepareFFTs();
qon's avatar
qon committed
35 36 37

	bioem_param_device param_device;

38
	int FFTMapSize;
39
	int Alignment;
40 41
	mycomplex_t* refCTF;
	myfloat3_t* CtfParam;
qon's avatar
qon committed
42

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

48
	int numberGridPointsDisplaceCenter;
qon's avatar
qon committed
49
// Grid sampling for the convolution kernel
50 51 52 53 54 55 56 57 58 59 60 61
	//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
62
	myfloat3_t* angles;
63 64
	int nTotGridAngles;
	int nTotCTFs;
65 66 67 68

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

69 70
	bool dumpMap, loadMap;

71 72
private:
	void releaseFFTPlans();
qon's avatar
qon committed
73 74 75
};

#endif