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:
FourierOperatorBaseInterface 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__Compute adjoint Non Uniform Fourier Transform.
check_shapeValidate the shapes of the image or k-space data against operator shapes.
compute_densityCompute the density compensation weights and set it.
compute_smapsCompute the sensitivity maps and set it.
Compute the data consistency estimation directly on gpu.
Return the Lipschitz constant of the operator.
make_autogradMake a new Operator with autodiff support.
make_linopsCreate a Scipy Linear Operator from the NUFFT operator.
Compute forward non-uniform Fourier Transform.
pinv_solverSolves the linear system Ax = y.
Compute the density compensation weights for a given set of kspace locations.
Toggle the gradient trajectory of the operator.
with_autogradReturn a Fourier operator with autograd capabilities.
with_off_resonance_correctionReturn a new operator with Off Resonnance Correction.
Attributes
autograd_availableavailablebackendcpx_dtypeReturn complex floating precision of the operator.
Density compensation of the operator.
dtypeReturn floating precision of the operator.
img_full_shapeFull image shape with batch and coil dimensions.
interfacesksp_full_shapeFull kspace shape with batch and coil dimensions.
n_batchsNumber of coils for the operator.
n_coilsNumber of coils for the operator.
n_samplesReturn the number of samples used by the operator.
ndimNumber of dimensions in image space of the operator.
norm_factorNormalization factor of the operator.
Return the samples used by the operator.
shapeShape of the image space of the operator.
Sensitivity maps of the operator.
uses_densityReturn True if the operator uses density compensation.
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
Note
This function uses
numpyfor all CPU arrays, andcupyfor all on-gpu array. It will convert all its array argument to the respective array library. The outputs will be converted back to the original array module and device.
- 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
Note
This function uses
numpyfor all CPU arrays, andcupyfor all on-gpu array. It will convert all its array argument to the respective array library. The outputs will be converted back to the original array module and device.
- property uses_sense#
Return True if the Fourier Operator uses the SENSE method.
- property smaps#
Sensitivity maps of the operator.
- property samples: ndarray[tuple[int, ...], dtype[_ScalarType_co]]#
Return the samples used by the operator.
- property density: ndarray[tuple[int, ...], dtype[floating]] | None#
Density compensation of the operator.
- classmethod pipe(kspace_loc, volume_shape, max_iter=10, osf=2, normalize=True, **kwargs)[source]#
Compute the density compensation weights for a given set of kspace locations.
- Parameters:
- get_lipschitz_cst(max_iter=10, tolerance=1e-05, **kwargs)[source]#
Return the Lipschitz constant of the operator.
- data_consistency(image_data, obs_data)[source]#
Compute the data consistency estimation directly on gpu.
This mixes the op and adj_op method to perform F_adj(F(x-y)) on a per coil basis. By doing the computation coil wise, it uses less memory than the naive call to adj_op(op(x)-y)
- Parameters:
image (array) – Image on which the gradient operation will be evaluated. N_coil x Image shape is not using sense.
obs_data (array) – Observed data.
Note
This function uses
numpyfor all CPU arrays, andcupyfor all on-gpu array. It will convert all its array argument to the respective array library. The outputs will be converted back to the original array module and device.