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

Function _check_complete_surface

mne/bem.py:309–322  ·  view source on GitHub ↗
(surf, copy=False, incomplete="raise", extra="")

Source from the content-addressed store, hash-verified

307
308
309def _check_complete_surface(surf, copy=False, incomplete="raise", extra=""):
310 surf = complete_surface_info(surf, copy=copy, verbose=_verbose_safe_false())
311 fewer = np.where([len(t) < 3 for t in surf["neighbor_tri"]])[0]
312 if len(fewer) > 0:
313 fewer = list(fewer)
314 fewer = (fewer[:80] + ["..."]) if len(fewer) > 80 else fewer
315 fewer = ", ".join(str(f) for f in fewer)
316 msg = (
317 f"Surface {_bem_surf_name[surf['id']]} has topological defects: "
318 f"{len(fewer)} / {len(surf['rr'])} vertices have fewer than three "
319 f"neighboring triangles [{fewer}]{extra}"
320 )
321 _on_missing(on_missing=incomplete, msg=msg, name="on_defects")
322 return surf
323
324
325def _fwd_bem_linear_collocation_solution(bem):

Callers 3

make_bem_solutionFunction · 0.85
_surfaces_to_bemFunction · 0.85
read_bem_surfacesFunction · 0.85

Calls 3

complete_surface_infoFunction · 0.85
_verbose_safe_falseFunction · 0.85
_on_missingFunction · 0.85

Tested by

no test coverage detected