## Bsoft program

# bctf

### Usage: bctf [options] input.star/input.img [input2.star/output.img]

Applies, determines or corrects for the CTF (contrast transfer function) in electron micrographs.

### Actions:

-action correct | Action: 1=flip, 2=apply, 3=correct, 4=wienerfilter,
| 5=baseline, 6=baseline2, 7=baseflip, 8=basecorrect,
| 11=prepare, 12=fit, 13=prepfit (default 0=none).
-invertaxis | Inverts the tilt axis to correct for improper setup.
-filter | Filter extremes before doing anything with the image.
-background | Correct background after applying CTF (default not).
-toparticle | Transfer micrograph CTF parameters to particle records (default not).
-ctf 512,512,2 | Generate a CTF image of this size with flag: 1=center, 2=power, 3=both.

### Parameters:

-verbose 7 | Verbosity of output.
-datatype u | Force writing of a new data type.
-mgpath dir/subdir | Set the micrograph file paths.
-pspath dir/subdir | Set the power spectrum file paths.
-partpath dir/subdir | Set the particle file paths.
-tile 1024,1024,1 | Size of power spectrum generated during preparation (default 512,512,1).
-micrograph | Use micrograph file given in parameter file instead of particle file.
-frames | Use micrograph frames file given in parameter file instead of particle file.
-sampling 1.5,1.5,1.5 | Sampling (angstrom/pixel, a single value sets all three).
-resolution 27.5,125.3 | Resolution limits for CTF determination and application (default 0.1,1e6).
-wiener 0.15 | Wiener factor for CTF correction (default 0.2).
-Defocus 1.2,1.0,47 | Defocus average & deviation, and astigmatism angle (default 1 um, 0 um, 0).
-Astigmatism 0.3,-34 | Set defocus deviation and astigmatism angle (um, degrees).
-axis 74.7 | Tilt axis angle relative to x-axis (default 0 or from parameter file).
-tilt 15 | Tilt angle (default from parameter file).
-Volt 100 | Set the acceleration voltage (default 120 kV).
-Amplitude 0.07 | Set the amplitude contrast (default 0.07).
-Cs 2.0 | Set the spherical aberration, Cs (default 2.0 mm).
-Cc 2.0 | Set the chromatic aberration, Cc (default 2.0 mm).
-alpha 0.15 | Set the illumination half-angle (default 0.1 milliradians).
-energyspread 0.9 | Set the effective energy spread (default 1 eV).
-basetype 2 | Baseline type: (default 1)
| Type 1: Polynomial with 5 coefficients.
| Type 2: Double Gaussian with 5 coefficients.
| Type 3: EMAN style with 4 coefficients.
| Types 4-6: as above but with a gaussian bump.
-baseline | 1,1.5,-2.6,12.9,30,118 Baseline type and 4 or 5 coefficients: (default 1,0,0,0,0)
-envtype 3 | Envelope type: (default 4)
| Type 1: Single gaussian (2 coefficients).
| Type 2: Single gaussian with constant (3 coefficients).
| Type 3: Double gaussian (4 coefficients).
| Type 4: Double gaussian with constant (5 coefficients).
-envelope | 28,-563,0.78,-215 Envelope coefficients: Double gaussian with 4 coefficients (default 1,-10,0,0).
| Fitting parameters:
-Range 0.6,3.5,0.2 | Defocus minimum, maximum and increment for fitting (default 0.1,20,0.1 um).

### Output:

-output file.star | Output parameter file.
-Postscript file.ps | Postscript output file name for CTF fit.
-Histogram file.ps | Postscript output file name for defocus histogram.
-Plotastigmatism file.ps | Postscript output file name for astigmatism.
-Average file.ps | Postscript output file name for average of all CTF curves.
-Zeroes file.ps | Postscript output file name for defocus-vs-zeroes plot.
-Envelope file.ps | Envelope curve output file name.
-Pointspread file.ps | Point spread curve output file name.
-Function ctf.mrc | Contrast transfer function output file name.

### Examples:

| To apply the CTF:
| bctf -verbose 7 -action apply -Defocus 2.3 input.img distorted.img
| To prepare a power spectrum from a micrograph and to fit the CTF:
| bctf -v 7 -datatype float -action prepfit -sam 1.842 -out new.star mg0001.tif mg0001_ps.pif
| This is a good way to generate the initial STAR file for each micrograph
| of a single particle analysis effort, as well as a power spectrum file.
| Subsequently, the automatic fit should be checked and corrected in bshow.
| To correct for the CTF by simply flipping the phases in every second Thon ring:
| bctf -verbose 7 -action flip -Defocus 1.4 part.pif part_flip.pif
| Applying the same flipping operation twice will recover the original image.
| To correct for the CTF:
| bctf -v 7 -action correct -Defocus 1.9 -wiener 0.1 part.pif part_corr.pif
| The equation used for the correction is:
| U = I*C/(C^2 + w)
| where:
| U: corrected image
| I: distorted image
| C: CTF
| w: Wiener factor, default 0.2
| To correct for the CTF with baseline compensation:
| bctf -v 7 -act baseline -Def 1.2 -wien 0.2 -base 1,1.5,-2.6,12.9,30,118 part.pif part_corr.pif
| The equation used for the correction is:
| U = I*C/(B*C^2 + w)
| where:
| U: corrected image
| I: distorted image
| C: CTF
| B: baseline
| w: Wiener factor, default 0.2
| Baseline equations:
| 1. a0 + a1*s + a2*s^2 + a3*s^3 + a4*s^4
| 2. a0 + a1*e^(a2*s^2) + a3*e^(a4*s^2)
| 3. a0 + a1*e^(a2*s^0.5 + a3*s^2)

Bsoft version 2.0.3-20180917 (64 bit)