(stc, src)
| 3406 | |
| 3407 | |
| 3408 | def _check_stc_src(stc, src): |
| 3409 | if stc is not None and src is not None: |
| 3410 | _check_subject( |
| 3411 | src._subject, |
| 3412 | stc.subject, |
| 3413 | raise_error=False, |
| 3414 | first_kind="source space subject", |
| 3415 | second_kind="stc.subject", |
| 3416 | ) |
| 3417 | for s, v, hemi in zip(src, stc.vertices, ("left", "right")): |
| 3418 | n_missing = (~np.isin(v, s["vertno"])).sum() |
| 3419 | if n_missing: |
| 3420 | raise ValueError( |
| 3421 | f"{n_missing}/{len(v)} {hemi} hemisphere stc vertices " |
| 3422 | "missing from the source space, likely mismatch" |
| 3423 | ) |
| 3424 | |
| 3425 | |
| 3426 | def _prepare_label_extraction(stc, labels, src, mode, allow_empty, use_sparse): |
no test coverage detected