From: ImageAnalyst on
Yes, if you need to do it in pairs, label-to-label, then you'll have
to set up a threshold to get just those two label numbers, so now
you'll have a binary image (not "bit code") that identifies the
locations of just those two blobs with those two specific labels. And
then you use bwdist. Then repeat for all permutations of label pair
numbers.