Skip to main content

Python package for signal reconstruction.

Project description

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

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 flake8 sphinx

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sigpy-0.1.22.tar.gz (110.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sigpy-0.1.22-py3-none-any.whl (139.0 kB view details)

Uploaded Python 3

File details

Details for the file sigpy-0.1.22.tar.gz.

File metadata

  • Download URL: sigpy-0.1.22.tar.gz
  • Upload date:
  • Size: 110.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.6

File hashes

Hashes for sigpy-0.1.22.tar.gz
Algorithm Hash digest
SHA256 e9ff5aa47bef18390ccbe9237bb3b18d358095d3a81f7c6270b776364ede76a2
MD5 e73d89319dee39b9a91b03a893bb610c
BLAKE2b-256 92c4b1578b1ef097740a3a3f7518edd707c55dae2df4f8108ce43600688e7278

See more details on using hashes here.

File details

Details for the file sigpy-0.1.22-py3-none-any.whl.

File metadata

  • Download URL: sigpy-0.1.22-py3-none-any.whl
  • Upload date:
  • Size: 139.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.6

File hashes

Hashes for sigpy-0.1.22-py3-none-any.whl
Algorithm Hash digest
SHA256 b3e2f15fe9d96a262bcbdf7c7de3ba05b161f86bb25bf411434f09db7e00a157
MD5 bef765d5c4cd49b99860dbbae93c93dc
BLAKE2b-256 7dacc65cfa010bc734a4453a5b36848b87c49b6a69cadec2f2cf632fb0cf2db7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page