33#define eman__ctf__h__ 1
41 #define M_PI 3.14159265358979323846f
99 virtual float zero(
int n)
const = 0;
156 float zero(
int n)
const;
186 float g1 = 2.5e6f *
cs * lambda * lambda * lambda;
193 float g2 = 5000.0f * -
defocus * lambda;
200 float gamma = (float) (-2 * M_PI * (g1 * s2 * s2 + g2 * s2));
219 float ns = (float) M_PI / 2 *
noise4 * s;
225 inline float calc_snr(
float g1,
float gamma,
float s)
278 float zero(
int n)
const;
280 inline float stos2(
float s,
float dZ) {
300 inline float df(
float ang)
const {
307 int si=(int)(s/
dsbg);
Ctf is the base class for all CTF model.
virtual void compute_2d_complex(EMData *img, CtfType t, XYData *struct_factor=0)=0
virtual float get_phase() const =0
virtual void from_dict(const Dict &dict)=0
virtual vector< float > compute_1d_fromimage(int size, float ds, EMData *image)=0
virtual vector< float > to_vector() const =0
virtual void from_vector(const vector< float > &vctf)=0
virtual int from_string(const string &ctf)=0
virtual float zero(int n) const =0
virtual void set_phase(float phase)=0
virtual string to_string() const =0
virtual bool equal(const Ctf *ctf1) const =0
virtual void compute_2d_real(EMData *img, CtfType t, XYData *struct_factor=0)=0
virtual vector< float > compute_1d(int size, float ds, CtfType t, XYData *struct_factor=0)=0
virtual Dict to_dict() const =0
virtual void copy_from(const Ctf *new_ctf)=0
Dict is a dictionary to store <string, EMObject> pair.
EMAN1Ctf is the CTF model used in EMAN1.
vector< float > compute_1d_fromimage(int size, float ds, EMData *image)
float calc_snr(float g1, float gamma, float s)
void from_vector(const vector< float > &vctf)
int from_string(const string &ctf)
float calc_noise(float s)
void set_phase(float phase)
void from_dict(const Dict &dict)
float get_defocus() const
float calc_ctf1(float g, float gamma, float s)
void compute_2d_real(EMData *image, CtfType type, XYData *struct_factor=0)
void copy_from(const Ctf *new_ctf)
EMAN1Ctf(const vector< float > &vf)
vector< float > to_vector() const
float get_bfactor() const
void compute_2d_complex(EMData *image, CtfType type, XYData *struct_factor=0)
float calc_gamma(float g1, float g2, float s)
vector< float > compute_1d(int size, float ds, CtfType type, XYData *struct_factor=0)
bool equal(const Ctf *ctf1) const
float calc_amplitude(float gamma)
EMAN2Ctf is the default CTF model used in EMAN2.
vector< float > get_snr()
float df(float ang) const
void set_snr(const vector< float > &vf)
bool equal(const Ctf *ctf1) const
float calc_noise(float s) const
void compute_2d_real(EMData *image, CtfType type, XYData *struct_factor=0)
float stos2(float s, float dZ)
vector< float > background
EMAN2Ctf(const vector< float > &vf)
void from_dict(const Dict &dict)
vector< float > compute_1d_fromimage(int size, float ds, EMData *image)
vector< float > compute_1d(int size, float ds, CtfType type, XYData *struct_factor=0)
void from_vector(const vector< float > &vctf)
vector< float > to_vector() const
void copy_from(const Ctf *new_ctf)
vector< float > get_background()
void compute_2d_complex(EMData *image, CtfType type, XYData *struct_factor=0)
void set_background(const vector< float > &vf)
int from_string(const string &ctf)
void set_phase(float phase)
EMData stores an image's data and defines core image processing routines.
XYData defines a 1D (x,y) data set.
EMData * sqrt() const
return square root of current image
EMData * phase() const
return phase part of a complex image as a real image format