(filename, *, on_defects)
| 1443 | |
| 1444 | |
| 1445 | def _read_surface(filename, *, on_defects): |
| 1446 | bem = dict() |
| 1447 | if filename is not None and op.exists(filename): |
| 1448 | if filename.endswith(".fif"): |
| 1449 | bem = read_bem_surfaces(filename, on_defects=on_defects, verbose=False)[0] |
| 1450 | else: |
| 1451 | try: |
| 1452 | bem = read_surface(filename, return_dict=True)[2] |
| 1453 | bem["rr"] *= 1e-3 |
| 1454 | complete_surface_info(bem, copy=False) |
| 1455 | except Exception: |
| 1456 | raise ValueError( |
| 1457 | f"Error loading surface from {filename} (see Terminal for details)." |
| 1458 | ) |
| 1459 | return bem |
| 1460 | |
| 1461 | |
| 1462 | @fill_doc |
no test coverage detected