Sorry missed this⊠that script should export a labelled image corresponding to each tile, where the integer label of each pixel corresponds to the classification of that pixel.
It has been a long time since I wrote the script and Iâm not entirely sure that these labels will necessarily be consistent across multiple images, or if they are inferred based upon the actual classifications discovered in an image (e.g. 1=tumor, 2=stroma might sometimes be reversed - I donât recall). So this might need to be amended if you see problems.
You may also need to be cautious in how you read the labelled image in Python to avoid it being converted to RGB (unless youâd prefer to work with RGB values, which might overcome the warning in my last paragraph).
In any case, youâd need to write some Python code that checks the labelled image and assigns the image tile as being tumor or stroma based upon the number of pixels with each label. This should be straightforward when all pixels have the same label, but, as I wrote above, counting the number of each label per tile this gives you the ability to make other decisions about the appropriate classification (e.g. if 99% of pixels are labelled tumor, you can probably use the tile - but if 50% is tumor then perhaps better not).