read_gradients#
- mrinufft.io.read_gradients(grad_filename: str | Path, gamma: Gammas | float = Gammas.HYDROGEN) tuple[NDArray, NDArray, dict[str, Any]][source]#
Read the gradient waveforms stored in a gradient file.
Unlike
read_trajectory(), the waveforms are returned as stored, on the gradient raster, including the samples played outside of the ADC window (pre-phasors and spoilers, for version >= 5.1).- Parameters:
- Returns:
gradients (NDArray) – Gradients in T/m. Shape (num_shots, num_samples_per_shot, dimension).
initial_positions (NDArray) – K-space positions at the start of the waveforms, in 1/m. Shape (num_shots, dimension).
params (dict) – Header of the file.
gammais in kHz/T,num_samples_per_shotcounts all the stored samples, of whichstart_skip_samplesandend_skip_samplesare played outside of the ADC window.
- Return type: