mlexchange / mlex_highres_segmentation

A Dash interface for ML-based segmentation of user-annotated large multi-dimensional image data
Other
5 stars 4 forks source link

Labels can be added when no classes exist #113

Closed ndrezn closed 1 year ago

ndrezn commented 1 year ago

It's possible to remove all classes, and you can still annotate. When you add annotations, they appear as grey and are removed if you add a class after the fact.

I would expect either:

Screen recording: https://github.com/mlexchange/mlex_highres_segmentation/assets/38958867/7c6d3598-666c-439b-8bf5-7bfa8a7f124e

ndrezn commented 1 year ago

cc @cleaaum

cleaaum commented 1 year ago

I purposely left it like this - it's the default behaviour for now because we allowed the user to delete all classes. Any drawn annotation in the grey is not saved because its not attached to a class. We weren't sure what the best option was here - but its something we can ask LBL this week. I'll implement this based on what they prefer:)

ndrezn commented 1 year ago

Maybe if it's drawn with no class, then when you add a class those annotations should be assigned to the first class? That way they aren't deleted.

cleaaum commented 1 year ago

I think the best would be to disable drawing. Implementing the above is not consistent with how the code currently works. Adding these grey annotations to a new class may not be what people expect, and may be confusing.

ndrezn commented 1 year ago

I think the logic would be current behaviour with no classes (i.e. grey and no class defined), and when a user clicks "Add class" it would change the color of the grey annotations? But disable drawing plausibly is fine too, and certainly easier to implement.

cleaaum commented 1 year ago

The latter would definitely be easier to implement. For the former, it doesn't make sense to me that these grey annotations get saved when a new class is created, its adding complexity to the code and not following the pattern previously implemented. These annotations get saved as soon as they are drawn, so this would require to redo an implementation for this edge case. When you annotate an image, you use a class, so if no class exists it makes sense that you're not annotating the image. If they like this approach we can implement it, but I would discourage it, and we can agree to disagree 😄

Initially the idea was to disable the deletion of the last class, but we got rid of this in the case that the user didn't like the default class color and wanted a new color (color could not be changed by the user). In the meantime, I implemented the possibility of changing the class color, so we could add back the inability to delete the last class as well.

Wiebke commented 1 year ago

I think adding back the inability to delete the last class makes the most sense.