FQ NP - Filter - Quick Fourier, High, low pass, etc, No Padding ||

(1/30/18)

PURPOSE

Apply Fourier filters to an image or volume. Warning: No padding is applied, this may lead to artifacts near boundary of image. Use slower operation 'FQ' to avoid this. NOTE: Butterworth filters altered to put 50% transfer in middle of requested cutoff band in Jan 2018.   Example.

SEE ALSO

BC [Box Convolution]
FQ [Filter - Quick Fourier, High, low pass, etc., Padded ||]
FF [Filter - Fourier]
FP [Interpolate/Resize using Fourier transform ||]
FT [Fourier Transform ||]
FF PLOT [Fourier - Filter design]

USAGE

.OPERATION: FQ NP

.INPUT FILE: PIC001
[Enter name of input file containing real image/volume.]

.OUTPUT FILE: PIC002
[Enter name of output file for filtered image/volume.]

1: LOW-PASS, 2: HIGH-PASS
3: GAUSS. LOW-PASS, 4: GAUSS. HIGH-PASS
5: FERMI LOW-PASS 6: FERMI HIGH-PASS
7: BUTTER. LOW-PASS, 8: BUTTER. HIGH-PASS
9: RAISED COS. LOW-PASS, 10: RAISED COS. HIGH-PASS
13: RAISED SINC WINDOW, 14: B FACTOR

.FILTER TYPE (1-10,13,14): 7
[Enter filter option type. In the following options F is the current spatial frequency.

Option "1" - Low-pass. truncation. Filter is a "top-hat" function that preserves frequencies below Fcut only.

Option "2" - High-pass. truncation. Filter is inverse "top-hat" function that preserves frequencies above Fcut only.

Option "3" - Gaussian low-pass. Filter is the Gaussian function: EXP(-F**2 / (2 * Frad**2)). Note that Frad is about where the transfer falls to 60% not 50%.

Option "4" - Gaussian high-pass. Filter is complement of the Gaussian function: 1 - EXP(-F**2 / (2 * Frad**2)) . Note that Frad is about where the transfer falls to 60% not 50%.

Option "5" - Fermi low-pass. Filter is: 1 / (1 + EXP[(F - Frad) / T]) which negotiates between "Top-hat" and Gaussian characteristics, depending on the temperature value:T (see below).

Option "6" - Fermi high-pass. Filter is: Filter is complement of the Fermi low-pass function with T replaced by -TF - Frad) / -T]).

Option "7" - Butterworth low-pass. Filter is: 1 / (SQRT(1 + (SQRT(2.0)-1) * F / RAD)**(2 * ORDER)) where 'eps' is hard coded = 0.882.
ORDER = [2 * log(eps/SQRT(**2-1)) ] / [log(Flow/Fhi)] and
RAD = Flow / ((eps)**(2 / ORDER))
The ORDER determines the filter fall off and RAD corresponds to a cut-off radius.
Preserves frequencies below <i>FlowFhi,
with a smooth transition in between lower and upper limiting frequencies.

Option "8" - Butterworth high-pass. Filter is complement of the Butterworth low-pass: 1 - (1 / (SQRT(1 + (SQRT(2.0)-1) * F / RAD)**(2 * ORDER)))
Removes frequencies below <i>FlowFhi,
with a smooth transition in between lower and upper limiting frequencies.

Option "9" - Raised Cosine low-pass. Filter is:
0.5 * (COS(PI * (F - Flow) / (Flow - Fhi)) + 1) if Flow < F < Fhi,
1 if F < Flow, and 0 if F > Fhi.

Option "10" - Raised Cosine high-pass. Filter is complement of the Raised Cosine low-pass:
0.5 * (-COS(PI*(F - Flow) / (Flow - Fhi)) + 1) if Flow < F < Fhi
0 if F < Flow, and 1 if F > Fhi.

Option "13" - Raised sinc. window for 2-D images. Filter is:
1 + 9 * (SIN(PI*F) / (PI*F)).

Option "14" B Factor. Multiply amplitudes by a B temperature factor. Filter is: D * (EXP(B * F**2)) however frequencies above the cutoff (Fcut) are preserved unchanged.

For options "1-2" SPIDER asks:

.FILTER RADIUS (IN FREQUENCY OR PIXEL UNITS): 0.12 or 5
[The filter radius (filter intrinsic frequency) can be input using either frequency units or pixel units. If filter radius is given in frequency units, they should be in the range: 0.0 - 0.5. If the input is > 1.0 it is treated as given in pixel units. This frequency is referred to above as: Fcut.]

For options "3-4" SPIDER asks:

.FILTER RADIUS (IN FREQUENCY OR PIXEL UNITS): 0.12 or 5
[The filter radius (filter intrinsic frequency) can be input using either frequency units or pixel units. If filter radius is given in frequency units, they should be in the range: 0.0 - 0.5. If the input is > 1.0 it is treated as given in pixel units. (The frequency is then 1 / radius). This frequency is referred to above as: Frad.]

For options "5-6" SPIDER asks:

.FILTER RADIUS (IN FREQUENCY OR PIXEL UNITS): 0.12 or 5
[The filter radius (filter intrinsic frequency) can be input using either frequency units or pixel units. If filter radius is given in frequency units, they should be in the range: 0.0 - 0.5. If the input is > 1.0 it is treated as given in pixel units. (The frequency is then 1 / radius). This frequency is referred to above as: Frad.]

.TEMPERATURE (0=CUTOFF): 0.3
[Enter a temperature parameter T The filter falls off roughly within this reciprocal distance (in terms of frequency units).]

For options "7-10" SPIDER asks:

.LOWER & UPPER LIMITING FREQUENCIES (IN FREQ OR PIXEL UNITS): 0.1, 0.2
[The Filter limiting frequencies can be given either in frequency units or pixel units. If limiting frequencies are given in frequency units, they should be in the range: 0.0 - 0.5. If limiting frequencies are > 1.0 they are treated as given in pixel units. Both values must be in the same units. These values expressed as frequencies are denoted: Flow and Fhi.]

For option "14" SPIDER asks:


.B FACTOR (PIXEL**2): 10
[B Temperature factor. Units are pixel**2. A positive value sharpens the image.]

.D CONSTANT: 1
[Multiplier.]

.FREQUENCY CUTOFF: 0.4
[ This frequency is referred to above as: Fcut. Values >= 0.5 have no effect.]

NOTES

  1. 'FQ NP' has similar functions to 'FF' except that:
    a) It only accepts real space images and creates a real filtered image.
    b) It always runs in core, so it is faster the 'FF' operation.

  2. The FILTER RADIUS and LOWER & UPPER LIMITING FREQUENCIES can be given either in frequency units (F) or pixel units (P). If the input is > 1.0 it is treated as given in pixel units.
    The following equations convert frequency units into pixel units for (P in range: 0 - (NX/2)):
    P = F * NX
    F = P / NX
    for square or cubic images.

  3. To convert resolution in Angstroms to frequency units (if the pixel size is known): F = Pixel size (A/pixel) / Resolution (A).

  4. Implemented by: Paul Penczek and Gregory Kishchenko.

SUBROUTINES

FOUR_FQ

CALLER

FOUR1