feat: group clear measurements history (#5194)
This commit is contained in:
parent
4e99f1ed34
commit
4d3ff5a6cc
@ -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,
|
||||
};
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user