![]() |
Bsoft 2.1.4
Bernard's software package
|
Header file for CTF (contrast transfer function) functions. More...
Functions | |
Bimage * | img_ctf_radial_average (Bimage *p, long n, CTFparam &em_ctf) |
Calculates the power spectrum radial average corrected for astigmatism. More... | |
Bimage * | img_ctf_fit_prepare (Bimage *p, double sigma) |
Bimage * | img_ctf_fit_prepare (Bimage *p, long n, double sigma) |
double | img_ctf_fit (Bimage *p, long n, CTFparam &em_ctf, double lores, double hires, double def_start=1e3, double def_end=2e5, double def_inc=1e3, int flag=0) |
double | img_ctf_isotropy (Bimage *p, long n, double lores, double hires) |
double | img_ctf_fit_baseline (Bimage *p, long n, CTFparam &em_ctf, double lores, double hires) |
Fits only the baseline for a given CTF. More... | |
double | img_ctf_fit_envelope (Bimage *p, long n, CTFparam &em_ctf, double lores, double hires) |
Fits only the envelope for a given CTF. More... | |
double | ctf_find_defocus (vector< double > &v, CTFparam &em_ctf, long rmin, long rmax, double step_size, double def_start, double def_end, double def_inc) |
double | img_ctf_find_defocus (Bimage *p, long n, CTFparam &em_ctf, double lores, double hires, double def_start=1e3, double def_end=2e5, double def_inc=1e3) |
Searches for the defocus based on correlation. More... | |
double | img_ctf_fit_astigmatism (Bimage *p, long n, CTFparam &em_ctf, double lores, double hires) |
Fits the astigmatism with a given defocus, baseline and envelope. More... | |
vector< map< pair< long, long >, double > > | img_aberration_phase_fit (Bimage *p, double lores, double hires, int flag=0, long iter=0) |
vector< map< pair< long, long >, double > > | img_aberration_phase_fit (Bimage *p, double lores, double hires, vector< map< pair< long, long >, double > > &win, int flag, long iter) |
Fits a phase image with aberration terms. More... | |
double | img_ctf_fit_aberration (Bimage *p, long n, CTFparam &em_ctf, double lores, double hires) |
double | img_water_ring_index (Bimage *p, long img_num, CTFparam &em_ctf) |
Calculates the water ring index from a power spectrum. More... | |
double | img_water_ring_index (Bimage *prad) |
Calculates the water ring index from a power spectrum. More... | |
vector< double > | img_fit_water_ring (Bimage *p) |
Header file for CTF (contrast transfer function) functions.
double ctf_find_defocus | ( | vector< double > & | v, |
CTFparam & | em_ctf, | ||
long | rmin, | ||
long | rmax, | ||
double | step_size, | ||
double | def_start, | ||
double | def_end, | ||
double | def_inc | ||
) |
vector< map< pair< long, long >, double > > img_aberration_phase_fit | ( | Bimage * | p, |
double | lores, | ||
double | hires, | ||
int | flag = 0 , |
||
long | iter = 0 |
||
) |
vector< map< pair< long, long >, double > > img_aberration_phase_fit | ( | Bimage * | p, |
double | lores, | ||
double | hires, | ||
vector< map< pair< long, long >, double > > & | win, | ||
int | flag, | ||
long | iter | ||
) |
Fits a phase image with aberration terms.
*p | phase image. |
lores | low resolution limit. |
hires | high resolution limit. |
win | initial aberration parameters. |
flag | 0=full, 1=odd, 2=even. |
iter | maximum number of iterations. |
double img_ctf_find_defocus | ( | Bimage * | p, |
long | n, | ||
CTFparam & | em_ctf, | ||
double | lores, | ||
double | hires, | ||
double | def_start, | ||
double | def_end, | ||
double | def_inc | ||
) |
Searches for the defocus based on correlation.
*p | image structure. |
n | sub-image number. |
&em_ctf | CTF parameter structure. |
lores | low resolution limit. |
hires | high resolution limit. |
def_start | defocus search start (default 1e3). |
def_end | defocus search end (default 2e5). |
def_inc | defocus search increment (default 1e3). |
A radial power spectrum is calculated. A range of defocus values is tested (1000-200000 angstrom, 0.1-20 um), and the best fitting value accepted. The new parameters are written into the CTFparam structure.
double img_ctf_fit | ( | Bimage * | p, |
long | n, | ||
CTFparam & | em_ctf, | ||
double | lores, | ||
double | hires, | ||
double | def_start = 1e3 , |
||
double | def_end = 2e5 , |
||
double | def_inc = 1e3 , |
||
int | flag = 0 |
||
) |
double img_ctf_fit_astigmatism | ( | Bimage * | p, |
long | n, | ||
CTFparam & | em_ctf, | ||
double | lores, | ||
double | hires | ||
) |
Fits the astigmatism with a given defocus, baseline and envelope.
*p | image structure. |
n | sub-image number. |
&em_ctf | CTF parameter structure. |
lores | low resolution limit. |
hires | high resolution limit |
A radial power spectrum is calculated and the baseline subtracted. The defocus deviation starts from a low value to get an estimate of the astigmatism angle. The defocus deviation is modified nased on the direction of improvements in the fit, at each iteration narrowing the angular search for the astigmatism angle. The new parameters are written into the CTFparam structure.
Fits only the baseline for a given CTF.
*p | image structure. |
n | sub-image number. |
&em_ctf | CTF parameter structure. |
lores | low resolution limit. |
hires | high resolution limit |
A radial power spectrum is calculated incorporating astigmatism. The baseline of the required type is fit. The new parameters are written into the CTFparam structure.
Fits only the envelope for a given CTF.
*p | image structure. |
n | sub-image number. |
*em_ctf | CTF parameter structure. |
lores | low resolution limit. |
hires | high resolution limit |
A radial power spectrum is calculated incorporating astigmatism. The envelope is fit. The new parameters are written into the CTFparam structure.
double img_ctf_isotropy | ( | Bimage * | p, |
long | n, | ||
double | lores, | ||
double | hires | ||
) |
Calculates the power spectrum radial average corrected for astigmatism.
*p | image structure. |
n | sub-image number. |
&em_ctf | CTF parameter structure. |
A power spectrum with its origin at the center. Functions: angle = atan(y/x) - astigmatism_angle s2 = reciprocal space distance squared defocus_min = defocus_avg - defocus_dev defocus_max = defocus_avg + defocus_dev smin2 = 1 - defocus_dev/defocus_avg smax2 = 1 + defocus_dev/defocus_avg radius = sqrt(2*s2*(smax2*cos(angle)*cos(angle)+ smin2*sin(angle)*sin(angle))/(smax2+smin2)) The radial average is returned as a new 1D image.
vector< double > img_fit_water_ring | ( | Bimage * | p | ) |
Calculates the water ring index from a power spectrum.
*p | power spectrum. |
img_num | sub-image number. |
&em_ctf | CTF parameter structure. |
A radial power spectrum is calculated. The the water ring index is defined as: wri = wp/b - 1 where wp is the intensity at s=0.26 (3.8 Å) and b is the background. The background is estimated as the average of sections before and after the water peak: b1 between s=0.1 and s=0.2 b2 between s=0.3 and s=0.4
double img_water_ring_index | ( | Bimage * | prad | ) |
Calculates the water ring index from a power spectrum.
*prad | radial power spectrum. |
The the water ring index is defined as: wri = wp/b - 1 where wp is the average intensity between 0.2 and 0.3, covering the peak at s=0.26 (3.8 Å). The background, b, is estimated as the average of sections before and after the water peak: b1 between s=0.1 and s=0.2 b2 between s=0.3 and s=0.4