-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add additional behaviors to image overlays #761
Conversation
When rendering image overlay element annotations, use the global opacity to help set the initial opactity. Also make image overlay layers respond to changes in the global opacity.
This supports deleting individual elements from an annotation containing overlay elements (e.g. from the HistomicsUI edit annotation widget.
If re-drawing an annotation with image overlay elements, compare the updated results of `annotation.overlays()` to the overlays stored in `this._annotations`. This captures changes to the `annotation._elements` collection between the initial render of the annotation and the redraw.
@@ -508,7 +508,7 @@ class AnnotationSchema: | |||
'group': groupSchema, | |||
}, | |||
'required': ['girderId', 'type'], | |||
'additionalProperties': False, | |||
'additionalProperties': True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably the correct thing to do is to make the overlay annotation inherit from the baseShapeSchema, except that we don't want to get the line and lineWidth properties. We can do this in a separate PR -- baseShapeSchema would inherit from baseElementSchema which would exclude those properties and then the overlay annotation would inherit from that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #762
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks right to me. We should make a new issue or PR to adjust the schema in a more intelligent manner.
This PR rounds out some functionality for image overlays that make them more reactive in applications like HistomicsUI.
Specifically, this PR introduces the following changes:
globalAnnotationOpacity
of the image viewer. As a result, image overlays now change opacity based on the slider in HistomicsUI.id
property would be added to the overlay elements.drawAnnotation
has been updated to account for the case where an image overlay element was removed from the annotation between an initial call todrawAnnotation
and a follow up call todrawAnnotation
.