File Exchange

image thumbnail

createVoronoi(centr​oids,imageFilename)

version 1.1 (2.93 KB) by

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

2 Downloads

Updated

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)
end
% Input:
% centroids - N x 3 matrix
% imageFilename - filename of image stack

Comments and Ratings (2)

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

Were can I find the .tif file?

Updates

1.1

Code cleanup and improve usability.

1.1

Minor modification to make it easier to use.

MATLAB Release
MATLAB 7.11 (R2010b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today