Skip to main content

NUFFT module for PyTorch

Introduction

There is no built-in NUFFT function in PyTorch, neither is Toeplitz MSE loss module, which is important for non-Cartesian MRI reconstruction works. To fill this gap, this package provides:

  1. A high performance NUFFT torch.nn module wrapping cufinufft [3] and finufft [1,2] - they are the fastest NUFFT backends to the best of my knowledge.
  2. Another elegant MSE loss (mean square of l2 loss) module for non-Cartesian reconstruction with DCF preconditioning boosted by Toeplitz operator. Basically, this is done by replacing the two-pass NUFFTs with a Cartesian fast Fourier convolution. This method is also fast but slightly slower than cufinufft in practice. Use as you need.

Both CPU and GPU are supported. Benchmark indicates a 2ms (NUFFT module) or a 3ms (Toeplitz MSE loss module) time cost per iteration in a 256×256 inverse NUFFT problem using a RTX3090 GPU.

Install

For offline installing:

$ bash install.bash

To install with pip:

$ pip install torchfinufft-ryan

Optionally, to enable CUDA computation, cufinufft>=2.5.0 has to be installed. To solve for the density compensation function, I recommend my mrarbdcf package [4].

Usage

Please refer to the exmaple folder - there are minimal example(s) for tutorial.

References

[1] Barnett AH. Aliasing error of the kerne exp(β√(1-z²)) in the nonuniform fast Fourier transform. Applied and Computational Harmonic Analysis. 2021 Mar 1;51:1–16.

[2] Barnett AH, Magland J, af Klinteberg L. A Parallel Nonuniform Fast Fourier Transform Library Based on an “Exponential of Semicircle" Kernel. SIAM J Sci Comput. 2019 Jan;41(5):C479–504.

[3] Shih Y hsuan, Wright G, Anden J, Blaschke J, Barnett AH. cuFINUFFT: a load-balanced GPU library for general-purpose nonuniform FFTs. 2021 IEEE International Parallel and Distributed Processing Symposium Workshops (IPDPSW). 2021 June;688–97.

[4] Luo R, Hu P, Qi H. Sampling Density Compensation using Fast Fourier Deconvolution. In: Proceedings of the Cape Town - 2026 ISMRM-ISMRT Annual Meeting and Exhibition, Cape Town, South Africa. Program #461-03-015.

Release files for torchfinufft-ryan 2.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torchfinufft-ryan 2.2.1
File Size Uploaded
torchfinufft_ryan-2.2.1.tar.gz 16.0 kB Details

Release files / torchfinufft_ryan-2.2.1.tar.gz

Download URL torchfinufft_ryan-2.2.1.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bdea33980e9ab79b2918e6999b69e137fb6f02d7d25d56cb3175041baa86e85c
BLAKE2b-256 checksum
How to use checksums
5fdb56fefd88eb475e7f84323e6c81fdd9c6caace4f8ab46460f51e96da20595
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

2.2.1 This release

1 release file

2.2.0

1 release file

2.1.0

1 release file

2.0.0

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page