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

Function write_bem_surfaces

mne/bem.py:1777–1801  ·  view source on GitHub ↗

Write BEM surfaces to a FIF file. Parameters ---------- fname : path-like Filename to write. Can end with ``.h5`` to write using HDF5. surfs : dict | list of dict The surfaces, or a single surface. %(overwrite)s %(verbose)s

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

Source from the content-addressed store, hash-verified

1775
1776@verbose
1777def write_bem_surfaces(fname, surfs, overwrite=False, *, verbose=None):
1778 """Write BEM surfaces to a FIF file.
1779
1780 Parameters
1781 ----------
1782 fname : path-like
1783 Filename to write. Can end with ``.h5`` to write using HDF5.
1784 surfs : dict | list of dict
1785 The surfaces, or a single surface.
1786 %(overwrite)s
1787 %(verbose)s
1788 """
1789 if isinstance(surfs, dict):
1790 surfs = [surfs]
1791 fname = _check_fname(fname, overwrite=overwrite, name="fname")
1792
1793 if fname.suffix == ".h5":
1794 _, write_hdf5 = _import_h5io_funcs()
1795 write_hdf5(fname, dict(surfs=surfs), overwrite=True)
1796 else:
1797 with start_and_end_file(fname) as fid:
1798 start_block(fid, FIFF.FIFFB_BEM)
1799 write_int(fid, FIFF.FIFF_BEM_COORD_FRAME, surfs[0]["coord_frame"])
1800 _write_bem_surfaces_block(fid, surfs)
1801 end_block(fid, FIFF.FIFFB_BEM)
1802
1803
1804@verbose

Callers 6

test_io_bemFunction · 0.90
test_make_bem_modelFunction · 0.90
scale_bemFunction · 0.85
make_watershed_bemFunction · 0.85
write_head_bemFunction · 0.85
make_scalp_surfacesFunction · 0.85

Calls 8

_check_fnameFunction · 0.85
_import_h5io_funcsFunction · 0.85
write_hdf5Function · 0.85
start_and_end_fileFunction · 0.85
start_blockFunction · 0.85
write_intFunction · 0.85
end_blockFunction · 0.85

Tested by 2

test_io_bemFunction · 0.72
test_make_bem_modelFunction · 0.72