Error in OpenMEEG in MEG data

Hello,

I know the OpenMEEG team worked a lot for correcting some bugs lately but it seems that the new version did not solve everything.

I have EEG/MEG data in which I want to compute the head model in EEG and in MEG.

It is working well in EEG, but for the same meshes, I have the following error for MEG:

***************************************************************************
** Error: No noise covariance matrix available.
***************************************************************************

Unable to perform assignment because the size of the left side is 294-by-24006 and the size of the right side is 2316-by-24006.

Error in bst_openmeeg (line 450)
    Gain(OPTIONS.iMeg, :) = 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));

I am using 64-bit Ubuntu, in Matlab 2018b, with an up-to-date version of brainstorm (28-sep-2018) and OpenMEEG (http://openmeeg.gforge.inria.fr/download/OpenMEEG-2.4.1-Linux.tar.gz).

Thank you

Tanguy

hi Tanguy,

can you share the content of the tmp folder containing the openmeeg files?

3 options I see:

  • another IO Bug on OpenMEEG code
  • bug in the brainstorm wrapper for MEG
  • left over files from old OpenMEEG versions

Alex

PS:
This tmp folder is in your home folder, something like:
/home/username/.brainstorm/tmp

Zip all its contents immediately after getting this error. Restarting a new computation, closing or starting Brainstorm empties this folder.

Here you are:
https://mcgill-my.sharepoint.com/:u:/g/personal/tanguy_hedrich_mail_mcgill_ca/Ebrh3AApBfZJkNt0w2_qspoBoKUdXOLsYJ96Nctopw9cvw?e=iYpvW3

I could not replicate the crash using the files attached:

https://www.dropbox.com/s/0mxffnfwlcwuicf/bst_openmeeg_meg.zip?dl=0

I just hacked some MEG sensor locations to complete the computation.

Can it be a pb with brainstorm MEG leadfield? or maybe it's because you did not provide the MEG sensor locations?

Alex

I’m not sure what you mean by the brainstorm MEG leadfield. But for sure the MEG sensor locations were provided!

The thing is that with the exact same data, if I use an older version of OpenMEEG (2.2.0), I am able to calculate the gain matrix without crash…

ok so with your squids file I had not seen I do see something weird.

I opened an issue: https://github.com/openmeeg/openmeeg/issues/347

thanks a lot for the issue report.

let’s hope we can fix this quickly.

Alex

Sorry for my late response. Unfortunately I cannot replicate.

@Francois from the matlab trace I’ve trouble to figure out which om_ binary failed. It seems that it might be om_load_full but I find it weird (actually i don’t even know what that binary is). om_gain is the usual suspect.

@tanguy could you run an ldd of the binary that brainstrom is executing underneath?
this is what I get on my pc:

~
(base) ❯ ldd ~/.brainstorm/openmeeg/linux64/om_gain 
	linux-vdso.so.1 (0x00007ffc757fe000)
	libgtk3-nocsd.so.0 => /usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0 (0x00007f615daf4000)
	libOpenMEEG.so.1 => /home/sik/.brainstorm/openmeeg/linux64/libOpenMEEG.so.1 (0x00007f615d738000)
	libOpenMEEGMaths.so.1 => /home/sik/.brainstorm/openmeeg/linux64/libOpenMEEGMaths.so.1 (0x00007f615c285000)
	libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f615c055000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f615bcb7000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f615b929000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f615b711000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f615b320000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f615b11c000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f615aefd000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f615ace0000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f615dcfb000)

Here’s what I get:

capulet 119% ldd ~/.brainstorm/openmeeg/linux64/om_gain
	linux-vdso.so.1 =>  (0x00007ffcb2c77000)
	libOpenMEEG.so.1 => not found
	libOpenMEEGMaths.so.1 => not found
	libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007fc086f53000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc086c4d000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fc086937000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fc08671f000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc086356000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc086152000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc085f34000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fc087182000)

@tanguy we don’t manage to replicate on multiple machines. You get this errors on all subjects? can you try on a different machine to see if you can replicate?

thanks

Yes, I get this error in all the machines in the lab (all Linux64) and all my MEG subjects (.ds files). Do you want me to send you some data to test with?

Thank you
Tanguy

@tanguy. My fault, can you export the LD_LIBRAY_PATH and repeat the ldd? I think that this not found would disappear.
Then the next step would be to replicate the call that brainstorm does.

see, these threads:

@Francois the BST error claims a missing covariance matrix, ant the openmeeg_log.txt shows no failure.

I think the error about the missing noise covariance matrix is unrelated, this does not happen in the same tasks.
This is probably something that residual that was in the Matlab command window.
@tanguy?

@Francois is right. The missing noise covariance error is an unrelated warning that I’ve copied/pasted by mistake. It is not part of my OpenMEEG problem, my bad.

I am not sure what to do now, I’ve updated my LD_LIBRARY_PATH and now all the libraries are seen by ldd. If I launch om_gain from a terminal, I’ve got no error, but in brainstorm, it is still not working. Any idea?

capulet 159% cd ~/.brainstorm/openmeeg/linux64
capulet 160% ldd ./om_gain
	linux-vdso.so.1 =>  (0x00007ffeae976000)
	libOpenMEEG.so.1 (0x00007ff3ed98a000)
	libOpenMEEGMaths.so.1 (0x00007ff3ec4d7000)
	libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007ff3ec2a8000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff3ebfa2000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff3ebc8c000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff3eba74000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff3eb6ab000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff3eb48d000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff3eb289000)
	libz.so.1 => /opt/minc-itk4/lib/libz.so.1 (0x00007ff3eb06e000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ff3edd46000)
capulet 161% ./om_gain -MEG ~/.brainstorm/tmp/openmeeg_hminv.mat ~/.brainstorm/tmp/openmeeg_dsm.mat ~/.brainstorm/tmp/openmeeg_h2mm.mat ~/.brainstorm/tmp/openmeeg_ds2meg.mat ~/.brainstorm/tmp/openmeeg_gain_meg.mat                                                                                                                                                                       ./om_gain version 2.4.1 compiled at Aug 29 2018 08:19:44 using OpenMP
 Executing using 4 threads.


| ------ ./om_gain
| -MEG
| /home/bic/tanguy/.brainstorm/tmp/openmeeg_hminv.mat
| /home/bic/tanguy/.brainstorm/tmp/openmeeg_dsm.mat
| /home/bic/tanguy/.brainstorm/tmp/openmeeg_h2mm.mat
| /home/bic/tanguy/.brainstorm/tmp/openmeeg_ds2meg.mat
| /home/bic/tanguy/.brainstorm/tmp/openmeeg_gain_meg.mat
| -----------------------
-------------------------------------------
| Elapsed Time: 49.137 s.
-------------------------------------------