Hello. I've got T1 images, BESA EEG sensor coordinates, and EEG data from several individual subjects. I have segmented all the MRIs with FreeSurfer and imported them into Brainstorm. I have also imported all the individual BESA coordinates into Brainstorm. I am now starting to construct head models for the individual subjects. My source model consists of ~15,000 vertices of neocortex, as well as a volume composed of some subcortical structures.
On Ubuntu: After starting "Compute head model", it runs for about 24 minutes, gets to the point where the dialog says "Assembling EEG leadfield", then the process crashes with the attached segmentation fault error. I tried it with several different subjects, and the same thing happens every time.
On macOS: The head models finish successfully to completion in about 32 minutes, identical data.
I'm using the mac laptop for now, but my Ubuntu machine is more powerful so I'd prefer to use that, so I am wondering if there is anything that can be done about this error, on my end or yours. I will probably need to provide more information besides just the error message for this to be addressed, and will be ready and willing to do so. Thanks very much!
All those files exist except for openmeeg_gain_eeg.mat, but I tried it anyway. Another segmentation fault:
pythagoras@pythagoras:~/.brainstorm/openmeeg/linux64$ LD_LIBRARY_PATH=$PWD ./om_gain -EEG /home/pythagoras/.brainstorm/tmp/openmeeg_hminv.mat /home/pythagoras/.brainstorm/tmp/openmeeg_dsm.mat /home/pythagoras/.brainstorm/tmp/openmeeg_h2em.mat /home/pythagoras/.brainstorm/tmp/openmeeg_gain_eeg.mat
./om_gain version 2.4.0 compiled at Jul 13 2018 15:57:20 using OpenMP
Executing using 12 threads.
| ------ ./om_gain
| -EEG
| /home/pythagoras/.brainstorm/tmp/openmeeg_hminv.mat
| /home/pythagoras/.brainstorm/tmp/openmeeg_dsm.mat
| /home/pythagoras/.brainstorm/tmp/openmeeg_h2em.mat
| /home/pythagoras/.brainstorm/tmp/openmeeg_gain_eeg.mat
| -----------------------
Using variable with name : matrix
Segmentation fault (core dumped)
pythagoras@pythagoras:~/.brainstorm/openmeeg/linux64$
I’d be glad to share whatever data is needed to replicate the error, but I’m not super familiar with FreeSurfer and Brainstorm yet. What would be the minimum things needed to replicate this particular part of the process? My guess is the mat files that Brainstorm has for this protocol so far in its database, for this particular subject. Here are those files, organized into anat and data directories like Brainstorm does. I am attempting to make a head model out of the “mixed” cortex+subcortical. Let me know if this is sufficient, thanks.
@francois, I don’t think that reverting to 2.2 is the solution. So far we have mainly encountered openmeeg-brainstorm integration issues (missing libraries, paths, lib incompatibility, etc…) This is the first one with something internal to openmeeg.
What it would be great is to find a manner to replicate brainstorm pipelines so that I can just run script like the epilepsy tutorial and generate the data. I’m sure there’s a way to do so. Its just that I’m not familiar with it.
Here is a zip of everything in my tmp directory after the segmentation fault on my data. And as I mentioned, openmeeg_gain_eeg.mat does not appear in my case:
I’m not sure what you expect, and from who. Writing a script that reproduces the crash means that we already know how to reproduce it, hence how to fix it…
I see that changes to both OpenMEEG and Matio have been merged. I now get the new error message from OpenMEEG. But how can I utilize the fix that was merged in Matio? Would I have to build and install Matio manually, or will OpenMEEG incorporate the fix somehow?
If you want to speed up and baypass the system I think that you can download the OpenMEEG universal linux binaries from https://github.com/openmeeg/openmeeg_packages untar them and swap the old backed for the new one. Like so:
just to make sure that its broken
~/.brainstorm/openmeeg/linux64
❯ LD_LIBRARY_PATH=$PWD OMP_NUM_THREADS=1 ./om_gain -EEG ~/.brainstorm/tmp/openmeeg_hminv.mat ~/.brainstorm/tmp/openmeeg_dsm.mat ~/.brainstorm/tmp/openmeeg_h2em.mat ~/.brainstorm/tmp/openmeeg_gain_eeg.mat
./om_gain version 2.4.0 compiled at Jul 13 2018 15:57:20 using OpenMP
Executing using 1 threads.
| ------ ./om_gain
| -EEG
| /home/sik/.brainstorm/tmp/openmeeg_hminv.mat
| /home/sik/.brainstorm/tmp/openmeeg_dsm.mat
| /home/sik/.brainstorm/tmp/openmeeg_h2em.mat
| /home/sik/.brainstorm/tmp/openmeeg_gain_eeg.mat
| -----------------------
Using variable with name : matrix
zsh: segmentation fault (core dumped) LD_LIBRARY_PATH=$PWD OMP_NUM_THREADS=1 ./om_gain -EEG
Keep a copy of the current OpenMEEG backend. (see that there would be 4 broken links)
~/.brainstorm/openmeeg/linux64
❯ mv libOpenMEEG.so.1.1.0 _libOpenMEEG.so.1.1.0
~/.brainstorm/openmeeg/linux64
❯ mv libOpenMEEGMaths.so.1.1.0 _libOpenMEEGMaths.so.1.1.0
~/.brainstorm/openmeeg/linux64
❯ ls -l
total 152640
lrwxrwxrwx 1 sik sik 21 Jul 13 17:58 libOpenMEEGMaths.so -> libOpenMEEGMaths.so.1
lrwxrwxrwx 1 sik sik 25 Jul 13 17:58 libOpenMEEGMaths.so.1 -> libOpenMEEGMaths.so.1.1.0
-rw-r--r-- 1 sik sik 20966161 Jul 13 17:56 _libOpenMEEGMaths.so.1.1.0
lrwxrwxrwx 1 sik sik 16 Jul 13 17:58 libOpenMEEG.so -> libOpenMEEG.so.1
lrwxrwxrwx 1 sik sik 20 Jul 13 17:58 libOpenMEEG.so.1 -> libOpenMEEG.so.1.1.0
-rw-r--r-- 1 sik sik 1925873 Jul 13 17:57 _libOpenMEEG.so.1.1.0
-rwxr-xr-x 1 sik sik 91362 Jul 13 17:57 om_assemble
-rwxr-xr-x 1 sik sik 14744873 Jul 13 17:57 om_check_geom
-rwxr-xr-x 1 sik sik 37065 Jul 13 17:57 om_forward
-rwxr-xr-x 1 sik sik 83188 Jul 13 17:57 om_gain
-rwxr-xr-x 1 sik sik 14744875 Jul 13 17:57 om_geometry_info
-rwxr-xr-x 1 sik sik 14767946 Jul 13 17:57 om_make_nerve
-rwxr-xr-x 1 sik sik 47597 Jul 13 17:57 om_matrix_convert
-rwxr-xr-x 1 sik sik 31855 Jul 13 17:57 om_matrix_info
-rwxr-xr-x 1 sik sik 14744839 Jul 13 17:57 om_mesh_concat
-rwxr-xr-x 1 sik sik 14768785 Jul 13 17:57 om_mesh_convert
-rwxr-xr-x 1 sik sik 14744813 Jul 13 17:57 om_mesh_info
-rwxr-xr-x 1 sik sik 14745097 Jul 13 17:57 om_mesh_smooth
-rwxr-xr-x 1 sik sik 36507 Jul 13 17:57 om_mesh_to_dip
-rwxr-xr-x 1 sik sik 31471 Jul 13 17:57 om_minverser
-rwxr-xr-x 1 sik sik 14756335 Jul 13 17:57 om_project_sensors
-rwxr-xr-x 1 sik sik 14786966 Jul 13 17:57 om_register_squids
-rwxr-xr-x 1 sik sik 31529 Jul 13 17:57 om_squids2vtk
-rw-r--r-- 1 sik sik 68 Jul 25 17:57 url
Overwrite with the new backend. (see that now the links are proper again)
~/.brainstorm/openmeeg/linux64
❯ cp $PATH_TO_UNZIP/OpenMEEG-2.4.0-Linux/lib/libOpenMEEG.so.1.1.0 ./
~/.brainstorm/openmeeg/linux64
❯ cp $PATH_TO_UNZIP/OpenMEEG-2.4.0-Linux/lib/libOpenMEEGMaths.so.1.1.0 ./
~/.brainstorm/openmeeg/linux64 19s
❯ ls -l
total 175168
lrwxrwxrwx 1 sik sik 21 Jul 13 17:58 libOpenMEEGMaths.so -> libOpenMEEGMaths.so.1
lrwxrwxrwx 1 sik sik 25 Jul 13 17:58 libOpenMEEGMaths.so.1 -> libOpenMEEGMaths.so.1.1.0
-rw-r--r-- 1 sik sik 20966161 Jul 13 17:56 _libOpenMEEGMaths.so.1.1.0
-rw-r--r-- 1 sik sik 21121792 Aug 17 18:20 libOpenMEEGMaths.so.1.1.0
lrwxrwxrwx 1 sik sik 16 Jul 13 17:58 libOpenMEEG.so -> libOpenMEEG.so.1
lrwxrwxrwx 1 sik sik 20 Jul 13 17:58 libOpenMEEG.so.1 -> libOpenMEEG.so.1.1.0
-rw-r--r-- 1 sik sik 1925873 Jul 13 17:57 _libOpenMEEG.so.1.1.0
-rw-r--r-- 1 sik sik 1925344 Aug 17 18:20 libOpenMEEG.so.1.1.0
-rwxr-xr-x 1 sik sik 91362 Jul 13 17:57 om_assemble
-rwxr-xr-x 1 sik sik 14744873 Jul 13 17:57 om_check_geom
-rwxr-xr-x 1 sik sik 37065 Jul 13 17:57 om_forward
-rwxr-xr-x 1 sik sik 83188 Jul 13 17:57 om_gain
-rwxr-xr-x 1 sik sik 14744875 Jul 13 17:57 om_geometry_info
-rwxr-xr-x 1 sik sik 14767946 Jul 13 17:57 om_make_nerve
-rwxr-xr-x 1 sik sik 47597 Jul 13 17:57 om_matrix_convert
-rwxr-xr-x 1 sik sik 31855 Jul 13 17:57 om_matrix_info
-rwxr-xr-x 1 sik sik 14744839 Jul 13 17:57 om_mesh_concat
-rwxr-xr-x 1 sik sik 14768785 Jul 13 17:57 om_mesh_convert
-rwxr-xr-x 1 sik sik 14744813 Jul 13 17:57 om_mesh_info
-rwxr-xr-x 1 sik sik 14745097 Jul 13 17:57 om_mesh_smooth
-rwxr-xr-x 1 sik sik 36507 Jul 13 17:57 om_mesh_to_dip
-rwxr-xr-x 1 sik sik 31471 Jul 13 17:57 om_minverser
-rwxr-xr-x 1 sik sik 14756335 Jul 13 17:57 om_project_sensors
-rwxr-xr-x 1 sik sik 14786966 Jul 13 17:57 om_register_squids
-rwxr-xr-x 1 sik sik 31529 Jul 13 17:57 om_squids2vtk
-rw-r--r-- 1 sik sik 68 Jul 25 17:57 url
Try it out (now you should be able to finally see this .brainstorm/tmp/openmeeg_gain_eeg.mat file, that was missing all the time)
~/.brainstorm/openmeeg/linux64
❯ LD_LIBRARY_PATH=$PWD OMP_NUM_THREADS=1 ./om_gain -EEG ~/.brainstorm/tmp/openmeeg_hminv.mat ~/.brainstorm/tmp/openmeeg_dsm.mat ~/.brainstorm/tmp/openmeeg_h2em.mat ~/.brainstorm/tmp/openmeeg_gain_eeg.mat
./om_gain version 2.4.0 compiled at Jul 13 2018 15:57:20 using OpenMP
Executing using 1 threads.
| ------ ./om_gain
| -EEG
| /home/sik/.brainstorm/tmp/openmeeg_hminv.mat
| /home/sik/.brainstorm/tmp/openmeeg_dsm.mat
| /home/sik/.brainstorm/tmp/openmeeg_h2em.mat
| /home/sik/.brainstorm/tmp/openmeeg_gain_eeg.mat
| -----------------------
Using variable with name: matrix
-------------------------------------------
| Elapsed Time: 18.7218 s.
-------------------------------------------
Ok, I will try this. But meanwhile, there is apparently another bug in OpenMEEG which is causing my head models being calculated in macOS to be incorrect, even though they were finishing. We are talking about it here:
I have been asked to report this. Would this be easy for you to report and/or diagnose, or should I go to the Github page and make an issue?