DigitalSlideArchive / HistomicsUI

A Girder plugin for pathology image annotations and analysis.
Apache License 2.0
56 stars 19 forks source link

Any way to enable editing annotation drawings? #39

Closed kavehtp closed 2 years ago

kavehtp commented 5 years ago

Hi. Is there any way to enable editing annotations? Geojs already supports this feature (when editing is on and an annotation is clicked) so I was wondering if we can have this feature in HistomicsTK as well.

The reason behind this feature request is adjustment of large polygon annotations. When the object to be annotated is large, the user needs to zoom out and carefully and slowly draw the whole annotation. However, when they zoom in after the annotation, usually the boundaries are not well drawn and so the users need to adjust them.

Thanks, Kaveh

cooperlab commented 5 years ago

Kaveh - we have discussed plans to support this and it is on the roadmap. It's a popular feature in other software. @manthey can provide more details. As you noted, this is already supported by Geojs and just requires some adaptation.

kavehtp commented 5 years ago

We have started to implement this feature. Would you please give us some pointers about this so that we can implement it quickly? @cooperlab @manthey

cooperlab commented 5 years ago

@kavehtp - @manthey is going to have the best advice here. All my implementation has been on the algorithm side.

When we discussed this @manthey showed a nice prototype in a different tool. If I recall correctly you could move vertices, break/join line sections, add/remove vertices.

manthey commented 5 years ago

Within geojs, rendering on a feature layer is faster than an annotation layer (since it can skip a lot of UI hooks and uses a more compact data representation). As a result, we render existing annotations on a feature layer and currently (in HistomicsTK) only use the annotation layer for adding new annotations.

When this gets implemented, I expect the annotation to be edited will be hidden on the feature layer. I'd copy the annotation to be edited to the annotation layer and switch that to edit mode. When the edit mode is exited, the modified annotation would be updated on the feature layer.

See https://opengeoscience.github.io/geojs/examples/annotations/ for an example of editing annotations.

kavehtp commented 5 years ago

Thank you both for the pointers. We'll give it a try and see if we can implement it.

manthey commented 2 years ago

This was added a while back in #100.