seung-lab / neuroglancer

WebGL-based viewer for volumetric data
https://neuromancer-seung-import.appspot.com/
Apache License 2.0
22 stars 10 forks source link

Collected annotations cannot be recovered from JSON #415

Open ceesem opened 4 years ago

ceesem commented 4 years ago

Retrieving a neuroglancer state with collected annotations from the JSON state server (or pasted JSON) does not recreate the annotation collection. The points are shown in the viewer, the annotation layer is created, but the annotations are not listed in their tab.

nkemnitz commented 4 years ago

Could you post a link please (or send it in Slack)?

ceesem commented 4 years ago

Of course, here is one example: https://neuromancer-seung-import.appspot.com/?json_url=https://www.dynamicannotationframework.com/nglstate/5143747048308736

ogewan commented 4 years ago

This is caused by not completing the collection annotation. The children of the collection are added as you add them, but the collection is not added till all the children have been added and it is completed. So here a state where the children have been added but not the parent is pushed and it breaks when loaded in.

Collections that are "In Progress" are highlighted green and cannot be modified until they are completed. To complete a collection use Ctrl + Doubleclick or press the collection annotation button again, or switch tools (Spoke and LineStrip only).

In the future, pressing the share button will force all collections to be completed, but in the meantime ensure that collections are completed (no green annotations) before sharing/saving.

ceesem commented 4 years ago

To complete a collection use Ctrl + Doubleclick or press the collection annotation button again, or switch tools (Spoke and LineStrip only).

This is extremely non-obvious behavior to expect of a user.

fcollman commented 4 years ago

I wonder if we can simply do a check then on "share" in order to check for this case, or close unclosed annotation groups upon share...

fcollman commented 4 years ago

also on my mac on google chrome ctrl+double click does not close the group effectively. I just get two points when i double click.

ogewan commented 4 years ago

Ah, so its actually worse than I expected. Incomplete collections break the layer just by reloading.

With #413, I'm making changes to make these new annotations more robust. This bug also exists with any annotation that takes more than one step to complete.

Because this change will introduce a method to change existing collections the default behavior can be to just assume any loaded state with incomplete annotation was meant to be complete and generate a parent for the children. This would cover all cases where an incomplete annotation is saved to some state (reload, crash, save/share).

The problem is this is only a partial recovery as the only info I have about the parent in that case would be its ID from the children. Things like tags and descriptions be lost and incomplete spokes/linestrips will default to a collection.

As for completing collections, because they are arbitrarily many steps rather than one or two steps, they can't be automatically completed.

ceesem commented 4 years ago

As for completing collections, because they are arbitrarily many steps rather than one or two steps, they can't be automatically completed

It feels to me like this suggests that the completion metaphor isn't necessarily the right one, but rather that every change/new point should result in a complete annotation, and complete annotations can be edited by adding more points (which is important and does not seem to be currently possible).

ogewan commented 4 years ago

Iirc the Ctrl + Double Click completion is a power user oriented feature. The most user friendly form of creating a collection is to group existing annotations in the layer view and create a collection. I believe this is what most of the tracers do. It is also the only way currently on Mac.

in #413, there is a method to edit existing collections, but completing Collections automatically is redundant when compared to the grouping mechanism.

ogewan commented 4 years ago

Migrating from #413 , the standard double click handler on Mac works which means there is an internal issue with neuroglancer that doesn't handle double click correctly. This requires a fix to that and is out of scope of #413. Additionally, this affects google realm as well.