Reputation: 19
raw, timestamp = ur.MNE_Read_EDF(path)
mne_events, events_dict = ev.MNE_prepare_events(path, timestamp)
epochs = mne.Epochs(raw, mne_events, events_dict, tmin=-0.5, tmax=0.5)
signal = epochs.plot(block=True)
I have a raw EEG signal in EDF files and events in a CSV file. I managed to create epochs by those events and then plot the raw signal with marked events, however I need to transfer it into a file that's accessible in Matlab.
I can't use scipy.io.savemat for a plot I guess? I can't simply load these files into Matlab because somehow it desynchronizes epochs, probably due to averaged sampling frequency. MNE doesn't do this, but further analysis has to be conducted in Matlab.
Upvotes: 0
Views: 1074
Reputation: 2151
For getting the raw epochs data you could call the .get_data()
method of the Epochs class. This will provide your with a 3D numpy array of shape (n_epochs, n_channels, n_times).
To get your events data, you can use the find_events
function, which will return events
:
Returns:
events : array, shape = (n_events, 3)
All events that were found. The first column contains the event time in samples and the third column contains the event id. For output = ‘onset’ or ‘step’, the second column contains the value of the stim channel immediately before the event/step. For output = ‘offset’, the second column contains the value of the stim channel after the event offset.
Actually, you probably have your event data already in mne_events
in your example.
These data can be saved with the scipy.io.savemat
function that you mentioned.
Upvotes: 1