mne.realtime.
RtEpochs
(client, event_id, tmin, tmax, stim_channel=’STI 014’, sleep_time=0.1, baseline=(None, 0), picks=None, name=None, reject=None, flat=None, proj=True, decim=1, reject_tmin=None, reject_tmax=None, detrend=None, add_eeg_ref=False, isi_max=2.0, find_events=None, verbose=None)[source]¶Realtime Epochs.
Can receive epochs in real time from an RtClient.
For example, to get some epochs from a running mne_rt_server on ‘localhost’, you could use:
client = mne.realtime.RtClient('localhost')
event_id, tmin, tmax = 1, -0.2, 0.5
epochs = mne.realtime.RtEpochs(client, event_id, tmin, tmax)
epochs.start() # start the measurement and start receiving epochs
evoked_1 = epochs.average() # computed over all epochs
evoked_2 = epochs[-5:].average() # computed over the last 5 epochs
Parameters: | client : instance of mne.realtime.RtClient
event_id : int | list of int
tmin : float
tmax : float
stim_channel : string or list of string
sleep_time : float
baseline : None (default) or tuple of length 2
picks : array-like of int | None (default)
name : string
reject : dict | None
flat : dict | None
proj : bool, optional
decim : int
reject_tmin : scalar | None
reject_tmax : scalar | None
detrend : int | None
add_eeg_ref : bool
isi_max : float
find_events : dict
verbose : bool, str, int, or None
|
---|
Attributes
ch_names |
Channel names. |
events |
The events associated with the epochs currently in the queue. |
info | (dict) Measurement info. |
event_id | (dict) Names of of conditions corresponding to event_ids. |
verbose | (bool, str, int, or None) See above. |
Methods
__contains__ (ch_type) |
Check channel type membership. |
__getitem__ (item) |
Return an Epochs object with a copied subset of epochs. |
__hash__ () |
Hash the object. |
__iter__ () |
Facilitate iteration over epochs. |
__len__ () |
Return the number of epochs. |
add_channels (add_list[, force_update_info]) |
Append new channels to the instance. |
add_proj (projs[, remove_existing, verbose]) |
Add SSP projection vectors. |
anonymize () |
Anonymize measurement information in place. |
apply_baseline ([baseline, verbose]) |
Baseline correct epochs. |
apply_proj () |
Apply the signal space projection (SSP) operators to the data. |
average ([picks]) |
Compute average of epochs. |
copy () |
Return copy of Epochs instance. |
crop ([tmin, tmax]) |
Crop a time interval from epochs object. |
decimate (decim[, offset, verbose]) |
Decimate the epochs. |
del_proj ([idx]) |
Remove SSP projection vector. |
drop (indices[, reason, verbose]) |
Drop epochs based on indices or boolean mask. |
drop_bad ([reject, flat, verbose]) |
Drop bad epochs without retaining the epochs data. |
drop_channels (ch_names) |
Drop some channels. |
drop_log_stats ([ignore]) |
Compute the channel stats based on a drop_log from Epochs. |
equalize_event_counts (event_ids[, method]) |
Equalize the number of trials in each condition. |
get_data () |
Get all epochs as a 3D array. |
interpolate_bads ([reset_bads, mode]) |
Interpolate bad MEG and EEG channels. |
iter_evoked () |
Iterate over epochs as a sequence of Evoked objects. |
load_data () |
Load the data if not already preloaded. |
next ([return_event_id]) |
Make iteration over epochs easy. |
pick_channels (ch_names) |
Pick some channels. |
pick_types ([meg, eeg, stim, eog, ecg, emg, …]) |
Pick some channels by type and names. |
plot ([picks, scalings, n_epochs, …]) |
Visualize epochs. |
plot_drop_log ([threshold, n_max_plot, …]) |
Show the channel stats based on a drop_log from Epochs. |
plot_image ([picks, sigma, vmin, vmax, …]) |
Plot Event Related Potential / Fields image. |
plot_projs_topomap ([ch_type, layout, axes]) |
Plot SSP vector. |
plot_psd ([fmin, fmax, tmin, tmax, proj, …]) |
Plot the power spectral density across epochs. |
plot_psd_topomap ([bands, vmin, vmax, tmin, …]) |
Plot the topomap of the power spectral density across epochs. |
plot_sensors ([kind, ch_type, title, …]) |
Plot sensor positions. |
plot_topo_image ([layout, sigma, vmin, vmax, …]) |
Plot Event Related Potential / Fields image on topographies. |
rename_channels (mapping) |
Rename channels. |
resample (sfreq[, npad, window, n_jobs, verbose]) |
Resample data. |
save (fname[, split_size]) |
Save epochs in a fif file. |
savgol_filter (h_freq[, copy]) |
Filter the data using Savitzky-Golay polynomial method. |
set_channel_types (mapping) |
Define the sensor type of channels. |
set_eeg_reference ([ref_channels, verbose]) |
Specify which reference to use for EEG data. |
set_montage (montage[, verbose]) |
Set EEG sensor configuration and head digitization. |
standard_error ([picks]) |
Compute standard error over epochs. |
start () |
Start receiving epochs. |
stop ([stop_receive_thread, stop_measurement]) |
Stop receiving epochs. |
subtract_evoked ([evoked]) |
Subtract an evoked response from each epoch. |
time_as_index (times[, use_rounding]) |
Convert time to indices. |
to_data_frame ([picks, index, scale_time, …]) |
Export data in tabular structure as a pandas DataFrame. |
__contains__
(ch_type)[source]¶Check channel type membership.
Parameters: | ch_type : str
|
---|---|
Returns: | in : bool
|
Examples
Channel type membership can be tested as:
>>> 'meg' in inst
True
>>> 'seeg' in inst
False
__getitem__
(item)[source]¶Return an Epochs object with a copied subset of epochs.
Parameters: | item : slice, array-like, str, or list
|
---|---|
Returns: | epochs : instance of Epochs
|
Notes
Epochs can be accessed as epochs[...]
in several ways:
epochs[idx]
: ReturnEpochs
object with a subset of epochs (supports single index and python-style slicing).
epochs['name']
: ReturnEpochs
object with a copy of the subset of epochs corresponding to an experimental condition as specified by ‘name’.If conditions are tagged by names separated by ‘/’ (e.g. ‘audio/left’, ‘audio/right’), and ‘name’ is not in itself an event key, this selects every event whose condition contains the ‘name’ tag (e.g., ‘left’ matches ‘audio/left’ and ‘visual/left’; but not ‘audio_left’). Note that tags like ‘auditory/left’ and ‘left/auditory’ will be treated the same way when accessed using tags.
epochs[['name_1', 'name_2', ... ]]
: ReturnEpochs
object with a copy of the subset of epochs corresponding to multiple experimental conditions as specified by'name_1', 'name_2', ...
.If conditions are separated by ‘/’, selects every item containing every list tag (e.g. [‘audio’, ‘left’] selects ‘audio/left’ and ‘audio/center/left’, but not ‘audio/right’).
__iter__
()[source]¶Facilitate iteration over epochs.
Notes
This enables the use of this Python pattern:
>>> for epoch in epochs:
>>> print(epoch)
Where epoch
is given by successive outputs of
mne.Epochs.next()
.
__len__
()[source]¶Return the number of epochs.
Returns: | n_epochs : int
|
---|
Notes
This function only works if bad epochs have been dropped.
Examples
This can be used as:
>>> epochs.drop_bad()
>>> len(epochs)
43
>>> len(epochs.events)
43
add_channels
(add_list, force_update_info=False)[source]¶Append new channels to the instance.
Parameters: | add_list : list
force_update_info : bool
|
---|---|
Returns: | inst : instance of Raw, Epochs, or Evoked
|
add_proj
(projs, remove_existing=False, verbose=None)[source]¶Add SSP projection vectors.
Parameters: | projs : list
remove_existing : bool
verbose : bool, str, int, or None
|
---|---|
Returns: | self : instance of Raw | Epochs | Evoked
|
anonymize
()[source]¶Anonymize measurement information in place.
Reset ‘subject_info’, ‘meas_date’, ‘file_id’, and ‘meas_id’ keys if they
exist in info
.
Returns: | info : instance of Info
|
---|
Notes
Operates in place.
New in version 0.13.0.
apply_baseline
(baseline=(None, 0), verbose=None)[source]¶Baseline correct epochs.
Parameters: | baseline : tuple of length 2
verbose : bool, str, int, or None
|
---|---|
Returns: | epochs : instance of Epochs
|
Notes
Baseline correction can be done multiple times.
New in version 0.10.0.
apply_proj
()[source]¶Apply the signal space projection (SSP) operators to the data.
Returns: | self : instance of Raw | Epochs | Evoked
|
---|
Notes
Once the projectors have been applied, they can no longer be removed. It is usually not recommended to apply the projectors at too early stages, as they are applied automatically later on (e.g. when computing inverse solutions). Hint: using the copy method individual projection vectors can be tested without affecting the original data. With evoked data, consider the following example:
projs_a = mne.read_proj('proj_a.fif')
projs_b = mne.read_proj('proj_b.fif')
# add the first, copy, apply and see ...
evoked.add_proj(a).copy().apply_proj().plot()
# add the second, copy, apply and see ...
evoked.add_proj(b).copy().apply_proj().plot()
# drop the first and see again
evoked.copy().del_proj(0).apply_proj().plot()
evoked.apply_proj() # finally keep both
average
(picks=None)[source]¶Compute average of epochs.
Parameters: | picks : array-like of int | None
|
---|---|
Returns: | evoked : instance of Evoked
|
Notes
Computes an average of all epochs in the instance, even if
they correspond to different conditions. To average by condition,
do epochs[condition].average()
for each condition separately.
When picks is None and epochs contain only ICA channels, no channels are selected, resulting in an error. This is because ICA channels are not considered data channels (they are of misc type) and only data channels are selected when picks is None.
ch_names
¶Channel names.
compensation_grade
¶The current gradient compensation grade.
crop
(tmin=None, tmax=None)[source]¶Crop a time interval from epochs object.
Parameters: | tmin : float | None
tmax : float | None
|
---|---|
Returns: | epochs : instance of Epochs
|
Notes
Unlike Python slices, MNE time intervals include both their end points; crop(tmin, tmax) returns the interval tmin <= t <= tmax.
decimate
(decim, offset=0, verbose=None)[source]¶Decimate the epochs.
Note
No filtering is performed. To avoid aliasing, ensure your data are properly lowpassed.
Parameters: | decim : int
offset : int
verbose : bool, str, int, or None
|
---|---|
Returns: | epochs : instance of Epochs
|
Notes
Decimation can be done multiple times. For example,
epochs.decimate(2).decimate(2)
will be the same as
epochs.decimate(4)
.
New in version 0.10.0.
del_proj
(idx=’all’)[source]¶Remove SSP projection vector.
Parameters: | idx : int | list of int | str
|
---|---|
Returns: | self : instance of Raw | Epochs | Evoked |
drop
(indices, reason=’USER’, verbose=None)[source]¶Drop epochs based on indices or boolean mask.
Note
The indices refer to the current set of undropped epochs
rather than the complete set of dropped and undropped epochs.
They are therefore not necessarily consistent with any
external indices (e.g., behavioral logs). To drop epochs
based on external criteria, do not use the preload=True
flag when constructing an Epochs object, and call this
method before calling the mne.Epochs.drop_bad()
or
mne.Epochs.load_data()
methods.
Parameters: | indices : array of ints or bools
reason : str
verbose : bool, str, int, or None
|
---|---|
Returns: | epochs : instance of Epochs
|
drop_bad
(reject=’existing’, flat=’existing’, verbose=None)[source]¶Drop bad epochs without retaining the epochs data.
Should be used before slicing operations.
Warning
This operation is slow since all epochs have to be read
from disk. To avoid reading epochs from disk multiple
times, use mne.Epochs.load_data()
.
Parameters: | reject : dict | str | None
flat : dict | str | None
verbose : bool, str, int, or None
|
---|---|
Returns: | epochs : instance of Epochs
|
Notes
Dropping bad epochs can be done multiple times with different
reject
and flat
parameters. However, once an epoch is
dropped, it is dropped forever, so if more lenient thresholds may
subsequently be applied, epochs.copy should be used.
drop_channels
(ch_names)[source]¶Drop some channels.
Parameters: | ch_names : list
|
---|---|
Returns: | inst : instance of Raw, Epochs, or Evoked
|
See also
Notes
New in version 0.9.0.
drop_log_stats
(ignore=(‘IGNORED’, ))[source]¶Compute the channel stats based on a drop_log from Epochs.
Parameters: | ignore : list
|
---|---|
Returns: | perc : float
|
See also
equalize_event_counts
(event_ids, method=’mintime’)[source]¶Equalize the number of trials in each condition.
It tries to make the remaining epochs occurring as close as possible in time. This method works based on the idea that if there happened to be some time-varying (like on the scale of minutes) noise characteristics during a recording, they could be compensated for (to some extent) in the equalization process. This method thus seeks to reduce any of those effects by minimizing the differences in the times of the events in the two sets of epochs. For example, if one had event times [1, 2, 3, 4, 120, 121] and the other one had [3.5, 4.5, 120.5, 121.5], it would remove events at times [1, 2] in the first epochs and not [20, 21].
Parameters: | event_ids : list
method : str
|
---|---|
Returns: | epochs : instance of Epochs
indices : array of int
|
Notes
For example (if epochs.event_id was {‘Left’: 1, ‘Right’: 2, ‘Nonspatial’:3}:
epochs.equalize_event_counts([[‘Left’, ‘Right’], ‘Nonspatial’])
would equalize the number of trials in the ‘Nonspatial’ condition with the total number of trials in the ‘Left’ and ‘Right’ conditions.
If multiple indices are provided (e.g. ‘Left’ and ‘Right’ in the example above), it is not guaranteed that after equalization, the conditions will contribute evenly. E.g., it is possible to end up with 70 ‘Nonspatial’ trials, 69 ‘Left’ and 1 ‘Right’.
events
¶The events associated with the epochs currently in the queue.
filename
¶The filename.
get_data
()[source]¶Get all epochs as a 3D array.
Returns: | data : array of shape (n_epochs, n_channels, n_times)
|
---|
interpolate_bads
(reset_bads=True, mode=’accurate’)[source]¶Interpolate bad MEG and EEG channels.
Operates in place.
Parameters: | reset_bads : bool
mode : str
|
---|---|
Returns: | inst : instance of Raw, Epochs, or Evoked
|
Notes
New in version 0.9.0.
iter_evoked
()[source]¶Iterate over epochs as a sequence of Evoked objects.
The Evoked objects yielded will each contain a single epoch (i.e., no averaging is performed).
load_data
()[source]¶Load the data if not already preloaded.
Returns: | epochs : instance of Epochs
|
---|
Notes
This function operates in-place.
New in version 0.10.0.
name
¶Name for the epoch set.
next
(return_event_id=False)[source]¶Make iteration over epochs easy.
Parameters: | return_event_id : bool
|
---|---|
Returns: | epoch : instance of Epochs
event_id : int
|
pick_channels
(ch_names)[source]¶Pick some channels.
Parameters: | ch_names : list
|
---|---|
Returns: | inst : instance of Raw, Epochs, or Evoked
|
See also
Notes
New in version 0.9.0.
pick_types
(meg=True, eeg=False, stim=False, eog=False, ecg=False, emg=False, ref_meg=’auto’, misc=False, resp=False, chpi=False, exci=False, ias=False, syst=False, seeg=False, dipole=False, gof=False, bio=False, ecog=False, fnirs=False, include=[], exclude=’bads’, selection=None)[source]¶Pick some channels by type and names.
Parameters: | meg : bool | str
eeg : bool
stim : bool
eog : bool
ecg : bool
emg : bool
ref_meg: bool | str
misc : bool
resp : bool
chpi : bool
exci : bool
ias : bool
syst : bool
seeg : bool
dipole : bool
gof : bool
bio : bool
ecog : bool
fnirs : bool | str
include : list of string
exclude : list of string | str
selection : list of string
|
---|---|
Returns: | inst : instance of Raw, Epochs, or Evoked
|
Notes
New in version 0.9.0.
plot
(picks=None, scalings=None, n_epochs=20, n_channels=20, title=None, events=None, event_colors=None, show=True, block=False)[source]¶Visualize epochs.
Bad epochs can be marked with a left click on top of the epoch. Bad channels can be selected by clicking the channel name on the left side of the main axes. Calling this function drops all the selected bad epochs as well as bad epochs marked beforehand with rejection parameters.
Parameters: | picks : array-like of int | None
scalings : dict | ‘auto’ | None
n_epochs : int
n_channels : int
title : str | None
events : None, array, shape (n_events, 3)
event_colors : None, dict
show : bool
block : bool
|
---|---|
Returns: | fig : Instance of matplotlib.figure.Figure
|
Notes
The arrow keys (up/down/left/right) can be used to navigate between
channels and epochs and the scaling can be adjusted with - and + (or =)
keys, but this depends on the backend matplotlib is configured to use
(e.g., mpl.use(TkAgg
) should work). Full screen mode can be toggled
with f11 key. The amount of epochs and channels per view can be adjusted
with home/end and page down/page up keys. These can also be set through
options dialog by pressing o
key. h
key plots a histogram of
peak-to-peak values along with the used rejection thresholds. Butterfly
plot can be toggled with b
key. Right mouse click adds a vertical line
to the plot. Click ‘help’ button at bottom left corner of the plotter to
view all the options.
New in version 0.10.0.
plot_drop_log
(threshold=0, n_max_plot=20, subject=’Unknown’, color=(0.9, 0.9, 0.9), width=0.8, ignore=(‘IGNORED’, ), show=True)[source]¶Show the channel stats based on a drop_log from Epochs.
Parameters: | threshold : float
n_max_plot : int
subject : str
color : tuple | str
width : float
ignore : list
show : bool
|
---|---|
Returns: | fig : Instance of matplotlib.figure.Figure
|
plot_image
(picks=None, sigma=0.0, vmin=None, vmax=None, colorbar=True, order=None, show=True, units=None, scalings=None, cmap=’RdBu_r’, fig=None, axes=None, overlay_times=None)[source]¶Plot Event Related Potential / Fields image.
Parameters: | picks : int | array-like of int | None
sigma : float
vmin : float
vmax : float
colorbar : bool
order : None | array of int | callable
show : bool
units : dict | None
scalings : dict | None
cmap : matplotlib colormap | (colormap, bool) | ‘interactive’
fig : matplotlib figure | None
axes : list of matplotlib axes | None
overlay_times : array-like, shape (n_epochs,) | None
|
---|---|
Returns: | figs : lists of matplotlib figures
|
plot_projs_topomap
(ch_type=None, layout=None, axes=None)[source]¶Plot SSP vector.
Parameters: | ch_type : ‘mag’ | ‘grad’ | ‘planar1’ | ‘planar2’ | ‘eeg’ | None | List
layout : None | Layout | List of Layouts
axes : instance of Axes | list | None
|
---|---|
Returns: | fig : instance of matplotlib figure
|
plot_psd
(fmin=0, fmax=inf, tmin=None, tmax=None, proj=False, bandwidth=None, adaptive=False, low_bias=True, normalization=’length’, picks=None, ax=None, color=’black’, area_mode=’std’, area_alpha=0.33, dB=True, n_jobs=1, show=True, verbose=None)[source]¶Plot the power spectral density across epochs.
Parameters: | fmin : float
fmax : float
tmin : float | None
tmax : float | None
proj : bool
bandwidth : float
adaptive : bool
low_bias : bool
normalization : str
picks : array-like of int | None
ax : instance of matplotlib Axes | None
color : str | tuple
area_mode : str | None
area_alpha : float
dB : bool
n_jobs : int
show : bool
verbose : bool, str, int, or None
|
---|---|
Returns: | fig : instance of matplotlib figure
|
plot_psd_topomap
(bands=None, vmin=None, vmax=None, tmin=None, tmax=None, proj=False, bandwidth=None, adaptive=False, low_bias=True, normalization=’length’, ch_type=None, layout=None, cmap=’RdBu_r’, agg_fun=None, dB=True, n_jobs=1, normalize=False, cbar_fmt=’%0.3f’, outlines=’head’, axes=None, show=True, verbose=None)[source]¶Plot the topomap of the power spectral density across epochs.
Parameters: | bands : list of tuple | None
vmin : float | callable | None
vmax : float | callable | None
tmin : float | None
tmax : float | None
proj : bool
bandwidth : float
adaptive : bool
low_bias : bool
normalization : str
ch_type : ‘mag’ | ‘grad’ | ‘planar1’ | ‘planar2’ | ‘eeg’ | None
layout : None | Layout
cmap : matplotlib colormap | (colormap, bool) | ‘interactive’ | None
agg_fun : callable
dB : bool
n_jobs : int
normalize : bool
cbar_fmt : str
outlines : ‘head’ | ‘skirt’ | dict | None
axes : list of axes | None
show : bool
verbose : bool, str, int, or None
|
---|---|
Returns: | fig : instance of matplotlib figure
|
plot_sensors
(kind=’topomap’, ch_type=None, title=None, show_names=False, ch_groups=None, to_sphere=True, axes=None, block=False, show=True)[source]¶Plot sensor positions.
Parameters: | kind : str
ch_type : None | str
title : str | None
show_names : bool
ch_groups : ‘position’ | array of shape (ch_groups, picks) | None
to_sphere : bool
axes : instance of Axes | instance of Axes3D | None
block : bool
show : bool
|
---|---|
Returns: | fig : instance of matplotlib figure
selection : list
|
See also
Notes
This function plots the sensor locations from the info structure using
matplotlib. For drawing the sensors using mayavi see
mne.viz.plot_trans()
.
New in version 0.12.0.
plot_topo_image
(layout=None, sigma=0.0, vmin=None, vmax=None, colorbar=True, order=None, cmap=’RdBu_r’, layout_scale=0.95, title=None, scalings=None, border=’none’, fig_facecolor=’k’, fig_background=None, font_color=’w’, show=True)[source]¶Plot Event Related Potential / Fields image on topographies.
Parameters: | layout: instance of Layout
sigma : float
vmin : float
vmax : float
colorbar : bool
order : None | array of int | callable
cmap : instance of matplotlib.pyplot.colormap
layout_scale: float
title : str
scalings : dict | None
border : str
fig_facecolor : str | obj
fig_background : None | array
font_color : str | obj
show : bool
|
---|---|
Returns: | fig : instance of matplotlib figure
|
proj
¶Whether or not projections are active.
rename_channels
(mapping)[source]¶Rename channels.
Parameters: | mapping : dict | callable
|
---|
Notes
New in version 0.9.0.
resample
(sfreq, npad=’auto’, window=’boxcar’, n_jobs=1, verbose=None)[source]¶Resample data.
Note
Data must be loaded.
Parameters: | sfreq : float
npad : int | str
window : string or tuple
n_jobs : int
verbose : bool, str, int, or None
|
---|---|
Returns: | epochs : instance of Epochs
|
See also
Notes
For some data, it may be more accurate to use npad=0 to reduce artifacts. This is dataset dependent – check your data!
save
(fname, split_size=‘2GB’)[source]¶Save epochs in a fif file.
Parameters: | fname : str
split_size : string | int
|
---|
Notes
Bad epochs will be dropped before saving the epochs to disk.
savgol_filter
(h_freq, copy=False)[source]¶Filter the data using Savitzky-Golay polynomial method.
Parameters: | h_freq : float
copy : bool
|
---|---|
Returns: | inst : instance of Epochs or Evoked
|
See also
Notes
For Savitzky-Golay low-pass approximation, see:
New in version 0.9.0.
References
[R55] | (1, 2) Savitzky, A., Golay, M.J.E. (1964). “Smoothing and Differentiation of Data by Simplified Least Squares Procedures”. Analytical Chemistry 36 (8): 1627-39. |
Examples
>>> import mne
>>> from os import path as op
>>> evoked_fname = op.join(mne.datasets.sample.data_path(), 'MEG', 'sample', 'sample_audvis-ave.fif')
>>> evoked = mne.read_evokeds(evoked_fname, baseline=(None, 0))[0]
>>> evoked.savgol_filter(10.) # low-pass at around 10 Hz
>>> evoked.plot()
set_channel_types
(mapping)[source]¶Define the sensor type of channels.
Parameters: | mapping : dict
|
---|
Notes
New in version 0.9.0.
set_eeg_reference
(ref_channels=None, verbose=None)[source]¶Specify which reference to use for EEG data.
By default, MNE-Python will automatically re-reference the EEG signal to use an average reference (see below). Use this function to explicitly specify the desired reference for EEG. This can be either an existing electrode or a new virtual channel. This function will re-reference the data according to the desired reference and prevent MNE-Python from automatically adding an average reference.
Some common referencing schemes and the corresponding value for the
ref_channels
parameter:
ref_channels=[]
. This will prevent MNE-Python from
automatically re-referencing the data to an average reference.ref_channels=None
.ref_channels
to the name of the channel that will act as
the new reference.ref_channels
to a list of channel names,
indicating which channels to use. For example, to apply an average
mastoid reference, when using the 10-20 naming scheme, set
ref_channels=['M1', 'M2']
.Parameters: | ref_channels : list of str | None
verbose : bool, str, int, or None
|
---|---|
Returns: | inst : instance of Raw | Epochs | Evoked
|
See also
Notes
apply_proj()
method to apply
them.New in version 0.13.0.
set_montage
(montage, verbose=None)[source]¶Set EEG sensor configuration and head digitization.
Parameters: | montage : instance of Montage or DigMontage
verbose : bool, str, int, or None
|
---|
Notes
Operates in place.
New in version 0.9.0.
standard_error
(picks=None)[source]¶Compute standard error over epochs.
Parameters: | picks : array-like of int | None
|
---|---|
Returns: | evoked : instance of Evoked
|
start
()[source]¶Start receiving epochs.
The measurement will be started if it has not already been started.
stop
(stop_receive_thread=False, stop_measurement=False)[source]¶Stop receiving epochs.
Parameters: | stop_receive_thread : bool
stop_measurement : bool
|
---|
subtract_evoked
(evoked=None)[source]¶Subtract an evoked response from each epoch.
Can be used to exclude the evoked response when analyzing induced activity, see e.g. [1].
Parameters: | evoked : instance of Evoked | None
|
---|---|
Returns: | self : instance of Epochs
|
References
[1] David et al. “Mechanisms of evoked and induced responses in MEG/EEG”, NeuroImage, vol. 31, no. 4, pp. 1580-1591, July 2006.
time_as_index
(times, use_rounding=False)[source]¶Convert time to indices.
Parameters: | times : list-like | float | int
use_rounding : boolean
|
---|---|
Returns: | index : ndarray
|
tmax
¶Last time point.
tmin
¶First time point.
to_data_frame
(picks=None, index=None, scale_time=1000.0, scalings=None, copy=True, start=None, stop=None)[source]¶Export data in tabular structure as a pandas DataFrame.
Columns and indices will depend on the object being converted. Generally this will include as much relevant information as possible for the data type being converted. This makes it easy to convert data for use in packages that utilize dataframes, such as statsmodels or seaborn.
Parameters: | picks : array-like of int | None
index : tuple of str | None
scale_time : float
scalings : dict | None
copy : bool
start : int | None
stop : int | None
|
---|---|
Returns: | df : instance of pandas.core.DataFrame
|