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

Function _trans_sss_basis

mne/preprocessing/maxwell.py:2496–2513  ·  view source on GitHub ↗

Compute SSS basis (optionally) using a dev<->head trans.

(exp, all_coils, trans=None, coil_scale=100.0)

Source from the content-addressed store, hash-verified

2494
2495
2496def _trans_sss_basis(exp, all_coils, trans=None, coil_scale=100.0):
2497 """Compute SSS basis (optionally) using a dev<->head trans."""
2498 if trans is not None:
2499 if not isinstance(trans, Transform):
2500 trans = Transform("meg", "head", trans)
2501 assert not np.isnan(trans["trans"]).any()
2502 all_coils = (
2503 apply_trans(trans, all_coils[0]),
2504 apply_trans(trans, all_coils[1], move=False),
2505 ) + all_coils[2:]
2506 if not isinstance(coil_scale, np.ndarray):
2507 # Scale all magnetometers (with `coil_class` == 1.0) by `mag_scale`
2508 cs = coil_scale
2509 coil_scale = np.ones((all_coils[3], 1))
2510 coil_scale[all_coils[4]] = cs
2511 S_tot = _sss_basis(exp, all_coils)
2512 S_tot *= coil_scale
2513 return S_tot
2514
2515
2516# intentionally omitted: st_duration, st_correlation, destination, st_fixed,

Callers 9

test_multipolar_basesFunction · 0.90
test_esssFunction · 0.90
average_movementsFunction · 0.85
_adjust_mag_normalsFunction · 0.85
_cal_sss_targetFunction · 0.85
_estimate_imbalanceFunction · 0.85
_prep_maxwell_filterFunction · 0.85
_get_s_decompFunction · 0.85
_sss_basis_pointFunction · 0.85

Calls 3

TransformClass · 0.85
apply_transFunction · 0.85
_sss_basisFunction · 0.85

Tested by 2

test_multipolar_basesFunction · 0.72
test_esssFunction · 0.72