Skip to main content

NOTE: This is a fork of the repository below. Changes have been made to lighten it’s dependency on Numba and PyWavelets. If you are using a function that used Numba either install with the [full] extra or expect much slower results.

SigPy

https://img.shields.io/badge/License-BSD%203--Clause-blue.svg https://travis-ci.com/mikgroup/sigpy.svg?branch=master Documentation Status https://codecov.io/gh/mikgroup/sigpy/branch/master/graph/badge.svg https://zenodo.org/badge/139635485.svg

Source Code | Documentation | MRI Recon Tutorial | MRI Pulse Design Tutorial

SigPy is a package for signal processing, with emphasis on iterative methods. It is built to operate directly on NumPy arrays on CPU and CuPy arrays on GPU. SigPy also provides several domain-specific submodules: sigpy.plot for multi-dimensional array plotting, sigpy.mri for MRI reconstruction, and sigpy.mri.rf for MRI pulse design.

Installation

SigPy requires Python version >= 3.5. The core module depends on numba, numpy, PyWavelets, scipy, and tqdm.

Additional features can be unlocked by installing the appropriate packages. To enable the plotting functions, you will need to install matplotlib. To enable CUDA support, you will need to install cupy. And to enable MPI support, you will need to install mpi4py.

Via conda

We recommend installing SigPy through conda:

conda install -c frankong sigpy
# (optional for plot support) conda install matplotlib
# (optional for CUDA support) conda install cupy
# (optional for MPI support) conda install mpi4py

Via pip

SigPy can also be installed through pip:

pip install sigpy
# (optional for plot support) pip install matplotlib
# (optional for CUDA support) pip install cupy
# (optional for MPI support) pip install mpi4py

Installation for Developers

If you want to contribute to the SigPy source code, we recommend you install it with pip in editable mode:

cd /path/to/sigpy
pip install -e .

To run tests and contribute, we recommend installing the following packages:

pip install coverage ruff sphinx sphinx_rtd_theme black isort

and run the script run_tests.sh.

Features

CPU/GPU Signal Processing Functions

SigPy provides signal processing functions with a unified CPU/GPU interface. For example, the same code can perform a CPU or GPU convolution on the input array device:

# CPU convolve
x = numpy.array([1, 2, 3, 4, 5])
y = numpy.array([1, 1, 1])
z = sigpy.convolve(x, y)

# GPU convolve
x = cupy.array([1, 2, 3, 4, 5])
y = cupy.array([1, 1, 1])
z = sigpy.convolve(x, y)

Iterative Algorithms

SigPy also provides convenient abstractions and classes for iterative algorithms. A compressed sensing experiment can be implemented in four lines using SigPy:

# Given some observation vector y, and measurement matrix mat
A = sigpy.linop.MatMul([n, 1], mat)  # define forward linear operator
proxg = sigpy.prox.L1Reg([n, 1], lamda=0.001)  # define proximal operator
x_hat = sigpy.app.LinearLeastSquares(A, y, proxg=proxg).run()  # run iterative algorithm

PyTorch Interoperability

Want to do machine learning without giving up signal processing? SigPy has convenient functions to convert arrays and linear operators into PyTorch Tensors and Functions. For example, given a cupy array x, and a Linop A, we can convert them to Pytorch:

x_torch = sigpy.to_pytorch(x)
A_torch = sigpy.to_pytorch_function(A)

Metadata

Release files for sigpy-lite 0.1.27

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

Source distribution (sdist)

Source distribution for sigpy-lite 0.1.27
File Size Uploaded
sigpy_lite-0.1.27.tar.gz 381.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sigpy-lite 0.1.27
File Interpreter ABI Platform
sigpy_lite-0.1.27-py3-none-any.whl Python 3 none any Details

Total release size: 490.6 kB

Release files / sigpy_lite-0.1.27.tar.gz

Download URL sigpy_lite-0.1.27.tar.gz
Size 381.4 kB
Tags Source
SHA-256 checksum
How to use checksums
14285d9006cc19a024cc7080b4b08e6c69c23a0ab406e3f39dcf5bc3c4f3233a
BLAKE2b-256 checksum
How to use checksums
d842924d081295415e73e732a13020757b7a743652bb7d1b1b7f6aff1ca3c65f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.13

Release files / sigpy_lite-0.1.27-py3-none-any.whl

Download URL sigpy_lite-0.1.27-py3-none-any.whl
Size 109.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d83d1a4e0770334d06bd679830cfbab3e9c498f9571f044878e98e64b090d1f
BLAKE2b-256 checksum
How to use checksums
6a00bc391f706f3946e302f9729aa4f24bde7edd5f2d92d348972da81c74475c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.1.27 This release

2 release files

0.1.26

2 release files

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