From: ImageAnalyst on
After you label, scan through the blobs to find the largest ones --
you can use ismember to do this as I do in my demo
http://www.mathworks.com/matlabcentral/fileexchange/25157
(This is essentially what bwareaopen does.) Then you'll have just the
very biggest objects. Then look at each of their centroids and find
the one with the Y centroid that is lowest in the image. Then use the
PixelIdxList from that blob to fill in your binary image. Then you're
done. That's how to do it.