Generation of 2D and 3D meshes from binary image mask

498 views
Skip to first unread message

Ryan Woodall

unread,
Mar 27, 2017, 3:53:43 PM3/27/17
to fenics-support
Hi all,

Is there a way to create a mesh from a binary image mask? I have two projects where I'd like to be able to do this. I have a 2D image of some cancerous tissue, and a binary mask of the domain of interest. Is there a way to create a mesh so that each pixel in the mesh is converted to 2 triangular elements?

I also have some 3D brain images, as well as binary masks for the brain. Is there a way to create a 3D mesh of the domain where each 3D pixel becomes a tetrahedral element?

Thanks for the help!

Ryan Woodall

Jack Hale

unread,
Mar 28, 2017, 5:05:26 AM3/28/17
to Ryan Woodall, fenics-support
Hi Ryan,

I'm not aware of any code that does this but I don't think coding it
from scratch should be too difficult. Python has the tools you need to
read in medical images e.g. DICOM then you could perform a cell
deletion strategy to on a UnitSquare/UnitCube type mesh to get your
final result. There may well be better ways!

One alternative approach would be to use CGAL's mesh generation tools.
Here you provide an implicit function that tells CGAL whether you are
inside or outside your domain (based on the binary masks perhaps) it
should do the rest automatically. This would give you better boundary
representation than the approach you're suggesting where the
stair-casing effect can cause issues.

Cheers,

Jack S. Hale
Jack Hale
> --
> You received this message because you are subscribed to the Google Groups
> "fenics-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fenics-suppor...@googlegroups.com.
> To post to this group, send email to fenics-...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/fenics-support/01749acc-bc4d-4e75-9b41-c9f0c3d973c6%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages