OpenMEEG error #-1073740791


Sorry to bump once again Francois, but would you have any suggestions possibly?

We just have a time sensitive project we're hoping to get underway with, but this error is stopping me from proceeding.

Thank you,

I'm sorry, this is not in my hands...
The only advice I could give would be to try computing the BEM surfaces differently (using the FieldTrip option, or with different number of vertices for the Brainstorm method).

For the actual debugging of OpenMEEG, this is up to the authors of the software: @papadop, @mclerc or @Alexandre

Sorry. For some reason I only see some of the replies in this forum. I missed the one where you provide the zips. I will have a look later tonight and will tell you what I found.

Yes I saw the code.... The only thing I can say up to now is that the error code does not correspond to a code that we return voluntarily (it might be a bug). I was first imagining a poor conversion sequence from integer to unsigned and back to integer, but this does not seem obvious.

With the zip file I will try to reproduce the problem and we will see....

The first look at your zip file shows that the problem arose because the file openmeeg_hm.mat is empty. Thus the error is not in the om_minverser but in the previous stage that generated this file. om_assemble.

Looking at the log file openmeeg_log.txt, it clearly says that two of your meshes are self-intersecting... This is probably the reason for which om_assemble produced and empty file. I consider this as a bug. The warning should be a clear and reported error. I will make a change to improve that, On the other hand, this means that openmeeg is not faulty here and that the tool that you used to produce the meshes did not work properly.

The log also shows some strange output for Interfaces "^H^H" as second parameters. I will have a look on that too. But I do not think it can have a link to the fact that meshes are self-intersecting.

@pdhami As I suggested before, try with different numbers of vertices or with the FieldTrip option.

By the way. I checked what is the error code that was sent by OpenMEEG and it is 134 (on linux). So it is either some windows weirdness. And I'm still unable to relate it to 1073740791 (2^32/4-33)...
Just to be clear: the error code we send in OpenMEEG does not depend on the operating system.

Thank you both with your help with this!

I'm using the exact same pipeline on this windows based virtual machine that I used with my personal Mac. Everything worked fine on my Mac. Could this be an issue with the virtual machine set up? I also ask since I have tried various number of vertices (as well as with FieldTrip), but am still running into the same error. For the time being, I will go through all the number of vertex options more thoroughly.

Thank you,

Greetings again,

I am still running into the same error, regardless of how many vertices I use (or if I use the FieldTrip method).

As a work around, because I am using the ICBM152 anatomy template, would I be able to simply send myself the openmeeg.mat file from my personal computer, and copy and paste it in the subject folders on the virtual machine?

I am going to attempt it regardless since I am running out of options, but feedback as to whether this is not suggested would be great.


This is all with the ICBM152 template from Brainstorm that you are running into these errors?
When using the template, you should not even try to change the number of vertices, but use directly the surfaces available in the template. If this doesn't work and you have errors mentioning self-intersecting surfaces, this seems to indicate you have modified this template.

  • Create a new test subject, with the options "Use default anatomy: No" and "Use default channel file: No"
  • In the anatomy view: right-click on the subject > Use template > MNI > ICBM152
  • In the functional view: right-click on the subject > Create folder > name it the way you want
  • Copy-paste your channel file to this new folder
  • Right-click on the channel file > MRI registration > Edit: Make sure the electrodes and correctly aligned on the head, and click on "Project on head surface" if you have not done this before, or if you are not using one template sensor cap distributed with Brainstorm for the ICBM152 template.
  • Right-click on the channel file > Compute head model > Select OpenMEEG and keep all the default values

I tested on Windows10 with the version of OpenMEEG that is installed by default as a plugin (see in the Plugin menu): no issue with the current ICBM152 template.

Hi Francois,

Apologizes, I meant that I had tried different values for the generation of the BEM surfaces, before running openMEEG. I do not change the vertices of the template (ICBM152)/modify the template in any way.

I am first running CAT12 segmentation on the ICBM152 template to get the Schaefer atlases. I then generated the BEM surfaces, and then tried computing the head model. It is here that I get the error as mentioned above.

I have the exact same pipeline on my personal Mac (just with a different dataset), and all works fine. However, it is on the Windows virtual machine that there comes this error.

Going back to my last post, I did send myself the openMEEG file from my Mac, and copied and pasted it into the subject folders on my virtual machine. All the parameters are the exact same. I did this, reloaded the database, and the compute sources worked fine. Do you think is an okay work around?

Thank you again,

Of course you do: Running CAT12 deletes all the files in the folder.
Then you re-import or re-compute everything.
Nothing is left of the original template, but the MRI volume.

Running the computation of the BEM surfaces for the MNI template is indeed not recommended, as the MRI is cut too high, there is not a full head in this volume.

What you could try:

  1. First, restore the original template: right-click on Default anatomy > Use template > MNI > ICBM152.
  2. Create a new subject ICBM152_cat12, with "Default anatomy: NO".
  3. Right-click on ICBM152_cat12 > Use template > MNI > ICBM152
  4. Right-click on ICBM152_cat12 > MRI segmentation > CAT12
  5. At the end, copy the volume atlases or the cortex surface (for surface atlases) fromICBM152_cat12 to the Default anatomy folder.

In the future: do not delete the existing files of the ICBM152 template, this would bring all sorts of issues.

Thank you Francois for the clarification.

I will try what you proposed shortly.

After following these steps, would I then not run the BEM surfaces and go straight to computing the head model?


Use the BEM surfaces from the template.

Having a more streamlined way of debugging OpenMEEG errors would still be a plus.

Hi Francois,

I followed your instructions, and accordingly computed the head model with the BEM surfaces from the template. I have also just simply tried to compute the head model on the default anatomy, without any further changes.

However, I am still running into openMEEG errors.

** Error: OpenMEEG call: om_gain -EEG
** "C:\Users\psdhami.brainstorm\tmp\openmeeg_hminv.mat"
** "C:\Users\psdhami.brainstorm\tmp\openmeeg_dsm.mat"
** "C:\Users\psdhami.brainstorm\tmp\openmeeg_h2em.mat"
** "C:\Users\psdhami.brainstorm\tmp\openmeeg_gain_eeg.mat"
** OpenMEEG error #-1073740791:
** om_gain version 2.4.1 compiled at Aug 22 2018 19:47:41 using OpenMP
** Executing using 1 threads.
** | ------ om_gain
** | -EEG
** | C:\Users\psdhami.brainstorm\tmp\openmeeg_hminv.mat
** | C:\Users\psdhami.brainstorm\tmp\openmeeg_dsm.mat
** | C:\Users\psdhami.brainstorm\tmp\openmeeg_h2em.mat
** | C:\Users\psdhami.brainstorm\tmp\openmeeg_gain_eeg.mat
** | -----------------------
** Using variable with name: matrix
** For help with OpenMEEG errors, please refer to the online tutorial:

Copying and pasting the openMEEG head model .mat file created from my personal Mac to the default anatomy folder on my virtual machine technically allows me to compute the sources. Would this be okay? Or do you see issues with this approach.


These meshes are not intersecting...
Is this is completely an OpenMEEG bug then?
That would explain a lot of the error reports we have on the forum...


Hi Francois,

Is this work around okay or would you suggest not to do it?

Copying and pasting the openMEEG head model .mat file created from my personal Mac to the default anatomy folder on my virtual machine technically allows me to compute the sources. Would this be okay? Or do you see issues with this approach.


It is OK to do so, but only if you use the original BEM surfaces, not the ones you recomputed from the truncated head surface after processing the MRI with CAT.