Mask overlap

Mask overlap  

  By: Andreas on Feb. 21, 2022, 11:21 p.m.

Hello,

While running some experiments, we came across some mask overlap (based on the polygons). When filling-in polygons some mask classes overlap due to a large polygon encompassing a bigger area. See example here: https://prnt.sc/yzv_eUrXKnEm (100B, middle ROI)

So we are wondering whether you have an automated rule to define the mask integer; other than estimating the smaller or polygons inside others and giving them a priority. When looping through the polygon objects it is unknown which one should go first and which one should overwrite the other.

For example, the "other" and "healthy glands" can be grouped into one class, for task 1, but in the example above (in the link) the invasive tumour contains areas marked as stroma. So in this case stroma should be prioritised. But it may be the case that in some cases stroma is the bigger polygon and some other class area is within. Do you perhaps have a solution for this already?

 Last edited by: Andreas on Aug. 15, 2023, 12:55 p.m., edited 2 times in total.

Re: Mask overlap  

  By: mart.vanrijthoven on Feb. 22, 2022, 9:52 a.m.

Dear Andreas Panteli,

Indeed, in some cases, polygons are on top of other polygons. As you already considered, we prioritize the smaller polygons (considering the total area) in these cases. I.e., we draw smaller polygons on top of larger polygons. Hence, in the example you give us, we draw the stroma on top of the tumor.

In other cases, where the stroma is the larger polygon, and another annotation with a different label is overlapping and smaller than the stroma annotation, we draw the annotation with the different label on top of the stroma.

Please note that we have developed the wholeslidedata python package that can deal with this smoothly.

Please let us know if you have any further questions.

Best wishes, Mart

 Last edited by: mart.vanrijthoven on Aug. 15, 2023, 12:55 p.m., edited 2 times in total.
Reason: add python package

Re: Mask overlap  

  By: Andreas on March 7, 2022, 5:44 p.m.

Minor note on the overlap.

We noticed a small mistake in the mask of the second region of TC_S01_P000046_C0001_B101 as shown here (https://prnt.sc/Yu8DtLByjZ2j). As you see the invasive tumour polygon marks it correctly, and it is visible that those are tumour cells but the masks shows them as stroma.

I guess when the polygons are overlapped, the small region of invasive tumour is incorrectly labeled in the mask you provide as stroma because of the size of the stroma polygon. This is a small thing though. I do not know how often it can happen, but thought that it might be useful to mention.

Re: Mask overlap  

  By: mart.vanrijthoven on March 7, 2022, 7:20 p.m.

Dear Andreas Panteli,

Thanks for noticing this.

This should not have happened as we have checked the masks and annotations for these situations and adjusted the polygons accordingly. Unfortunately, this error slipped through. We will fix this annotation as soon as possible.

Best wishes, Mart

Re: Mask overlap  

  By: mart.vanrijthoven on March 9, 2022, 8:15 a.m.

The following files have been updated:

s3://tiger-training/wsirois/roi-level-annotations/tissue-cells/masks/TC_S01_P000046_C0001_B101_[119711, 55143, 120831, 56208].png s3://tiger-training/wsirois/wsi-level-annotations/annotations-tissue-cells-xmls/TC_S01_P000046_C0001_B101.xml s3://tiger-training/wsirois/wsi-level-annotations/annotations-tissue-cells-masks/TC_S01_P000046_C0001_B101.tif

Best wishes, Mart