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

Method find_bads_ecg

mne/preprocessing/ica.py:1603–1760  ·  view source on GitHub ↗

Detect ECG related components. Cross-trial phase statistics :footcite:`DammersEtAl2008` or Pearson correlation can be used for detection. .. note:: If no ECG channel is available, an artificial ECG channel will be created based on cross-channel averaging o

(
        self,
        inst,
        ch_name=None,
        threshold="auto",
        start=None,
        stop=None,
        l_freq=8,
        h_freq=16,
        method="ctps",
        reject_by_annotation=True,
        measure="zscore",
        verbose=None,
    )

Source from the content-addressed store, hash-verified

1601
1602 @verbose
1603 def find_bads_ecg(
1604 self,
1605 inst,
1606 ch_name=None,
1607 threshold="auto",
1608 start=None,
1609 stop=None,
1610 l_freq=8,
1611 h_freq=16,
1612 method="ctps",
1613 reject_by_annotation=True,
1614 measure="zscore",
1615 verbose=None,
1616 ):
1617 """Detect ECG related components.
1618
1619 Cross-trial phase statistics :footcite:`DammersEtAl2008` or Pearson
1620 correlation can be used for detection.
1621
1622 .. note:: If no ECG channel is available, an artificial ECG channel will be
1623 created based on cross-channel averaging of ``"mag"`` or ``"grad"``
1624 channels. If neither of these channel types are available in
1625 ``inst``, artificial ECG channel creation is impossible.
1626
1627 Parameters
1628 ----------
1629 inst : instance of Raw, Epochs or Evoked
1630 Object to compute sources from.
1631 %(ch_name_ecg)s
1632 threshold : float | 'auto'
1633 Value above which a feature is classified as outlier. See Notes.
1634
1635 .. versionchanged:: 0.21
1636 start : int | float | None
1637 First sample to include. If float, data will be interpreted as
1638 time in seconds. If None, data will be used from the first sample.
1639 When working with Epochs or Evoked objects, must be float or None.
1640 stop : int | float | None
1641 Last sample to not include. If float, data will be interpreted as
1642 time in seconds. If None, data will be used to the last sample.
1643 When working with Epochs or Evoked objects, must be float or None.
1644 l_freq : float
1645 Low pass frequency.
1646 h_freq : float
1647 High pass frequency.
1648 method : 'ctps' | 'correlation'
1649 The method used for detection. If ``'ctps'``, cross-trial phase
1650 statistics :footcite:`DammersEtAl2008` are used to detect
1651 ECG-related components. See Notes.
1652 %(reject_by_annotation_all)s
1653
1654 .. versionadded:: 0.14.0
1655 %(measure)s
1656 %(verbose)s
1657
1658 Returns
1659 -------
1660 ecg_idx : list of int

Callers 3

test_ica_additionalFunction · 0.95
test_ica_labelsFunction · 0.95

Calls 12

_get_ctps_thresholdMethod · 0.95
get_sourcesMethod · 0.95
_find_bads_chMethod · 0.95
ctpsFunction · 0.90
_validate_typeFunction · 0.85
_check_optionFunction · 0.85
_get_ecg_channel_indexFunction · 0.85
_make_ecgFunction · 0.85
create_ecg_epochsFunction · 0.85
warnFunction · 0.85
infoMethod · 0.80
get_dataMethod · 0.45

Tested by 2

test_ica_additionalFunction · 0.76
test_ica_labelsFunction · 0.76