ppftpy.ppft3#

ppftpy.ppft3(data, /, *, vectorized=False, scipy_fft=False)[source]#

Compute the 3D Pseudo-Polar Fourier Transform.

This function computes the 3-dimensional Pseudo-Polar Fourier Transform [Averbuch2003].

Parameters:
  • data (ndarray[tuple[Any, ...], dtype[TypeVar(_ScalarT, bound= generic)]]) – The input data, either a single 3D matrix (shape (N, N, N)) or a batch of 3D matrices (shape (V, N, N, N)). Each matrix must be cubical with even length. The data can be either real or complex.

  • scipy_fft (bool) – If True, uses SciPy’s FFT backend (scipy.fft) or a registered backend via SciPy’s backend control instead of the native array’s FFT implementation (e.g., numpy.fft). This may improve performance but requires SciPy to be installed.

  • vectorized (bool) – If True, computes the transform using a fully vectorized approach. This is significantly faster but requires more memory. Use with caution for large datasets.

Return type:

ndarray[tuple[Any, ...], dtype[complex128 | clongdouble]]

Returns:

The computed 3D Pseudo-Polar Fourier Transform. The output shape depends on the input:

  • If data has shape (N, N, N), the output has shape (3, 3N+1, N+1, N+1).

  • If data has shape (V, N, N, N), the output has shape (V, 3, 3N+1, N+1, N+1).

Raises:
  • ValueError – If the input shape is not (N, N, N) or (V, N, N, N) with even N and arbitrary V.

  • ModuleNotFoundError – If scipy_fft=True but SciPy is not installed.

See also

rppft3

The 3D Pseudo-Polar Fourier Transform of real input.

ppft2

The 2D Pseudo-Polar Fourier Transform.

References

[Averbuch2003]

A. Averbuch and Y. Shkolnisky, “3D Fourier based discrete Radon transform,” Applied and Computational Harmonic Analysis, vol. 15, no. 1, pp. 33-69, Jul. 2003, issn: 1063-5203. doi:10.1016/s1063-5203(03)00030-7.

Examples

>>> from ppftpy import ppft3
>>> import numpy as np
>>> arr = np.random.default_rng().random((4, 4, 4))
>>> ppft3(arr).shape
(3, 13, 5, 5)

Compute PPFT3D for 2 arrays.

>>> from ppftpy import ppft3
>>> import numpy as np
>>> arr = np.random.default_rng().random((2, 4, 4, 4))
>>> ppft3(arr).shape
(2, 3, 13, 5, 5)