Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/config_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ If a hotkey is specified for a group, it will only be active if the group was lo
action: group
param: Red

Unselected Annotation Capacity
______________________________
When annotation elements are selected, the annotations not included in the user's selection have their opacity decreased to 0.33 times their specified opacity. This can be modified:
::
---
# A lower value will make unselected annotations more transparent.
unselectedOpacityMultiplier: 0.33


UI Settings
___________

Expand Down
14 changes: 13 additions & 1 deletion histomicsui/web_client/views/body/ImageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,17 @@ var ImageView = View.extend({
// it is very confusing if this value is smaller than the
// AnnotationSelector MAX_ELEMENTS_LIST_LENGTH
highlightFeatureSizeLimit: 5000,
scale: {position: {bottom: 20, right: 10}}
scale: {position: {bottom: 20, right: 10}},
unselectedOpacityMultiplier: typeof this._unselectedOpacityMultiplier !== 'number'
? 0.33
: this._unselectedOpacityMultiplier
});
// Don't unclamp bounds for the image even if image overlays are present.
if (this.viewerWidget.setUnclampBoundsForOverlay) {
this.viewerWidget.setUnclampBoundsForOverlay(false);
}
this.trigger('h:viewerWidgetCreated', this.viewerWidget);
this.viewerWidget.setUnselectedOpacityMultiplier(this._unselectedOpacityMultiplier);

// handle annotation mouse events
this.listenTo(this.viewerWidget, 'g:mouseOverAnnotation', this.mouseOverAnnotation);
Expand Down Expand Up @@ -1784,6 +1788,14 @@ var ImageView = View.extend({
}
});
}
if (val.unselectedOpacityMultiplier !== undefined) {
this._unselectedOpacityMultiplier = typeof val.unselectedOpacityMultiplier !== 'number'
? 0.33
: val.unselectedOpacityMultiplier;
if (this.viewerWidget) {
this.viewerWidget.setUnselectedOpacityMultiplier(val.unselectedOpacityMultiplier);
}
}
});
},

Expand Down
1 change: 1 addition & 0 deletions tests/test_files/.histomicsui_config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
unselectedOpacityMultiplier: 0.5
annotationGroups:
# If replaceGroups isn't present or false, groups will be merged with
# existing groups. Those that have the same name will be updated. If
Expand Down
5 changes: 5 additions & 0 deletions tests/web_client_specs/annotationSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1812,6 +1812,11 @@ girderTest.promise.done(function () {
it('open image', function () {
huiTest.openImage('image.svs', ['subfolder']);
});
it('respects unselected opacity config', function () {
girderTest.waitForLoad();
expect(huiTest.app.bodyView._unselectedOpacityMultiplier).toBe(0.5);
expect(huiTest.app.bodyView.viewerWidget._unselectedOpacityMultiplier).toBe(0.5);
});
it('create a new annotation', function () {
girderTest.waitForLoad();
runs(function () {
Expand Down