fangq / iso2mesh

Iso2Mesh - a 3D surface and volumetric mesh generator for MATLAB/Octave
http://iso2mesh.sf.net
Other
182 stars 73 forks source link

Unexpected error with surf2mesh/tetgen #51

Closed tmedani closed 4 years ago

tmedani commented 4 years ago

Hi @fangq

I'm trying to generate tetra mesh from nested, closed, and not intersecting surfaces. There are fives surfaces: wm, gm, CSF, skull, and scalp.

When I try to generate the FEM with all these surfaces the following tetgen error appears image

The weird behavior is when I try to use just a subset of the surfaces, in this cases it works! the first group: wm, gm, CSF and skull ==> the tetra mesh is generated correctly image

the second group : wm, gm, skull and scalp ==> it works image

and just to check, when I use the scalp, skull CSF, it works image

I tried this in three subjects and the same errors appear.

I don't have any idea why this is happening, could you please help us with this issue?

Here is a link to an example of the data and a small script test.m that call surf2mesh https://www.dropbox.com/sh/90ar3g1o6htwvjy/AADESjZ2Prps-FQXe6cRcMKQa?dl=0

Thank you in advance for your support.

Best,

fangq commented 4 years ago

@tmedani, can you let me know what OS did you have this issue?

I tested your data+script on Linux (Ubuntu 18.04) with MATLAB R2010 and R2020, as well as R2016 on Windows 10, in all 3 cases, the mesh was created correctly, with all 6 segments presented. see screenshots below.

I am using the latest git version of iso2mesh - I suppose the only difference is that for Windows, I added 64bit executables for all utilities on Windows, including tetgen1.5_x86-64.exe, about 3 months ago

https://github.com/fangq/iso2mesh/commit/477625f444a20acf87b3fadd99227c8e44fceee1#diff-91c904ef82233bb750429c5da358ac77

can you try using the latest iso2mesh and see if it makes any difference?

testmesh_ubuntu testmesh_win

tmedani commented 4 years ago

Hi @fangq I'm using windows 10 with Matlab 2019a,

I have updated the iso2mesh from the git and now it works fine.

That's great thank you.

However, I'm expecting 5 layers instead of 6, something went wrong in the identification of the tissues.

I will check it.

Best,

fangq commented 4 years ago

great. this makes sense now - when combining more surfaces, the memory demand of tetgen might have exceeded ~2GB and made 32bit binary crashed. A 64bit binary does not have that limit.

For the extra label, check to see if any of your surfaces have a closed compartment or two surfaces touching each other (like brain-stem), tetgen1.5 automatically label closed compartments if it sees one.

I will close this ticket for now.