fix(interpolation): Auto accept interpolation when the interpolation process is completed. (#5555)
* Update Cornerstone3D packages to 4.9.1.
This commit is contained in:
1 parent
79fab8d70d
commit
834ae3c762
18 files changed
+251
-228
No files matched your search
@@ -46,8 +46,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.28.2",
|
||||
"@cornerstonejs/adapters": "4.9.0",
|
||||
"@cornerstonejs/core": "4.9.0",
|
||||
"@cornerstonejs/adapters": "4.9.1",
|
||||
"@cornerstonejs/core": "4.9.1",
|
||||
"@kitware/vtk.js": "32.12.0",
|
||||
"react-color": "2.19.3"
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.28.2",
|
||||
"@cornerstonejs/adapters": "4.9.0",
|
||||
"@cornerstonejs/core": "4.9.0",
|
||||
"@cornerstonejs/adapters": "4.9.1",
|
||||
"@cornerstonejs/core": "4.9.1",
|
||||
"@kitware/vtk.js": "32.12.0",
|
||||
"react-color": "2.19.3"
|
||||
}
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.28.2",
|
||||
"@cornerstonejs/adapters": "4.9.0",
|
||||
"@cornerstonejs/core": "4.9.0",
|
||||
"@cornerstonejs/tools": "4.9.0",
|
||||
"@cornerstonejs/adapters": "4.9.1",
|
||||
"@cornerstonejs/core": "4.9.1",
|
||||
"@cornerstonejs/tools": "4.9.1",
|
||||
"classnames": "2.5.1"
|
||||
}
|
||||
}
|
||||
@@ -42,8 +42,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.28.2",
|
||||
"@cornerstonejs/core": "4.9.0",
|
||||
"@cornerstonejs/tools": "4.9.0",
|
||||
"@cornerstonejs/core": "4.9.1",
|
||||
"@cornerstonejs/tools": "4.9.1",
|
||||
"classnames": "2.5.1"
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@
|
||||
"@cornerstonejs/codec-libjpeg-turbo-8bit": "1.2.2",
|
||||
"@cornerstonejs/codec-openjpeg": "1.3.0",
|
||||
"@cornerstonejs/codec-openjph": "2.4.7",
|
||||
"@cornerstonejs/dicom-image-loader": "4.9.0",
|
||||
"@cornerstonejs/dicom-image-loader": "4.9.1",
|
||||
"@ohif/core": "3.12.0-beta.84",
|
||||
"@ohif/ui": "3.12.0-beta.84",
|
||||
"dcmjs": "0.43.1",
|
||||
@@ -53,12 +53,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.28.2",
|
||||
"@cornerstonejs/adapters": "4.9.0",
|
||||
"@cornerstonejs/ai": "4.9.0",
|
||||
"@cornerstonejs/core": "4.9.0",
|
||||
"@cornerstonejs/labelmap-interpolation": "4.9.0",
|
||||
"@cornerstonejs/polymorphic-segmentation": "4.9.0",
|
||||
"@cornerstonejs/tools": "4.9.0",
|
||||
"@cornerstonejs/adapters": "4.9.1",
|
||||
"@cornerstonejs/ai": "4.9.1",
|
||||
"@cornerstonejs/core": "4.9.1",
|
||||
"@cornerstonejs/labelmap-interpolation": "4.9.1",
|
||||
"@cornerstonejs/polymorphic-segmentation": "4.9.1",
|
||||
"@cornerstonejs/tools": "4.9.1",
|
||||
"@itk-wasm/morphological-contour-interpolation": "1.1.0",
|
||||
"@kitware/vtk.js": "32.12.0",
|
||||
"html2canvas": "1.4.1",
|
||||
|
||||
@@ -2292,7 +2292,6 @@ function commandsModule({
|
||||
const interpolationConfig = {
|
||||
interpolation: {
|
||||
enabled: interpolateContours,
|
||||
showInterpolationPolyline: true,
|
||||
},
|
||||
};
|
||||
toolGroup.setToolConfiguration(activeTool, interpolationConfig);
|
||||
@@ -2358,7 +2357,6 @@ function commandsModule({
|
||||
break;
|
||||
default:
|
||||
throw new Error('Unsupported logical operation');
|
||||
break;
|
||||
}
|
||||
},
|
||||
copyContourSegment: ({
|
||||
|
||||
@@ -58,6 +58,7 @@ import CornerstoneViewportDownloadForm from './utils/CornerstoneViewportDownload
|
||||
import utils from './utils';
|
||||
import { useMeasurementTracking } from './hooks/useMeasurementTracking';
|
||||
import { setUpSegmentationEventHandlers } from './utils/setUpSegmentationEventHandlers';
|
||||
import { setUpAnnotationEventHandlers } from './utils/setUpAnnotationEventHandlers';
|
||||
export * from './components';
|
||||
|
||||
const { imageRetrieveMetadataProvider } = cornerstone.utilities;
|
||||
@@ -103,6 +104,9 @@ const cornerstoneExtension: Types.Extensions.Extension = {
|
||||
});
|
||||
unsubscriptions.push(...segmentationUnsubscriptions);
|
||||
|
||||
const annotationUnsubscriptions = setUpAnnotationEventHandlers();
|
||||
unsubscriptions.push(...annotationUnsubscriptions);
|
||||
|
||||
toolbarService.registerEventForToolbarUpdate(cornerstoneViewportService, [
|
||||
cornerstoneViewportService.EVENTS.VIEWPORT_DATA_CHANGED,
|
||||
]);
|
||||
@@ -110,7 +114,7 @@ const cornerstoneExtension: Types.Extensions.Extension = {
|
||||
toolbarService.registerEventForToolbarUpdate(segmentationService, [
|
||||
segmentationService.EVENTS.SEGMENTATION_REMOVED,
|
||||
segmentationService.EVENTS.SEGMENTATION_MODIFIED,
|
||||
segmentationService.EVENTS.ANNOTATION_CUT_MERGE_PROCESS_COMPLETED,
|
||||
segmentationService.EVENTS.SEGMENTATION_ANNOTATION_CUT_MERGE_PROCESS_COMPLETED,
|
||||
]);
|
||||
|
||||
toolbarService.registerEventForToolbarUpdate(cornerstone.eventTarget, [
|
||||
|
||||
@@ -109,7 +109,7 @@ export default async function init({
|
||||
toolbarService.registerEventForToolbarUpdate(segmentationService, [
|
||||
segmentationService.EVENTS.SEGMENTATION_MODIFIED,
|
||||
segmentationService.EVENTS.SEGMENTATION_REPRESENTATION_MODIFIED,
|
||||
segmentationService.EVENTS.ANNOTATION_CUT_MERGE_PROCESS_COMPLETED,
|
||||
segmentationService.EVENTS.SEGMENTATION_ANNOTATION_CUT_MERGE_PROCESS_COMPLETED,
|
||||
]);
|
||||
|
||||
window.services = servicesManager.services;
|
||||
|
||||
@@ -82,7 +82,8 @@ const EVENTS = {
|
||||
// loading completed for all segments
|
||||
SEGMENTATION_LOADING_COMPLETE: 'event::segmentation_loading_complete',
|
||||
// fired when a contour annotation cut merge process is completed
|
||||
ANNOTATION_CUT_MERGE_PROCESS_COMPLETED: 'event::annotation_cut_merge_process_completed',
|
||||
SEGMENTATION_ANNOTATION_CUT_MERGE_PROCESS_COMPLETED:
|
||||
'event::annotation_cut_merge_process_completed',
|
||||
};
|
||||
|
||||
const VALUE_TYPES = {};
|
||||
@@ -1696,13 +1697,6 @@ class SegmentationService extends PubSubService {
|
||||
|
||||
if (hideOthers) {
|
||||
throw new Error('hideOthers is not working right now');
|
||||
for (let i = 0; i < segments.length; i++) {
|
||||
if (i !== segmentIndex) {
|
||||
newSegmentSpecificConfig[i] = {
|
||||
fillAlpha: 0,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const { fillAlpha } = this.getStyle({
|
||||
@@ -1928,7 +1922,7 @@ class SegmentationService extends PubSubService {
|
||||
|
||||
private _onAnnotationCutMergeProcessCompletedFromSource = evt => {
|
||||
const { segmentationId } = evt.detail;
|
||||
this._broadcastEvent(this.EVENTS.ANNOTATION_CUT_MERGE_PROCESS_COMPLETED, {
|
||||
this._broadcastEvent(this.EVENTS.SEGMENTATION_ANNOTATION_CUT_MERGE_PROCESS_COMPLETED, {
|
||||
segmentationId,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -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];
|
||||
};
|
||||
@@ -32,8 +32,8 @@
|
||||
"start": "yarn run dev"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@cornerstonejs/core": "4.9.0",
|
||||
"@cornerstonejs/tools": "4.9.0",
|
||||
"@cornerstonejs/core": "4.9.1",
|
||||
"@cornerstonejs/tools": "4.9.1",
|
||||
"@ohif/core": "3.12.0-beta.84",
|
||||
"@ohif/extension-cornerstone-dicom-sr": "3.12.0-beta.84",
|
||||
"@ohif/extension-default": "3.12.0-beta.84",
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.28.2",
|
||||
"@cornerstonejs/core": "4.9.0",
|
||||
"@cornerstonejs/tools": "4.9.0",
|
||||
"@cornerstonejs/core": "4.9.1",
|
||||
"@cornerstonejs/tools": "4.9.1",
|
||||
"@ohif/core": "3.12.0-beta.84",
|
||||
"@ohif/extension-cornerstone": "3.12.0-beta.84",
|
||||
"@ohif/extension-default": "3.12.0-beta.84",
|
||||
|
||||
Reference in new issue
Block a user