Closed dfsp-spirit closed 3 years ago
Hi @dfsp-spirit , here you go. This is an implementation of the Dijkstra-algorithm. It gives you the shorted geodesic distance to a point for each vertex. Please test and report back.
Update: I just pushed a wrapper function vcgGeodist
to explicitly compute the geodesic distances between two 3D coordinates (projected) on a triangular surface mesh.
Oh wow, that was fast. Thanks heaps, I'm off to test it...
If you encounter me in procrastination mode, things can be fast ;)
This looks great so far, I am testing it here.
I'll post a visualization soon and compare the results to those from a Python and C implementation of geodesic distances.
Here is a visualization of the 3 points tested in the script (in Test 1 and Test 2), near motor cortex:
Nice, keep me posted. BTW it gives the exact same results as the VTK implementation.
Here is another CAVEAT: this is actually not the geodesic path between the points but the pseudo-geodesic path (following the edges) between the two vertices closest to these points.
Yes I know, I have read quite a bit about geodesic distances and seen various implementations and aproximative algorithms. That is fine with me.
I also computed the one-to-all vertices geodesic path length map for a larger mesh (160k verts, Test 3 in the script above), here is the plot:
I just also tested it and it takes 0.29 secs for a mesh with ~850.000 vertices.
Yes, it is very fast.
@zarquon42b This is amazing, thanks a lot.
I'll cite the Morpho/Rvcg paper given incitation("Rvcg")
when I use it. Anything else (except for VCGLIB, of course)?
I am glad that it works for you. Cool images ;)
Thanks for making Rvcg! I wanted to ask whether you could consider adding geodesic distance computation.
A vcglib example from the official docs is here and here.
I tried to do it myself and submit a PR, but my knowledge on C++ template programming and Rcpp is very limited and I could not get it to work.
I asked you about this a while ago in an RvtkStatismo issue and got it to work, but the installation required quite some effort and I cannot make RvtkStatismo a dependency of my package that is on CRAN.