3D Butterworth Filter

Overview

This program filters the image in Fourier space. In a lowpass filter the Fourier coeficients corresponding to frequencies below a given threshold (called the cutoff frequency) have no (or little) modification by the filter. That is the filter lets low frequency components pass and block high frequency components. For a highpass filter the opposite happens. The equation for the transfer function the filters are:

1st order lowpass
T(f)=1/(1+(r^2/cf^2))
2nd order lowpass
T(f)=1/(1+(r^4/cf^4))
1st order higpass
T(f)=1/(1+(cf^2/r^2))
2nd order highpass
T(f)=1/(1+(cf^4/r^2))

where cf is the cutoff frequency and r is the square root of the sum of the squares of the three frequency components. The cutoff frequency is in the interval [0, 0.5]. The difference between the first order filter and the second order one is that the second order filter is more steep.

Topics

Overview | x0 y0 z0 | nx ny nz | nxpad nypad nzpad | cutoff frequency | Filter function file | Viewing filter in gnuplot

Related Priism Topics

Priism | Categories | Applications


x0 y0 z0

This field represent the coordinates of the lower left corner of the selected region to be studied (z0 is the first section of the selected region).

Return to the overview.


nx ny nz

Here the user gives the sizes (number of pixels) in x, y, and z of the selected region. nx, ny, and nz must be an integer power of 2, less or equal to 2048.

Return to the overview.


nxpad nypad nzpad

Since the FT expansion assumes that the image is periodic we pad the image with nxpad, nypad, and nzpad pixels, in such a way that it becomes periodic in x, y, and z. If the entire image is filtered, the default for nxpad, nypad, and nzpad is the smallest value that brings the size of the image to the next power of two. If a selected region of the image is studied, then the default value is 10% of the number of pixels in the respective direction.

Return to the overview.


Cutoff Frequency

The cutoff frequency is chosen by moving the sliding bar. Since it is taken in the interval [0, 0.5], the number shown above the bar (which is an integer) represents 100 times the actual value of the cutoff frequency used in the calculation.

Return to the overview.


Filter Function File

If one wants to know the filter function correspoding to the chosen parameters, then a file name (such as filter.dat) should be given here. Using a software package such as gnuplot (see Viewing filter in gnuplot for details), one can plot the filter function as a function of the frequency. If no filename is given, the calculation of the filter function will not be made.

Return to the overview.


Viewing filter in gnuplot

To make a plot of the filter function, which we suppose that it was saved to a file called filter.dat one can use the gnuplot software. To do this, just create a file, which here we call Plot (but it can have any name). In this file write the following lines:

                set term postscript
                set output 'figure.ps'
                set size 0.6, 0.6
                set nokey
                set nozeroaxis
                plot [0 : 0.5] 'filter.dat' with line 1   

Save this file and at the UNIX prompt type:

                gnuplot Plot

You now will have a postcript file called figure.ps. Then you can use 'showps' to see and print this postscript file.

Return to the overview.