From 97546d1c7a7321a14da4dacac9ff3359ef1a72bf Mon Sep 17 00:00:00 2001 From: Chris Jordan Date: Wed, 2 Oct 2024 18:17:35 -0400 Subject: [PATCH] quick fix for tags breaking precomputed annotations --- src/annotation/frontend_source.ts | 4 ++-- src/layer/annotation/index.ts | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/annotation/frontend_source.ts b/src/annotation/frontend_source.ts index f150a4d12..f0c84629b 100644 --- a/src/annotation/frontend_source.ts +++ b/src/annotation/frontend_source.ts @@ -56,7 +56,7 @@ import { SliceViewChunkSource, } from "#src/sliceview/frontend.js"; import { StatusMessage } from "#src/status.js"; -import type { WatchableValue } from "#src/trackable_value.js"; +import { WatchableValue } from "#src/trackable_value.js"; import type { Borrowed, Owned } from "#src/util/disposable.js"; import { ENDIANNESS, Endianness } from "#src/util/endian.js"; import * as matrix from "#src/util/matrix.js"; @@ -532,7 +532,7 @@ export class MultiscaleAnnotationSource ) { super(); this.rank = options.rank; - this.properties.value = options.properties; + this.properties = new WatchableValue(options.properties); this.annotationPropertySerializers = makeAnnotationPropertySerializers( this.rank, this.properties.value, diff --git a/src/layer/annotation/index.ts b/src/layer/annotation/index.ts index 47164c3a4..3f70ecef4 100644 --- a/src/layer/annotation/index.ts +++ b/src/layer/annotation/index.ts @@ -723,11 +723,13 @@ export class AnnotationUserLayer extends Base { getter: () => new RenderingOptionsTab(this), }); this.tabs.default = "annotations"; - this.tabs.add("tags", { - label: "Tags", - order: 10, - getter: () => new TagsTab(this), - }); + if (this.localAnnotations) { + this.tabs.add("tags", { + label: "Tags", + order: 10, + getter: () => new TagsTab(this), + }); + } } syncTagTools = (tagIdentifiers: string[]) => {