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 + }, + }, + ], }; `, },