Functions (sigpy)

The core module contains functions and classes for signal processing.

SigPy provides simple interfaces to commonly used signal processing functions, including convolution, FFT, NUFFT, wavelet transform, and thresholdings. All functions, except wavelet transform, can run on both CPU and GPU.

These functions are wrapped into higher level classes (Linop and Prox) that can be used in conjuction with Alg to form an App.

Computing Backend Functions

Functions and classes for getting and setting computing devices.

sigpy.Device Device class.
sigpy.get_device Get Device from input array.
sigpy.get_array_module Gets an appropriate module from numpy or cupy.
sigpy.cpu_device Device class.
sigpy.to_device Move input to device.
sigpy.copyto Copy from input to output.
sigpy.Communicator Communicator for distributed computing using MPI.

Block Reshape Functions

Block reshape functions.

sigpy.array_to_blocks Extract blocks from an array in a sliding window manner.
sigpy.blocks_to_array Accumulate blocks into an array in a sliding window manner.

Convolution Functions

Convolution functions with multi-dimension, and multi-channel support.

sigpy.convolve Convolution that supports multi-dimensional and multi-channel inputs.
sigpy.convolve_data_adjoint Adjoint convolution operation with respect to data.
sigpy.convolve_filter_adjoint Adjoint convolution operation with respect to filter.

Fourier Functions

FFT and non-uniform FFT (NUFFT) functions.

sigpy.fft FFT function that supports centering.
sigpy.ifft IFFT function that supports centering.
sigpy.nufft Non-uniform Fast Fourier Transform.
sigpy.nufft_adjoint Adjoint non-uniform Fast Fourier Transform.
sigpy.estimate_shape Estimate array shape from coordinates.

Interpolation Functions

Interpolation functions.

sigpy.interpolate Interpolation from array to points specified by coordinates.
sigpy.gridding Gridding of points specified by coordinates to array.

Pytorch Interop Functions

Functions for interoperability between sigpy and pytorch.

sigpy.to_pytorch Zero-copy conversion from numpy/cupy array to pytorch tensor.
sigpy.from_pytorch Zero-copy conversion from pytorch tensor to numpy/cupy array.
sigpy.to_pytorch_function Convert SigPy Linop to PyTorch Function.

Simulation Functions

Functions for simulations.

sigpy.shepp_logan Generates a Shepp Logan phantom with a given shape and dtype.

Thresholding Functions

Thresholding functions.

sigpy.soft_thresh Soft threshold.
sigpy.hard_thresh Hard threshold.
sigpy.l1_proj Projection onto L1 ball.
sigpy.l2_proj Projection onto L2 ball.
sigpy.linf_proj Projection onto L-infinity ball.
sigpy.psd_proj Projection onto postiive semi-definite matrices.

Utility Functions

Utility functions.

sigpy.resize Resize with zero-padding or cropping.
sigpy.flip Flip input.
sigpy.circshift Circular shift input.
sigpy.downsample Downsample input.
sigpy.upsample Upsample input.
sigpy.dirac Create Dirac delta.
sigpy.randn Create random Gaussian array.
sigpy.triang Create multi-dimensional triangular window.
sigpy.hanning Create multi-dimensional hanning window.
sigpy.monte_carlo_sure Monte Carlo Stein Unbiased Risk Estimator (SURE).
sigpy.axpy Compute y = a * x + y.
sigpy.xpay Compute y = x + a * y.

Wavelet Functions

Wavelet transform functions.

sigpy.fwt Forward wavelet transform.
sigpy.iwt Inverse wavelet transform.