MCPcopy
hub / github.com/mne-tools/mne-python / write_bem_solution

Function write_bem_solution

mne/bem.py:1852–1874  ·  view source on GitHub ↗

Write a BEM model with solution. Parameters ---------- fname : path-like The filename to use. Can end with ``.h5`` to write using HDF5. bem : instance of ConductorModel The BEM model with solution to save. %(overwrite)s %(verbose)s See Also --------

(fname, bem, overwrite=False, *, verbose=None)

Source from the content-addressed store, hash-verified

1850
1851@verbose
1852def write_bem_solution(fname, bem, overwrite=False, *, verbose=None):
1853 """Write a BEM model with solution.
1854
1855 Parameters
1856 ----------
1857 fname : path-like
1858 The filename to use. Can end with ``.h5`` to write using HDF5.
1859 bem : instance of ConductorModel
1860 The BEM model with solution to save.
1861 %(overwrite)s
1862 %(verbose)s
1863
1864 See Also
1865 --------
1866 read_bem_solution
1867 """
1868 fname = _check_fname(fname, overwrite=overwrite, name="fname")
1869 if fname.suffix == ".h5":
1870 _, write_hdf5 = _import_h5io_funcs()
1871 bem = {k: bem[k] for k in ("surfs", "solution", "bem_method")}
1872 write_hdf5(fname, bem, overwrite=True)
1873 else:
1874 _write_bem_solution_fif(fname, bem)
1875
1876
1877def _write_bem_solution_fif(fname, bem):

Callers 3

test_io_bemFunction · 0.90
test_bem_solutionFunction · 0.90

Calls 4

_check_fnameFunction · 0.85
_import_h5io_funcsFunction · 0.85
write_hdf5Function · 0.85
_write_bem_solution_fifFunction · 0.85

Tested by 2

test_io_bemFunction · 0.72
test_bem_solutionFunction · 0.72