Converted Harmony file markers

Hi,

I had to convert EEG files .sig and .sts (recorded with Harmony) in order to use brainstorm into. edf . The problem is by converting I lose my markers, but fortunately an edf.xml is created separately. Is there a way to automatically enter those xml files on brainstorm to gain time ?

Thank you

Hello,

When reviewing a file, you can select the menu File > Add events from file from the Record tab.
Or from the Process1 tab, you can select the process “Events > Import from file”.

However, the list of supported file formats does not include these .xml files from Harmony.
If you could export your list of events into something that Brainstorm can read, it would be easy to read them. The easier option would be to save text files with only the latency of the events (one value per line), one file per event, and Brainstorm would ask you the event name when importing it.
Or maybe you can export to one of the formats that are readily available.

Francois

Thank you very much,

Which format would you recommend that I convert these .xml files into ?

In fact, if in the futur you plan to add .sig (harmony format) in the supported files format i know a lot of people who will be happy about it! (including myself)!

If you are OK with having one file per event type, then for each event type:

  • save the latencies of all the occurrences in a text file, one time value per line
  • load the file in Brainstorm using the file format “Array of times” (using the menu File > Add events from file from the Record tab)

If you want all the event types in the same file, you can use for instance the ANT EEProbe .trg file format, probably the simplest format available in this list. It consists in one line of header (put anything in it, not used by Brainstorm), followed by one line per event, with the following format: “latency sample name”. For “sample”, you can set it to 0 everywhere, Brainstorm doesn’t use this value. The “name” is a string with no space.
Example:

0.0019531250000000 136
    0.000000      5850  START
   25.085938   1752634 ev1
   25.101563   1753722  ev2
   26.367188   1841850 ev1
   27.835938   1944122   3
   ...

Last option, you create directly a Brainstorm structure, if you want the support for extended events, colors, etc:
https://neuroimage.usc.edu/brainstorm/Tutorials/EventMarkers#On_the_hard_drive

To address the other suggestion: unfortunately it is not possible to add the support for the Stellate Harmonie .sig files in Brainstorm because this is a proprietary file format. Programs that can read .sig files (BESA, ANT, …) have signed an agreement with the company, and use an old windows 32bits .dll library. To my knowledge, the company didn’t want any open source software to be able to read the .sig files.

Hi! i tried to create an automatic converter based on your example with .trg format (xml to .txt) Actually it work really nice. i now try to make the same things but with .xml to .trg but i dont know actually how to create .trg, do you have any hint on how to convert my .txt in .trg? Thank you very much again, your help is always precious!

The .trg is a simple text file with the format I described in my previous post.

Ho!
Thank you… sorry I found the problem… my file was saved with the extension .trg.txt … everything work perfectly! One last question, if I want too make extended events, by example :

0.0019531250000000 136
12.229167 to 14.67483 9999 EV
20.921667 9999 START
128.444167 9999 KO

is it possible?

thank you again for your patience!

Not with this file format.
If you are writing your conversion script with Matlab, maybe it’s easier to write directly a Brainstorm events structure. For an example file, save some events you already have using the file format “Brainstorm (events*.mat)” - in tab Record, menu File > Export selected events.

1 Like

Hi François,

So I tried with the file format .trg following your suggested steps, but i still get an error message naming the header latency as the problem…so i took out the header, kept only the values and got another error message naming the second line YEUX_OUVERTS as the problem…

Here is how they were written:

latency sample name
1.703125 0 YEUX_OUVERTS
216.187500 0 YEUX_FERMÉS
251.687500 0 YEUX_OUVERTS
391.429688 0 YEUX_FERMÉS
394.679688 0 YEUX_FERMÉS
429.175781 0 YEUX_OUVERTS
573.917969 0 YEUX_FERMÉS
609.914063 0 YEUX_OUVERTS

Thank you !

The first line is completely ignored, it could even be empty. The rest of the file looks OK to me.

Make sure that in the import window, the file format selected is “ANT EEProbe .trg”.
If you have an error, it should come from function in_events_ant.
If you don’t understand where your error comes from, please post the full error message here.

ok! i got one last last question about this, with a friend we still try to create a converter. now we decide to go with the brainstorm event format. The only problem is than we dont have the sample in our input file, is this possible to bypass the sample rate input in the event*.mat file if yes how?

Thank you very much again Francois your help is always precious!

If you are with mac, make yourself sure your .trg is really a .trg, i am not sure why but i have to change my name extension file in the terminal wnidow. just drag and drop your event marker file in a terminal window and double check the extension (maybe you got something lie event.trg.txt

Sample indices are very easy to compute, but are necessary in the file:
samples = round(time * sampling_frequency)

(I agree, this is stupidly redundant, we should simplify this at some point)

crystal clear and awesome!
Thanks!