For label image with a lot of labels, compute the distance map within all labels.