From b9d6f558cbe5957f83e6d92305a78662a0b186ed Mon Sep 17 00:00:00 2001 From: Salim Kanoun Date: Mon, 25 Aug 2025 15:56:36 +0200 Subject: [PATCH] fix: Segmentation stats customization module (#5324) --- .../src/utils/segmentationHandlers.ts | 5 ++++- .../sampleCustomizations.tsx | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/extensions/cornerstone/src/utils/segmentationHandlers.ts b/extensions/cornerstone/src/utils/segmentationHandlers.ts index b79f30e7c..42b406fb7 100644 --- a/extensions/cornerstone/src/utils/segmentationHandlers.ts +++ b/extensions/cornerstone/src/utils/segmentationHandlers.ts @@ -16,9 +16,12 @@ export function setupSegmentationDataModifiedHandler({ const { unsubscribe: debouncedUnsubscribe } = segmentationService.subscribeDebounced( segmentationService.EVENTS.SEGMENTATION_DATA_MODIFIED, async ({ segmentationId }) => { + + const disableUpdateSegmentationStats = customizationService.getCustomization('panelSegmentation.disableUpdateSegmentationStats'); + const segmentation = segmentationService.getSegmentation(segmentationId); - if (!segmentation) { + if (!segmentation || disableUpdateSegmentationStats) { return; } diff --git a/platform/docs/docs/platform/services/customization-service/sampleCustomizations.tsx b/platform/docs/docs/platform/services/customization-service/sampleCustomizations.tsx index 8ac060dcb..b3b997446 100644 --- a/platform/docs/docs/platform/services/customization-service/sampleCustomizations.tsx +++ b/platform/docs/docs/platform/services/customization-service/sampleCustomizations.tsx @@ -1310,6 +1310,24 @@ window.config = { }, }, ], +}; + `, + }, + { + id: 'panelSegmentation.disableUpdateSegmentationStats', + description: 'Disables the automatic update of segmentation statistics in the panel.', + default: false, + image: [], + configuration: ` +window.config = { + // rest of window config + customizationService: [ + { + 'panelSegmentation.disableUpdateSegmentationStats': { + $set: true, // Disables the automatic update of segmentation statistics in the panel + }, + }, + ], }; `, },