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

Function _write_bem_solution_fif

mne/bem.py:1877–1895  ·  view source on GitHub ↗
(fname, bem)

Source from the content-addressed store, hash-verified

1875
1876
1877def _write_bem_solution_fif(fname, bem):
1878 _check_bem_size(bem["surfs"])
1879 with start_and_end_file(fname) as fid:
1880 start_block(fid, FIFF.FIFFB_BEM)
1881 # Coordinate frame (mainly for backward compatibility)
1882 write_int(fid, FIFF.FIFF_BEM_COORD_FRAME, bem["surfs"][0]["coord_frame"])
1883 solver = bem.get("solver", "mne")
1884 if solver != "mne":
1885 write_string(fid, FIFF.FIFF_DESCRIPTION, json.dumps(dict(solver=solver)))
1886 # Surfaces
1887 _write_bem_surfaces_block(fid, bem["surfs"])
1888 # The potential solution
1889 if "solution" in bem:
1890 _check_option(
1891 "bem_method", bem["bem_method"], (FIFF.FIFFV_BEM_APPROX_LINEAR,)
1892 )
1893 write_int(fid, FIFF.FIFF_BEM_APPROX, FIFF.FIFFV_BEM_APPROX_LINEAR)
1894 write_float_matrix(fid, FIFF.FIFF_BEM_POT_SOLUTION, bem["solution"])
1895 end_block(fid, FIFF.FIFFB_BEM)
1896
1897
1898# #############################################################################

Callers 1

write_bem_solutionFunction · 0.85

Calls 9

_check_bem_sizeFunction · 0.85
start_and_end_fileFunction · 0.85
start_blockFunction · 0.85
write_intFunction · 0.85
write_stringFunction · 0.85
_check_optionFunction · 0.85
write_float_matrixFunction · 0.85
end_blockFunction · 0.85

Tested by

no test coverage detected