(fname, bem)
| 1875 | |
| 1876 | |
| 1877 | def _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 | # ############################################################################# |
no test coverage detected