DUNEuro error with the tutorial dataset

when I run the "FEM advanced tutorial with MEG/EEG Median nerve stimulation", I follow all the steps as the tutorial say. When I come to the step "Forward Model\ MEG with DTI tensors" error occur


dipole_9648.time = 0 
dipole_9649.density = sparse 
dipole_9649.time = 0 
dipole_9650.density = sparse 
dipole_9650.time = 0 
Dune reported error: Dune::Exception [findEntityImpl:/home/juan/bst-duneuro/src/duneuro/duneuro/common/edgehopping.hh:84]: coordinate is outside of the grid, or grid is not convex 

status =

    -1


***************************************************************************
** Error: Error during the DUNEuro computation, see logs in the command window.
***************************************************************************

I use the FEM mesh :joy:

Name: Subject01/tess_fem_simnibs_718392V.mat
---------------------------------------------------
  |  
  |- Comment:      'FEM 718392V (simnibs, 5 layers)'
  |- Vertices:     [718392x3 double]
  |- Elements:     [3984445x4 double]
  |- Tissue:       [3984445x1 double]
  |- TissueLabels: {1x5 cell}
  |- Tensors:      [3984445x12 double]
  |- History:      {2x3 cell}

can somebody help me, thanks

Please share your subject, it would be the fastest way for us to reproduce your error and find a solution:

  • right-click on the subject folder > File > Export subject
  • upload the .zip file somewhere
  • post the download link there

Please include a screen capture of the forward model and DUNEuro option windows you are using.

Thanks

@tmedani @juangpc

Thank you, I have send the .zip file and the DUNEuro option windows to your E-mail

Please post the here, as it will mostly be useful for @tmedani and/or @juangpc

Download link: https://share.weiyun.com/NWoqzxE1
5F32A55D@CE4DC525.5D220562.jpg_recompress

Hi there,

To make sure, you are computing only the MEG right?

Have you generated the mesh using the iso2mesh option, the error may accrue when some hole are present on the mesh, as explained in this step:
https://neuroimage.usc.edu/brainstorm/Tutorials/FemMedianNerve?highlight=(fem)#Remesh_with_Iso2mesh

when I use the iso2mesh as tutorial say, the error occur

BST> Plugin iso2mesh already loaded: C:\Users\27848\.brainstorm\plugins\iso2mesh
Fixing asin tolerance to 1.745329e-004 
meshfix C:\Users\27848\.brainstorm\tmp\pre_sclean.off 
Cleaning intersections, degeneracies ... 
Saving output mesh to 'C:\Users\27848\.brainstorm\tmp\pre_sclean_fixed.off' 
Fixing asin tolerance to 1.745329e-004 
meshfix C:\Users\27848\.brainstorm\tmp\pre_sclean.off 
Cleaning intersections, degeneracies ... 
Saving output mesh to 'C:\Users\27848\.brainstorm\tmp\pre_sclean_fixed.off' 
Fixing asin tolerance to 1.745329e-004 
meshfix C:\Users\27848\.brainstorm\tmp\pre_sclean.off 
Cleaning intersections, degeneracies ... 
Saving output mesh to 'C:\Users\27848\.brainstorm\tmp\pre_sclean_fixed.off' 
Fixing asin tolerance to 1.745329e-004 
meshfix C:\Users\27848\.brainstorm\tmp\pre_sclean.off 
Cleaning intersections, degeneracies ... 
Saving output mesh to 'C:\Users\27848\.brainstorm\tmp\pre_sclean_fixed.off' 
Fixing asin tolerance to 1.745329e-004 
meshfix C:\Users\27848\.brainstorm\tmp\pre_sclean.off 
Cleaning intersections, degeneracies ... 
Saving output mesh to 'C:\Users\27848\.brainstorm\tmp\pre_sclean_fixed.off' 
BST> Emptying temporary directory...
BST> Plugin iso2mesh already loaded: C:\Users\27848\.brainstorm\plugins\iso2mesh
 
FEM> 1. scalp: D:\BrainSuite\brainstorm_db\TutorialFem1\anat\Subject01\tess_scalp.mat
FEM> 2. skull: D:\BrainSuite\brainstorm_db\TutorialFem1\anat\Subject01\tess_skull.mat
FEM> 3. white: D:\BrainSuite\brainstorm_db\TutorialFem1\anat\Subject01\tess_white.mat
FEM> 4.  gray: D:\BrainSuite\brainstorm_db\TutorialFem1\anat\Subject01\tess_gray.mat
FEM> 5.   csf: D:\BrainSuite\brainstorm_db\TutorialFem1\anat\Subject01\tess_csf.mat
 
generating tetrahedral mesh from closed surfaces ...
creating volumetric mesh from a surface mesh ...

***************************************************************************
** Error: Line 52: 错误使用 readtetgen (line 52)
** wrong surface file
** 
** Call stack:
** >readtetgen.m at 52
** >surf2mesh.m at 121
** >process_fem_mesh.m>Compute at 384
** >process_fem_mesh.m>ComputeInteractive at 1226
** >process_fem_mesh.m at 32
** >bst_call.m at 28
** >tree_callbacks.m>@(h,ev)bst_call(@process_fem_mesh,'ComputeInteractive',iSubject,[],GetAllFilenames(bstNodes)) at 1172
** 
***************************************************************************

@YRW
I can't download your files from here: https://share.weiyun.com/NWoqzxE1
It looks like we need a WeChat account, or something like that, which I don't have.
Please upload your file on a service that does not require to create any account.

image

Sorry, I have re-uploaded [TutorialFem1_Subject01.zip] to GitHub, you can download the split volume compressed file.
https://github.com/Shuangquxian525/Brainstorm_proj

Thanks.
I could reproduce the error on my computer (Win10).

@tmedani @tmedani @juangpc
This is exactly the tutorial... has it been tested on Windows?

dipole_9649.density = sparse 
dipole_9649.time = 0 
dipole_9650.density = sparse 
dipole_9650.time = 0.0010032 
Dune reported error: Dune::Exception [findEntityImpl:/home/juan/bst-duneuro/src/duneuro/duneuro/common/edgehopping.hh:84]: coordinate is outside of the grid, or grid is not convex 

status =
    -1

***************************************************************************
** Error: Error during the DUNEuro computation, see logs in the command window.
***************************************************************************

yes we tested the pipeline on windows and its working.

@Francois just to make sure, are you using the mesh from simnibs or the mesh from iso2mesh?

I will check what is wrong on this data.

@Francois did we fixed this error with the last discussion with iso2mesh dev team?

I believe that the error is due to some hole on the mesh, but I will check it again.

It is the mesh from SimNIBS, that @YRW posted on github.

@Francois did we fixed this error with the last discussion with iso2mesh dev team?

Yes, I believe it was fixed.
At least it works now on my Win10 computer:

image



@YRW
Takfarinas is right, you haven't gone through the step of remeshing the SimNIBS mesh.
It is clearly stated in the tutorial that in case of problem with MEG and SimNIBS meshes with air cavities, you must remesh the layers.
Please follow this section step by step:
https://neuroimage.usc.edu/brainstorm/Tutorials/FemMedianNerve#Remesh_with_Iso2mesh

If you have issues with iso2mesh, please post full error messages and screen captures.

1 Like

But when I remesh the layers with iso2mesh, error occur

***************************************************************************
** Error: Line 398: The index at position 1 is invalid.  The array index must be a positive integer or logical value 
** 
** Call stack:
** >process_fem_mesh.m>Compute at 398
** >process_fem_mesh.m>ComputeInteractive at 1226
** >process_fem_mesh.m at 32
** >bst_call.m at 28
** >tree_callbacks.m>@(h,ev)bst_call(@process_fem_mesh,'ComputeInteractive',iSubject,[],GetAllFilenames(bstNodes)) at 1172
** 
***************************************************************************


***************************************************************************
** Error: The FEM mesh generation failed.
** Check the Matlab command window for additional information.
** 
***************************************************************************

Can you send the file "FEM 679613V (iso2mesh-2021, 5layers)" to me, thank you every much

But when I remesh the layers with iso2mesh, error occur

  • Are your versions of Brainstorm and Iso2mesh up-to-date? - Maybe try to update both.
  • I've been running this computation from your database... we're both on Win10 so I don't see why the results of Iso2mesh would be different...
    What is your version of Matlab?
  • Are your sure your followed exactly the instructions from the tutorial?

Can you send the file "FEM 679613V (iso2mesh-2021, 5layers)" to me, thank you every much

Here it is: https://www.dropbox.com/s/fyk2dnvvza4atyc/tess_fem_iso2mesh-2021_679613V.mat?dl=0

But I'd prefer you keep on trying computing it on your own... At least to help us debug completely this issue :slight_smile:

thank you very much

thank you, I have download your "FEM 679613V(iso2mesh-2021)", when I used it to compute ISO MEG head model, it worked. But when I used it to compute DTI MEG head model, error occur

dipole_2987.density = sparse 
dipole_2987.time = 0 
Dune reported error: Dune::Exception [findEntityImpl:/home/juan/bst-duneuro/src/duneuro/duneuro/common/edgehopping.hh:84]: coordinate is outside of the grid, or grid is not convex 

status =

    -1


***************************************************************************
** Error: Error during the DUNEuro computation, see logs in the command window.
***************************************************************************

I have download your "FEM 679613V(iso2mesh-2021)"

I strongly advise you compute this file yourself instead of using the one I posted, in order to debug all the processing chain upstream and validate the contents of your database. If you have errors in other files, it is pointless for us to try and debug the problems you report.

when I used it to compute ISO MEG head model, it worked. But when I used it to compute DTI MEG head model, error occur

It seems unlikely that DUNEuro would check for the grid in the anisotropic case, but not in the isotropic case. Please check again what you are doing.

@tmedani @juangpc ?

I did try to remesh with Iso2mesh as tutorials say, but error occur

Then we need to do further debugging, please share the following information:

  • Zip together: the MRI file + the surface files you select in the subject anatomy folder in order to obtain this error
  • Upload the .zip file somewhere and post the download link here (please try using an appropriate service for that, not github, if you can find one that does not require a WeChat account...)
  • Post the screen capture of the window you get with the menu "Plugins > List" in Brainstorm.

Failed to save the desktop configuration

This is not coming from Brainstorm.
You have additional configuration issues on your computer.

***************************************************************************
** Error: Line 39: incorrectly use of readtetgen (line 39)
** wrong elem file
** 
** Call stack:
** >readtetgen.m at 39
** >surf2mesh.m at 121
** >process_fem_mesh.m>Compute at 384
** >process_fem_mesh.m>ComputeInteractive at 1226
** >process_fem_mesh.m at 32
** >bst_call.m at 28
** >tree_callbacks.m>@(h,ev)bst_call(@process_fem_mesh,'ComputeInteractive',iSubject,[],GetAllFilenames(bstNodes)) at 1172
** 
***************************************************************************

Failed to save the desktop configuration

***************************************************************************
** Error: The FEM mesh generation failed.
** Check the Matlab command window for additional information.
** 
***************************************************************************