3D Fourier Transform

Overview

This program will perform a 3D Fourier transform to each xyz volume in the input with the option to process the data beforehand to remove trends and smooth discontinuities at the edges.

The controls in the user interface include a standard set of controls for selecting the input file, output file, and region of interest and for starting and interrupting processing. The other controls are organized as follows:

Because of the nature of the Fourier transform, the handling of the data header is different than most other Priism applications:

The Fourier transforms calculated have these properties:

Topics

Overview | Region processing | Shift | Preprocessing | Window/taper | Edge handling | Output size

Related Priism Topics

Priism | 2D Fourier Transform


Shift

The Shift field specifies a translation, measured in pixels, that is applied in conjunction with the transform. The translation is circular in the sense that something which is pushed off one side wraps around to the opposite side.

When a forward transform is performed, a shift of (x, y, z) moves pixel (x, y, z) to the origin, (0,0,0). For a reverse transform, the same shift will place what would appear at the origin, (0,0,0), at pixel (x, y, z).

Topics

Overview | Region processing | Shift | Preprocessing | Window/taper | Edge handling | Output size


Preprocessing

The input region can be processed to remove an offset or trend before the data is tapered, padded, and transformed. To display the controls for this processing, press the button labelled Set preprocessing in the main dialog. There are five types of processing that can be done; select one by pressing the appropriate toggle in the dialog. The processing options are:

None
The input is not modified before padding and transforming the data.
Subtract offset
The specified value is subtracted from all the input values.
Subtract mean
For each 3D (xyz) input region, the mean of the region is subtracted from all values in the region.
Remove linear trend
An average slope for each 3D (xyz) input region is estimated by averaging values from the first and last third of each dimension; the linear trend corresponding to that average slope and the mean of the region is subtracted from the input data. The algorithm used is the average slope method extended to three dimensions (Digital data analysis procedures, Bendat and Piersol, 1st Edition, 1971, page 288).
Remove trends up to order
A polynomial of the given order is fit to each 3D (xyz) input region. That polynomial evaluated at each input point is then subtracted from the input before padding and transforming the data.

If you are intending to taper the data and the data does not already have a zero mean, you should consider using the mean subtraction, linear trend removal, or polynomial fit options.

Topics

Overview | Region processing | Shift | Preprocessing | Window/taper | Edge handling | Output size


Window/taper

Applying a windowing function, also called tapering, multiplies the data by a function which goes to zero (or near zero) at the edges of the data. This is done before the forward transform to remove discontinuities at the edges which can complicate the interpretation of frequency spectra; the disadvantage of applying a window is that it essentially throws away parts of the input and it broadens features in the spectra.

The windowing functions used are separable, i.e, the windowing function, W(x,y,z), can be written as the product of WX(x), WY(y), and WZ(z). WX, WY, and WZ are calculated from the same formula but with different inputs for the number of pixels, n, and the fraction, f, of the dimension that is attenuated by the windowing function. The three values in the Coverage field are the values of f divided by two for the x, y, and z directions, respectively. Commonly used values for the coverage are 0.5 (a "full taper") and 0.1 (a 10% taper). The power, x, is used by half-sine windowing function.

The functions used to calculate the windowing functions are shown below. i is the pixel index and runs from 0 to n minus 1, and e is given by

      { floor(0.5 + f / 2.0 * n)          n even
  e = {
      { floor(0.5 + f / 2.0 * (n - 1))    n odd

Rectangular

         { 0     i < e
  w(i) = { 1     e <= i <= n - e
         { 0     i > n - e

Because of the sharp cutoffs of the rectangular window, it is not particularly useful; it's provided for completeness.

Triangular

         { i / e           i < e
  w(i) = { 1               e <= i <= n - e
         { (n - i) / e     i > n - e

Half-sine^power

         { (sin(pi * i / (2 * e)))^x           i < e
  w(i) = { 1                                   e <= i <= n - e
         { (sin(pi * (n - i) / (2 * e)))^x     i > n - e

Hamming

         { 0.54 - 0.46 * cos(pi * i / e)           i < e
  w(i) = { 1                                       e <= i <= n - e
         { 0.5f - 0.46 * cos(pi * (n - i) / e)     i > n - e

Blackman

         { cos(pi * i / e)           i < e
  a(i) = { -1                        e <= i <= n - e
         { cos(pi * (n - i) / e)     i > n - e

  w(i) = 0.34 - a(i) * (0.5 - a(i) * 0.16)

Topics

Overview | Region processing | Shift | Preprocessing | Window/taper | Edge handling | Output size


Edge handling

The dimensions of the input region can be extended by adding elements at the end of each dimension. This is typically done for two reasons:

To display the controls for the amount of padding and the values of the elements added, press the button labelled Set edge handling in the main dialog. For each dimension the Width field sets the number of elements that will be added. When the toggle labelled Use default width is on, the Width field will automatically be set so the padded size can be efficiently handled. There are three ways in which the values of the added elements are set. These are:

Pad with value
Use the given value for all the elements added to a dimension. The imaginary component of the value is only used if the input data is complex.
Pad with mean
Use the mean of the 3D (xyz) input region being processed when padding the dimension.
Pad with linear ramp
For each line in x (or column for y or z-line for z) the padding elements added to the line (or column or z-line) are a linear combination of the first and last element of that input line (or column or z-line).

If a forward transform is being done and the data was tapered, than padding with zeroes is the best choice. Padding with zeroes is also appropriate if a reverse transform is being done and you want the grid sampled on a finer grid using Fourier interpolation.

Topics

Overview | Region processing | Shift | Preprocessing | Window/taper | Edge handling | Output size


Output size

When a reverse transform is performed, the size of the region written to the output file may be smaller than that of the straight Fourier transform of the input after padding. Press the button labelled Set output size to open a dialog with controls for trimming the data. For each dimension, there is a display of the size of the transformed data and what the application believes was the size of the data before padding and the forward transform was applied (this information is read from the number of samples in the header; it's possible that processing after the forward transform have altered this field so it may not reflect the original size). The amount of trimming for each dimension is listed in an editable field.

Topics

Overview | Region processing | Shift | Preprocessing | Window/taper | Edge handling | Output size