meeg_utils.qc.HeadMovement#
- class meeg_utils.qc.HeadMovement(*, head_pos=None, warn_mm=None, origin=(0.0, 0.0, 0.04), gof_limit=0.98, dist_limit=0.005, min_good_fraction=0.9, weighted=False)[source]#
Head movement during an MEG recording, from continuous head localization.
Head positions are estimated from the cHPI coils with MNE (
mne.chpi.compute_chpi_amplitudes(),compute_chpi_locs()andcompute_head_pos()for Neuromag;extract_chpi_locs_ctf()for CTF), or read from a head-position file (e.g. MaxFilter’s.pos). Movement is the displacement oforiginrelative to the sensors, compared with the head position ininfo["dev_head_t"](the one source analysis uses).- Parameters:
head_pos (str | Path | ndarray | None) – Precomputed head positions (
.posfile or array of shape (n, 10));Noneestimates them from the cHPI signals.warn_mm (float | None) – Maximum displacement that is flagged. There is no formal standard and the acceptable movement depends on the participants (children and patients move more) and on whether movement is compensated later; 5 mm is a common exclusion or movement-correction criterion.
None(default) reports the displacement without a verdict.origin (tuple of float) – Point (head frame, m) whose displacement is measured.
gof_limit (float) – Coil fits with a goodness of fit below
gof_limitor further thandist_limit(m) from their digitized position are not used (MNE defaults 0.98 and 0.005).dist_limit (float) – Coil fits with a goodness of fit below
gof_limitor further thandist_limit(m) from their digitized position are not used (MNE defaults 0.98 and 0.005).min_good_fraction (float) – A coil with good fits in less than this fraction of the time is flagged (loose, off, or not digitized correctly).
weighted (bool) – Weight coil fits by their goodness of fit (MNE’s current default,
False).
- metrics_#
max_displacement_mm,median_displacement_mm,fraction_above(of time abovewarn_mm, when set),max_rotation_deg,n_positionsand, when estimated from cHPI,coil_good_fraction.- Type:
Notes
Figures:
"positions"(mne.viz.plot_head_positions(), relative todev_head_t) and"displacement"(displacement over time).- __init__(*, head_pos=None, warn_mm=None, origin=(0.0, 0.0, 0.04), gof_limit=0.98, dist_limit=0.005, min_good_fraction=0.9, weighted=False)[source]#
Methods
__init__(*[, head_pos, warn_mm, origin, ...])compute(raw)Measure the recording.
get_metadata_routing()Get metadata routing of this object.
get_params([deep])Get parameters for this estimator.
not_applicable(raw)Return why the check cannot run on
raw, orNoneif it can.plot([kind, inst])Draw quality-control figures.
set_params(**params)Set the parameters of this estimator.
Attributes
levelThe worst verdict of the findings (
"ok"if there are none).Data types the check needs at least one of ("meg", "eeg").
Key of the check in reports.
kind -> whether it needs data (
inst).systemsAcquisition systems the check applies to;
Nonemeans all.- modalities: ClassVar[frozenset[str]] = frozenset({'meg'})#
Data types the check needs at least one of (“meg”, “eeg”).