Open MEEG error

Have you restarted Matlab?

Yes, I restarted Matlab. I gave you the error from the Linux computer. I went back to version 2.2 on the linux computer and it works fine.

This is the error from the Mac:

Subscripted assignment dimension mismatch.

Error in bst_openmeeg (line 450)
Gain(OPTIONS.iMeg, :slight_smile: = om_load_full(meggain_file);

Error in bst_headmodeler (line 470)
[Gain, errMessage] = bst_openmeeg(OPTIONS);

Error in panel_headmodel>ComputeHeadModel (line 647)
[OPTIONS, errMessage] = bst_headmodeler(OPTIONS);

Error in panel_headmodel (line 27)
eval(macro_method);

Error in panel_protocols>TreeHeadModel (line 1156)
[OutputFiles, errMessage] = panel_headmodel(‘ComputeHeadModel’, iChanStudies);

Error in panel_protocols (line 44)
eval(macro_method);

Error in tree_callbacks>@(h,ev)panel_protocols(‘TreeHeadModel’,bstNodes) (line 2269)
gui_component(‘MenuItem’, jPopup, [], ‘Compute head model’, IconLoader.ICON_HEADMODEL, [],
@(h,ev)panel_protocols(‘TreeHeadModel’, bstNodes));

Marcel

The error with "org.brainstorm.dialogs.HotkeyDialog" you copied previously was not related to the OpenMEEG version. Could you please try with the version 2.4 of OpenMEEG?
(for this: delete the folder $HOME/.brainstorm/openmeeg and restart the computation).

This is the error from the Mac:
Subscripted assignment dimension mismatch.

About this I don't know... I don't have a mac, I cannot debug it...
@Sylvain @jeremym @MartinC @Alexandre We need MACOS testers here

After updating Brainstorm and Open MEEG we receive the same error (see below) on a Windows 10 machine. Might the error be related to the error shown on the mac?
Greetings,
Matthias

Unable to perform assignment because the size of the left side is 306-by-45006 and the size of the right side is
1224-by-45006.

Error in bst_openmeeg (line 450)
Gain(OPTIONS.iMeg,:slight_smile: = om_load_full(meggain_file);

Error in bst_headmodeler (line 470)
[Gain, errMessage] = bst_openmeeg(OPTIONS);

Error in panel_headmodel>ComputeHeadModel (line 647)
[OPTIONS, errMessage] = bst_headmodeler(OPTIONS);

Error in panel_headmodel (line 27)
eval(macro_method);

Error in panel_protocols>TreeHeadModel (line 1156)
[OutputFiles, errMessage] = panel_headmodel(‘ComputeHeadModel’, iChanStudies);

Error in panel_protocols (line 44)
eval(macro_method);

Error in tree_callbacks>@(h,ev)panel_protocols(‘TreeHeadModel’,bstNodes) (line 2269)
gui_component(‘MenuItem’, jPopup, [], ‘Compute head model’, IconLoader.ICON_HEADMODEL, [],
@(h,ev)panel_protocols(‘TreeHeadModel’, bstNodes));

I’m sorry for all these issues related with the OpenMEEG upgrade…
Please give us a few weeks. We’ll work on it with @Alexandre at some point in August.

Hello Francois, I am having similar issues with OpenMEEG. I have attempted to run a head model on some MEG data with every variable possible and it either runs indefinitely without finish or terminates due to ‘om_gain’ error. Is there any way this will be resolved within the next two weeks? I must give a presentation for my internship at the NIH in two weeks and am relying on this software. If this is not possible do you recommend any other solution for generating a head model. For now I may simply use the overlapping spheres method.Thank you.

Sorry for the inconvenience, which is essentially beyond our control. We are communicating actively with the OpenMEEG group to resolve these integration issues that appeared with their new version.

If you are using EEG, consider using the spherical head model option instead.
If you are using MEG, the overlapping model is a great alternative.

If it runs forever, it might be because you selected a source space that is too big. In the subject anatomy folder, make sure the cortex surface selected (displayed in green) is the low resolution one (15000 vertices).
Check also the BEM surfaces, maybe try with less vertices on each layer (try down to 600 for the head, 400 for the inner and outer skull)

I’m trying to reproduce it. Can anyone provide a MWE ?
I’ve run tutorial_epilepsy('/home/sik/Downloads/', '/tmp/report_dir/') and everything works fine.

What happens if you do the equivalent of this linux commands?

~
❯ cd ~/.brainstorm/openmeeg/linux64       

~/.brainstorm/openmeeg/linux64
❯ export LD_LIBRARY_PATH=$PWD

~/.brainstorm/openmeeg/linux64
❯ ./om_assemble 
./om_assemble version 2.4.0 compiled at Jul 13 2018 15:57:20 using OpenMP
 Executing using 4 threads.

./om_assemble [-option] [filepaths...]

option :
   -HeadMat, -HM, -hm :   
       Compute Head Matrix for Symmetric BEM (left-hand side of linear system).
             Arguments :
             ...
               dipoles positions and orientations
               a mesh file or a file with point positions at which to evaluate the potential
               output matrix
               (Optional) domain name where lie all dipoles.


~/.brainstorm/openmeeg/linux64
❯ 

Hi Francois,
Our lab is also having similar issues with OpenMEEG. We are using the spherical and overlapping models for the time being. However it would be really helpful if you could tell us when you think this problem would be solved.
We are working on a new source localization project and it would help to know when OpenMEEG would start working again so we can plan our data analysis’ timeline.

Thank you,
Michel

image

Hi Francois and team,

May I know what actually happen, by referring to above printscreen shot, may you suggest to overcome the problem. TQ

Error: OpenMEEG call: om_assemble -HM
** "C:\Users\O M E N.brainstorm\tmp\openmeeg.geom"
** "C:\Users\O M E N.brainstorm\tmp\openmeeg.cond"
** "C:\Users\O M E N.brainstorm\tmp\openmeeg_hm.mat"
** OpenMEEG error #1:
** om_assemble version 2.4.1 compiled at Aug 22 2018 19:47:28 using OpenMP
** Executing using 6 threads.
**
** | ------ om_assemble
** | -HM
** | C:\Users\O M E N.brainstorm\tmp\openmeeg.geom
** | C:\Users\O M E N.brainstorm\tmp\openmeeg.cond
** | C:\Users\O M E N.brainstorm\tmp\openmeeg_hm.mat
** | -----------------------
** (DEPRECATED) Please consider updating your geometry file to the new format 1.1 (see data/README.rst): C:\Users\O M E N.brainstorm\tmp\openmeeg.geom
** IO: load: Unknown mesh file format for C:\Users\O
**
** For help with OpenMEEG errors, please refer to the online tutorial:
** https://neuroimage.usc.edu/brainstorm/Tutorials/TutBem#Errors


Hello

This issue is related with the spaces in the folder names.
The was fixed yesterday: OpenMEEG bug for head model

Please update Brainstorm and try again.
Francois

Dear Francois,

after a while I tested OpenMEEG 2.4 on a Mac using Matlab 2016b again. It still does not finish the headmodel calculations. It crashes when the OPENMEEG window shows: ‘Reading MEG leadfield’.
The Matlab error message is as follows:
Subscripted assignment dimension mismatch.

Error in bst_openmeeg (line 450)
Gain(OPTIONS.iMeg, :slight_smile: = om_load_full(meggain_file);

Error in bst_headmodeler (line 470)
[Gain, errMessage] = bst_openmeeg(OPTIONS);

Error in panel_headmodel>ComputeHeadModel (line 647)
[OPTIONS, errMessage] = bst_headmodeler(OPTIONS);

Error in panel_headmodel (line 27)
eval(macro_method);

Error in panel_protocols>TreeHeadModel (line 1156)
[OutputFiles, errMessage] = panel_headmodel(‘ComputeHeadModel’, iChanStudies);

Error in panel_protocols (line 44)
eval(macro_method);

Error in tree_callbacks>@(h,ev)panel_protocols(‘TreeHeadModel’,bstNodes) (line 2271)
gui_component(‘MenuItem’, jPopup, [], ‘Compute head model’, IconLoader.ICON_HEADMODEL, [],
@(h,ev)panel_protocols(‘TreeHeadModel’, bstNodes));

Best regards

Marcel

hi Marcel,

can you share the content of the folder:

$HOME/.brainstorm/tmp

it should contain the OpenMEEG files necessary for me to understand
what is happening.

thanks
Alex

Helo Alexandre,
I have similar problem and I was unable to find any further responses to this topic. It happens in only one subject, other subjects I processed before or after went without error. I am running openMEEG version 2.4 on Brainstorm with current update (February 2019), Matlab R2016b, Win 7 64-bit.

Creation of head model hangs on "Reading SEEG leadfield".

Here is the content of $HOME/.brainstorm/tmp https://www.dropbox.com/sh/noiez860h3fz0cl/AAA6SMHKY-chCY_9g-FdNX0ga?dl=0

Matlab produces error message:

Subscripted assignment dimension mismatch.

Error in bst_openmeeg (line 492)
Gain(OPTIONS.iSeeg, : ) = om_load_full(seeggain_file);

Error in bst_headmodeler (line 470)
[Gain, errMessage] = bst_openmeeg(OPTIONS);

Error in panel_headmodel>ComputeHeadModel (line 647)
[OPTIONS, errMessage] = bst_headmodeler(OPTIONS);

Error in panel_headmodel (line 27)
eval(macro_method);

Error in panel_protocols>TreeHeadModel (line 1159)
[OutputFiles, errMessage] = panel_headmodel('ComputeHeadModel', iChanStudies);

Error in panel_protocols (line 44)
eval(macro_method);

Error in tree_callbacks>@(h,ev)panel_protocols('TreeHeadModel',bstNodes) (line 2319)
gui_component('MenuItem', jPopup, [], 'Compute head model', IconLoader.ICON_HEADMODEL, [], @(h,ev)panel_protocols('TreeHeadModel', bstNodes));

Thank you for your time,
Adam

It is weird that this only happens with a single subject, which will suggest that is unrelated to the original issue. But I agree that the error message might not help. It seems like it just hangs and never comes back.

I'll try to reproduce.

Hi Adam,

The bug you get is not coming from OpenMEEG, but from Brainstorm. In the files you sent, we can see that the leadfield was correctly computed (openmeeg_gain_seeg.mat), but it looks like its size does not match what Brainstorm expects at line 492 in bst_openmeeg.

The leadfield matrix computed by openmeeg has 114 rows, but I can't check how many were expected based only on the OpenMEEG files you sent.
If you are comfortable with the Matlab environment, you could try understanding where is the error coming from by placing a breakpoint in bst_openmeeg at line 492 (click at the left of the line), then starting the BEM computation. When the debugger stops, you can explore the contents of the variables.

Otherwise, you could try sending me the files and I could do it for you. Right-click on the subject > file > duplicate subject, then delete all files that are not necessary to run this computation. Then right-click on the subject > File > Export subject, upload the .zip file somewhere, and send me the link as a private message.

Francois

Hello,

I am having trouble computing the head model with BEM for one of my subjects.
The Error that I am getting is the following:

I tried to follow the tutorial and compute the BEM surfaces in brainstorm but this did not work.
Could you please help me with that?

Thank you so much,
Georgios

the error is at the bottom. Did you check that the meshes in your model are nested and non-intersecting?

Alex

1 Like

@Georgios You can copy-paste the full error message from the Matlab command window.