Skip to content

Commit

Permalink
fix(Labelmaps): Hide labelmaps along with base image
Browse files Browse the repository at this point in the history
  • Loading branch information
floryst committed Apr 13, 2020
1 parent ab5accc commit 20d7dab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/core/Datasets/script.js
Expand Up @@ -27,6 +27,7 @@ export default {
return [].concat(...priorities.map((prio) => state.panels[prio]));
},
}),
...mapState('widgets', ['imageToLabelmaps']),
panelState: {
get() {
const ret = [];
Expand Down Expand Up @@ -149,9 +150,13 @@ export default {
},
toggleDatasetVisibility(sourceId) {
const visible = !this.getDatasetVisibility(sourceId);
const labelmaps = this.imageToLabelmaps[sourceId] || [];
this.$proxyManager
.getRepresentations()
.filter((r) => r.getInput().getProxyId() === sourceId)
.filter((r) => {
const id = r.getInput().getProxyId();
return id === sourceId || labelmaps.indexOf(id) > -1;
})
.forEach((r) => r.setVisibility(visible));
// TODO use onProxyModified?
this.$forceUpdate();
Expand Down

0 comments on commit 20d7dab

Please sign in to comment.