Hello, I am currently working on creating a head model using FEM from T1+T2 images.
I successfully processed the first participant using SimNIBS 4, but I encountered an error with the second participant and wanted to seek advice on this forum.
However, I've run into the following issue:
After using SimNIBS 4 to create a 12-layer mesh through files > MRI segmentation > Generate FEM mesh, I encountered a problem where the skull breaches through part of the scalp after merging 5 layers. (Image attached)
This issue generates the following error message when I try to "Functional data", right-click on the channel file > Compute head model:
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
I attempted to remesh using Iso2mesh, but encountered the following error message:
***************************************************************************
** Error: The FEM mesh generation failed.
** Check the Matlab command window for additional information.
**
***************************************************************************
BST> Plugin iso2mesh already loaded: C:\Users\user\.brainstorm\plugins\iso2mesh
FEM> 1. scalp: E:\toolbox\brainstorm_db\Interoception\anat\S002\tess_scalp.mat
FEM> 2. skull: E:\toolbox\brainstorm_db\Interoception\anat\S002\tess_skull.mat
FEM> 3. white: E:\toolbox\brainstorm_db\Interoception\anat\S002\tess_white.mat
FEM> 4. gray: E:\toolbox\brainstorm_db\Interoception\anat\S002\tess_gray.mat
FEM> 5. csf: E:\toolbox\brainstorm_db\Interoception\anat\S002\tess_csf.mat
generating tetrahedral mesh from closed surfaces ...
creating volumetric mesh from a surface mesh ...
***************************************************************************
** Error: Line 117: surf2mesh (line 117)
** Tetgen command failed
**
** Call stack:
** >surf2mesh.m at 117
** >process_fem_mesh.m>Compute at 434
** >process_fem_mesh.m>ComputeInteractive at 1531
** >process_fem_mesh.m at 31
** >bst_call.m at 28
** >tree_callbacks.m>@(h,ev)bst_call(@process_fem_mesh,'ComputeInteractive',iSubject,[],GetAllFilenames(bstNodes)) at 1223
**
***************************************************************************
I am roughly following the pipeline of the FEM with median nerve tutorial.
https://neuroimage.usc.edu/brainstorm/Tutorials/FemMedianNerveCharm#Merge_tissues
One potential solution I'm considering is to manually adjust the skull within the scalp, or to use a different algorithm to address the problem.
However, I am unfamiliar with manually changing surfaces, and I am concerned that it might lead to further complications.
If anyone has had a similar experience or knows of a solution, I would greatly appreciate your advice. I look forward to your response.
p.s. If I add 'disp(cmdout)' in surf2mesh.m's line 117,
a lot of warning and follow error messege printed:
Delaunay seconds: 47.414
Creating surface mesh ...
Found two overlapping facets.
1st: [57305, 222151, 211697] #1
2nd: [57305, 222151, 211697] #2
A self-intersection was detected. Program stopped.
Hint: use -d option to detect all self-intersections.
Best regards,
Bong