MCPcopy Index your code
hub / github.com/mne-tools/mne-python / _assert_inside

Function _assert_inside

mne/bem.py:547–557  ·  view source on GitHub ↗

Check one set of points is inside a surface.

(fro, to)

Source from the content-addressed store, hash-verified

545
546
547def _assert_inside(fro, to):
548 """Check one set of points is inside a surface."""
549 # this is "is_inside" in surface_checks.c
550 fro_name = _bem_surf_name[fro["id"]]
551 to_name = _bem_surf_name[to["id"]]
552 logger.info(f"Checking that surface {fro_name} is inside surface {to_name} ...")
553 tot_angle = _get_solids(to["rr"][to["tris"]], fro["rr"])
554 if (np.abs(tot_angle / (2 * np.pi) - 1.0) > 1e-5).any():
555 raise RuntimeError(
556 f"Surface {fro_name} is not completely inside surface {to_name}"
557 )
558
559
560def _check_surfaces(surfs, incomplete="raise"):

Callers 2

test_bem_solutionFunction · 0.90
_check_surfacesFunction · 0.85

Calls 2

_get_solidsFunction · 0.85
infoMethod · 0.80

Tested by 1

test_bem_solutionFunction · 0.72