feat: group clear measurements history (#5194)

This commit is contained in:
Pedro Köhler 2025-07-11 12:26:10 -03:00 committed by GitHub
parent 4e99f1ed34
commit 4d3ff5a6cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 34974 additions and 7220 deletions

42177
bun.lock

File diff suppressed because it is too large Load Diff

View File

@ -2021,6 +2021,12 @@ function commandsModule({
viewport.render();
}
},
startRecordingForAnnotationGroup: () => {
cornerstoneTools.AnnotationTool.startGroupRecording();
},
endRecordingForAnnotationGroup: () => {
cornerstoneTools.AnnotationTool.endGroupRecording();
},
triggerCreateAnnotationMemo: ({
annotation,
FrameOfReferenceUID,
@ -2342,6 +2348,8 @@ function commandsModule({
hydrateSecondaryDisplaySet: actions.hydrateSecondaryDisplaySet,
getVolumeIdForDisplaySet: actions.getVolumeIdForDisplaySet,
triggerCreateAnnotationMemo: actions.triggerCreateAnnotationMemo,
startRecordingForAnnotationGroup: actions.startRecordingForAnnotationGroup,
endRecordingForAnnotationGroup: actions.endRecordingForAnnotationGroup,
toggleSegmentLabel: actions.toggleSegmentLabel,
};

View File

@ -359,6 +359,7 @@ const connectMeasurementServiceToTools = ({
return;
}
commandsManager.run('startRecordingForAnnotationGroup');
for (const measurement of Object.values(measurements)) {
const { uid, source } = measurement;
if (source.name !== CORNERSTONE_3D_TOOLS_SOURCE_NAME) {
@ -372,6 +373,7 @@ const connectMeasurementServiceToTools = ({
options: { deleting: true },
});
}
commandsManager.run('endRecordingForAnnotationGroup');
// trigger a render
cornerstoneViewportService.getRenderingEngine().render();

View File

@ -149,12 +149,7 @@ function TrackedMeasurementsContextProvider(
}
},
clearAllMeasurements: (ctx, evt) => {
const measurements = measurementService.getMeasurements();
const measurementIds = measurements.map(fm => fm.uid);
for (let i = 0; i < measurementIds.length; i++) {
measurementService.remove(measurementIds[i]);
}
measurementService.clearMeasurements();
measurementService.setIsMeasurementDeletedIndividually(false);
},
clearDisplaySetHydratedState: (ctx, evt) => {