Problems to import EGI .raw files

Dear François,

I am using Brainstorm 30-Sep-2016 to process scalp EEG data coming from EGI system (128 electrodes NetStation).
I have converted mff files to raw files with EGI system and used the review Raw files process to read the data.

Since I don't have exact electrode locations, I am using standard EEG positions for EGI "Not Aligned" with 128 electrodes. I tried all the 128 electodes standards positions for EGI (GSN 128 / GSN HydroCel 128 E001 / GSN HydroCel 128 E1 / U562 128).

When I try to display the EEG data, I get a crash each time since the number of electrodes in the channel file (128) does not match the number of electrodes in the EEG file (129).

Please note that I used exactly the same import process earlier (2 months ago) and it was working perfectly : it seems all the standard EGI 128 electrode position files have been updated recently, probably leading to today's crash with EGI files.

Any suggestions to import the data and use standard EGI 128 electrodes location files ?

Thanks again for your help and your really nice sofware !

Best,

Julien

Hi Julien,

When using default electrode positions, you should use the menu “Add EEG positions” instead:

  1. Import/link the EEG data to the database - it will create a channel file with no positions
  2. Right-click on this empty channel file > Add EEG positions > Select your template

Francois

[QUOTE=Francois;11139]Hi Julien,

When using default electrode positions, you should use the menu “Add EEG positions” instead:

  1. Import/link the EEG data to the database - it will create a channel file with no positions
  2. Right-click on this empty channel file > Add EEG positions > Select your template

Francois[/QUOTE]

Thanks François, it works fine !

Bonjour François,

I am having a similar problem to this. I exported NetStation files as binary raw files. I can import them into Brainstorm. However, Brainstorm/Matlab crashes every time I try to open and view the raw file. I checked the forum and found this thread. Sure enough, my default channel file shows that the position values for every channel are zero. However, when I tried to add EEG positions, I get a message that says, “No channel matching the loaded cap.” What could this mean?

Incidentally, if I import the file as epoched data and try to view one epoch, Brainstorm/Matlab again crashes. The channel file also shows that the position values for every channel are zero. The same message is displayed when I try to add EEG positions. However, strangely, if ask Brainstorm to review one of the epochs as RAW, it produces a new RAW file that I can view perfectly fine without the software crashing. Unfortunately, the channel file associated with this new RAW file still has the same issues, so I cannot use this procedure as a workaround.

I know you are really busy helping all of us here. I really appreciate your advice when you have time. Thank you!

Jared (at HEC Montreal)

Hi Jared,

However, Brainstorm/Matlab crashes every time I try to open and view the raw file.

Can you describe what this crash looks like?
If Brainstorm generates an error in the Matlab command window: please copy-paste the full error messages you get on this forum.
If Matlab crashes, it is a problem that we won't have control over. You can try to look for Matlab crash reports (possibly in your home folder, if you are on Linux or MacOS), post the stack trace here, maybe it contains some helpful information indicating what doesn't work well on your computer.

Sure enough, my default channel file shows that the position values for every channel are zero. However, when I tried to add EEG positions, I get a message that says, “No channel matching the loaded cap.” What could this mean?

The EGI .raw files do not include the electrodes positions, so indeed you have to add them manually.
Where do you get them from? Are you using one of the default caps available in Brainstorm?
This error message indicates that you picked a file with 3D positions where the electrode do not match the name of the data channels in your recordings, so most likely you didn't pick the correct file.
Please describe exactly what you're doing here: what electrode cap did you use for the recordings, what do the list of channel names look like in your recordings, which menu you select...

Incidentally, if I import the file as epoched data and try to view one epoch, Brainstorm/Matlab again crashes.

Again: please post more details describing this "crash".

However, strangely, if ask Brainstorm to review one of the epochs as RAW, it produces a new RAW file that I can view perfectly fine without the software crashing.

This is weird... it doesn't make much sense.

Unfortunately, the channel file associated with this new RAW file still has the same issues, so I cannot use this procedure as a workaround.

The missing positions in the channel file are a manipulation issue, not a problem with your dataset.

PS: When you want to add the electrodes positions, make sure you use the menu “Add EEG positions”, not “Import channel file”.
Make sure also that Brainstorm is up to date.

Bonjour François,

Thank you very much for your reply.

Regarding the Matlab crash. It is a low-level graphics error, apparently related to Java. Matlab suggested running using OpenGL. I tried this but still cannot open files with "RAW" over them (i.e. links to RAW files) as doing so causes Matlab to crash. However, if I import those same files into the database and opened the imported versions, Matlab does not crash. Files on other data bases that never used to crash are also crashing too. So perhaps something changed on my system relating to Java. I will reinstall Matlab and see if the problem is resolved.

However, the issue with adding EEG channels still remains. The files I am using used a 65 channel setup with ActiCap (I think 64 EEG channels plus one ground channel). However, no matter which template I try and load, I get a message saying that "No channel matching the loaded cap".

Of course, without channel positions, I cannot view sensor topography, and get this error:
BST> Warning: The position of the following sensors is not set: E01 E02 E03 E04 E05 E06 E07 E08 E09 E10 E11 E12 E13 E14 E15 E16 E17 E18 E19 E20 E21 E22 E23 E24 E25 E26 E27 E28 E29 E30 E31 E32 E33 E34 E35 E36 E37 E38 E39 E40 E41 E42 E43 E44 E45 E46 E47 E48 E49 E50 E51 E52 E53 E54 E55 E56 E57 E58 E59 E60 E61 E62 E63 E64 E65
Error using bst_figures>CreateFigure (line 220)
Nothing to display: All the "EEG" channels are marked as bad or do not have 3D positions.

Error in bst_figures (line 59)
eval(macro_method);

Error in view_topography (line 256)
[hFig, iFig, isNewFig] = bst_figures('CreateFigure', iDS, FigureId, CreateMode, DataFile);

Error in bst_figures>ViewTopography (line 1539)
view_topography(DataFile, Modalities{i}, '2DSensorCap', [], UseSmoothing);

Error in bst_figures (line 59)
eval(macro_method);

Error in figure_timeseries>@(h,ev)bst_figures('ViewTopography',hFig,1) (line 2027)
jItem = gui_component('MenuItem', jPopup, [], 'View topography', IconLoader.ICON_TOPOGRAPHY, [],
@(h,ev)bst_figures('ViewTopography', hFig, 1));

The EEG channels are not marked as bad, they just don't have any position information in the channel file.

Do you have any recommendations?

Thank you!

Jared


Here is a screen shot of the channel file.

P.S. My version of Brainstorm is Jan 08, 2019.

Matlab low-level crashes are not something we can do much about. The first thing you should try is updating your graphics driver (and make sure all your system is up-to-date). If it doesn't work: upgrade Matlab. If you keep on getting the same crash: submit the bug to the Mathworks, or change graphics card/computer.

However, the issue with adding EEG channels still remains. The files I am using used a 65 channel setup with ActiCap (I think 64 EEG channels plus one ground channel). However, no matter which template I try and load, I get a message saying that "No channel matching the loaded cap".

Of course, without channel positions, I cannot view sensor topography, and get this error:
BST> Warning: The position of the following sensors is not set: E01 E02 E03...

Your EEG recordings come from the NetStation, so I guess you should be using EGI HydroCel nets instead of BrainProducts caps... The ActiCap and EasyCap recordings are typically saved with 10-10 channel names (FPz, Cz, etc) not this flat numbering you have in your file (E01, E02, ...)
When adding 3D positions to a channel file, the data channels are matched with the electrodes positions by name. If the positions are not set, it's because the naming is incorrect.

Bonjour Francois,

Regarding the Matlab crash. I don't understand why it is happening. But I do understand from you that it is not a Brainstorm issue. Nevertheless, it is weird because I did not have problems with older versions of Brainstorm. And I have not changed my drivers. Anyway, I have found that I can get around the problem for now by going into "Edit Preferences" and selecting either "OpenGL: Software" or "OpenGL: Disabled". The later is of course really slow, so I am using the former.

As for the channels. It was my understanding that exporting NetStation files as binary RAW resulted in a file without any channel information, and thus the format of the channel file I currently have was created by Brainstorm when I imported the EEG raw data. Is my understanding incorrect? Or perhaps you are saying that in order to add the appropriate template using the Brainstorm "add EEG positions" command, I need to first edit my channel file so that the names match the template I want to use? I guess the easiest way to do that would be to open the templates up in Matlab and copy and past the channel names?, and then perform the "add EEG positions" function? This seems unnecessarily tedious.

So, what I did was to just manually search for the template channel file within Matlab. I copied it, then pasted and replaced the automatically created one in my subject folder with imported NetStation EEG raw data. Now I can see topography. It would be nice though if the "add EEG positions" function would just do the same thing (i.e. replace the automatically created channel file with the template).

As for the channels. It was my understanding that exporting NetStation files as binary RAW resulted in a file without any channel information, and thus the format of the channel file I currently have was created by Brainstorm when I imported the EEG raw data. Is my understanding incorrect?

Yes.

Or perhaps you are saying that in order to add the appropriate template using the Brainstorm "add EEG positions" command, I need to first edit my channel file so that the names match the template I want to use? I guess the easiest way to do that would be to open the templates up in Matlab and copy and past the channel names?, and then perform the "add EEG positions" function? This seems unnecessarily tedious.

I'm just saying that you are probably trying to load the wrong electrode cap.
(unless you have plugged a BrainProduct cap on an EGI amplifier)

So, what I did was to just manually search for the template channel file within Matlab. I copied it, then pasted and replaced the automatically created one in my subject folder with imported NetStation EEG raw data. Now I can see topography. It would be nice though if the "add EEG positions" function would just do the same thing (i.e. replace the automatically created channel file with the template).

The matching electrode position-channel by name is supposed to work. If you have channel names that do not match the name of the electrode on a standard cap, there is something not standard in your acquisition setup.
What you did is exactly what the menu "Use default channel cap" does. This can be use only if you are 100% sure that the order of you data channels is your recordings is exactly the same as in the electrode template. I'm not sure how you would assert this if the two don't even have the same naming convention.

unless you have plugged a BrainProduct cap on an EGI amplifier

Actually, that appears to be the case. EasyCap's Standard 32Ch actiCAP Electrode Cap was used.

The matching electrode position-channel by name is supposed to work. If you have channel names that do not match the name of the electrode on a standard cap, there is something not standard in your acquisition setup.

Well, with EGI data, the channel file is automatically created with just a generic numerical format. But I guess our acquisition setup was not standard because the actiCAP was used.

What you did is exactly what the menu "Use default channel cap" does.

This is the function that I would like to use, however Brainstorm does not currently have the channel cap we used listed. I sent it in a separate thread, but will also add it here. For now, I will manually edit an appropriate channel file template.

Thank you Fraincois for all your kind assistance and clarification.

Best,

Jared
EGI32.bvef (4.9 KB)
EGI32.pdf (302.9 KB)

Problem resolved in this other thread: