marcomusy / vedo

A python module for scientific analysis of 3D data based on VTK and Numpy
https://vedo.embl.es
MIT License
2.03k stars 264 forks source link

Plotting voronoi diagram in vedo #758

Open DeepaMahm opened 1 year ago

DeepaMahm commented 1 year ago

Hello @marcomusy,

Could we create voronoi diagram in vedo by specifying the coordinates or indices of the lattice points of cell boundaries detected in images?

I've tried this before by specifying just the coordinates of centroids. But I am not sure how to specify the point region enclosed by the boundary of each Voronoi cell.

Sample image : please see link

marcomusy commented 1 year ago

Hello :)

I guess it's possible with a bit of work from the Delauney triangulation which is the dual of Voronoi: https://en.wikipedia.org/wiki/Delaunay_triangulation

you can use delauney2d(...), then use cell_centers() to get the voronoi seeds.

DeepaMahm commented 1 year ago

Hello :) Thanks a lot, I will try this out.