[Mne_analysis] Plot Epochs with Bad Epochs Selected in Red
mainakjas at gmail.com
Mon Mar 4 22:12:04 EST 2019
External Email - Use Caution
I don’t think it’s possible in MNE. The reason is that the data that has
been dropped is not there any more.
However, there is a workaround that you could try using autoreject. Here’s
a code snippet to get you started:
import numpy as npfrom autoreject import RejectLog
epochs_orig = epochs.copy()
# now interactively mark the bad epochs
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,
On Mon, Mar 4, 2019 at 1:47 PM Rockhill, Alexander P.
AROCKHILL at mgh.harvard.edu <http://mailto:AROCKHILL@mgh.harvard.edu> wrote:
> I couldn't find a way to plot epochs with the epochs in the drop log
> plotted in red instead of not plotted at all. If anyone had any advice in
> regards to how to do that I would appreciate it.
> Translational NeuroEngineering Laboratory
> Division of Neurotherapeutics, Department of Psychiatry
> Massachusetts General Hospital, Martinos Center
> 149 13th St Charlestown #2301, Boston, MA 02129
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mne_analysis