Interesting demonstration ImageAnalyst. Fortunately the 'coins' sample image has high contrasting content which allows for easy selection of the threshold. Plus the coins allow for the 'imfill' operation to perform the majority of the work.
It would be interesting to see results on an image with a much smoother histogram but this is where image segmentation gets complicated I guess...
All in all, a nice demonstration of the capabilities that both the IPT and Mathematical Morphology can provide in image processing applications.