compute_mfi_coefficients#
- mrinufft.extras.compute_mfi_coefficients(field_map: NDArray, readout_time: NDArray, mask: NDArray, L: int = 9, n_bins: int | tuple[int, int] = 1024, lazy: bool = True)[source]#
Compute off-resonance correction coefficients using Mixed-Frequency-Interpolator.
- Parameters:
field_map (NDArray) – The field map (off-resonance map) in rad/s, If complex-valued, the real part is interpreted as R2* mapping. If real-valued this is the field inhomogeneities in Hz. and will be multiplied by \(2j\pi\)
readout_time (NDArray) – The vector of time points (in seconds) at which to compute phase evolution.
mask (NDArray) – Binary mask indicating object region for field map/statistics. Only those voxels are used to build the histogram, so field-map values outside it are clamped to the range spanned by the object.
L (int, optional) – Number of virtual centers or basis functions retained (default is -1, automatically estimated from the time-bandwidth product of the readout). Too small an
Lleaves a large residual phase error, which appears as artefacts in the corrected image; a warning is logged when that happens.n_bins (int, optional) – Number of histogram bins for off-resonance value clustering (default is 1024).
lazy (bool, default False) – If True, use a lazy evaluation scheme for the space interpolator C, saving memory.
- Returns:
B (NDArray) – [L, nbins] phase basis matrix in the time domain.
C (NDArray) – [L, nt] interpolation matrix to transform weighted basis to phase at the time points; nt = len(readout_time).
E (NDArray) – [nbins, nt] exponential off-resonance phase matrix at input histogram bins.
References
Man, L.-C., Pauly, J.M. and Macovski, A. (1997), Multifrequency interpolation for fast off-resonance correction. Magn. Reson. Med., 37: 785-792. https://doi.org/10.1002/mrm.1910370523
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.See also
This function is part of the orc_factorization registry,
get_orc_factorization(). You can find other registered functions in this registry below: