scalableminds / webknossos

Visualize, share and annotate your large 3D images online
https://webknossos.org
GNU Affero General Public License v3.0
126 stars 23 forks source link

Allow Segment Picker to set active segment ID to 0 #6658

Open erjel opened 1 year ago

erjel commented 1 year ago

Detailed Description

Currently, the segment picker does not pick the background value (might be a feature?).

Context

During the volume annotation it might be beneficial to delete large areas via the bucket tool. Since the bucket tool does not come with an "erase" option such as "brush", "lasso", you need to set its value manually to 0.

For me, the workflow becomes much easier (also for the other tools) if I can just pick an empty-valued pixel in the vicinity to change the active segment ID value and use the tools itself as eraser ...

philippotto commented 1 year ago

Hi @erjel! In general, I think that 0 as the active segment ID can be quite confusing for newcomers. Especially, if the annotation is empty, brushing with 0 as an ID will do nothing. This is also the reason why there will be a warning shown when trying to do so. Therefore, I don't really want to make it easier to slip into this state.

However, I can understand your use case. To improve it, my suggestion would be as follows: The context menu could be extended to provide an "Erase this segment via flood-fill" action (not shown in screenshot). image

That way, the desired action would be two clicks away and the active segment ID can stay unchanged.

What do you think about this idea?

erjel commented 1 year ago

I like the idea - it gets the job done. Yet, with your suggestion I would: 1.) First color all segments I want to delete with the same new label (since it is just one click on the segment) 2.) Delete the new label with the proposed item in the context menu.

Probably works perfectly fine, but not as straight forward as deleting them with the bucket tool directly 😉

philippotto commented 1 year ago

Ok, I wasn't aware that you are really doing this in "bulk mode" :) Then, I can understand that two clicks per segment can be too much. However, then I'd suggest a separate flood-fill eraser. We will probably discuss this internally in our team, since new tools should be added with thought.

1.) First color all segments I want to delete with the same new label (since it is just one click on the segment) 2.) Delete the new label with the proposed item in the context menu.

This would probably not work, because the flood-fill only works on connected segments.