pyvista.ImageDataFilters.fft#

ImageDataFilters.fft(output_scalars_name=None, progress_bar=False)[source]#

Apply a fast Fourier transform (FFT) to the active scalars.

The input can be real or complex data, but the output is always numpy.complex128. The filter is fastest for images that have power of two sizes.

The filter uses a butterfly diagram for each prime factor of the dimension. This makes images with prime number dimensions (i.e. 17x17) much slower to compute. FFTs of multidimensional meshes (i.e volumes) are decomposed so that each axis executes serially.

The frequencies of the output assume standard order: along each axis first positive frequencies are assumed from 0 to the maximum, then negative frequencies are listed from the largest absolute value to smallest. This implies that the corners of the grid correspond to low frequencies, while the center of the grid corresponds to high frequencies.

Parameters:
output_scalars_namestr, optional

The name of the output scalars. By default, this is the same as the active scalars of the dataset.

progress_barbool, default: False

Display a progress bar to indicate progress.

Returns:
pyvista.ImageData

pyvista.ImageData with applied FFT.

See also

rfft

The reverse transform.

low_pass

Low-pass filtering of FFT output.

high_pass

High-pass filtering of FFT output.

Examples

Apply FFT to an example image.

>>> from pyvista import examples
>>> image = examples.download_moonlanding_image()
>>> fft_image = image.fft()
>>> fft_image.point_data  
pyvista DataSetAttributes
Association     : POINT
Active Scalars  : PNGImage
Active Vectors  : None
Active Texture  : None
Active Normals  : None
Contains arrays :
PNGImage                complex128 (298620,)          SCALARS

See Fast Fourier Transform for a full example using this filter.