Code covered by the BSD License  

Highlights from

Be the first to rate this file! 24 Downloads (last 30 days) File Size: 2.93 KB File ID: #41729 Version: 1.1
image thumbnail



Name (view profile)


13 May 2013 (Updated )

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

| Watch this File

File Information

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

Required Products MATLAB
MATLAB release MATLAB 7.11 (R2010b)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
22 Jul 2014 Farid

Farid (view profile)

I receive the following error;

Error: File: \MATLAB6p1\work\VoronoiCells.m Line: 59 Column: 19 Expected a variable, function, or constant, found ",".

The line is; [~,index] = min(eucDistance);
Would you help to resolve. Thanks

Comment only
10 Nov 2013 Gustavo Jaime-Muñoz

Were can I find the .tif file?

Comment only
26 Mar 2014 1.1

Minor modification to make it easier to use.

15 Oct 2015 1.1

Code cleanup and improve usability.

Contact us