BEM for ECoG and stereotactic EEG

Dear Francois,

I am working with Dr. Christos Papadelis on an epilepsy project in pediatric patients. We are co-registering our ECoG sensors with the cortex using Brainstorm and then we would like to run source localization by using the ECoG and stereotactic EEG sensors. However, we have been having problems when trying to apply the BEM model.
Any advice or solution you have would be greatly appreciated.

Thank you,
Michel AlHilani

Dear Michel,

What kind of problems did you have?
Please post all the error messages and relevant screen captures to illustrate your issues.


I’ve done some work on sEEG and source if you guys are looking for a collaborators. It was in adults but should be translatable. Email is

Hello Francois,

Thank you for your prompt response.

I have been trying to do "compute head model" for the CT/MRI coregistration, using OpenMEEG BEM for ECOG and SEEG. After I press yes for the openMEEG options, Brainstorm starts processing and then it gives this error:

I have tried to decrease the number of vertices when generating the BEM surface model for the patient, it hasn't work and it kept giving the same error.
When I reached to 362 vertices it gave a different error when trying to use OpenMEEG:

I'm not sure if this is a memory issue, these are the options that I chose for OpenMEEG. I chose the less memory option, but it still did not solve the issue.

If I missed any detail please let me know.

Thank you for your help.

Thank you very much for your comment Andrew, I think it’s a great idea. I will let Dr.Papadelis know.

There is a new version of OpenMEEG that is in the process of being released.
Maybe you could try with these test packages:;O=D

Download the 2.4 package for you operating system, then in Brainstorm select the menu Update > Update OpenMEEG > Install.

Are you running Brainstorm from Matlab or are you using the compiled version?

PS: If you are using a compiled version a Brainstorm, I’ve just recompiled it.
Update Brainstorm again to get the latest modifications in the compiled version.

If you are still getting the same error, we would need you to send additional debugging information to help you further:

  • When the error appears, do not close it: open a Linux terminal, then zip the openmeeg temporary files (tar zcvf debug_openmeeg.tgz ~/.brainstorm/tmp)
  • Upload this .tgz file somewhere (eg. dropbox, google drive…)
  • Post the link to the file here

With stereotactic EEG you have all electrodes inside the BEM. Hence, it is no use of the BEM.

1 Like

Hello Francois,

We are running Brainstorm from Matlab. I tried what you suggested and installed the new OpenMEEG but I still got the same error.
This is the dropbox .tgz link for the error:

Do you have any other suggestion or idea with regards to how to run source localization with the ECoG and SEEG sensors?

Thank you very much for your help!

A finite element model is more correct. Even a homogenous sphere may be acceptable. The big issue is that many contacts are in VM and “see” a very different EEG than contacts in GM. Somehow you have to take this into account. In GM you may have very focal activities that even may be uncorrelated to other activities in other parts of GM. I can’t see how you can do source reconstructions on these. Using only VM contacts may be a way for source localization. Connectivity measures should work in both VM and GM contacts

Hi Michel,

we broke something with the ECoG option with openmeeg 2.4.

the line that should be called by brainstorm is :

om_assemble -H2ECOGM openmeeg.geom openmeeg.cond openmeeg_loc_ecog.txt 3 openmeeg_h2ecogm.mat


om_assemble -H2ECOGM openmeeg.geom openmeeg.cond openmeeg_loc_ecog.txt openmeeg_h2ecogm.mat

you hack the brainstorm openmeeg binding by adding this “3” before we find the time to fix it properly.

Sorry about that.


FYI: We improved significantly the tools available in Brainstorm for processing and visualizing SEEG and ECOG data, including new options for volume coregistration. They are now documented in a new tutorial: