Esempio n. 1
0
sfreq = d['sfreq']
ch_names = layout.names
print ch_names
types = ['mag'] * len(ch_names)
info = create_info(ch_names, sfreq, types)
events = np.vstack(zip([125 for _ in xrange(len(labels))], [0 for _ in xrange(len(labels))], labels))
print events.shape

#help(EpochsArray)
ea = EpochsArray(data, info, events, tmin=d['tmin'])

from mne.evoked import EvokedArray
evoked = EvokedArray(data[labels==1].mean(axis=0), info, tmin=d['tmin'])
print evoked
print info
times = np.arange(0.05, 0.15, 0.01)
print len(info['ch_names'])
evoked.plot_topomap(0.15, ch_type='mag', layout=layout, size=10, colorbar=False)
#evoked.plot_topomap(times, ch_type='mag', layout=layout, size=10, colorbar=False)

evoked = EvokedArray(data[labels==0].mean(axis=0), info, tmin=d['tmin'])
evoked.plot_topomap(0.15, ch_type='mag', layout=layout, size=10, colorbar=False)
#evoked.plot_topomap(times, ch_type='mag', layout=layout, size=10, colorbar=False)

evoked = EvokedArray(data[labels==1].mean(axis=0) - data[labels==0].mean(axis=0), info, tmin=d['tmin'])
evoked.plot_topomap(0.25, ch_type='mag', layout=layout, size=10, colorbar=False)


# TODO use the EpochsArray