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

Function create_ecg_epochs

mne/preprocessing/ecg.py:337–482  ·  view source on GitHub ↗

Conveniently generate epochs around ECG artifact events. %(create_ecg_epochs)s .. note:: Filtering is only applied to the ECG channel while finding events. The resulting ``ecg_epochs`` will have no filtering applied (i.e., have the same filter properties as

(
    raw,
    ch_name=None,
    event_id=999,
    picks=None,
    tmin=-0.5,
    tmax=0.5,
    l_freq=8,
    h_freq=16,
    reject=None,
    flat=None,
    baseline=None,
    preload=True,
    keep_ecg=False,
    reject_by_annotation=True,
    decim=1,
    verbose=None,
)

Source from the content-addressed store, hash-verified

335
336@verbose
337def create_ecg_epochs(
338 raw,
339 ch_name=None,
340 event_id=999,
341 picks=None,
342 tmin=-0.5,
343 tmax=0.5,
344 l_freq=8,
345 h_freq=16,
346 reject=None,
347 flat=None,
348 baseline=None,
349 preload=True,
350 keep_ecg=False,
351 reject_by_annotation=True,
352 decim=1,
353 verbose=None,
354):
355 """Conveniently generate epochs around ECG artifact events.
356
357 %(create_ecg_epochs)s
358
359 .. note:: Filtering is only applied to the ECG channel while finding
360 events. The resulting ``ecg_epochs`` will have no filtering
361 applied (i.e., have the same filter properties as the input
362 ``raw`` instance).
363
364 Parameters
365 ----------
366 raw : instance of Raw
367 The raw data.
368 %(ch_name_ecg)s
369 %(event_id_ecg)s
370 %(picks_all)s
371 tmin : float
372 Start time before event.
373 tmax : float
374 End time after event.
375 %(l_freq_ecg_filter)s
376 %(reject_epochs)s
377 %(flat)s
378 %(baseline_epochs)s
379 preload : bool
380 Preload epochs or not (default True). Must be True if
381 keep_ecg is True.
382 keep_ecg : bool
383 When ECG is synthetically created (after picking), should it be added
384 to the epochs? Must be False when synthetic channel is not used.
385 Defaults to False.
386 %(reject_by_annotation_epochs)s
387
388 .. versionadded:: 0.14.0
389 %(decim)s
390
391 .. versionadded:: 0.21.0
392 %(verbose)s
393
394 Returns

Callers 5

test_find_ecgFunction · 0.90
test_plot_ica_overlayFunction · 0.90
find_bads_ecgMethod · 0.85

Calls 7

find_ecg_eventsFunction · 0.85
_picks_to_idxFunction · 0.85
EpochsClass · 0.85
RawArrayClass · 0.85
create_infoFunction · 0.85
_unlockMethod · 0.80
add_channelsMethod · 0.80

Tested by 2

test_find_ecgFunction · 0.72
test_plot_ica_overlayFunction · 0.72