fix(interpolation): Auto accept interpolation when the interpolation process is completed. (#5555)

* Update Cornerstone3D packages to 4.9.1.
This commit is contained in:
Joe Boccanfuso authored and GitHub committed 2025-11-11 08:19:45 -05:00
1 parent 79fab8d70d
commit 834ae3c762
18 files changed
+251 -228

No files matched your search

@@ -0,0 +1,26 @@
import * as csTools from '@cornerstonejs/tools';
import { eventTarget } from '@cornerstonejs/core';
const { Enums: csToolsEnums } = csTools;
const _autoAcceptAnnotationInterpolationHandler = evt => {
const { element } = evt.detail;
csTools.utilities.contours.acceptAutogeneratedInterpolations(element, {});
};
export const setUpAnnotationEventHandlers = (): [() => void] => {
eventTarget.addEventListener(
csToolsEnums.Events.ANNOTATION_INTERPOLATION_PROCESS_COMPLETED,
_autoAcceptAnnotationInterpolationHandler
);
const annotationInterpolationProcessCompletedUnsubscribe = () => {
eventTarget.removeEventListener(
csToolsEnums.Events.ANNOTATION_INTERPOLATION_PROCESS_COMPLETED,
_autoAcceptAnnotationInterpolationHandler
);
};
return [annotationInterpolationProcessCompletedUnsubscribe];
};