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

Function write_source_spaces

mne/source_space/_source_space.py:1289–1313  ·  view source on GitHub ↗

Write source spaces to a file. Parameters ---------- fname : path-like The name of the file, which should end with ``-src.fif`` or ``-src.fif.gz``. src : instance of SourceSpaces The source spaces (as returned by read_source_spaces). %(overwrite)s %(v

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

Source from the content-addressed store, hash-verified

1287
1288@verbose
1289def write_source_spaces(fname, src, *, overwrite=False, verbose=None):
1290 """Write source spaces to a file.
1291
1292 Parameters
1293 ----------
1294 fname : path-like
1295 The name of the file, which should end with ``-src.fif`` or
1296 ``-src.fif.gz``.
1297 src : instance of SourceSpaces
1298 The source spaces (as returned by read_source_spaces).
1299 %(overwrite)s
1300 %(verbose)s
1301
1302 See Also
1303 --------
1304 read_source_spaces
1305 """
1306 _validate_type(src, SourceSpaces, "src")
1307 check_fname(
1308 fname, "source space", ("-src.fif", "-src.fif.gz", "_src.fif", "_src.fif.gz")
1309 )
1310 _check_fname(fname, overwrite=overwrite)
1311
1312 with start_and_end_file(fname) as fid:
1313 _write_source_spaces(fid, src)
1314
1315
1316def _write_source_spaces(fid, src):

Callers 13

fname_src_smallFunction · 0.90
test_volume_source_spaceFunction · 0.90
test_setup_source_spaceFunction · 0.90
test_write_source_spaceFunction · 0.90
test_scale_mriFunction · 0.90
test_scale_mri_xfmFunction · 0.90
test_scale_morph_labelsFunction · 0.90
scale_source_spaceFunction · 0.85

Calls 5

_validate_typeFunction · 0.85
check_fnameFunction · 0.85
_check_fnameFunction · 0.85
start_and_end_fileFunction · 0.85
_write_source_spacesFunction · 0.85

Tested by 11

fname_src_smallFunction · 0.72
test_volume_source_spaceFunction · 0.72
test_setup_source_spaceFunction · 0.72
test_write_source_spaceFunction · 0.72
test_scale_mriFunction · 0.72
test_scale_mri_xfmFunction · 0.72
test_scale_morph_labelsFunction · 0.72