Neuromag event list

Dear all,

I have several manually created event lists (using Elekta - Graph) containing marked interictal spikes. I was hoping to import these event files into Brainstorm…however the way that Graph structures the events (which can be saved as an .evl/.txt file) are not compatible with the accepted Brainstorm/MNE event list structure. E.g. Graph saves the marked events like so: ((:time 28.8425) (:class :manual) (:length 0.069)) , where as Event files compatible with Brainstorm/MNE are <sample> <time> <from> <to> <text>.

Is there a function or some way of being able to convert the Graph event list into an event file that is compatible with Brainstorm, or is it a case that I should remark the spikes in Brainstorm?

Many thanks,
Mike

Hi Mike,

There are many file formats for the events that are supported, other than the MNE file format. If yours is not, it is an easy thing to add.
Please attach examples of files that you would like to be able to import in Brainstorm. If there are possible variations, please make sure you include examples for all of them.

Thanks,
Francois

Hi Francois,

Thank you for your response. I have tried to use a .evl, .txt, and .fif (I used mne_write_events.m to get a fif version). As mentioned in my previous post, Graph stores the event information in a different way - please see the attachment for info.

Best wishes
Mike

Hi Mike,

A file with a LISP syntax… interesting =)
I’m not sure we want to write a full LISP interpreter for reading those simple files, so I added a very simplistic parser.
It reads the time and duration of the lines that have strictly the syntax " ((:time XXXXXX) (:class :manual) (:length YYYYYY))" and ignores everything else.
It reads the file you sent me but it might not work if your files have a different structure.
You can try and let me know if it works for you. We’ll think about a different solution if it doesn’t.

To read your file: In the Record tab, select the menu File > Add events from file > Format “Neuromag Graph”.

Cheers,
Francois

Yes, good ol’LISP!

I have just tried using a few .txt and .evl files that were created by Graph and it works perfectly! Thank you very much for your assistance Francois =).

All the best,
Mike

Hello,

I am posting on this thread as my problem is related to importing events from a Neuromag recording.
I am trying to import events through a matlab script. Currently I am:
Setting up a new protocol+new subject etc.
Creating a link to raw file
Reading events from channel (‘STI101’)
Grouping events by name (Rename)

This is all working fine. All the event categories are being picked up. I am then trying to import 1 category of events and then average the events for this category. However, when I try to call ‘process_import_data_event’ it returns an error ‘cannot find sFiles’ at line 266 of ‘process_import_data_event.m’. I have traced through the code and sFiles is undefined on route to this point. Here is my call for importing events:
% ===== IMPORT EVENTS =====
% Process: Import MEG/EEG: Events
sFilesEpochs = bst_process(‘CallProcess’, ‘process_import_data_event’, …
sFilesRaw, [], …
‘subjectname’, SubjectName, …
‘condition’, ‘’, …
‘datafile’, {RawFile, RawFile}, …
‘eventname’, ‘event_1’, …
‘timewindow’, [], …
‘epochtime’, [-0.1, 0.5], …
‘createcond’, 0, …
‘ignoreshort’, 1, …
‘channelalign’, 1, …
‘usectfcomp’, 1, …
‘usessp’, 1, …
‘freq’, [], …
‘baseline’, [-0.1, -0.001]);

I have been using ‘tutorial_neuromag’ for inspiration. Any suggestions how to resolve this issue?

Hello,

There is something wrong with your script. If you have the link to raw file in “sFilesRaw”, you should not have the option “datafile”.
Use the pipeline editor to generate the correct call: drag and drop your “link to raw file” in the Process1 box, select the process “Import MEG/EEG: Events”, and generate a script.
It should not have the field “datafile” defined.

Let me know if you need further help with this.
Francois

Hi Francois,

Yes that works now! Thank you for your help and quick reply!

Kind regards,

Richard