meeg_utils.qc.HeartRate#
- class meeg_utils.qc.HeartRate(*, min_bpm=None, max_bpm=None, max_irregular=0.1)[source]#
Heart rate from the ECG channel (or MEG magnetometers), a test of the ECG.
Heartbeats are detected with
mne.preprocessing.find_ecg_events()(MNE defaults; without an ECG channel MNE builds a synthetic ECG from the MEG magnetometers).Whether the detection worked is judged from the intervals between beats, not from the rate: missed or spurious beats make them irregular (a missed beat doubles an interval). Intervals more than 30 % away from the median interval are counted; normal beat-to-beat variability at rest stays well below that. When too many are irregular the rate is not reported (
heart_rate_bpmisNone,reliableisFalse). With an ECG channel this is a"warn"(check the ECG electrodes); with the synthetic ECG it is"info", since the magnetometers often pick up the heart too weakly and nothing is wrong with the recording.The rate itself is reported without a verdict by default: the normal adult resting range is 60-100 bpm, but trained people are often below 60 and children above 100.
- Parameters:
min_bpm (float | None) – Range of the heart rate outside which it is flagged;
None(default) does not judge the rate.max_bpm (float | None) – Range of the heart rate outside which it is flagged;
None(default) does not judge the rate.max_irregular (float) – Fraction of irregular intervals above which the detection is unreliable. There is no published limit; 0.1 is this library’s choice. (Synthetic ECG from CTF magnetometers in HAD-MEEG gave a plausible-looking 86 bpm with intervals varying by 340 ms.)
- metrics_#
heart_rate_bpm(Nonewhen unreliable),reliable,n_beats,rr_sd_ms,irregular_fractionandchannel("synthetic"when derived from MEG).- Type:
Notes
Figures:
"heartbeats"(heart rate over time and the average beat).Methods
__init__(*[, min_bpm, max_bpm, max_irregular])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).modalitiesData 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.