clear all, close all
BW1 = imread('circbw.tif');
subplot(2,2,1)
imshow(BW1)

SE = strel('rectangle',[40 30]);
BW2 = imerode(BW1,SE);
subplot(2,2,2)
imshow(BW2)

BW3 = imdilate(BW2,SE);
subplot(2,2,3)
imshow(BW3)

L = bwlabel(BW3);
RGB = label2rgb(L, 'spring', 'c', 'shuffle');
subplot(2,2,4)
imshow(RGB)