Created
March 5, 2019 03:16
-
-
Save jasmainak/1d3e04633e50328abd81408481ca884f to your computer and use it in GitHub Desktop.
visualize bad epochs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from autoreject import RejectLog | |
epochs_orig = epochs.copy() | |
# now interactively mark the bad epochs | |
epochs.plot() | |
bad_idxs = [idx for idx, drop in enumerate(epochs.drop_log) if | |
drop == ['USER']] | |
n_channels = epochs_orig.info['nchan'] | |
n_epochs = len(epochs_orig) | |
bad_epochs = np.zeros((n_epochs,)) | |
labels = np.zeros((n_epochs, n_channels)) | |
bad_epochs[bad_idxs] = 1 | |
reject = RejectLog(bad_epochs=bad_epochs, labels=labels, | |
ch_names=epochs.info['ch_names']) | |
reject.plot_epochs(epochs_orig) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment