from morph import *
a = mmreadgray('bloodcells.tif');
b = mmareaopen(a, 200);
c = mmcmp( uint8(0), '<=', b, '<=', uint8(140));
Warning: Converting input image from int32 to uint16.
Warning: Converting input image from int32 to uint16.
d = mmopen(c,mmsedisk(2,'2D','EUCLIDEAN'));
e1 = mmdist(c, mmsebox(),'EUCLIDEAN');
e2 = mmsurf(e1);
e3 = mmregmax(e1);
e = mmdil(e3);
f = mmneg(e1);
fs = mmsurf(f);
g = mmcwatershed( f, e, mmsebox());
h = mmintersec(c,mmneg(g));
i = mmedgeoff(h);
j = mmgradm(i);
fig_a = c;
fig_b = mmunion(mmgray(e),e2);
fig_c = mmunion(e2,mmgray(g),mmgray(e));
fig_d = h;
mmshow(fig_a)
mmshow(fig_b)
mmshow(fig_c)
mmshow(fig_d)