MRIFourierCorrected#

class mrinufft.operators.off_resonance.MRIFourierCorrected(fourier_op, b0_map=None, readout_time=None, n_time_segments=6, n_bins=(40, 10), mask=None, r2star_map=None, B=None, tl=None, backend='cpu')[source]#

Bases: FourierOperatorBase

Fourier Operator with B0 Inhomogeneities compensation.

This is a wrapper around the Fourier Operator to compensate for the B0 inhomogeneities in the k-space.

Parameters:
  • b0_map (np.ndarray) – Static field inhomogeneities map. b0_map and readout_time should have reciprocal units. Also supports Cupy arrays and Torch tensors.

  • readout_time (np.ndarray) – Readout time in [s] of shape (n_shots, n_pts) or (n_shots * n_pts,). Also supports Cupy arrays and Torch tensors.

  • n_time_segments (int, optional) – Number of time segments. The default is 6.

  • n_bins (int | Sequence[int] optional) – Number of histogram bins to use for (B0, T2*). The default is (40, 10) If it is a scalar, assume n_bins = (n_bins, 10). For real fieldmap (B0 only), n_bins[1] is ignored.

  • mask (np.ndarray, optional) – Boolean mask of the region of interest (e.g., corresponding to the imaged object). This is used to exclude the background fieldmap values from histogram computation. The default is None (use the whole map). Also supports Cupy arrays and Torch tensors.

  • B (np.ndarray, optional) – Temporal interpolator of shape (n_time_segments, len(readout_time)).

  • tl (np.ndarray, optional) – Time segment centers of shape (n_time_segments,). Also supports Cupy arrays and Torch tensors.

  • r2star_map (np.ndarray, optional) – Effective transverse relaxation map (R2*). r2star_map and readout_time should have reciprocal units. Must have same shape as b0_map. The default is None (purely imaginary field). Also supports Cupy arrays and Torch tensors.

  • backend (str, optional) – The backend to use for computations. Either ‘cpu’, ‘gpu’ or ‘torch’. The default is cpu.

Notes

The total field map used to calculate the field coefficients is field_map = R2*_map + 1j * B0_map. If R2* is not provided, the field is purely immaginary: field_map = 1j * B0_map.

Methods

__init__

adj_op

Compute Adjoint Operation with off-resonance effect.

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.

get_spatial_coefficients

Compute spatial coefficients for field approximation.

make_autograd

Make a new Operator with autodiff support.

op

Compute Forward Operation with off-resonance effect.

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, *args)[source]#

Compute Forward Operation with off-resonance effect.

Parameters:

x (numpy.ndarray) – N-D input image. Also supports Cupy arrays and Torch tensors.

Returns:

Masked distorted N-D k-space. Array module is the same as input data.

Return type:

numpy.ndarray

adj_op(coeffs, *args)[source]#

Compute Adjoint Operation with off-resonance effect.

Parameters:

x (numpy.ndarray) – Masked distorted N-D k-space. Also supports Cupy arrays and Torch tensors.

Returns:

Inverse Fourier transform of the distorted input k-space. Array module is the same as input coeffs.

Return type:

numpy.ndarray

static get_spatial_coefficients(field_map, tl)[source]#

Compute spatial coefficients for field approximation.

Parameters:
  • field_map (np.ndarray) – Total field map used to calculate the field coefficients is field_map = R2*_map + 1j * B0_map. Also supports Cupy arrays and Torch tensors.

  • tl (np.ndarray) – Time segment centers of shape (n_time_segments,). Also supports Cupy arrays and Torch tensors.

Returns:

C – Off-resonance phase map at each time segment center of shape (n_time_segments, *field_map.shape). Array module is the same as input field_map.

Return type:

np.ndarray