Preamble
import mne
Dataset
Download sample data from Mike Cohen.
def load_data(tmin, tmax):
epochs = mne.io.read_epochs_eeglab('sampleEEGdata.mat', verbose=False).crop(tmin, tmax)
return epochs
All Trials
raw = load_data(-1, 1)
values = (raw.get_data().mean(axis=0).squeeze())
evoked = mne.EvokedArray(values, raw.info, tmin=-1)
Plot Topographical Map at 0ms
evoked.plot_topomap(times=[0], time_unit='ms',cmap='Spectral_r');
Plot Topographical Map at 0ms, 500ms, and 1000ms
evoked.plot_topomap(times=[0, .5, 1], time_unit='ms',cmap='Spectral_r');
Plot First 5 Topographical Maps
evoked.plot_topomap(times=evoked.times[0:6], time_unit='ms',cmap='Spectral_r');
Plot Sensor Position
evoked.plot_sensors();
evoked.plot_sensors(kind='3d', ch_groups='position');
Single Trial
raw = load_data(-1, 1)
values = (raw[0].get_data().squeeze())
evoked = mne.EvokedArray(values, raw.info, tmin=-1)
Plot Topographical Map at 0ms
evoked.plot_topomap(times=[0], time_unit='ms',cmap='Spectral_r');
Plot Topographical Map at 0ms, 500ms, and 1000ms
evoked.plot_topomap(times=[0, .5, 1], time_unit='ms',cmap='Spectral_r');
Plot First 5 Topographical Maps
evoked.plot_topomap(times=evoked.times[0:6], time_unit='ms',cmap='Spectral_r');