From 40373140487d902254198afe1b968d92331d62ee Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Tue, 25 Oct 2022 13:42:09 -0400 Subject: [PATCH] fix(annotation):The wrong annotation was being selected for common frameUID (#259) * fix(annotation):The wrong annotation was being selected for common frameUID * Small tweak to commit to be a bit more reliable for volume measurements * fix(tools):getPointNearTool would throw an exception on volume viewport --- packages/tools/src/utilities/getAnnotationNearPoint.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/tools/src/utilities/getAnnotationNearPoint.ts b/packages/tools/src/utilities/getAnnotationNearPoint.ts index 668f605c5..8f49df311 100644 --- a/packages/tools/src/utilities/getAnnotationNearPoint.ts +++ b/packages/tools/src/utilities/getAnnotationNearPoint.ts @@ -102,9 +102,15 @@ function findAnnotationNearPointByTool( enabledElement.viewport.element, (tool.constructor as typeof BaseTool).toolName ); + const currentId = enabledElement.viewport?.getCurrentImageId?.(); if (annotations?.length) { const { element } = enabledElement.viewport; for (const annotation of annotations) { + const referencedImageId = annotation.metadata?.referencedImageId; + if (currentId && referencedImageId && currentId !== referencedImageId) { + continue; + } + if ( tool.isPointNearTool(element, annotation, point, proximity, '') || tool.getHandleNearImagePoint(element, annotation, point, proximity)