Bsoft function
img_ctf_apply
Source:
src/img/img_ctf.c
Description:
Applies or corrects for the contrast transfer function (CTF).
Algorithm:
The actions for this funtion are:
1 flip phase (multiply by the sign of the CTF)
2 apply a CTF (multiply with the CTF)
3 correct for the CTF: ctf/(ctf^2 + wiener_factor)
4 correct for the CTF: env*ctf/((env*ctf)^2 + noise^2)
5 correct for the CTF with baseline: ctf/(ctf^2*noise^2 + wiener_factor)
6 correct for the CTF with baseline: 1/(ctf*noise + sign*wiener_factor)
Functions:
angle = atan(y/x)
s2 = x*x + y*y
defocus_average = (defocus_max + defocus_min)/2
defocus_deviation = (defocus_max - defocus_min)/2
defocus = defocus_average + defocus_deviation*cos(2*(angle - astigmatism_angle))
phase = 0.5*PI*lambda*lambda*lambda*Cs*s2*s2 - PI*lambda*defocus*s2;
phi_fac = sqrt(1-amp_fac*amp_fac)
CTF = amp_fac*cos(phase) - phi_fac*sin(phase)
Note: Defocus is positive for underfocus and negative for overfocus.
All of the parameters required to calculate the CTF, envelope and baseline
functions are embedded in the CTF structure.
Arguments:
| Bimage* p | image (modified).
|
| CTF* em_ctf | CTF parameter structure.
|
| float wiener | Wiener factor (fraction).
|
| int action | action to be taken.
|
| float lores | low resolution limit.
|
| float hires | high resolution limit.
|
Returns:
int 0, <0 on error.
Prototype:
int img_ctf_apply(Bimage* p, CTF* em_ctf, float wiener, int action, float lores, float hires)
Functions used:
bfree
check_defocus_and_Cs
ctf_baseline_calculate
ctf_envelope_calculate
electron_wavelength
generate_baseline_equation
generate_envelope_equation
img_fft
Other objects included:
struct Bimage
struct Bmarker
class Complex
constant M_PI
Generated by bdoc.pl on Mon Jun 15 11:47:47 2009
Back to the Bsoft home