fix: jump to measurement forever (#4867)

This commit is contained in:
Alireza authored and GitHub committed 2025-03-28 10:53:04 -04:00
1 parent eafa2efda5
commit d7bd36544a
39 files changed
+731 -448

No files matched your search

+13 -11
View File
@@ -215,6 +215,7 @@ function commandsModule({
viewportId,
displaySetInstanceUID,
referencedImageId,
options,
}) => {
const presentations = cornerstoneViewportService.getPresentations(viewportId);
const { positionPresentationStore, setPositionPresentation, getPositionPresentationId } =
@@ -226,16 +227,18 @@ function commandsModule({
([key, value]) => key.includes(displaySetInstanceUID) && value.viewportId === viewportId
)?.[0];
if (previousReferencedDisplaySetStoreKey) {
const presentationData = referencedImageId
? {
...presentations.positionPresentation,
viewReference: {
referencedImageId,
},
}
: presentations.positionPresentation;
// Create presentation data with referencedImageId and options if provided
const presentationData = referencedImageId
? {
...presentations.positionPresentation,
viewReference: {
referencedImageId,
...options,
},
}
: presentations.positionPresentation;
if (previousReferencedDisplaySetStoreKey) {
setPositionPresentation(previousReferencedDisplaySetStoreKey, presentationData);
return;
}
@@ -243,13 +246,12 @@ function commandsModule({
// if not found means we have not visited that referencedDisplaySetInstanceUID before
// so we need to grab the positionPresentationId directly from the store,
// Todo: this is really hacky, we should have a better way for this
const positionPresentationId = getPositionPresentationId({
displaySetInstanceUIDs: [displaySetInstanceUID],
viewportId,
});
setPositionPresentation(positionPresentationId, presentations.positionPresentation);
setPositionPresentation(positionPresentationId, presentationData);
},
getNearbyToolData({ nearbyToolData, element, canvasCoordinates }) {
return nearbyToolData ?? cstUtils.getAnnotationNearPoint(element, canvasCoordinates);