ImagingDataCommons / slim

Interoperable web-based slide microscopy viewer and annotation tool
https://imagingdatacommons.github.io/slim/
Apache License 2.0
118 stars 36 forks source link

Implement SRs Class-Based Annotation Toggle #193

Open pedrokohler opened 6 months ago

pedrokohler commented 6 months ago

Each SR object belongs to a class (e.g. ERMS, ARMS, connective tissue, etc). Could it someday be added to have a way to enable or disable all the annotations of only a particular class simultaneously?

Implement Class-Based Annotation Toggle

Description

Introduce a feature to enable or disable annotations for a specific class of SR objects simultaneously. Each SR object belongs to a class (e.g., ERMS, ARMS, connective tissue, etc.), and providing the capability to toggle annotations for a particular class will enhance user control and streamline workflow efficiency.

Acceptance Criteria

  1. Users should be able to enable or disable annotations for a specific class of SR objects.
  2. The toggle functionality should affect all annotations belonging to the selected class simultaneously.
  3. Ensure that enabling or disabling annotations for a class does not affect annotations for other classes.
  4. The user interface for class-based annotation toggling should be intuitive and accessible.

From #184

pedrokohler commented 6 months ago

@fedorov please confirm if the solution I'm proposing makes sense for your needs:

I'm thinking we can maybe add a Annotation Type menu together with the ones in the picture below:

image

In this menu we'd have all of the types of the SRs loaded. Then with a toggle button you can disable or enable all of them at once. Something similar to this:

image

Let me know if that works.

fedorov commented 4 months ago

How about we add "Property types" and "Property categories" sections under "Annotation groups", list all distinct types/properties under those along with the toggles, and use the same text as we use for those attributes in the individual annotation groups?

pedrokohler commented 4 months ago

Just to clarify, you're envisioning something like the following then, @fedorov?

Suppose you have these Annotation Groups: image

You'd then also have these two sections which would look like the image below: image

Is that it?

In this case me and Igor were discussing and we think the best option in case of conflict (suppose the 'type' one is turned on and the 'category' one is turned off), then the 'off' always wins... meaning that if you either turn off the type or the category, then the annotations that match either one will disappear, no matter is the remaining section says otherwise.

For the sake of an example, suppose the following scenario:

Annotation 1 - Type A, Category X Annotation 2 - Type A, Category Y Annotation 3 - Type B, Category X

Type A - OFF Type B - ON

Category X - OFF Category Y - ON

In this case none of the annotations would be visible, even though Type B and Category Y are turned on, because the 'off' switch has precedence.

Hope I made myself clear.

Please let me know if that works.

fedorov commented 4 months ago

How hard would it be to implement a three-state switch or checkbox for categories, as shown below?

image

From what I understand (from how the data is encoded), category can include one or more types, BUT type can belong to one and only one category. So in your example, if Type A is switched off, Type B would be still on, and it would make sense to show Category X as partially enabled.

If this is too difficult to understand or implement - I am fine with your approach, and we can revisit after the initial implementation!