You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
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)
end
% Input:
% centroids - N x 3 matrix
% imageFilename - filename of image stack
Cite As
Audrey Cheong (2026). createVoronoi(centroids,imageFilename) (https://www.mathworks.com/matlabcentral/fileexchange/41729-createvoronoi-centroids-imagefilename), MATLAB Central File Exchange. Retrieved .
Acknowledgements
Inspired: Voronoi Label N dimensions
General Information
- Version 1.1.0.0 (2.93 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
