Getting Started#

Installing MRI-NUFFT#

mri-nufft is available on PyPi

pip install mri-nufft

Development Version#

If you want to modifiy the mri-nufft code base

git clone https://github.com:mind-inria/mri-nufft
pip install -e ./mri-nufft[dev]

Choosing a NUFFT Backend#

In order to performs Non Uniform fast fourier transform you need to install a specific backend library.

Supported Libraries#

These libraries needs to be installed separately from this package.

Backend

Hardward

Batch computation

Precision

Array Interface

cufinufft

GPU (CUDA)

single

cupy/torch/numpy

finufft

CPU

single/double

numpy

gpunufft

GPU

single/double

numpy

tensorflow-nufft

GPU (CUDA)

single

tensorflow

pynufft-cpu

CPU

single/double

numpy

pynfft

CPU

single/double

numpy

bart

CPU/GPU

single

numpy

sigpy

CPU

single

numpy

stacked (*)

CPU/GPU

single/double

numpy

  • (*) stacked-nufft allow to use any supported backend to perform a stack of 2D NUFFT and adds a z-axis FFT (using scipy or cupy)

The NUFFT operation is often not enough to provide good image quality by itself (even with density compensation). It is best used in a Compress Sensing setup, you can check the pysap-mri for MRI dedicated solutions and deepinv for Deep Learning based solutions.

Backend Installations#

To benefit the most from certain backend we recommend to use the following instructions

finufft / cufinufft#

Those are develop by the flatiron-institute and are installable with pip install finufft and pip install cufinufft.

Warning

for cufinufft, a working installation of CUDA and cupy is required.

gpuNUFFT#

an active gpuNUFFT fork is maintained by chaithyagr.

Warning

This is compatible only up to CUDA 11.8 !

To install it use pip install gpuNUFFT or for local development.

git clone https://github.com/chaythiagr/gpuNUFFT
cd gpuNUFFT
python setup.py install

BART#

BART has to be installed separately and bart command needs to be runnable from your PATH. See installation instructions

PyNFFT#

PyNFFT requires Cython<3.0.0 to work. and can be installed using

pip install cython<3.0.0 pynfft2

Which backend to use#

[TBA] See the benchmark. Fastest are gpunufft and cufinufft (because they are using gpu). gpunufft is usually more memory efficient also.

Note

if you are using pytorch gpu-array, you can only use cufinufft.