adaptive refinement

119 views
Skip to first unread message

Marc Lalancette

unread,
Jan 30, 2014, 7:48:32 PM1/30/14
to iso2mes...@googlegroups.com
Hello,
I just started using this tool (which I found in Fieldtrip), so first and foremost, thanks for the tool.  Trying to make a skull surface, I find I get a uniform mesh except at a single point at the bottom which ends up being way over refined. But before addressing that, am I correct in concluding from the uniformity that this program does not refine the surface adaptively, in the sense of more refinement where the surface is more complex (e.g. where the curvature is large)?  Thanks!


Andreas Fabri

unread,
Jan 31, 2014, 5:51:43 AM1/31/14
to iso2mes...@googlegroups.com


Hello Marc,

Unless I am wrong that uses the surface mesh algorithm of CGAL,
and it is a known bug. The algorithm shoots rays to find
intersections with the surface to compute. The process starts
with random points from where to shoot rays. When these points
happen to be close to the surface this cluster of tiny triangles
gets generated. We know how to fix it, but it didn't get
high enough priority yet.

Can you give me a pointer where I can find the mesh generation
in fieldtrip?

Best,

Andreas

--
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912 skype: andreas.fabri
<https://lh5.googleusercontent.com/-71_1MXYXIUs/Uurxtq8oI-I/AAAAAAAAAZk/n08oporpR3Y/s1600/SkullSurf.png>


--
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 post to this group, send email to iso2mes...@googlegroups.com.
Visit this group at http://groups.google.com/group/iso2mesh-users.
For more options, visit https://groups.google.com/groups/opt_out.


Qianqian Fang

unread,
Jan 31, 2014, 10:50:03 AM1/31/14
to iso2mes...@googlegroups.com

Marc Lalancette

unread,
Jan 31, 2014, 4:45:52 PM1/31/14
to iso2mes...@googlegroups.com
Thank you both for your prompt assistance.  I will try the meshresample workaround.

To answer Andreas' question: in Fieldtrip, it is used in the function /private/prepare_mesh_segmentation.m, line 160:
    case 'iso2mesh'
      ft_hastoolbox('iso2mesh', 1);
      
      opt = [];
      opt.radbound = 3; % set the target surface mesh element bounding sphere be <3 pixels in radius
      opt.maxnode = cfg.numvertices(i);
      opt.maxsurf = 1;
      
      [pnt, tri] = v2s(seg, 1, opt, 'cgalsurf');
      tri = tri(:,1:3);
 
Although I'd be interested, I don't really have time to get into the details of the algorithms.  Maybe you can help me with this: I am looking to get a "nice" "deblocked" surface, where I mean it is smoothed to remove the "voxel block" appearance.  Sounds like your low-pass filter method could be ideal for this.  However, I also want the final surface to "respect" the initial segmentation.  In other words, if a voxel was selected as part of the tissue on one side, after smoothing, I'd still want more than half of it to be on that same side.  Seems to me I'd need some kind of constrained smoothing method.  Is there a way to acheive this with your tools?  Or if not exactly, what would you recommend to get the best possible result on those two criteria (smoothing voxels while respecting segmentation as close as possible)?  I'm guessing the initial radbound parameter would also be important, I probably need it to be at least a little smaller than a voxel to be able to "round their edges" in pointy spots.  Any insight will be appreciated.

Thanks again for your help and your nice tools. 
Cheers,
Marc

Marc Lalancette

unread,
Feb 3, 2014, 8:01:43 PM2/3/14
to iso2mes...@googlegroups.com
Well I ended up writing a smoothing function.  It's not very fast, but I'm really happy with how it's able to get rid of voxel artefacts while not oversmoothing.  It has other nice features such as conserving volume (approximately) and converging to the smoothed surface, only depending on the voxel size we want to smooth out.  As it is, it also freely "regularizes" the mesh along the surface, but that could easily be restricted as well.  For my eventual application though (BEM), that's an advantage.  I'd be happy to share if you're interested.  In the example below, the volume change was 0.03%.  I still need to look closer at details to see how well it respects the initial segmentation, but it looks pretty good so far.

  

Cheers,
Marc

Qianqian Fang

unread,
Feb 3, 2014, 9:34:42 PM2/3/14
to iso2mes...@googlegroups.com

hi Marc

just in case you do not know, there is a smoothsurf/sms
function in iso2mesh.

http://sourceforge.net/p/iso2mesh/code/HEAD/tree/trunk/iso2mesh/smoothsurf.m

a demo script can be found under iso2mesh/sample.

Qianqian

> Cheers,
> Marc


> --
> 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 post to this group, send email to iso2mes...@googlegroups.com.
> Visit this group at http://groups.google.com/group/iso2mesh-users.
> For more options, visit https://groups.google.com/groups/opt_out.

The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

Manuel F. Mejía De Alba

unread,
Feb 3, 2014, 9:23:39 PM2/3/14
to iso2mes...@googlegroups.com
Please share this function, the result looks pretty well...


--
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 post to this group, send email to iso2mes...@googlegroups.com.
Visit this group at http://groups.google.com/group/iso2mesh-users.
For more options, visit https://groups.google.com/groups/opt_out.



--
-----------------------------------------------------------------------
Manuel Felipe Mejía De Alba
Docente Ingeniería Mecánica
Tel:  323 9868 ext  3354
Facultad de Ingeniería - Universidad Central 
Cra 5 21-28 Bogotá D.C. Colombia
------------------------------------------------------------------------

Marc Lalancette

unread,
Feb 5, 2014, 6:00:10 PM2/5/14
to iso2mes...@googlegroups.com
Hi Manuel,

I had to work a bit more on the function but it looks like it works well now.  I made it possible to separate normal and tangential motion.  

I just submitted the file on the Matlab File Exchange.  I will post again when it has been reviewed and is available publicly.

Thanks Qianqian, I had seen the smoothing function and looked at the paper it cites, but honestly, if the goal is to remove voxel artefacts, these algorithms were really not very appropriate.  I am not very impressed that the authors wouldn't have found something better.  In any case, feel free to have a look at my function (once it's posted) if you like.

Cheers,
Marc

Marc Lalancette

unread,
Feb 5, 2014, 6:54:55 PM2/5/14
to iso2mes...@googlegroups.com
That was fast. Here's the link on the File Exchange: 45416-surfacesmooth
Do let me know if you find it useful, or find bugs!
Cheers

Qianqian Fang

unread,
Feb 5, 2014, 7:34:48 PM2/5/14
to iso2mes...@googlegroups.com
I see. Is it fair to say your function works more effectively when
the node spacing on the surface is close to uniform (that is similar
to a grid-derived dense mesh)?

Marc Lalancette

unread,
Feb 5, 2014, 7:43:09 PM2/5/14
to iso2mes...@googlegroups.com
Good question.

I started from the idea of moving vertices towards the average of neighbors, same as those other methods.  The more irregular the mesh, probably the less precise the normals and more unwanted deformation.  But that is speculation at this point.  We'd have to try to really know how bad it may get.  On the other hand, the idea here is to smooth out voxel artefacts so it presupposes having a mesh that is of the same order, or smaller, than the voxel size.  And at that level, probably the irregularity wouldn't matter too much.
Reply all
Reply to author
Forward
0 new messages