Matlab crash during display sensors> EEG; processing EEG data without using anatomy

Dear François,

I am a new Brainstorm user and I am encountering a number of problems that I could not find answered on the forum. Hence I write to you.
I am using Brainstorm v3.1 matlab; R2010a and macOSX 10.7.5
I have an EEG data set that consists of an auditory streaming experiment- steady state experiment for condition blocks are each in biosemi bdf files.
I do not have any individual anatomy or individual 3d cap coordinates per subject and want to use a defualt template.
We use a 64 channel cap that uses the extended 10-20 system with mastoids and a VEOG channel cap that contains 67 channels of interest for which I have 2d radial coordinates in a text file:
Fp1 -92 -72
AF7 -92 -54
AF3 -74 -65

Importantly this file represents a subset of the channels recorded in in the actual bdf data file which has 80 channels: such as ‘EXG1’ ‘EXG2’
‘EXG3’ ‘EXG4’ ‘EXG5’ ‘EXG6’ ‘EXG7’ ‘EXG8’ ‘GSR1’ ‘GSR2’ ‘Erg1’ ‘Erg2’ ‘Resp’ ‘Plet’ ‘Temp’ ‘Status’

EXG 1 is the VEOG and EXG2, and EX3 are M1 and M2 respectively, the rest of the channels I want to cut.

However I have tried using my text file containing the 67 channels of interest described above, along with the data file but when I go to display sensors all of matlab crashes.

Initially, I thought this was do to by idiosyncratic procedures for this data, but the same thing happens at this stage in the tutorial using the sample CTF data, making me think that this problem is more general.

My questions are threefold:

  1. What is the work around for this error
  2. More generally: is there a way to analyze EEG data like mine by-passing the source modeling and Anatomy requirement to do timefrequency analysis on electrode data
  3. I have been able to accomplish much of this preprocessing using SPM-eeg, is there a way to import SPM matlab structs files into brainstorm, to pick up from this point

I have included the coordinate file and the crash log>but the bdf file *.2 mbs fails to attach so I cannot send you it

Thank you so much in advance for your attention.

Hi,
I checked your electrodes file, it is totally fine, you just need to import it as "ASCII: Name, Theta, Phi"
You can use it on a default head model, you can even deform/realign it manually to adapt it to the standard head shape so that you can do some basic source reconstruction. Right-click on the channel file > MRI registration > Edit… Then play with all the menus, read the tooltips for all the buttons in the toolbar for help.

About your crash: this is related with Matlab and the Apple Java Virtual Machine (JVM), with Brainstorm. There are some operations that are not handled properly. What you can try to do:

  • identify exactly what line makes Matlab crash and why (using breakpoints and the debugger)
  • try without the OpenGL support (in Brainstorm window > File > Edit preferences > OpenGL: disabled)
  • let me know what the problem is, maybe there is an alternate solution
  • run the binary version of Brainstorm (see installation instructions)
  • report the bug to the Mathworks
  • update your OS / the Apple JVM
  • use another computer

Cheers,
Francois

Regarding the other questions:
2) Yes, you can keep working on your EEG recordings: all the frequency and time-frequency features are available both at the sensor and the source levels. Keep on reading the tutorials.
3) No easy way to import SPM structures. You would probably go faster re-doing the pre-processing in Brainstorm than trying to convert the structures you got from SPM (check out the first two tutorials in the “advanced tutorials” section). This way you can also double-check that both programs are doing more or less the same thing.

Francois

Hi Francois,

I was able late last night to use another computer pre lion mac (OSX 10.6.8) with MATLAB r2012b, and it works! however the electrode locations all cluster around the back of the head, perhaps due to the fact that there is no radius in the file. instead I exported to text one of the standard 10-20 64 channel caps I think it was a neuroscan-quickcap-68, and used with Cartasian coordinated and modified it for my purposes, and that did the trick

The only other thing I am now trying to figure out is how to remove extraneous data channels from my raw bdf file once it is loaded in

so i think it is Mac Lion issue with Java, as I have had similar Java issues.

thanks so much for your help!

dave

[QUOTE=Francois;4108]Hi,
I checked your electrodes file, it is totally fine, you just need to import it as "ASCII: Name, Theta, Phi"
You can use it on a default head model, you can even deform/realign it manually to adapt it to the standard head shape so that you can do some basic source reconstruction. Right-click on the channel file > MRI registration > Edit… Then play with all the menus, read the tooltips for all the buttons in the toolbar for help.

About your crash: this is related with Matlab and the Apple Java Virtual Machine (JVM), with Brainstorm. There are some operations that are not handled properly. What you can try to do:

  • identify exactly what line makes Matlab crash and why (using breakpoints and the debugger)
  • try without the OpenGL support (in Brainstorm window > File > Edit preferences > OpenGL: disabled)
  • let me know what the problem is, maybe there is an alternate solution
  • run the binary version of Brainstorm (see installation instructions)
  • report the bug to the Mathworks
  • update your OS / the Apple JVM
  • use another computer

Cheers,
Francois[/QUOTE]

Hello:

Just FYI: I am also running OSX 10.7.5 and I am not experiencing the same issue (w/ Matlab 2011b though). So it’s probably not a problem with the OS; Make sure though your Java version is up to date. Does it happen also when you run the compiled/bin version of brainstorm?

Cheers,

Thanks for this- info I will let you know shortly when I try it- dave

The only other thing I am now trying to figure out is how to remove extraneous data channels from my raw bdf file once it is loaded in

The number of channel described in the channel files and the number of data tracks in the BDF file must be the same. Rather than deleting data tracks, it would be much easier to add the channels in your channel file, and then change their type if you don't want to see them in your figures (ex: EOG, EMG, EDF Annotations, stim channels...).
To do that, right-click on the channel file > Edit channel file > Change the type column of the channels you want to ignore (you can either pick something in the list of type in a custom type).

Cheers,
Francois

HI, Francois

I have done as you suggested and they are no longer displayed when i select display eeg.

However, I still seem to have a problem in part I believe might be due to the use of these channels
I also was curious as to how to get the Biosemi data onto the proper scales this system uses pre-amplified electrodes so the scaling of EEG signals that should usually be under 100 uV are much larger.
How can I adjust this scale in Biosemi so I can see realistic uV values?
so sorry to be a pest
Thanks
dave

Hi Dave,

I’ve just added a process “Pre-process > Scale values”, with which you’ll be able to multiply easily your recordings by a fixed factor.

Alternatively, you can edit your values manually (not convenient for a large number of files):

  • Right-click on your imported recordings (not the raw files) > File > Export to Matlab > “DataMat”
  • Change the .F values
  • Right-click again on your file > File > Export to Matlab > “DataMat”, to update the file stored in the database

Cheers,
Francois

Hi Francios,
Wow what service!, I just triued it on the raw data by draging the raw data file into the Process window and it gave me an error that I have inculded here:

In the biosemi system there is a hard refrence channel e.g. EXG5 and if I can refreference the electrode matrix by subtracting the value of data at this electrode from the matrix. Tis too would solve the issue.

Howerver, It seems that I cannot do this at the raw data stage and that I must first import the data, using the import function and thereby epoching the data… or am i wrong?

I do remember getting a similar error when trying to filter or artifact reject the raw data before importing and epoching. Is there a way to perform some of these pre-processing steps without epoching the data?

cheers//dave

Line 1153: bst_process>CreateRawOut (line 1153) Unsupported file format (only continuous FIF and CTF files can be processed).


Call stack:
>bst_process.m>CreateRawOut at 1153
>bst_process.m>ProcessFilter at 489
>bst_process.m>Run at 86
>bst_call.m at 26
>macro_methodcall.m at 37
>bst_process.m at 30
>panel_process1.m>RunProcess at 71
>bst_call.m at 28
>macro_methodcall.m at 39
>panel_process1.m at 27
>gui_brainstorm.m>CreateWindow/ProcessRun_Callback at 614
>bst_call.m at 28
>gui_brainstorm.m>@(h,ev)bst_call(@ProcessRun_Callback) at 277


Hi Dave,

  1. Unfortunately, all the pre-processing functions only available for the CTF MEG file format. The support for other file formats will be added in the future, but not in the next 6 months.
    You have to import your recordings (=epoch) before you can perform this operation.

  2. There is no re-referencing operation available, except for the conversion to average reference. It was not a priority, as I thought all the manufacturers’ software provide tools to do this. Biosemi doesn’t?
    If you are using Brainstorm for source localization, the EEG reference doesn’t matter: all the recordings are in the end converted to average reference before estimating the sources.

Cheers,
Francois

HI Francois,

Sorry for the delay in getting back to you.
Thanks for the info. in terms of Biosemi and referencing: Biosemi has a slightly different setup than standard machines because of using active electrodes: see
which have - Common Mode Sense (CMS) active electrode
- Driven Right Leg (DRL) passive electrode.
see the follwowing which explaines that the resutling data is therefore applified by a factor of 100 at 50hz

so for example: the BDF file contains data like:
Channel 1 (Oz) = 110uV (Both Oz and Cz contain 50Hz Common Mode. In the BDF file there is no
Channel 2 (Cz) = 101uV information about the amount of CM. In this example we suppose it is 100uV)

From this you can calculate the voltage between Oz and Cz:
Oz - Cz = 110uV - 101uV = 9 uV of clean EEG signal (without 100 uV of 50 Hz and other noise).

http://www.biosemi.com/faq/cms&drl.htm

however you are correct in that there may be ways in biosemi itself to rerefrence the data so that this CMS application factor is removed.