This figure illustrates the construction of the Voronoi diagram from the watershed of the distance transform.
.
from morph import *
from MLab import rand
a=mmbinary(rand(256,256) > 0.999);
d=mmdist(mmneg(a),mmsebox(),'EUCLIDEAN');
ws=mmcwatershed(d,mmregmin(d));
mmshow(mmdil(a));
mmshow(mmsurf(d));
mmshow(mmunion(ws,mmdil(a)));