FourierOperatorCPU#

class mrinufft.operators.base.FourierOperatorCPU(samples, shape, density=False, n_coils=1, n_batchs=1, n_trans=1, smaps=None, raw_op=None, squeeze_dims=True)[source]#

Bases: FourierOperatorBase

Base class for CPU-based NUFFT operator.

The NUFFT operation will be done sequentially and looped over coils and batches.

Parameters:
  • samples (np.ndarray) – The samples used by the operator.

  • shape (tuple) – The shape of the image space (in 2D or 3D)

  • density (bool or np.ndarray) – If True, the density compensation is estimated from the samples. If False, no density compensation is applied. If np.ndarray, the density compensation is applied from the array.

  • n_coils (int) – The number of coils.

  • smaps (np.ndarray) – The sensitivity maps.

  • raw_op (object) – An object implementing the NUFFT API. Ut should be responsible to compute a single type 1 /type 2 NUFFT.

Methods

__init__

adj_op

Non Cartesian MRI adjoint operator.

check_shape

Validate the shapes of the image or k-space data against operator shapes.

compute_density

Compute the density compensation weights and set it.

compute_smaps

Compute the sensitivity maps and set it.

data_consistency

Compute the gradient data consistency.

get_lipschitz_cst

Return the Lipschitz constant of the operator.

make_autograd

Make a new Operator with autodiff support.

op

Non Cartesian MRI forward operator.

with_autograd

Return a Fourier operator with autograd capabilities.

with_off_resonance_correction

Return a new operator with Off Resonnance Correction.

Attributes

autograd_available

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 operator uses sensitivity maps.

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

Non Cartesian MRI forward operator.

Parameters:
  • data (np.ndarray)

  • space. (The uniform (2D or 3D) data in image)

Return type:

Results array on the same device as data.

Notes

this performs for every coil ell: ..math:: mathcal{F}mathcal{S}_ell x

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

Non Cartesian MRI adjoint operator.

Parameters:

coeffs (np.array or GPUArray)

Return type:

Array in the same memory space of coeffs. (ie on cpu or gpu Memory).

data_consistency(image_data, obs_data)[source]#

Compute the gradient data consistency.

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.

_safe_squeeze(arr)[source]#

Squeeze the first two dimensions of shape of the operator.