Write bem surfaces to open file handle.
(fid, surfs)
| 1831 | |
| 1832 | |
| 1833 | def _write_bem_surfaces_block(fid, surfs): |
| 1834 | """Write bem surfaces to open file handle.""" |
| 1835 | for surf in surfs: |
| 1836 | start_block(fid, FIFF.FIFFB_BEM_SURF) |
| 1837 | if "sigma" in surf: |
| 1838 | write_float(fid, FIFF.FIFF_BEM_SIGMA, surf["sigma"]) |
| 1839 | write_int(fid, FIFF.FIFF_BEM_SURF_ID, surf["id"]) |
| 1840 | write_int(fid, FIFF.FIFF_MNE_COORD_FRAME, surf["coord_frame"]) |
| 1841 | write_int(fid, FIFF.FIFF_BEM_SURF_NNODE, surf["np"]) |
| 1842 | write_int(fid, FIFF.FIFF_BEM_SURF_NTRI, surf["ntri"]) |
| 1843 | write_float_matrix(fid, FIFF.FIFF_BEM_SURF_NODES, surf["rr"]) |
| 1844 | # index start at 0 in Python |
| 1845 | write_int_matrix(fid, FIFF.FIFF_BEM_SURF_TRIANGLES, surf["tris"] + 1) |
| 1846 | if "nn" in surf and surf["nn"] is not None and len(surf["nn"]) > 0: |
| 1847 | write_float_matrix(fid, FIFF.FIFF_BEM_SURF_NORMALS, surf["nn"]) |
| 1848 | end_block(fid, FIFF.FIFFB_BEM_SURF) |
| 1849 | |
| 1850 | |
| 1851 | @verbose |
no test coverage detected