Import triggers

Hello,

I am trying to import .mat file triggers but I am having a problem. The triggers are coded as either 1 /la/ or 2 /ra/ (I did an MMN study). When I load in the triggers to the EEGs the triggers are not aligned with the stimulus train nor the EEG responses, they simply are coded as 1 or 2 and are shown at 1 sec and 2 sec tick mark in the time series. How can I allow brainstorm to recognize that the 1s and 2s are event markers without having it line up with the 1 sec/2 sec tick mark and have the triggers appear across the entire recorded session?

-Bre

Hello,
I’m not sure to understand what you mean.
What file format are you using for the EEG? Exported from what system?
Are you importing triggers separately? Why are they not saved in the your EEG file?
What generated your trigger files?
Please describe better the situation and add a screen capture to illustrate your problem.
Cheers,
Francois

Sure!

The EEGs were recorded through Thought Technology and exported into a .txt file with 6 channels (EOG, Fz,Cz,C3,C4, Stim). The event markers were created and delivered via MATLAB through a personal script that loaded in a .wav file of synthesized speech created from Praat, la and ra, an array of 1s(la) and 2s(ra) created with a probability of 85% and 15%, respectively. The stimuli were then delivered and stored into a .mat file. The EEG files were loaded into a new protocol in Brainstorm and the channel details were added. The problem arises with the eventmarkers; I import the eventmarkers from the .mat file that was saved after data collection but because they are saved as 1s and 2s the event markers only display at the 1 and 2 tick mark in the time series. I would like the eventmarkers to line up with the stimulus train displayed at the bottom. Is there a way to do this?


I’m not sure I understand what the events your are importing look like…
If you don’t have any other issue than the markers, then it’s the way you are saving/importing your markers that is faulty.
Brainstorm can import markers from a variety of formats. The easier is to use text files and time stamps in seconds, then load it using the file type “Array of times”.
The markers are going to be displayed where you indicate them to be, but make sure the times are always in seconds.

Hi Francois,

I was browsing the forum for solving a problem and you suggested the easier way is to have a txt file and import it as Array of times.

I made a mistake in coding the triggers in the stimulation software, so that the triggers are wrong, but I still have the list of correct triggers (in chronological order), so what I need is just take the timestamps and add the correct trigger. I have a txt file (tabulated) with the following format "trigger, timestamp", which is the format Brainstorm uses when exporting the event list. I made the relevant changes, and I have the correct list of triggers, but I can't find a way to import them into the raw file. Any suggestions?

Thanks

EDIT: I managed to import them but had to generate an array of timestamps for each trigger :slight_smile:

Hi Simone,

There are plenty of ways for doing this: either using one file per trigger with only the list of latencies, or using a more complete file format that includes at least trigger name + latency (but their are not documented clearly anywhere...) or if you are manipulating these timings in Matlab, you can directly write the events structure in the "Link to raw file" .mat file.
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting#Example:_Editing_events
https://neuroimage.usc.edu/brainstorm/Tutorials/EventMarkers#On_the_hard_drive

Ask if you need more details :slight_smile:
Francois