Volume meshing randomly fails?

139 views
Skip to first unread message

epaj95

unread,
Aug 4, 2020, 1:15:48 PM8/4/20
to vmtk-users
Hello all,

I was wondering if someone could help me. I'm using the VMTKmeshgenerator class to mesh some aortic vessels (using the command line).

For some reason, the mesher fails/succeeds randomly on the same mesh with the same parameters.

E.g. If I run
vmtkmeshgenerator -ifile aorta1.vtk -ofile aorta1.vtu -edgelength 0.5

Sometimes it succeeds, sometimes it fails despite the exact same command. I thought the tetgen mesher was deterministic and that it would work identically each time.

If it does fail I get the following error:
Internalerror in findedge():  Unable to find an edge in subface.
ERROR
: In ../vtkVmtk/Misc/vtkvmtkTetGenWrapper.cxx, line 431
vtkvmtkTetGenWrapper
(0x20e0d70): TetGen quit with an exception.

If anyone has any advice for parameters to tweak, please let me know! I'm not working with large or complex meshes.

Thank you!!!
Endrit

andra...@gmail.com

unread,
Aug 4, 2020, 1:49:47 PM8/4/20
to vmtk-...@googlegroups.com

These random crashes were the main reason we gave up on using TetGen (and its GPL/commercial license).

 

We then found Cleaver2 (https://github.com/SCIInstitute/Cleaver2), which has many advantages over TetGen:

  • very robust: it has never crashed for us, except when we run out of memory
  • has free license: even for commercial use
  • multi-material meshing is very easy
  • works directly from segmented images: this is very important for medical applications, where your inputs are segmented images (you don’t need to create a surface mesh; which might not be trivial for complex geometry or multiple materials)
  • it has both command-line tool and a small GUI application

 

You can use SegmentMesher extension for 3D Slicer (https://github.com/lassoan/SlicerSegmentMesher) to run both TetGen and Cleaver2 so that you can easily compare the two. It is also interesting to note that with Slicer core features and SlicerVMTK and SegmentMeshes extensions, you can run your entire vascular data import, processing, segmentation, analysis, visualization, and export workflow in the same environment, using convenient GUI, Python console, scripting, or Jupyter notebooks.

 

Andras

--
You received this message because you are subscribed to the Google Groups "vmtk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vmtk-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vmtk-users/f86c22a1-9526-4645-8cf8-e49948cea18do%40googlegroups.com.

epaj95

unread,
Aug 5, 2020, 10:30:24 AM8/5/20
to vmtk-users
Thank you very much for your reply!

Cleaver2 looks to be quite promising. I will make sure to check it out.

Endrit

epa...@gmail.com

unread,
Aug 13, 2020, 12:04:36 PM8/13/20
to vmtk-users
Just to follow up with this post, the issue seems to have been associated with the python wrapping in VMTK... Using vmtkscripts or pypes in python leads to inconsistent errors with tetgen. Running the commands from the terminal seems to work, or using os.system() from python. Maybe someone in the future might find this helpful.

(I tried VMTK from conda and built from source on Ubuntu and I had the same problems with the python API)
Reply all
Reply to author
Forward
0 new messages