RawGpuNUFFT#

class mrinufft.operators.interfaces.gpunufft.RawGpuNUFFT(samples, shape, n_coils=1, density_comp=None, kernel_width=3, sector_width=8, osf=2, upsampfac=None, balance_workload=True, smaps=None, pinned_smaps=None, pinned_image=None, pinned_kspace=None, use_gpu_direct=False)[source]#

Bases: object

GPU implementation of N-D non-uniform fast Fourier Transform class.

samples#

the normalized kspace location values in the Fourier domain.

Type:

np.ndarray

shape#

shape of the image

Type:

tuple of int

operator#

to carry out operation

Type:

The NUFFTOp object

n_coils#

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

Type:

int default 1

Methods

__init__

Initialize the 'NUFFT' class.

adj_op

Compute adjoint of non-uniform Fourier transform.

adj_op_direct

Compute adjoint of non-uniform Fourier transform.

op

Compute the masked non-Cartesian Fourier transform.

op_direct

Compute the masked non-Cartesian Fourier transform.

set_pts

Update the kspace locations and density compensation.

set_smaps

Update the smaps.

toggle_grad_traj

Toggle the gradient mode of the operator.

toggle_grad_traj()[source]#

Toggle the gradient mode of the operator.

_reshape_image(image, direction='op')[source]#

Reshape the image to the correct format.

set_smaps(smaps)[source]#

Update the smaps.

Parameters:

smaps (np.ndarray[np.complex64])) – sensittivity maps

set_pts(samples, density=None)[source]#

Update the kspace locations and density compensation.

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

  • density (np.ndarray|str, optional) – the density compensation if not provided, no density compensation is performed. if “recompute”, the density compensation is recomputed. Note the recompute option works only if density compensation was computed at initialization and not provided as ndarray.

op_direct(image, kspace=None, interpolate_data=False)[source]#

Compute the masked non-Cartesian Fourier transform.

The incoming data is on GPU already and we return a GPU array.

Parameters:
  • image (np.ndarray) – input array with the same shape as self.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:

Non-uniform Fourier transform of the input image.

Return type:

cp.ndarray

op(image, kspace=None, interpolate_data=False)[source]#

Compute the masked non-Cartesian Fourier transform.

Parameters:
  • image (np.ndarray) – input array with the same shape as self.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:

Non-uniform Fourier transform of the input image.

Return type:

np.ndarray

adj_op(coeffs, image=None, grid_data=False)[source]#

Compute adjoint of non-uniform Fourier transform.

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

  • grid_data (bool, default False) – if True, the kspace data is gridded and returned, this is used for density compensation

Returns:

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

Return type:

np.ndarray

adj_op_direct(coeffs, image=None, grid_data=False)[source]#

Compute adjoint of non-uniform Fourier transform.

The incoming data is on GPU already and we return a GPU array.

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

  • grid_data (bool, default False) – if True, the kspace data is gridded and returned, this is used for density compensation

Returns:

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

Return type:

np.ndarray