From 878a1f8af864b82bfd4b460efaf1352d24930a5b Mon Sep 17 00:00:00 2001 From: Salim Kanoun Date: Mon, 2 Dec 2024 14:53:46 +0100 Subject: [PATCH] fix : Resize was broken if 3d viewport displayed in HP (#4561) --- .../src/services/ViewportService/CornerstoneViewportService.ts | 2 +- platform/ui/src/contextProviders/ViewportGridProvider.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts b/extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts index c07a4de01e..9c9bc59091 100644 --- a/extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts +++ b/extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts @@ -1062,7 +1062,7 @@ class CornerstoneViewportService extends PubSubService implements IViewportServi // During a resize, the slice index should remain unchanged. This is a temporary fix for // a larger issue regarding the definition of slice index with slab thickness. // We need to revisit this to make it more robust and understandable. - delete presentation.viewReference.sliceIndex; + delete presentation.viewReference?.sliceIndex; this.beforeResizePositionPresentations.set(viewportId, presentation); }); diff --git a/platform/ui/src/contextProviders/ViewportGridProvider.tsx b/platform/ui/src/contextProviders/ViewportGridProvider.tsx index fe67b6350c..49c9939fcc 100644 --- a/platform/ui/src/contextProviders/ViewportGridProvider.tsx +++ b/platform/ui/src/contextProviders/ViewportGridProvider.tsx @@ -187,7 +187,7 @@ export function ViewportGridProvider({ children, service }: ViewportGridProvider updatedViewport?.viewportOptions ); - const displaySetOptions = updatedViewport.displaySetOptions || []; + const displaySetOptions = updatedViewport?.displaySetOptions || []; if (!displaySetOptions.length) { // Copy all the display set options, assuming a full set of displaySet UID's is provided. if (state.isHangingProtocolLayout) {