autoreject.RejectLog#

class autoreject.RejectLog(bad_epochs, labels, ch_names)[source]#

Bases: object

The Rejection Log.

Parameters:
bad_epochsarray_like, shape (n_epochs,)

The boolean array with entries True for epochs that are marked as bad.

labelsarray, shape (n_epochs, n_channels)

It contains integers that encode if a channel in a given epoch is good (value 0), bad (1), or bad and interpolated (2).

ch_nameslist of str

The list of channels corresponding to the rows of the labels.

plot(orientation='vertical', show_names='auto', aspect='equal', show=True, ax=None)[source]#

Plot an image of good, bad and interpolated channels for each epoch.

Parameters:
orientation‘vertical’ | ‘horizontal’

If ‘vertical’ (default), will plot sensors on x-axis and epochs on y-axis. If ‘horizontal’, will plot epochs on x-axis and sensors on y-axis.

show_names‘auto’ | int

If ‘auto’ (default), show all channel names if fewer than 25 entries. Otherwise it shows every 5 entries. If int, show every show_names entries.

aspect‘equal’ | ‘auto’

If ‘equal’, the pixels are square. If ‘auto’, the axis is fixed and the aspect ratio is adjusted for data to fit. See documentation of plt.imshow() for more details.

showbool

If True (default), display the figure immediately.

axmatplotlib.axes.Axes | None

The axes to plot to. In None (default), create a new figure and axes.

Returns:
figurematplotlib.figure.Figure

The figure object containing the plot.

plot_epochs(epochs, scalings=None, title='')[source]#

Plot interpolated and dropped epochs.

Parameters:
epochsinstance of mne.Epochs

The epochs.

scalingsdict | None

Scaling factors for the traces. If None, defaults to:

dict(mag=1e-12, grad=4e-11, eeg=20e-6, eog=150e-6, ecg=5e-4,
     emg=1e-3, ref_meg=1e-12, misc=1e-3, stim=1,
     resp=1, chpi=1e-4, whitened=1e2)
titlestr

The title to display.

Returns:
figmatplotlib.figure.Figure

Epochs traces.

save(fname, overwrite=False)[source]#

Save a reject log.

Parameters:
fnamestr

The filename to save to. The filename must end in ‘.npz’.

overwritebool

If True, overwrite file if it already exists. Defaults to False.

Examples using autoreject.RejectLog#

Preprocessing workflow with autoreject and ICA

Preprocessing workflow with autoreject and ICA

Visualize bad sensors per trial

Visualize bad sensors per trial