ins-amu / scripts

prepare data for TVB
MIT License
21 stars 12 forks source link

better decimation of the surface #24

Closed timpx closed 9 years ago

timpx commented 9 years ago

we would like to have the best decimated surface possible. (see Bojak, 2011, Sanz-Leon et al, under review) Brainvisa decimation is quite good, but simulation was not the goal here. other tools include ad-hoc written algorithms or tools borrowed from computer graphics or mechanic. Should be tested further

timpx commented 9 years ago

From @maedoc There's some mesh resampling the iso2mesh project meshresample, which appears to depend on CGAL's mesh simplification sadface

timpx commented 9 years ago

I tried iso2mesh, you loose a lot of the sulci depth when decimating, so it's not suitable. Sulci should explicitly be kept

maedoc commented 9 years ago

Perhaps decimation advsersely affects the parts with highest curvature. Would it be possible to decimate the inflated or spherical surfaces?

timpx commented 9 years ago

that could be a good idea, using freesurfer tools to come back? Not sure if that will work.

maedoc commented 9 years ago

I think it will depend on the algorithm. Stuart also had some mesh simplification stuff.

Which part of the Bojak article are you referring to?

timpx commented 9 years ago

Yep, Stuart is the ad-hoc written algorithms in Sanz-leon et al. Bojak: Bojak, Oostendorp, Reid,Kötter, Towards a model-based integration of co-registered electroencephalography/functional magnetic resonance imaging data with realistic neural population meshes, Philos. Trans. R Soc. Lond. A., 2011, p3789

maedoc commented 9 years ago

Interesting paper (Bojak), explains several things nicely, but I didn't see any links or urls for where the code is.

timpx commented 9 years ago

oh I was thinking to draw inspiration from it

maedoc commented 9 years ago

yep, agreed. I just would like to see their code.

maedoc commented 9 years ago

I was looking at mesh simplification with Blender. They have a decimation tool and looking at sources there are a few algos (collapse, un-subdivide & dissolve) but I'm not sure if they take into account anything like loss of curvature etc.

Another interesting tool they have is "retopology" which works like papier mâché, by throwing new, simple geometries onto the complex one, allowing you to have exactly the amount of detail and form necessary to approximate the complex surface. In Blender this is done by hand but it could be interesting if could be automatic.

timpx commented 9 years ago

The keywords are "isotropic remeshing". Several good papers (look at the David on last page, Whao!) are available out there, however I would like to use something already implemented. I found this one, but I am open to suggestions.

maedoc commented 9 years ago
import joke_about_100k_vertex_genitalia

always good to know the right keyword. I couldn't find software related to first paper, but I'm compiling the remesher you linked to.

Where does this enter into your pipeline? Just a command to run in before tractography?

maedoc commented 9 years ago

The GUI is nice; allows you to configure and inspect results as you work. Requires PLY format so I'm thinking of a Py script to create a ply from freesurfer surface.

If you decide to download and compile, there will be a bug about ::getcwd in file arguments.cc, just replace the function call with "./", and it runs fine.

timpx commented 9 years ago

CGAL is what we need.

maedoc commented 9 years ago

OK but what part? CGAL is huge.

timpx commented 9 years ago

remesher works fine, it would be used at the decimation part, but until now I could not find an option to get uniform sampling, at the output the sampling is fine is parts f higher curvature, I don't know if this implementation can have uniform sampling; I did not used the GUI, but input/output is fairly easy to do with the OFF format (text format with vertices and triangles). I am also looking for an implementation of the "first" paper or equivalent in cgal, but until now I could not find one.

timpx commented 9 years ago

thanks for the tip for the compilation bug

timpx commented 9 years ago

ok playing with remesher options we can have a uniform grid, , we only need now to find the best compromise to keep the sulci as good as possible; Different parameters are used on right and left image example

maedoc commented 9 years ago

did you check distribution of edge lengths, e.g.?

timpx commented 9 years ago

not yet, that's with area distribution and area change (compare to original mesh) the quality criterion to find the compromise

timpx commented 9 years ago

one should smooth before simplifying as this is not done by freesurfer

timpx commented 9 years ago

done