ppft-py
Highly optimized Pseudo-Polar Fourier Transform in Python.
This repository provides a Python implementation of the Pseudo-Polar Fourier Transform (PPFT) in both 2D (PPFT2D) and 3D (PPFT3D), based on the methods presented in the following papers:
- Averbuch et al., 2001 — Fast Slant Stack: A notion of Radon Transform for Data in a Cartesian Grid which is Rapidly Computable, Algebraically Exact, Geometrically Faithful and Invertible.
- Averbuch & Shkolnisky, 2003 — 3D Fourier based discrete Radon transform, Applied and Computational Harmonic Analysis, Vol. 15, No. 1, pp. 33–69.
Features
- GPU-accelerated computation for enhanced performance.
- Backend-agnostic implementation using the Array API Standard with no direct dependencies.
- Memory-efficient and fully vectorized modes available.
- Optimized handling of real-valued input data for improved efficiency.
- Supports additional FFT backends using SciPy for extended flexibility and performance.
Usage
To transform data with the Pseudo-Polar Fourier Transform, import the function
from ppftpy and apply it to the input data:
2D Pseudo-Polar Fourier Transform:
import numpy as np
from ppftpy import ppft2
data = np.random.default_rng().random((128, 128))
transformed = ppft2(data)
3D Pseudo-Polar Fourier Transform:
import numpy as np
from ppftpy import ppft3
data = np.random.default_rng().random((32, 32, 32))
transformed = ppft3(data)
Note: The example uses NumPy arrays for the Pseudo-Polar Fourier Transform. However, this library supports all backends that implement the Array API Standard and its FFT extension (via the array-api-compat compatibility layer). See backends for a list of tested backends.
SciPy FFT Backends
Additionally, implementations of the SciPy FFT interface can be used as backends for the underlying FFT:
2D Pseudo-Polar Fourier Transform with SciPy backend:
import numpy as np
from ppftpy import ppft2
data = np.random.default_rng().random((128, 128))
transformed = ppft2(data, scipy_fft=True)
2D Pseudo-Polar Fourier Transform with pyFFTW backend:
import numpy as np
import pyfftw.interfaces.scipy_fft as pyfftw
from scipy import fft
from ppftpy import ppft2
data = np.random.default_rng().random((128, 128))
with fft.set_backend(pyfftw):
transformed = ppft2(data, scipy_fft=True)
Note: For more information on using custom FFT backends with SciPy, check out the backend control section of the SciPy documentation. See backends for a list of tested backends.
Backends
The following implementations of the Array API Standard have been tested to work:
| Backend | Devices | Minimum Version |
|---|---|---|
| NumPy | CPU | 1.23.0 |
| CuPy | GPU | 10.0.0 |
| DPNP | CPU / GPU | 0.17.01 |
| Dask | CPU / GPU | 2024.8.1 |
| PyTorch | CPU / GPU | 1.13.0 |
| JAX | CPU / GPU | 0.4.32 |
The following implementations of the SciPy FFT interface have been tested to work:
| Backend | Supports | Minimum Version |
|---|---|---|
| SciPy | NumPy (incl. Dask/JAX with NumPy arrays) | 1.8.0 |
| mkl_fft | NumPy (incl. Dask/JAX with NumPy arrays) | 1.3.6 |
| pyFFTW | NumPy (incl. Dask/JAX with NumPy arrays) | 0.13.0 |
| CuPy | CuPy (incl. Dask with CuPy arrays) | 10.0.0 |
Acknowledgments
This project utilizes concepts from the reference implementations and for generating test data for regression tests:
- PPFT2D: ShkolniskyLab/PPFT2D
- PPFT3D: ShkolniskyLab/PPFT3D and its associated MATLAB Central resource
Metadata
Release files for ppft-py 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ppft_py-0.1.0.tar.gz | 5.6 MB | With provenance | Details for ppft_py-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ppft_py-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for ppft_py-0.1.0-py3-none-any.whl |
Total release size: 5.6 MB
Release files / ppft_py-0.1.0.tar.gz
| Download URL | ppft_py-0.1.0.tar.gz |
|---|---|
| Size | 5.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e57b44d8748900c167314b2eb93dca0afacb283884877573230e815f0e3d72d8
|
|
BLAKE2b-256 checksum How to use checksums |
d3c830724e3686550c3e157b2fed31a801fe258259258528c7e2c2b4e8ccde14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 11, 2025.
Transparency logRelease files / ppft_py-0.1.0-py3-none-any.whl
| Download URL | ppft_py-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9d43cb3f04654075a8c34eae9f7f1b6d6a26be03b6017e9f00232b447756630
|
|
BLAKE2b-256 checksum How to use checksums |
d46e021d875da8ffb54a9e6e28dfac7129ed1616c1abe2ee9b8f8a7398018208
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 11, 2025.
Transparency logSecurity for ppft-py 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ppft_py-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 11, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.