Algorithms for finding the consensus among different image segmentations