Creating Mesh of Uniform Surface Area

58 views
Skip to first unread message

Frank Fazekas

unread,
Nov 16, 2022, 2:58:57 PM11/16/22
to iso2mesh-users
Dear Dr. Fang,

I'm using iso2mesh to generate surface models of cell nuclei generated from binarized 3D confocal microscopy images. As referred to in some previous posts here, I've encountered some dense clusters of nodes resulting from the initial call to "v2s," but have largely gotten rid of them with meshresample.

For this application, I'm using the output of iso2mesh to compute curvatures over the surface of the mesh with https://www.mathworks.com/matlabcentral/fileexchange/47134-curvature-estimationl-on-triangle-mesh. The goal is to learn about local deformations of the nucleus. I think, though, that it would be ideal if all the triangular faces had roughly the same area. Is there a way to do this with iso2mesh? I've attached below a mesh of a sample nucleus (produced with plotmesh), along with a histogram of areas of the faces, for your inspection. 

meshes_Cell1_screenshot.PNG

meshes_Cell1_area_hist.PNG

Best,
Frank

Qianqian Fang

unread,
Nov 16, 2022, 3:20:58 PM11/16/22
to iso2mes...@googlegroups.com, Frank Fazekas
hi Frank,

producing dense cluster is a known issue using the CGAL utilities (based on 3.8) included in iso2mesh, see this issue and the included links



it is related to how CGAL handles "non-manifold" nodes - see Laurent Rineau's reply: https://sympa.inria.fr/sympa/arc/cgal-discuss/2010-11/msg00019.html

we have included the source code (https://github.com/fangq/iso2mesh/tree/master/tools/cgalsurf) and makefile for a user to recompile CGAL utilities using the latest CGAL libraries, but from what I recall, at least a few years ago, this is still an issue. I did not test this lately.

one workaround is to apply a mesh-simplification after you extracting the surface. This is done by calling meshresample(). Usually I would set the keep-ratio to be close to 1 (like 0.9 or 0.95) if the dense cluster does not have too many nodes in it. You will have to play with that number to see if the cluster is being "simplified".

You can also call sms/smoothsurf to further process the surface. I want to mention that surfboolean() has a remeshing option, usually produce somewhat uniform meshes, but it will completely alter the node/triangles, and I don't see a control of remesh density.

for concave surfaces, we found that the meshresample (also calling CGAL) can produce self-intersecting surfaces, if this is a problem, you can call meshcheckrepair(.., 'meshfix') to fix it. this won't work with multiple closed surfaces or multiple-shells.


Qianqian
--
You received this message because you are subscribed to the Google Groups "iso2mesh-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iso2mesh-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/44cc2799-8af0-4040-8c54-f24717598ab2n%40googlegroups.com.


Frank Fazekas

unread,
Nov 17, 2022, 2:06:04 PM11/17/22
to iso2mesh-users
Dear Dr. Fang,

Thanks for your reply. Do you think it would be appropriate to additionally call remeshsurf() before meshresample()? I've been experimenting with this, setting opt.gridsize = 1 and opt.elemsize = maxrad. Generally, I've been setting maxrad = 5 pixels in the initial v2s() call. This seems to generally lead to a smoother final mesh (including the subsequent call to smoothsurf() with 10 iterations of Laplacian-HC smoothing).

Also, I'm running this analysis over a lot of nuclei, and sometimes > 20% or so of the total can be found in a cluster. To deal with this, I've defined keepratio in the meshresample() call as the fraction of faces with areas at least 15% of that of the maximal area. Does this sound like a reasonable method of remeshing in your view? If I set the figure at 25% instead of 15%, occasionally the code will hang in meshresample() indefinitely. Was that because keepratio was too small (<70%) in those cases? 

Thanks,
Frank

Qianqian Fang

unread,
Nov 22, 2022, 6:16:46 PM11/22/22
to iso2mes...@googlegroups.com, Frank Fazekas
I do not suggest calling remeshsurf before meshresample. remeshsurf is a computational heavy function, and completely remesh the mesh with no nodes overlapping the input mesh. it also does not cure the dense cluster issue because it calls cgalsurf, same as v2s/vol2surf, to produce the final output, thus clusters may reappear.

if it is important for you to have a roughly equal sized surface triangles, then, calling meshresample should be careful - if the decimation ratio is too small, then meshresample won't completely remove the dense cluster, if it is too large, then meshresample start removing edges of well-shaped triangles and forming larger triangles.

on the other hand, you can set opt.distbound (default is 1) in v2s to a larger value to discourage adaptive refinement on the surface. Usually, cgalsurf refine triangles near pointy structures.

Frank Fazekas

unread,
Nov 29, 2022, 9:08:37 AM11/29/22
to iso2mesh-users
Dear Dr. Fang,

Thanks again for your reply. Manually increasing opt.distbound doesn't seem to be changing the final mesh. Fixing opt.radbound at 5 (what I've been using), it seems, based on line 150 of vol2surf(), that opt.distbound had previously been set to 5 as well, implicitly. Increasing this value doesn't change the output mesh; decreasing it to 3 or below will increase the number of vertices. Do you know why increasing opt.distbound might not be having an effect?

Best,
Frank

Reply all
Reply to author
Forward
0 new messages