Skip to content

FourierFilter

Adrian Quintana edited this page Dec 11, 2017 · 1 revision

fourier_filter

Purpose

This utility allows you to filter images and volumes with different filter shapes. A CTF can be applied to an image. The applied filter (in fact, its magnitude) can be saved to disk, so it can be visually inspected.

Usage


$ fourier_filter -i ...


Parameters

  • __OR__

  • __OR__

  • ``

  • ``

  • `` Apply a mask and save the masks generated for the selected regions with the given name. The saved image is a Fourier Xmipp image

  • `` Apply a mask and save the amplitude of the mask generated with the given name. The saved image is a normal Xmipp image. What is really saved is the log10 of the squared amplitude plus 1.

  • `` Low pass filter withw1 (<1/2 unless sampling rate is given) as cutoff frequency. The shape of the filter is controlled later

  • `` High pass filter withw1 (<1/2 unless sampling rate is given) as cutoff frequency. The shape of the filter is controlled later

  • `` Band pass filter betweenw1 and`w2` (<1/2 unless sampling rate is given) as cutoff frequency. The shape of the filter is controlled later

  • `` Stopband filter betweenw1 and`w2` (<1/2 unless sampling rate is given) as cutoff frequency. The shape of the filter is controlled later

  • `` Sampling rate in A/pixel. This value is used for generating the normalized digital frequencies.

Filter shape

I. Read from file

  • `` The mask is read from the specified file.

II. 2D and 3D raised cosine shapes

  • `` The right mask is generated with a raised cosine shape depending if it is a low_pass, high_pass or band_pass, stopband. Thefreq_width parameter controls the smoothness of the transition, and it is expressed as a digital frequency (w<0.5). Common values are around 0.05 and 0.18. For low pass filters the transition band goes from`w1` to`w1+freq_width` while for high pass filters it is from`w1-freq_width` to`w1`

II. 2D and 3D Gaussians

  • `` The Gaussian is defined in Fourier space and its sigma isw1 (remind that in Fourier space the maximum frequency is 0.5)
  • `` The Gaussian is defined in real space and its sigma isw1. Although the filter is defined in real-space, it is still applied in Fourier space.

III. 3D missing wedge shapes

  • `` A mask is created corresponding to a missing wedge in Fourier-Space for data that is collected between tilting anglesth0[-90,0]= and`thF`[0,90]=. The Y-axis is supposed to be the tilting axis. Note that this option is only valid for volumes

IV. 2D CTF

  • `` The CTF file is one with the following structure. The meaning of each one is exactly the same as in the program ICE
    • K[K=0]= CTF gain. Determines the height of the CTF
    • defocusU[DeltafU]= Defocus in Angstroms (Ex: -800). Negative values are underfocused
    • defocusV[DeltafV=DeltafU]= If astigmatism
    • azimuthal_angle[ang=0]= Angle between X and U (degrees)
    • sampling_rate[Tm=1]= Angstroms/pixel
    • voltage[kV=100]= Accelerating voltage (kV)
    • spherical_aberration[Cs=0]= Milimiters. Ex: 5.6
    • chromatic_aberration[Ca=0]= Milimiters. Ex: 4
    • energy_loss[espr=0]= eV. Ex: 1
    • lens_stability[ispr=0]= ppm. Ex: 1
    • convergence_cone[alpha=0]= mrad. Ex: 0.5
    • longitudinal_displace[DeltaF=0]= Angstrom. Ex: 100
    • transversal_displace[DeltaR=0]= Angstrom. Ex: 3
    • Q0[Q0=0]= Factor for the amplitude contrast amplitude. Q0. See Frank's book
    • base_line[b=0]= Noise baseline. This value is added all over the spectrum as a supporting line
    • gaussian_K[K=0]= Gaussian gain. This is determining the height of the gaussian term
    • sigmaU[sigmaU=0]= Gaussian width in U direction
    • sigmaV[sigmaV=sigmaU]= Gaussian width in V direction
    • cU[cU=0]= Gaussian center in U direction
    • cV[cV=cU]= Gaussian center in V direction
    • gaussian_angle[ang=0]= Gaussian angle. Notice that the sqrt term uses the same angle
    • sqU[sqU=0]= Square root term width in U direction
    • sqV[sqV=0]= Square root term width in V direction
    • sqrt_K[K=0]= Square root term gain
  • `` apply absolute value of CTF
  • `` apply b factor

Examples and Notes

  • Cutoff freq. The cutoff frequency is expressed in the digital Fourier space normalized to 1/2. So, if you have a particle which you want to filter at 10 Angstroms, and the image was sampled at 1.16 Angstroms/pixel, then you have to filter it at w1=1.16/10=0.116
  • Bandpass and CTF When the CTF is applied the low, high, band and stopband flags are useless
  • CTF noiseIf CTF noise is provided, then the CTF has got a Fourier Transform which is given in part by the CTF description, and the other part comes from an underlying noise which is a rotated version of:

   CTFnoise(U,V)=base_line+gaussian_K*exp(-(U-cU)²-(V-cV)²)+sqrt_K*exp(-sq*sqrt(w))
   

Apply a low pass filter to an image


$ fourier_filter -i g0ta00001.xmp -low_pass 0.058 -fourier_mask raised_cosine 0.1 


And now with a CTF


$ fourier_filter -i g0ta00001.xmp -fourier_mask ctf ctf.param 


You can see another example of CTF filtration at xmipp_correctphase.

Here you are an example of an image and its different filtrations:

Original Low Pass High Pass Band Pass Stop Band CTF
/g0ta00001.jpg /low_pass.jpg /high_pass.jpg /band_pass.jpg /stop_band.jpg /ctf.jpg
--Main.AlfredoSolano - 17 Jan 2007
Clone this wiki locally