MRIGpuNUFFT#

class mrinufft.operators.interfaces.gpunufft.MRIGpuNUFFT(samples, shape, n_coils=1, n_batchs=1, n_trans=1, density=None, smaps=None, squeeze_dims=True, eps=0.001, **kwargs)[source]#

Bases: FourierOperatorBase

Interface for the gpuNUFFT backend.

Parameters:
  • samples (np.ndarray (Mxd)) – the samples locations in the Fourier domain where M is the number of samples and d is the dimensionnality of the output data (2D for an image, 3D for a volume).

  • 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

  • density (bool or np.ndarray default None) – if True, the density compensation is estimated from the samples locations. If an array is passed, it is used as the density compensation.

  • squeeze_dims (bool, default True) – If True, will try to remove the singleton dimension for batch and coils.

  • smaps (np.ndarray default None) – Holds the sensitivity maps for SENSE reconstruction.

  • n_trans (int, default =1) – This has no effect for now.

  • kwargs (extra keyword args) – these arguments are passed to gpuNUFFT operator. This is used only in gpuNUFFT

Methods

__init__

adj_op

Compute adjoint Non Uniform Fourier Transform.

compute_density

Compute the density compensation weights and set it.

data_consistency

Compute the gradient data consistency.

get_lipschitz_cst

Return the Lipschitz constant of the operator.

op

Compute forward non-uniform Fourier Transform.

pipe

Compute the density compensation weights for a given set of kspace locations.

with_off_resonnance_correction

Return a new operator with Off Resonnance Correction.

Attributes

available

backend

cpx_dtype

Return complex floating precision of the operator.

density

Density compensation of the operator.

dtype

Return floating precision of the operator.

interfaces

n_coils

Number of coils for the operator.

n_samples

Return the number of samples used by the operator.

ndim

Number of dimensions in image space of the operator.

norm_factor

Normalization factor of the operator.

samples

Return the samples used by the operator.

shape

Shape of the image space of the operator.

smaps

Sensitivity maps of the operator.

uses_density

Return True if the operator uses density compensation.

uses_sense

Return True if the Fourier Operator uses the SENSE method.

op(data, coeffs=None)[source]#

Compute forward non-uniform Fourier Transform.

Parameters:
  • img (np.ndarray) – input N-D array with the same shape as self.shape.

  • coeffs (np.ndarray, optional) – output Array. Should be pinned memory for best performances.

Returns:

Masked Fourier transform of the input image.

Return type:

np.ndarray

adj_op(coeffs, data=None)[source]#

Compute adjoint Non Uniform Fourier Transform.

Parameters:
  • coeffs (np.ndarray) – masked non-uniform Fourier transform 1D data.

  • data (np.ndarray, optional) – output image array. Should be pinned memory for best performances.

Returns:

Inverse discrete Fourier transform of the input coefficients.

Return type:

np.ndarray

property uses_sense#

Return True if the Fourier Operator uses the SENSE method.

classmethod pipe(kspace_loc, volume_shape, num_iterations=10, osf=2, **kwargs)[source]#

Compute the density compensation weights for a given set of kspace locations.

Parameters:
  • kspace_loc (np.ndarray) – the kspace locations

  • volume_shape (np.ndarray) – the volume shape

  • num_iterations (int default 10) – the number of iterations for density estimation

  • osf (float or int) – The oversampling factor the volume shape

get_lipschitz_cst(max_iter=10, tolerance=1e-05, **kwargs)[source]#

Return the Lipschitz constant of the operator.

tolerance: float, optional default 1e-5

Tolerance for the spectral radius estimation.

kwargs:

Extra kwargs for the operator.

Returns:

Lipschitz constant of the operator.

Return type:

float

_safe_squeeze(arr)[source]#

Squeeze the first two dimensions of shape of the operator.