ReplaceSegmentations[seg,labs,new]
replaces the labels labs from the segmentation seg for labels new. Both labs and new should be lists of integers of the same size. If seg contains more labels then given in labs these will be replaced by 0.
ReplaceSegmentations[seg,labs]
replaces the labels labs by a random permutation of Range[Length[labs]],using a fixed random seed.
ReplaceSegmentations[seg]
does the same for all labels in seg. When labs is given, the input seg can also be a split segmentation {masks, labels}, in which case the output is {masks, labels} sorted by label.
ReplaceSegmentations
ReplaceSegmentations[seg,labs,new]
replaces the labels labs from the segmentation seg for labels new. Both labs and new should be lists of integers of the same size. If seg contains more labels then given in labs these will be replaced by 0.
ReplaceSegmentations[seg,labs]
replaces the labels labs by a random permutation of Range[Length[labs]],using a fixed random seed.
ReplaceSegmentations[seg]
does the same for all labels in seg. When labs is given, the input seg can also be a split segmentation {masks, labels}, in which case the output is {masks, labels} sorted by label.