Add function to extract a few segments from a segmentation.