Given a list of centroids, it computes the 2D/3D voronoi diagram.
Updated 15 Oct 2015

View License

Given a list of centroids, it computes the 2D/3D voronoi diagram and extracts each Voronoi cell from the original image.
The voronoi diagram is calculated based on the Euclidean distance in 3D space.
centroid = [x1 y1 z1]
voxel = [x2 y2 z2]
for each voxel
Euclidean distance = sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2)
% Input:
% centroids - N x 3 matrix
% imageFilename - filename of image stack

Cite As

Audrey Cheong (2024). createVoronoi(centroids,imageFilename) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Voronoi Diagram in Help Center and MATLAB Answers

Inspired: Voronoi Label N dimensions

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Code cleanup and improve usability.
Minor modification to make it easier to use.