MRIFourierCorrected#

class mrinufft.operators.off_resonance.MRIFourierCorrected(fourier_op, b0_map=None, readout_time=None, r2star_map=None, mask=None, interpolator='svd')[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:
  • fourier_op (FourierOperatorBase) – Existing NUFFT operator.

  • b0_map (NDArray) – Static field inhomogeneities map. b0_map and readout_time should have reciprocal units. (e.g. [Hz] and [s]) Also supports Cupy arrays and Torch tensors.

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

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

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

  • interpolators (str, dict, tuple[NDArray, NDArray]) –

    Determine how to decompose the field-map.

    • If str, use an existing method in extra/field_map.py with default parameters

    • If {"name":name, **kwargs} use an existing method in extra_field_map.py parameterize by kwargs.

    • If``tuple[NDArray, NDArray]`` use this directly as the decomposition (B and C)

  • interpolator (str | dict | tuple[ndarray[tuple[int, ...], dtype[_ScalarType_co]], ndarray[tuple[int, ...], dtype[_ScalarType_co]]])

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 imaginary: field_map = 1j * B0_map.

You can also use the method .with_off_resonance_correction to augment an existing operator with off-resonance correction capability.

Methods

__init__

adj_op

Compute Adjoint Operation with off-resonance effect.

cg

Conjugate Gradient method to solve the inverse problem.

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_interpolator

Decompose the field-map in space and time-wise interpolators.

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

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_batchs

Number of coils for the operator.

n_coils

Number of coils for the operator.

n_interpolators

Number of interpolators used to approximate the off-resonance effects.

n_samples

Return the number of samples used by the operator.

n_samples_per_shot

Number of time points in a shot.

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.

backend

available

Examples using mrinufft.operators.off_resonance.MRIFourierCorrected#

Off-resonance corrected NUFFT operator

Off-resonance corrected NUFFT operator
compute_interpolator(interpolators, field_map, readout_time, mask)[source]#

Decompose the field-map in space and time-wise interpolators.

Sets the B and C attributes.

Parameters:
op(data, *args)[source]#

Compute Forward Operation with off-resonance effect.

Parameters:

data (NDArray) – N-D input image.

Returns:

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

Return type:

NDArray

Note

This function uses numpy for all CPU arrays, and cupy for 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, *args)[source]#

Compute Adjoint Operation with off-resonance effect.

Parameters:

coeffs (NDArray) – k-space data

Returns:

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

Return type:

NDArray

Note

This function uses numpy for all CPU arrays, and cupy for 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.

get_lipschitz_cst(max_iter=10, **kwargs)[source]#

Return the Lipschitz constant of the operator.

Parameters:
  • max_iter (int) – Number of iteration to perform to estimate the Lipschitz constant.

  • kwargs – Extra kwargs for the cufinufft operator.

Returns:

Lipschitz constant of the operator.

Return type:

float

property n_interpolators#

Number of interpolators used to approximate the off-resonance effects.

property n_samples_per_shot#

Number of time points in a shot.