EMAN2
Public Member Functions | Public Attributes | Private Member Functions | List of all members
EMAN::EMAN1Ctf Class Reference

EMAN1Ctf is the CTF model used in EMAN1. More...

#include <ctf.h>

Inheritance diagram for EMAN::EMAN1Ctf:
Inheritance graph
[legend]
Collaboration diagram for EMAN::EMAN1Ctf:
Collaboration graph
[legend]

Public Member Functions

 EMAN1Ctf ()
 
 EMAN1Ctf (const vector< float > &vf)
 
 ~EMAN1Ctf ()
 
vector< float > compute_1d (int size, float ds, CtfType type, XYData *struct_factor=0)
 
vector< float > compute_1d_fromimage (int size, float ds, EMData *image)
 
void compute_2d_real (EMData *image, CtfType type, XYData *struct_factor=0)
 
void compute_2d_complex (EMData *image, CtfType type, XYData *struct_factor=0)
 
int from_string (const string &ctf)
 
string to_string () const
 
void from_dict (const Dict &dict)
 
Dict to_dict () const
 
void from_vector (const vector< float > &vctf)
 
vector< float > to_vector () const
 
void copy_from (const Ctf *new_ctf)
 
bool equal (const Ctf *ctf1) const
 
float zero (int n) const
 
float get_defocus () const
 
float get_bfactor () const
 
float get_phase () const
 
void set_phase (float phase)
 
- Public Member Functions inherited from EMAN::Ctf
virtual ~Ctf ()
 

Public Attributes

float amplitude
 
float ampcont
 
float noise1
 
float noise2
 
float noise3
 
float noise4
 
- Public Attributes inherited from EMAN::Ctf
float defocus
 
float bfactor
 
float voltage
 
float cs
 
float apix
 

Private Member Functions

float calc_amp1 ()
 
float calc_lambda ()
 
float calc_g1 ()
 
float calc_g2 ()
 
float calc_gamma (float g1, float g2, float s)
 
float calc_ctf1 (float g, float gamma, float s)
 
float calc_amplitude (float gamma)
 
float calc_noise (float s)
 
float calc_snr (float g1, float gamma, float s)
 

Additional Inherited Members

- Public Types inherited from EMAN::Ctf
enum  CtfType {
  CTF_AMP , CTF_SIGN , CTF_BACKGROUND , CTF_SNR ,
  CTF_SNR_SMOOTH , CTF_WIENER_FILTER , CTF_TOTAL , CTF_FITREF ,
  CTF_NOISERATIO , CTF_INTEN , CTF_POWEVAL , CTF_ALIFILT ,
  CTF_ABS
}
 

Detailed Description

EMAN1Ctf is the CTF model used in EMAN1.

Definition at line 119 of file ctf.h.

Constructor & Destructor Documentation

◆ EMAN1Ctf() [1/2]

EMAN1Ctf::EMAN1Ctf ( )

Definition at line 39 of file ctf.cpp.

40{
41 defocus = 0;
42 bfactor = 0;
43 amplitude = 0;
44 ampcont = 0;
45 noise1 = 0;
46 noise2 = 0;
47 noise3 = 0;
48 noise4 = 0;
49 voltage = 0;
50 cs = 0;
51 apix = 0;
52}
float cs
Definition: ctf.h:87
float bfactor
Definition: ctf.h:85
float voltage
Definition: ctf.h:86
float apix
Definition: ctf.h:88
float defocus
Definition: ctf.h:84
float amplitude
Definition: ctf.h:124
float noise2
Definition: ctf.h:127
float noise4
Definition: ctf.h:129
float noise1
Definition: ctf.h:126
float ampcont
Definition: ctf.h:125
float noise3
Definition: ctf.h:128

References ampcont, amplitude, EMAN::Ctf::apix, EMAN::Ctf::bfactor, EMAN::Ctf::cs, EMAN::Ctf::defocus, noise1, noise2, noise3, noise4, and EMAN::Ctf::voltage.

◆ EMAN1Ctf() [2/2]

EMAN::EMAN1Ctf::EMAN1Ctf ( const vector< float > &  vf)
inline

Definition at line 136 of file ctf.h.

136{from_vector(vf);} //for unpickling
void from_vector(const vector< float > &vctf)
Definition: ctf.cpp:112

References from_vector().

◆ ~EMAN1Ctf()

EMAN1Ctf::~EMAN1Ctf ( )

Definition at line 55 of file ctf.cpp.

56{
57}

Member Function Documentation

◆ calc_amp1()

float EMAN::EMAN1Ctf::calc_amp1 ( )
inlineprivate

Definition at line 172 of file ctf.h.

173 {
174 return (sqrt(1 - ampcont * ampcont/10000.0f));
175 }
EMData * sqrt() const
return square root of current image

References ampcont, and sqrt().

Referenced by compute_1d(), and compute_2d_complex().

◆ calc_amplitude()

float EMAN::EMAN1Ctf::calc_amplitude ( float  gamma)
inlineprivate

Definition at line 210 of file ctf.h.

211 {
212 float t1 = sqrt(1.0f - ampcont * ampcont/10000.0f) * sin(gamma);
213 float v = amplitude * (t1 + ampcont/100.0f * cos(gamma));
214 return v;
215 }

References ampcont, amplitude, and sqrt().

Referenced by compute_2d_complex().

◆ calc_ctf1()

float EMAN::EMAN1Ctf::calc_ctf1 ( float  g,
float  gamma,
float  s 
)
inlineprivate

Definition at line 204 of file ctf.h.

205 {
206 float r = amplitude * exp(-(bfactor/4.0f * s * s)) * (g * sin(gamma) + ampcont/100.0f * cos(gamma));
207 return r;
208 }

References ampcont, amplitude, and EMAN::Ctf::bfactor.

Referenced by calc_snr(), compute_1d(), and compute_2d_complex().

◆ calc_g1()

float EMAN::EMAN1Ctf::calc_g1 ( )
inlineprivate

Definition at line 183 of file ctf.h.

184 {
185 float lambda = calc_lambda();
186 float g1 = 2.5e6f * cs * lambda * lambda * lambda;
187 return g1;
188 }
float calc_lambda()
Definition: ctf.h:177

References calc_lambda(), and EMAN::Ctf::cs.

Referenced by compute_1d(), and compute_2d_complex().

◆ calc_g2()

float EMAN::EMAN1Ctf::calc_g2 ( )
inlineprivate

Definition at line 190 of file ctf.h.

191 {
192 float lambda = calc_lambda();
193 float g2 = 5000.0f * -defocus * lambda;
194 return g2;
195 }

References calc_lambda(), and EMAN::Ctf::defocus.

Referenced by compute_1d(), and compute_2d_complex().

◆ calc_gamma()

float EMAN::EMAN1Ctf::calc_gamma ( float  g1,
float  g2,
float  s 
)
inlineprivate

Definition at line 197 of file ctf.h.

198 {
199 float s2 = s * s;
200 float gamma = (float) (-2 * M_PI * (g1 * s2 * s2 + g2 * s2));
201 return gamma;
202 }

Referenced by compute_1d(), and compute_2d_complex().

◆ calc_lambda()

float EMAN::EMAN1Ctf::calc_lambda ( )
inlineprivate

Definition at line 177 of file ctf.h.

178 {
179 float lambda = 12.2639f / sqrt(voltage * 1000.0f + 0.97845f * voltage * voltage);
180 return lambda;
181 }

References sqrt(), and EMAN::Ctf::voltage.

Referenced by calc_g1(), and calc_g2().

◆ calc_noise()

float EMAN::EMAN1Ctf::calc_noise ( float  s)
inlineprivate

Definition at line 217 of file ctf.h.

218 {
219 float ns = (float) M_PI / 2 * noise4 * s;
220 float ns2 = ns * ns;
221 float n = noise3 * exp(-ns2 - s * noise2 - sqrt(fabs(s)) * noise1);
222 return n;
223 }

References noise1, noise2, noise3, noise4, and sqrt().

Referenced by calc_snr(), compute_1d(), and compute_2d_complex().

◆ calc_snr()

float EMAN::EMAN1Ctf::calc_snr ( float  g1,
float  gamma,
float  s 
)
inlineprivate

Definition at line 225 of file ctf.h.

226 {
227 float ctf1 = calc_ctf1(g1, gamma, s);
228 float ctf2 = ctf1 * ctf1 / calc_noise(s);
229 return ctf2;
230 }
float calc_noise(float s)
Definition: ctf.h:217
float calc_ctf1(float g, float gamma, float s)
Definition: ctf.h:204

References calc_ctf1(), and calc_noise().

Referenced by compute_1d().

◆ compute_1d()

vector< float > EMAN1Ctf::compute_1d ( int  size,
float  ds,
CtfType  type,
XYData struct_factor = 0 
)
virtual

Implements EMAN::Ctf.

Definition at line 176 of file ctf.cpp.

177{
178 Assert(size > 0);
179
180 float tmp_f1 = sqrt((float) 2) * size / 2;
181 int np = (int) ceil(tmp_f1) + 2;
182 vector < float >r;
183
184 r.resize(np);
185
186// float ds = 1 / (apix * size * CTFOS);
187 float s = 0;
188 float g1 = calc_g1();
189 float g2 = calc_g2();
190 float amp1 = calc_amp1();
191
192 switch (type) {
193 case CTF_AMP:
194 for (int i = 0; i < np; i++) {
195 float gamma = calc_gamma(g1, g2, s);
196 r[i] = calc_ctf1(amp1, gamma, s);
197 s += ds;
198 }
199 break;
200
201 case CTF_ABS:
202 for (int i = 0; i < np; i++) {
203 float gamma = calc_gamma(g1, g2, s);
204 r[i] = fabs(calc_ctf1(amp1, gamma, s));
205 s += ds;
206 }
207 break;
208
209 case CTF_SIGN:
210 for (int i = 0; i < np; i++) {
211 float gamma = calc_gamma(g1, g2, s);
212 r[i] = calc_ctf1(amp1, gamma, s)>0?1.0f:-1.0f;
213 s += ds;
214 }
215 break;
216
217 case CTF_BACKGROUND:
218 for (int i = 0; i < np; i++) {
219 r[i] = calc_noise(s);
220 s += ds;
221 }
222 break;
223
224 case CTF_SNR:
225 case CTF_SNR_SMOOTH:
226// if (!sf) {
227// LOGERR("CTF computation error, no SF found\n");
228// return r;
229// }
230
231 for (int i = 0; i < np; i++) {
232 float gamma = calc_gamma(g1, g2, s);
233 r[i] = calc_snr(amp1, gamma, s);
234 if (s && sf) {
235 r[i] *= sf->get_yatx(s);
236 }
237 s += ds;
238 }
239
240 break;
241
243 if (!sf) {
244 LOGERR("CTF computation error, no SF found\n");
245 return r;
246 }
247
248 for (int i = 0; i < np; i++) {
249 float gamma = calc_gamma(g1, g2, s);
250 r[i] = calc_snr(amp1, gamma, s);
251 if (s && sf) {
252 r[i] *= sf->get_yatx(s);
253 }
254
255 r[i] = 1.0f / (1.0f + 1.0f / r[i]);
256 s += ds;
257 }
258 break;
259
260 case CTF_TOTAL:
261 if (!sf) {
262 LOGERR("CTF computation error, no SF found\n");
263 return r;
264 }
265
266 for (int i = 0; i < np; i++) {
267 float gamma = calc_gamma(g1, g2, s);
268 if (sf) {
269 r[i] = calc_ctf1(amp1, gamma, s);
270 r[i] = r[i] * r[i] * sf->get_yatx(s) + calc_noise(s);
271 }
272 else {
273 r[i] = calc_ctf1(amp1, gamma, s);
274 r[i] = r[i] * r[i] + calc_noise(s);
275 }
276 s += ds;
277 }
278 break;
279 default:
280 break;
281 }
282
283 return r;
284}
@ CTF_TOTAL
Definition: ctf.h:71
@ CTF_SNR_SMOOTH
Definition: ctf.h:69
@ CTF_WIENER_FILTER
Definition: ctf.h:70
@ CTF_AMP
Definition: ctf.h:65
@ CTF_SIGN
Definition: ctf.h:66
@ CTF_BACKGROUND
Definition: ctf.h:67
@ CTF_SNR
Definition: ctf.h:68
@ CTF_ABS
Definition: ctf.h:77
float calc_snr(float g1, float gamma, float s)
Definition: ctf.h:225
float calc_g2()
Definition: ctf.h:190
float calc_amp1()
Definition: ctf.h:172
float calc_g1()
Definition: ctf.h:183
float calc_gamma(float g1, float g2, float s)
Definition: ctf.h:197
#define Assert(s)
Define Assert() function that is effective only when -DDEBUG is used.
Definition: emassert.h:42
#define LOGERR
Definition: log.h:51

References Assert, calc_amp1(), calc_ctf1(), calc_g1(), calc_g2(), calc_gamma(), calc_noise(), calc_snr(), EMAN::Ctf::CTF_ABS, EMAN::Ctf::CTF_AMP, EMAN::Ctf::CTF_BACKGROUND, EMAN::Ctf::CTF_SIGN, EMAN::Ctf::CTF_SNR, EMAN::Ctf::CTF_SNR_SMOOTH, EMAN::Ctf::CTF_TOTAL, EMAN::Ctf::CTF_WIENER_FILTER, EMAN::XYData::get_yatx(), LOGERR, and sqrt().

◆ compute_1d_fromimage()

vector< float > EMAN1Ctf::compute_1d_fromimage ( int  size,
float  ds,
EMData image 
)
virtual

Implements EMAN::Ctf.

Definition at line 293 of file ctf.cpp.

294{
295 vector < float >r;
296
297 printf("Sorry, this function hasn't been implemented for EMAN1Ctf\n");
298
299 int np=size/2;
300 r.resize(np);
301
302 return r;
303}

◆ compute_2d_complex()

void EMAN1Ctf::compute_2d_complex ( EMData image,
CtfType  type,
XYData struct_factor = 0 
)
virtual

Implements EMAN::Ctf.

Definition at line 306 of file ctf.cpp.

307{
308 // Discovered that whomever wrote these apparently never tested them. They do not follow the correct
309 // conventions, and the results are rubbish!
310 throw InvalidParameterException("EMAN1Ctf compute_2d_complex is broken, please use EMAN2Ctf instead");
311
312 if (!image) {
313 LOGERR("image is null. cannot computer 2D complex CTF");
314 return;
315 }
316
317 if (image->is_complex() == false) {
318 LOGERR("compute_2d_complex can only work on complex images");
319 return;
320 }
321
322 int nx = image->get_xsize();
323 int ny = image->get_ysize();
324
325 if (nx != ny + 2) {
326 LOGERR("compute_2d_complex only works on (nx, nx-2) images");
327 return;
328 }
329
330 float ds = 1.0f / (apix * ny);
331 image->to_one();
332
333 float *d = image->get_data();
334 float g1 = calc_g1();
335 float g2 = calc_g2();
336
337 if (type == CTF_BACKGROUND) {
338 for (int y = 0; y < ny; y++) {
339 int ynx = y * nx;
340
341 for (int x = 0; x < nx / 2; x++) {
342 float s = (float) hypot(x, y - ny / 2.0f) * ds;
343 d[x * 2 + ynx] = calc_noise(s);
344 d[x * 2 + ynx + 1] = 0; // The phase is somewhat arbitrary
345 }
346 }
347 }
348 else if (type == CTF_AMP) {
349 for (int y = 0; y < ny; y++) {
350 int ynx = y * nx;
351
352 for (int x = 0; x < nx / 2; x++) {
353 float s = (float)hypot((float) x, (float) y - ny / 2) * ds;
354 float gamma = calc_gamma(g1, g2, s);
355// float v = fabs(calc_amplitude(gamma)); // There should NOT be an fabs() here! 10/30/18
356 float v = calc_amplitude(gamma);
357 d[x * 2 + ynx] = v;
358 d[x * 2 + ynx + 1] = 0;
359 }
360 }
361 }
362 else if (type == CTF_ABS) {
363 for (int y = 0; y < ny; y++) {
364 int ynx = y * nx;
365
366 for (int x = 0; x < nx / 2; x++) {
367 float s = (float)hypot((float) x, (float) y - ny / 2) * ds;
368 float gamma = calc_gamma(g1, g2, s);
369// float v = fabs(calc_amplitude(gamma)); // There should NOT be an fabs() here! 10/30/18
370 float v = calc_amplitude(gamma);
371 d[x * 2 + ynx] = fabs(v);
372 d[x * 2 + ynx + 1] = 0;
373 }
374 }
375 }
376 else if (type == CTF_SIGN) {
377 for (int y = 0; y < ny; y++) {
378 int ynx = y * nx;
379 for (int x = 0; x < nx / 2; x++) {
380 float s = (float)hypot(x, y - ny / 2.0f) * ds;
381 float gamma = calc_gamma(g1, g2, s);
382 float v = calc_amplitude(gamma);
383 d[x * 2 + ynx] = v > 0 ? 1.0f : -1.0f;
384 d[x * 2 + ynx + 1] = 0;
385 }
386 }
387
388 }
389 else if (type == CTF_SNR || type == CTF_SNR_SMOOTH) {
390 float amp1 = calc_amp1();
391
392 for (int y = 0; y < ny; y++) {
393 int ynx = y * nx;
394
395 for (int x = 0; x < nx / 2; x++) {
396
397 float s = (float)hypot(x, y - ny / 2.0f) * ds;
398 float gamma = calc_gamma(g1, g2, s);
399 float f = calc_ctf1(amp1, gamma, s);
400 float noise = calc_noise(s);
401 f = f * f / noise;
402
403 if (s && sf) {
404 f *= sf->get_yatx(s);
405 }
406 d[x * 2 + ynx] *= f;
407 d[x * 2 + ynx + 1] = 0;
408 }
409 }
410 }
411 else if (type == CTF_WIENER_FILTER) {
412 float amp1 = calc_amp1();
413
414 for (int y = 0; y < ny; y++) {
415 int ynx = y * nx;
416
417 for (int x = 0; x < nx / 2; x++) {
418
419 float s = (float)hypot(x, y - ny / 2.0f) * ds;
420 float gamma = calc_gamma(g1, g2, s);
421 float f = calc_ctf1(amp1, gamma, s);
422 float noise = calc_noise(s);
423 f = f * f / noise;
424
425 if (s) {
426 f *= sf->get_yatx(s);
427 }
428 f = 1.0f / (1.0f + 1.0f / f);
429 d[x * 2 + ynx] *= f;
430 d[x * 2 + ynx + 1] = 0;
431 }
432 }
433 }
434 else if (type == CTF_TOTAL) {
435 float amp1 = calc_amp1();
436
437 for (int y = 0; y < ny; y++) {
438 int ynx = y * nx;
439
440 for (int x = 0; x < nx / 2; x++) {
441
442 float s = (float)hypot(x, y - ny / 2.0f) * ds;
443 float gamma = calc_gamma(g1, g2, s);
444 float f = calc_ctf1(amp1, gamma, s);
445 float noise = calc_noise(s);
446 f = f * f;
447
448 if (sf && s) {
449 f *= sf->get_yatx(s);
450 }
451 f+=noise;
452
453 d[x * 2 + ynx] *= f;
454 d[x * 2 + ynx + 1] = 0;
455 }
456 }
457 }
458
459 image->update();
460}
float calc_amplitude(float gamma)
Definition: ctf.h:210
#define InvalidParameterException(desc)
Definition: exception.h:361
#define y(i, j)
Definition: projector.cpp:1516
#define x(i)
Definition: projector.cpp:1517

References EMAN::Ctf::apix, calc_amp1(), calc_amplitude(), calc_ctf1(), calc_g1(), calc_g2(), calc_gamma(), calc_noise(), EMAN::Ctf::CTF_ABS, EMAN::Ctf::CTF_AMP, EMAN::Ctf::CTF_BACKGROUND, EMAN::Ctf::CTF_SIGN, EMAN::Ctf::CTF_SNR, EMAN::Ctf::CTF_SNR_SMOOTH, EMAN::Ctf::CTF_TOTAL, EMAN::Ctf::CTF_WIENER_FILTER, EMAN::XYData::get_yatx(), InvalidParameterException, LOGERR, x, and y.

◆ compute_2d_real()

void EMAN1Ctf::compute_2d_real ( EMData image,
CtfType  type,
XYData struct_factor = 0 
)
virtual

Implements EMAN::Ctf.

Definition at line 287 of file ctf.cpp.

288{
289
290
291}

◆ copy_from()

void EMAN1Ctf::copy_from ( const Ctf new_ctf)
virtual

Implements EMAN::Ctf.

Definition at line 157 of file ctf.cpp.

158{
159 if (new_ctf) {
160 const EMAN1Ctf *c = static_cast<const EMAN1Ctf *>(new_ctf);
161 defocus = c->defocus;
162 bfactor = c->bfactor;
163 amplitude = c->amplitude;
164 ampcont = c->ampcont;
165 noise1 = c->noise1;
166 noise2 = c->noise2;
167 noise3 = c->noise3;
168 noise4 = c->noise4;
169 voltage = c->voltage;
170 cs = c->cs;
171 apix = c->apix;
172 }
173}
EMAN1Ctf is the CTF model used in EMAN1.
Definition: ctf.h:120

References ampcont, amplitude, EMAN::Ctf::apix, EMAN::Ctf::bfactor, EMAN::Ctf::cs, EMAN::Ctf::defocus, noise1, noise2, noise3, noise4, and EMAN::Ctf::voltage.

◆ equal()

bool EMAN1Ctf::equal ( const Ctf ctf1) const
virtual

Implements EMAN::Ctf.

Definition at line 464 of file ctf.cpp.

465{
466 if (ctf1) {
467 const EMAN1Ctf *c = static_cast<const EMAN1Ctf *>(ctf1);
468 if (defocus == c->defocus &&
469 bfactor == c->bfactor &&
470 amplitude == c->amplitude &&
471 ampcont == c->ampcont &&
472 noise1 == c->noise1 &&
473 noise2 == c->noise2 &&
474 noise3 == c->noise3 &&
475 noise4 == c->noise4 && voltage == c->voltage && cs == c->cs && apix == c->apix) {
476 return true;
477 }
478 }
479 return false;
480}

References ampcont, amplitude, EMAN::Ctf::apix, EMAN::Ctf::bfactor, EMAN::Ctf::cs, EMAN::Ctf::defocus, noise1, noise2, noise3, noise4, and EMAN::Ctf::voltage.

◆ from_dict()

void EMAN1Ctf::from_dict ( const Dict dict)
virtual

Implements EMAN::Ctf.

Definition at line 79 of file ctf.cpp.

80{
81 defocus = dict["defocus"];
82 bfactor = dict["bfactor"];
83 amplitude = dict["amplitude"];
84 ampcont = dict["ampcont"];
85 noise1 = dict["noise1"];
86 noise2 = dict["noise2"];
87 noise3 = dict["noise3"];
88 noise4 = dict["noise4"];
89 voltage = dict["voltage"];
90 cs = dict["cs"];
91 apix = dict["apix"];
92}

References ampcont, amplitude, EMAN::Ctf::apix, EMAN::Ctf::bfactor, EMAN::Ctf::cs, EMAN::Ctf::defocus, noise1, noise2, noise3, noise4, and EMAN::Ctf::voltage.

◆ from_string()

int EMAN1Ctf::from_string ( const string &  ctf)
virtual

Implements EMAN::Ctf.

Definition at line 60 of file ctf.cpp.

61{
62 Assert(ctf != "");
63 char type;
64 int pos;
65 int i = sscanf(ctf.c_str(), "%c%f %f %f %f %f %f %f %f %f %f %f%n",
66 &type,&defocus, &bfactor, &amplitude, &ampcont, &noise1,
67 &noise2, &noise3, &noise4, &voltage, &cs, &apix, &pos);
68 defocus*=-1.0; // different convention in EMAN2
69 ampcont*=100.0; // different convention in EMAN2
70 bfactor*=4.0; // again
71 if (pos==-1) {
72 const char *s=ctf.c_str();
73 throw InvalidValueException(s," Invalid CTF string");
74 }
75
76 return 0;
77}
#define InvalidValueException(val, desc)
Definition: exception.h:285

References ampcont, amplitude, EMAN::Ctf::apix, Assert, EMAN::Ctf::bfactor, EMAN::Ctf::cs, EMAN::Ctf::defocus, InvalidValueException, noise1, noise2, noise3, noise4, and EMAN::Ctf::voltage.

◆ from_vector()

void EMAN1Ctf::from_vector ( const vector< float > &  vctf)
virtual

Implements EMAN::Ctf.

Definition at line 112 of file ctf.cpp.

113{
114 defocus = vctf[0];
115 bfactor = vctf[1];
116 amplitude = vctf[2];
117 ampcont = vctf[3];
118 noise1 = vctf[4];
119 noise2 = vctf[5];
120 noise3 = vctf[6];
121 noise4 = vctf[7];
122 voltage = vctf[8];
123 cs = vctf[9];
124 apix = vctf[10];
125}

References ampcont, amplitude, EMAN::Ctf::apix, EMAN::Ctf::bfactor, EMAN::Ctf::cs, EMAN::Ctf::defocus, noise1, noise2, noise3, noise4, and EMAN::Ctf::voltage.

Referenced by EMAN1Ctf(), and get_ctf().

◆ get_bfactor()

float EMAN::EMAN1Ctf::get_bfactor ( ) const
inline

Definition at line 162 of file ctf.h.

163 {
164 return bfactor;
165 }

References EMAN::Ctf::bfactor.

◆ get_defocus()

float EMAN::EMAN1Ctf::get_defocus ( ) const
inline

Definition at line 158 of file ctf.h.

159 {
160 return defocus;
161 }

References EMAN::Ctf::defocus.

◆ get_phase()

float EMAN::EMAN1Ctf::get_phase ( ) const
inlinevirtual

Implements EMAN::Ctf.

Definition at line 167 of file ctf.h.

167{ return 0.0; }

◆ set_phase()

void EMAN::EMAN1Ctf::set_phase ( float  phase)
inlinevirtual

Implements EMAN::Ctf.

Definition at line 169 of file ctf.h.

169{ }

◆ to_dict()

Dict EMAN1Ctf::to_dict ( ) const
virtual

Implements EMAN::Ctf.

Definition at line 94 of file ctf.cpp.

95{
96 Dict dict;
97 dict["defocus"] = defocus;
98 dict["bfactor"] = bfactor;
99 dict["amplitude"] = amplitude;
100 dict["ampcont"] = ampcont;
101 dict["noise1"] = noise1;
102 dict["noise2"] = noise2;
103 dict["noise3"] = noise3;
104 dict["noise4"] = noise4;
105 dict["voltage"] = voltage;
106 dict["cs"] = cs;
107 dict["apix"] = apix;
108
109 return dict;
110}
Dict is a dictionary to store <string, EMObject> pair.
Definition: emobject.h:385

References ampcont, amplitude, EMAN::Ctf::apix, EMAN::Ctf::bfactor, EMAN::Ctf::cs, EMAN::Ctf::defocus, noise1, noise2, noise3, noise4, and EMAN::Ctf::voltage.

◆ to_string()

string EMAN1Ctf::to_string ( ) const
virtual

Implements EMAN::Ctf.

Definition at line 147 of file ctf.cpp.

148{
149 char ctf[1024];
150 sprintf(ctf, "O%1.10g %1.10g %1.10g %1.10g %1.10g %1.10g %1.10g %1.10g %1.10g %1.10g %1.10g",
152 apix);
153
154 return string(ctf);
155}

References ampcont, amplitude, EMAN::Ctf::apix, EMAN::Ctf::bfactor, EMAN::Ctf::cs, EMAN::Ctf::defocus, noise1, noise2, noise3, noise4, and EMAN::Ctf::voltage.

◆ to_vector()

vector< float > EMAN1Ctf::to_vector ( ) const
virtual

Implements EMAN::Ctf.

Definition at line 127 of file ctf.cpp.

128{
129 vector<float> vctf;
130
131 vctf.push_back(defocus);
132 vctf.push_back(bfactor);
133 vctf.push_back(amplitude);
134 vctf.push_back(ampcont);
135 vctf.push_back(noise1);
136 vctf.push_back(noise2);
137 vctf.push_back(noise3);
138 vctf.push_back(noise4);
139 vctf.push_back(voltage);
140 vctf.push_back(cs);
141 vctf.push_back(apix);
142
143 return vctf;
144}

References ampcont, amplitude, EMAN::Ctf::apix, EMAN::Ctf::bfactor, EMAN::Ctf::cs, EMAN::Ctf::defocus, noise1, noise2, noise3, noise4, and EMAN::Ctf::voltage.

Referenced by EMAN::MrcIO::read_mrc_header().

◆ zero()

float EMAN1Ctf::zero ( int  n) const
virtual

Implements EMAN::Ctf.

Definition at line 482 of file ctf.cpp.

482{ return 0; }

Member Data Documentation

◆ ampcont

float EMAN::EMAN1Ctf::ampcont

◆ amplitude

float EMAN::EMAN1Ctf::amplitude

◆ noise1

float EMAN::EMAN1Ctf::noise1

◆ noise2

float EMAN::EMAN1Ctf::noise2

◆ noise3

float EMAN::EMAN1Ctf::noise3

◆ noise4

float EMAN::EMAN1Ctf::noise4

The documentation for this class was generated from the following files: