Menu

Python Sparse data Analysis Package external MRI plugin.

Fourier operators for cartesian and non-cartesian space.

class mri.operators.fourier.non_cartesian.NFFT(samples, shape, n_coils=1)[source]

ND non catesian Fast Fourrier Transform class The NFFT will normalize like the FFT i.e. in a symetric way. This means that both direct and adjoint operator will be divided by the square root of the number of samples in the fourier domain.

Attributes

samples: np.ndarray

the samples locations in the Fourier domain between [-0.5; 0.5[.

shape: tuple of int

shape of the image (not necessarly a square matrix).

n_coils: int default 1

Number of coils used to acquire the signal in case of multiarray receiver coils acquisition

adj_op(x)[source]

This method calculates inverse masked non-cartesian Fourier transform of a 1-D coefficients array.

Parameters

x: np.ndarray

masked non-cartesian Fourier transform 1D data.

Returns

img: np.ndarray

inverse 2D discrete Fourier transform of the input coefficients.

op(img)[source]

This method calculates the masked non-cartesian Fourier transform of a N-D data.

Parameters

img: np.ndarray

input ND array with the same shape as the mask.

Returns

x: np.ndarray

masked Fourier transform of the input image.

class mri.operators.fourier.non_cartesian.NUFFT(samples, shape, platform='cuda', Kd=None, Jd=None, n_coils=1, verbosity=0)[source]

GPU implementation of N-D non uniform Fast Fourrier Transform class.

Attributes

samples: np.ndarray

the mask samples in the Fourier domain.

shape: tuple of int

shape of the image (necessarly a square/cubic matrix).

nufftObj: The pynufft object

depending on the required computational platform

platform: string, ‘opencl’ or ‘cuda’

string indicating which hardware platform will be used to compute the NUFFT

Kd: int or tuple

int or tuple indicating the size of the frequency grid, for regridding. if int, will be evaluated to (Kd,)*nb_dim of the image

Jd: int or tuple

Size of the interpolator kernel. If int, will be evaluated to (Jd,)*dims image

n_coils: int default 1

Number of coils used to acquire the signal in case of multiarray receiver coils acquisition. If n_coils > 1, please organize data as n_coils X data_per_coil

adj_op(x)[source]

This method calculates inverse masked non-uniform Fourier transform of a 1-D coefficients array.

Parameters

x: np.ndarray

masked non-uniform Fourier transform 1D data.

Returns

img: np.ndarray

inverse 3D discrete Fourier transform of the input coefficients.

numOfInstances = 0
op(img)[source]

This method calculates the masked non-cartesian Fourier transform of a 3-D image.

Parameters

img: np.ndarray

input 3D array with the same shape as shape.

Returns

x: np.ndarray

masked Fourier transform of the input image.

class mri.operators.fourier.non_cartesian.NonCartesianFFT(samples, shape, implementation='cpu', n_coils=1, density_comp=None, **kwargs)[source]

This class wraps around different implementation algorithms for NFFT

adj_op(coeffs, *args)[source]

This method calculates inverse masked non-uniform Fourier transform of a 1-D coefficients array.

Parameters

x: np.ndarray

masked non-uniform Fourier transform 1D data.

Returns

inverse discrete Fourier transform of the input coefficients.

op(data, *args)[source]

This method calculates the masked non-cartesian Fourier transform of an image.

Parameters

img: np.ndarray

input N-D array with the same shape as shape.

Returns

masked Fourier transform of the input image.

class mri.operators.fourier.non_cartesian.Singleton[source]

This is an internal class used by GPU based NUFFT, to hold a count of instances of GPU NUFFT Class. We raise an error if we have more than one

classmethod countInstances()[source]

This function increments each time an object is created

classmethod getNumInstances()[source]
numOfInstances = 0
class mri.operators.fourier.non_cartesian.Stacked3DNFFT(kspace_loc, shape, implementation='cpu', n_coils=1)[source]

” 3-D non uniform Fast Fourier Transform class, fast implementation for Stacked samples. Note that the kspace locations must be in the form of a stack along z, with same locations in each plane.

Attributes

samples: np.ndarray

the mask samples in the Fourier domain.

shape: tuple of int

shape of the image (necessarly a square/cubic matrix).

implementation: string, ‘cpu’, ‘cuda’ or ‘opencl’ default ‘cpu’

string indicating which implemenmtation of Noncartesian FFT must be carried out

n_coils: int default 1

Number of coils used to acquire the signal in case of multiarray receiver coils acquisition

adj_op(coeff)[source]

This method calculates inverse masked non-uniform Fourier transform of a 1-D coefficients array.

Parameters

coeff: np.ndarray

masked non-uniform Fourier transform 1D data.

Returns

img: np.ndarray

inverse 3D discrete Fourier transform of the input coefficients.

op(data)[source]

This method calculates Fourier transform.

Parameters

data: np.ndarray

input image as array.

Returns

result: np.ndarray

Forward 3D Fourier transform of the image.

class mri.operators.fourier.non_cartesian.gpuNUFFT(samples, shape, n_coils=1, density_comp=None, kernel_width=3, sector_width=8, osf=2, balance_workload=True, smaps=None)[source]

GPU implementation of N-D non uniform Fast Fourrier Transform class.

Attributes

samples: np.ndarray

the normalized kspace location values in the Fourier domain.

shape: tuple of int

shape of the image

operator: The NUFFTOp object

to carry out operation

n_coils: int default 1

Number of coils used to acquire the signal in case of multiarray receiver coils acquisition. If n_coils > 1, please organize data as n_coils X data_per_coil

adj_op(coeff, grid_data=False)[source]

This method calculates adjoint of non-uniform Fourier transform of a 1-D coefficients array.

Parameters

coeff: np.ndarray

masked non-uniform Fourier transform 1D data.

grid_data: bool, default False

if True, the kspace data is gridded and returned, this is used for density compensation

Returns

——-

np.ndarray

adjoint operator of Non Uniform Fourier transform of the input coefficients.

op(image, interpolate_data=False)[source]

This method calculates the masked non-cartesian Fourier transform of a 2D / 3D image.

Parameters

image: np.ndarray

input array with the same shape as shape.

interpolate_data: bool, default False

if set to True, the image is just apodized and interpolated to kspace locations. This is used for density estimation.

Returns

np.ndarray

Non Uniform Fourier transform of the input image.

Follow us

© 2019, Antoine Grigis Samuel Farrens Jean-Luc Starck Philippe Ciuciu .
Inspired by AZMIND template.