bioem.h 2.4 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   < BioEM software for Bayesian inference of Electron Microscopy images>
   Copyright (C) 2016 Pilar Cossio, David Rohr, Fabio Baruffa, Markus Rampp, 
        Volker Lindenstruth and Gerhard Hummer.
   Max Planck Institute of Biophysics, Frankfurt, Germany.

   See license statement for terms of distribution.

   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

11
12
13
14
15
16
17
18
19
20
21
#ifndef BIOEM_H
#define BIOEM_H

#include "defs.h"
#include "bioem.h"
#include "model.h"
#include "map.h"
#include "param.h"

class bioem
{
22
	friend class bioem_RefMap;
David Rohr's avatar
David Rohr committed
23
	friend class bioem_Probability;
24

25
public:
26
27
28
29
	bioem();
	virtual ~bioem();

	int configure(int ac, char* av[]);
30
31
	void cleanup(); //Cleanup everything happening during configure

32
33
34
35
	int precalculate(); // Is it better to pass directly the input File names?
	int dopreCalCrossCorrelation(int iRefMap, int iRefMapLocal);
	int run();
	int doProjections(int iMap);
36
	int createConvolutedProjectionMap(int iOreint, int iMap, mycomplex_t* lproj, myfloat_t* Mapconv, mycomplex_t* localmultFFT, myfloat_t& sumC, myfloat_t& sumsquareC);
37

38
	virtual int compareRefMaps(int iOrient, int iConv, myfloat_t amp, myfloat_t pha, myfloat_t env, const myfloat_t* conv_map, mycomplex_t* localmultFFT, myfloat_t sumC, myfloat_t sumsquareC, const int startMap = 0);
39

40
41
42
	virtual void* malloc_device_host(size_t size);
	virtual void free_device_host(void* ptr);

43
	int createProjection(int iMap, mycomplex_t* map);
44
	int calcross_cor(myfloat_t* localmap, myfloat_t& sum, myfloat_t& sumsquare);
45
	void calculateCCFFT(int iMap, int iOrient, int iConv, myfloat_t amp, myfloat_t pha, myfloat_t env, myfloat_t sumC, myfloat_t sumsquareC, mycomplex_t* localConvFFT, mycomplex_t* localCCT, myfloat_t* lCC);
46

47
	bioem_Probability pProb;
48

Pilar Cossio's avatar
Pilar Cossio committed
49
50
51
52
        string OutfileName;
	bool yesoutfilename;


53
54
55
56
57
protected:
	virtual int deviceInit();
	virtual int deviceStartRun();
	virtual int deviceFinishRun();

58
59
60
61
62
63
	bioem_param param;
	bioem_model Model;
	bioem_RefMap RefMap;

	int nReferenceMaps;			//Maps in memory at a time
	int nReferenceMapsTotal;	//Maps in total
64

65
66
	int nProjectionMaps;		//Maps in memory at a time
	int nProjectionMapsTotal;	//Maps in total
67

68
69
70
	int FFTAlgo;				//Use the FFT Algorithm (Default 1)
	int DebugOutput;			//Debug Output Level (Default 2)
	int nProjectionsAtOnce;		//Number of projections to do at once via OpenMP (Default 1)
71
72
73
};

#endif