read_girf#

mrinufft.io.read_girf(filename: str | Path, fmax: float | None = None) → tuple[NDArray, NDArray][source]#

Read a gradient impulse response function (GIRF) exported at NeuroSpin.

The file is a MATLAB file holding f, the frequencies in kHz, and girf, the transfer functions with shape (3, n_terms, n_freqs): for each gradient axis of the scanner, the response of the spherical harmonic terms measured by the field camera, ordered as (B0, x, y, z, ...). See Gradient Impulse Response Function (GIRF) for the terms and their units.

Parameters:
  • filename (str | Path) – Path to the MATLAB file.

  • fmax (float, optional) – Frequency in Hz above which the response is set to zero, e.g. where the measurement is only noise. By default, the whole response is kept.

Returns:

  • freqs (NDArray) – Frequencies in Hz, from 0. Shape (n_freqs,).

  • girf (NDArray) – One-sided transfer functions, averaged between positive and negative frequencies so that the impulse response is real. Shape (3, n_terms, n_freqs).

Return type:

tuple[NDArray, NDArray]

Example using read_girf:#

GIRF-based correction of the encoding

GIRF-based correction of the encoding