Search code examples
image-processingdata-annotationsimage-segmentationsemantic-segmentationmedical-imaging

Combining two image label to one label


I have medical images for the prostate where each image has two anatomical labels label0= background label1= peripheral zone, Label2= transitional zone.

I would like to combine two labels so that they become one label and will form the whole prostate structure, Can you help me with this?

attached is the picture to verify my question more:

enter image description here


Solution

  • You can clip the values of your segmentation mask to the range [0, 1] (instead of [0, 2]): After clipping, all pixels with label > 0 (non-background) will have label 1.