scalableminds / webknossos

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

Volume-Only annotations show green bounding box. Should be unified/clarified #7831

Open MichaelBuessemeyer opened 6 months ago

MichaelBuessemeyer commented 6 months ago

Context

When I create an annotation with a locked mapping and reupload it, the reuploaded annotation suddenly has the dataset bounding box colored in green and not in grey (as usual). See here

Expected Behavior

The bounding box should be grey as normal.

Current Behavior

The dataset bounding box is green.

Steps to Reproduce the bug

  1. Create an annotation on a dataset with a hdf5 mapping (like test-agglomerate-file). Do not add a skeleton layer! The annotation is not allowed to have a single tree. Else the behaviour wont show
  2. Select a hdf5 mapping and do some volume annotation
  3. Download the annotation in the annotation view and reupload the annotation in the explorative annotations view
  4. The opened annotation should have a green dataset bounding box

Bug first noticed on the mapping-nml branch.

fm3 commented 6 months ago

Could you check if the mappings really affect this or if it is the case for all volume annotations with fallback layer?

I think this green border used to be a feature, not a bug, but I also think we lost track of the cases where this does and/or should appear. So »Needs Clarification« is the right label…

Possibly related: discussion in https://github.com/scalableminds/webknossos/pull/7580

MichaelBuessemeyer commented 6 months ago

Ok I think I know whats going on: This is independent of the hdf5 mapping and the reuploading.

Each volume layer has a bounding box attached to it. That's how the backend sends it to the frontend. This bounding box is saved as the boundingBox field in the volumetracing. The frontend now renders task bounding boxes in green. It decides whether there is a task bounding box by using getSomeTracing(storeState.tracing).userBoundingBoxes. See https://github.com/scalableminds/webknossos/blob/466d4d7d71ea51a6b59d10264dbb7643d61e3595/frontend/javascripts/oxalis/controller/scene_controller.ts#L217-L218

In case there is no skeleton tracing, the first volume tracing is taken and as it has a bounding box, its bounding box is treated and rendered like a task bounding box (in green). An easy way to reproduce this is to open a hybrid annotation of some dataset and then another annotation that is volume only of the same dataset. In the second notation, there should be a green bounding box.

So: How to we want to tackle this: I'd say having a green dataset bounding box for exploration volume only tracings is kinda strange as green should indicate the task bounding box and not a volume layer bounding box. I see 2 ways to fix this:

  1. The backend no longer sends bounds for a volume layer (might collide with #7580). But maybe sending a bounding box in an explorative volume annotation is incorrect. But I do not know more about this. So I cannot decide here.
  2. The frontend only renders a task bounding box, in case a task is opened.