Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with SEEG #64

Closed
ftadel opened this issue Nov 21, 2014 · 4 comments
Closed

Crash with SEEG #64

ftadel opened this issue Nov 21, 2014 · 4 comments

Comments

@ftadel
Copy link

ftadel commented Nov 21, 2014

Hello,
I'm having a really hard time running OpenMEEG from Brainstorm for SEEG. It crashes constantly on some datasets, and only on Windows for others. I'm going to try to isolate some reproducible examples for all those issues.

Here is the first one, 7 depth electrodes, 3 layers, 642 vertices per layer. See OpenMEEG logs below.
Brainstorm database: https://www.dropbox.com/s/t66p25fbvjv0jsz/seeg_crash_bst.zip?dl=0
Files generated by OpenMEEG: https://www.dropbox.com/s/bd7z8m97b5z1z83/seeg_crash_openmeeg.zip?dl=0

To import in Brainstorm: menu File > Load protocol > Load from .zip file > Select seeg_crash_bst.zip
To reproduce the error: Right-click on the channel file "CTF channels" > Compute head model > Cortex surface / SEEG > Leave all the default options for OpenMEEG.

seeg_test

Thanks for your help.
Francois

Logs for Win7-64:

om_assemble version 2.2.0 (exported) compiled at Feb 19 2013 14:01:10

| ------ om_assemble
| -HM
| C:\Users\francois.brainstorm\tmp\openmeeg.geom
| C:\Users\francois.brainstorm\tmp\openmeeg.cond

C:\Users\francois.brainstorm\tmp\openmeeg_hm.bin
Sorted List : 1 0 2
Sorted Domains : Brain Skull Scalp Air
Total number of points : 1926
Total number of triangles : 3840

Checking
Mesh 0 : internal conductivity = 1 and external conductivity = 0.0125
Mesh 1 : internal conductivity = 0.0125 and external conductivity = 1
Mesh 2 : internal conductivity = 1 and external conductivity = 0
OPERATOR S... (arg : mesh m1, mesh m2)
OPERATOR S... (arg : mesh m1, mesh m2)
OPERATOR S... (arg : mesh m1, mesh m2)
OPERATOR N... (arg : mesh m1, mesh m2)
OPERATOR N... (arg : mesh m1, mesh m2)
OPERATOR N... (arg : mesh m1, mesh m2)
OPERATOR D... (arg : mesh m1, mesh m2)
OPERATOR D... (arg : mesh m1, mesh m2)
OPERATOR D... (arg : mesh m1, mesh m2)
OPERATOR D... (arg : mesh m1, mesh m2)
OPERATOR S... (arg : mesh m1, mesh m2)
OPERATOR S... (arg : mesh m1, mesh m2)
OPERATOR N... (arg : mesh m1, mesh m2)
OPERATOR N... (arg : mesh m1, mesh m2)
OPERATOR D... (arg : mesh m1, mesh m2)

Elapsed Time: 39.709 s.

om_minverser version 2.2.0 (exported) compiled at Feb 19 2013 13:59:57

| ------ om_minverser
| C:\Users\francois.brainstorm\tmp\openmeeg_hm.bin

C:\Work\Protocols\Test\anat\BEM_SEEG_crash\tess_innerskull_bem_642V_openmeeg.bin
Elapsed Time: 15.047 s.

om_assemble version 2.2.0 (exported) compiled at Feb 19 2013 14:01:10

| ------ om_assemble
| -DSM
| C:\Users\francois.brainstorm\tmp\openmeeg.geom
| C:\Users\francois.brainstorm\tmp\openmeeg.cond
| C:\Users\francois.brainstorm\tmp\openmeeg_dipoles.txt

C:\Users\francois.brainstorm\tmp\openmeeg_dsm.bin

Logs for Linux Debian-64:

./om_assemble version 2.2.0 (exported) compiled at Feb 25 2013 17:40:47

| ------ ./om_assemble
| -HM
| /export02/ftadel/tmp/openmeeg.geom
| /export02/ftadel/tmp/openmeeg.cond

/export02/ftadel/tmp/openmeeg_hm.bin
Sorted List : 1 0 2
Sorted Domains : Brain Skull Scalp Air
Total number of points : 1926
Total number of triangles : 3840

Checking
Mesh 0 : internal conductivity = 1 and external conductivity = 0.0125
Mesh 1 : internal conductivity = 0.0125 and external conductivity = 1
Mesh 2 : internal conductivity = 1 and external conductivity = 0
OPERATOR S... (arg : mesh m1, mesh m2)
PERATOR S... (arg : mesh m1, mesh m2)
OPERATOR S... (arg : mesh m1, mesh m2)
OPERATOR N... (arg : mesh m1, mesh m2)
OPERATOR N... (arg : mesh m1, mesh m2)
OPERATOR N... (arg : mesh m1, mesh m2)
OPERATOR D... (arg : mesh m1, mesh m2)
OPERATOR D... (arg : mesh m1, mesh m2)
OPERATOR D... (arg : mesh m1, mesh m2)
OPERATOR D... (arg : mesh m1, mesh m2)
OPERATOR S... (arg : mesh m1, mesh m2)
OPERATOR S... (arg : mesh m1, mesh m2)
OPERATOR N... (arg : mesh m1, mesh m2)
OPERATOR N... (arg : mesh m1, mesh m2)
OPERATOR D... (arg : mesh m1, mesh m2)

Elapsed Time: 132.56 s.

./om_minverser version 2.2.0 (exported) compiled at Feb 25 2013 17:40:58

| ------ ./om_minverser
| /export02/ftadel/tmp/openmeeg_hm.bin

/host/jupiter/export02/ftadel/brainstorm_db/seeg_crash_bst/anat/BEM_SEEG_crash/tess_innerskull_bem_642V_openmeeg.bin
Elapsed Time: 15.46 s.

./om_assemble version 2.2.0 (exported) compiled at Feb 25 2013 17:40:47

| ------ ./om_assemble
| -DSM
| /export02/ftadel/tmp/openmeeg.geom
| /export02/ftadel/tmp/openmeeg.cond
| /export02/ftadel/tmp/openmeeg_dipoles.txt

/export02/ftadel/tmp/openmeeg_dsm.bin
Sorted List : 1 0 2
Sorted Domains : Brain Skull Scalp Air
Total number of points : 1926
Total number of triangles : 3840

Checking
Mesh 0 : internal conductivity = 1 and external conductivity = 0.0125
Mesh 1 : internal conductivity = 0.0125 and external conductivity = 1
Mesh 2 : internal conductivity = 1 and external conductivity = 0

Elapsed Time: 971.86 s.

./om_assemble version 2.2.0 (exported) compiled at Feb 25 2013 17:40:47

| ------ ./om_assemble
| -H2IPM
| /export02/ftadel/tmp/openmeeg.geom
| /export02/ftadel/tmp/openmeeg.cond
| /export02/ftadel/tmp/openmeeg_loc_seeg.txt

/export02/ftadel/tmp/openmeeg_h2ipm.bin
Sorted List : 1 0 2
Sorted Domains : Brain Skull Scalp Air
Total number of points : 1926
Total number of triangles : 3840

Checking
Mesh 0 : internal conductivity = 1 and external conductivity = 0.0125
Mesh 1 : internal conductivity = 0.0125 and external conductivity = 1
Mesh 2 : internal conductivity = 1 and external conductivity = 0
INTERNAL OPERATOR D...
INTERNAL OPERATOR D...
INTERNAL OPERATOR D...
INTERNAL OPERATOR S...
INTERNAL OPERATOR S...
INTERNAL OPERATOR S...
INTERNAL OPERATOR D...
INTERNAL OPERATOR D...
INTERNAL OPERATOR S...

Elapsed Time: 0.06 s.

./om_assemble version 2.2.0 (exported) compiled at Feb 25 2013 17:40:47

| ------ ./om_assemble
| -DS2IPM
| /export02/ftadel/tmp/openmeeg.geom
| /export02/ftadel/tmp/openmeeg.cond
| /export02/ftadel/tmp/openmeeg_dipoles.txt
| /export02/ftadel/tmp/openmeeg_ds2ipm.bin

/export02/ftadel/tmp/openmeeg_gain_ecog.bin
Sorted List : 1 0 2
Sorted Domains : Brain Skull Scalp Air
Total number of points : 1926
Total number of triangles : 3840

Checking
Mesh 0 : internal conductivity = 1 and external conductivity = 0.0125
Mesh 1 : internal conductivity = 0.0125 and external conductivity = 1
Mesh 2 : internal conductivity = 1 and external conductivity = 0
Exception: Unable to open the file /export02/ftadel/tmp/openmeeg_ds2ipm.bin for reading Doing my best....
terminate called after throwing an instance of 'OpenMEEG::maths::BadFileOpening'
what(): Exception: Unable to open the file /export02/ftadel/tmp/openmeeg_ds2ipm.bin for reading
/bin/bash: line 1: 8760 Aborted ./om_assemble -DS2IPM "/export02/ftadel/tmp/openmeeg.geom" "/export02/ftadel/tmp/openmeeg.cond" "/export02/ftadel/tmp/openmeeg_dipoles.txt" "/export02/ftadel/tmp/openmeeg_ds2ipm.bin" "/export02/ftadel/tmp/openmeeg_gain_ecog.bin" 2>&1

@papadop
Copy link
Contributor

papadop commented Mar 2, 2015

Reproduced...

@papadop
Copy link
Contributor

papadop commented Mar 2, 2015

In this case, I believe OpenMEEG is not faulty. I have only little experience with SEEG but as far as I understand OpenMEEG waits as its fourth argument a file of positions of SEEG electrode locations (which is openmeeg_loc_seeg.txt in the tmp directory). The file openmeeg_ds2ipm.bin does not exist yet, it is probably the name of the file that needs to be generated instead of openmeeg_gain_ecog.bin (which is probably generated by om_gain).

So there is an error in the use of OpenMEEG, maybe because of a documentation problem in our documentation.

Using the OpenMEEG installed by BrainStorm in the tmp directory, I get:

sipadan-> ../openmeeg/linux64/om_assemble -DS2IPM openmeeg.geom openmeeg.cond openmeeg_dipoles.txt openmeeg_loc_seeg.txt openmeeg_ds2ipm.bin
../openmeeg/linux64/om_assemble version 2.2.0 (exported) compiled at Feb 25 2013 17:40:47

| ------ ../openmeeg/linux64/om_assemble
| -DS2IPM
| openmeeg.geom
| openmeeg.cond
| openmeeg_dipoles.txt
| openmeeg_loc_seeg.txt

openmeeg_ds2ipm.bin
Sorted List : 1 0 2
Sorted Domains : Brain Skull Scalp Air
Total number of points : 1926
Total number of triangles : 3840

Checking
Mesh 0 : internal conductivity = 1 and external conductivity = 0.0125
Mesh 1 : internal conductivity = 0.0125 and external conductivity = 1

Mesh 2 : internal conductivity = 1 and external conductivity = 0

Elapsed Time: 0.174496 s.

and the file openmeeg_dsm.bin is properly generated in tmp

sipadan-> ls
openmeeg_1.tri openmeeg_3.tri openmeeg_dipoles.txt openmeeg_dsm.bin openmeeg_h2ipm.bin openmeeg_log.txt
openmeeg_2.tri openmeeg.cond openmeeg_ds2ipm.bin openmeeg.geom openmeeg_loc_seeg.txt

@papadop
Copy link
Contributor

papadop commented Mar 2, 2015

In the file bst_openmeeg.m, changing the line:
if ~om_call('om_assemble -DS2IPM', ['"' geomfile '" "' condfile '" "' dipfile '" "' ds2ipmfile '"'], ecoggain_file, 'Assembling SEEG dipoles source matrix...')
into
if ~om_call('om_assemble -DS2IPM', ['"' geomfile '" "' condfile '" "' dipfile '" "' seegloc_file '"'], ds2ipmfile, 'Assembling SEEG sensor matrix...')
should do the trick...

At least it does generate the file openmeeg_ds2ipm.bin and does not crash. Then the gain matrix is not generated, so there is still a missing step.

@ftadel
Copy link
Author

ftadel commented Mar 3, 2015

Hi Theo,

Thank you very much for looking into this.
This is indeed a dumb copy-paste bug I introduced in November 2014 when I added some functions to track down and report the bugs in OpenMEEG....... I'm sorry I blamed you for it.

So this issue is solved, I updated the distribution already.
However, we did have some real reproducible bugs with SEEG, which is the reason for which I did this previous update of the code initially. I'll try to package another buggy example dataset soon.

Thanks,
Francois

@ftadel ftadel closed this as completed Mar 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants