Page MenuHomePhabricator

[Segmentation] Erase tool has unclear edge cases
Open, NormalPublic

Assigned To
Authored By
Mar 28 2022, 5:23 PM
Referenced Files
F2526204: Capture2.JPG
Apr 4 2022, 10:59 AM
F2526203: Capture.JPG
Apr 4 2022, 10:59 AM
F2524913: image.png
Mar 28 2022, 5:23 PM
F2524911: image.png
Mar 28 2022, 5:23 PM


According to some issues mentioned in tested checklists, the erase tool does not work correctly:

image.png (140×967 px, 9 KB)

image.png (116×949 px, 9 KB)

Event Timeline

kalali triaged this task as High priority.Mar 28 2022, 5:23 PM
kalali created this task.
kislinsk renamed this task from [Segmentation] Erase tool does not work on the whole slice to [Segmentation] Erase tool has unclear edge cases.Apr 4 2022, 10:31 AM
kislinsk lowered the priority of this task from High to Normal.

Erase tool is the inverted Fill tool

  • Erase works on the whole slice (for the currently selected label) when clicking on the background label and the clicked region touches every single border pixel.
  • Erase works only for the selected label but still the preview snaps to other labels if clicked into them resulting basically in a no-op.

Erase is just an inverted fill tool but this is unintuitive in some cases. It fills the clicked area and if that filled area has holes they are filled as well.

Example 1

Capture.JPG (362×401 px, 26 KB)

When you click on any of the background areas, everything that is enclosed by it is erased ignoring any holes. So clicking in the innermost background will erase only the bulls eye but clicking on the outer background ring will erase both the bulls eye and the innermost ring. Clicking on the background completely outside will erase everything since nothing touches the border of the image.

Example 2

Capture2.JPG (449×420 px, 25 KB)

Clicking in the background will not delete everything since the label touches the border. Clicking inside the C will do nothing. Clicking outside the C will do nothing as well. Both times the background areas are highlighted but since they do not completely enclose the red label in both cases, it is not deleted. So as soon as a label touches the border even a single pixel, you cannot delete it by clicking on the background.


(A) If we decide that erase should only work on the selected label:

  • Only do something when clicking into the actual, selected label
  • Do not show any preview when clicking on background or other labels

(B) If we decide that erase should work on all (unlocked) labels:

  • Make sure the tool can be activated all the time, even without any selected label
  • Show previews and apply them on all clicked areas of unlocked labels

In case we still want the "delete everything when clicking on background", in both cases the result would be something different according to the rules but still it would be a special case that has to be checked explicitly. If clicked pixel is background, than delete "everything" according to what that means in (A) or (B).

I updated the checklists to make the description more clear, when it comes to clicking on the background. It is hard to explain how the tool behaves, although for me it is clear what happens.