Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Loading a .mat reconstruction

RawMRISeries (and everything built on it — MRSSeries, MRSISeries, MRSWashinSeries) reads its recon dict from load_mat_file under the hood. Scanner reconstructions come in two MATLAB file formats depending on size and MATLAB version — plain (v5/v7, scipy-readable) and v7.3 (HDF5-based, needs mat73) — and load_mat_file hides that distinction behind one call.

FunctionWhat it does here
load_mat_file()loads either .mat format, returns a plain dict

The current format

<class 'dict'> ['__globals__', '__header__', '__version__', 'bb', 'h']
(700, 16, 16, 16)

The older (v7.3) format

Older reconstructions saved as MATLAB v7.3 fail the plain scipy.io.loadmat path and fall back to mat73 transparently — same call, same return type.

True

When the path isn’t a real .mat file

SymptomCauseFix
FileNotFoundErrorpath doesn’t existdouble-check the series ID / get_mat_data_from_series result
ValueError: ...does not have a .mat extensionwrong file passedload_mat_file only accepts .mat
RuntimeError: mat73 is required...v7.3 file, but mat73 isn’t installedmat73 is a core dependency (see pyproject.toml) — reinstall the env