Highly optimized Pseudo-Polar Fourier Transform in Python
Project description
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.0[^1] |
| Dask | CPU / GPU | 2024.8.1 |
| PyTorch | CPU / GPU | 1.13.0 |
| JAX | CPU / GPU | 0.4.32 |
[^1]: Released, but not yet available on PyPI.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ppft_py-0.1.0.tar.gz.
File metadata
- Download URL: ppft_py-0.1.0.tar.gz
- Upload date:
- Size: 5.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e57b44d8748900c167314b2eb93dca0afacb283884877573230e815f0e3d72d8
|
|
| MD5 |
1ec1632890eb32a0671c142b4d04c2c6
|
|
| BLAKE2b-256 |
d3c830724e3686550c3e157b2fed31a801fe258259258528c7e2c2b4e8ccde14
|
Provenance
The following attestation bundles were made for ppft_py-0.1.0.tar.gz:
Publisher:
publish.yml on jnk22/ppft-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ppft_py-0.1.0.tar.gz -
Subject digest:
e57b44d8748900c167314b2eb93dca0afacb283884877573230e815f0e3d72d8 - Sigstore transparency entry: 180280223
- Sigstore integration time:
-
Permalink:
jnk22/ppft-py@bb012f755e1ec13ad74c15f88f202b6468060e98 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jnk22
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bb012f755e1ec13ad74c15f88f202b6468060e98 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ppft_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ppft_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9d43cb3f04654075a8c34eae9f7f1b6d6a26be03b6017e9f00232b447756630
|
|
| MD5 |
906fbf856d73a15bb926c15de57a4a49
|
|
| BLAKE2b-256 |
d46e021d875da8ffb54a9e6e28dfac7129ed1616c1abe2ee9b8f8a7398018208
|
Provenance
The following attestation bundles were made for ppft_py-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on jnk22/ppft-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ppft_py-0.1.0-py3-none-any.whl -
Subject digest:
e9d43cb3f04654075a8c34eae9f7f1b6d6a26be03b6017e9f00232b447756630 - Sigstore transparency entry: 180280228
- Sigstore integration time:
-
Permalink:
jnk22/ppft-py@bb012f755e1ec13ad74c15f88f202b6468060e98 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jnk22
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bb012f755e1ec13ad74c15f88f202b6468060e98 -
Trigger Event:
push
-
Statement type: