fix: remove duplicated deleteMeasurements code (#4895)

This commit is contained in:
Pedro Köhler 2025-03-26 14:58:15 -03:00 committed by GitHub
parent 7f8fa1e1f4
commit 9bde644fce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 17 deletions

View File

@ -4,10 +4,7 @@ import {
VolumeViewport, VolumeViewport,
utilities as csUtils, utilities as csUtils,
Types as CoreTypes, Types as CoreTypes,
cache,
BaseVolumeViewport, BaseVolumeViewport,
triggerEvent,
eventTarget,
} from '@cornerstonejs/core'; } from '@cornerstonejs/core';
import { import {
ToolGroupManager, ToolGroupManager,
@ -78,13 +75,10 @@ function commandsModule({
colorbarService, colorbarService,
hangingProtocolService, hangingProtocolService,
syncGroupService, syncGroupService,
toolbarService,
segmentationService, segmentationService,
displaySetService, displaySetService,
} = servicesManager.services as AppTypes.Services; } = servicesManager.services as AppTypes.Services;
const { measurementServiceSource } = this;
function _getActiveViewportEnabledElement() { function _getActiveViewportEnabledElement() {
return getActiveViewportEnabledElement(viewportGridService); return getActiveViewportEnabledElement(viewportGridService);
} }
@ -286,12 +280,6 @@ function commandsModule({
? nearbyToolData ? nearbyToolData
: null; : null;
}, },
/** Delete the given measurement */
deleteMeasurement: ({ uid }) => {
if (uid) {
measurementServiceSource.remove(uid);
}
},
/** /**
* Common logic for handling measurement label updates through dialog * Common logic for handling measurement label updates through dialog
* @param uid - measurement uid * @param uid - measurement uid
@ -1575,9 +1563,6 @@ function commandsModule({
toggleViewportColorbar: { toggleViewportColorbar: {
commandFn: actions.toggleViewportColorbar, commandFn: actions.toggleViewportColorbar,
}, },
deleteMeasurement: {
commandFn: actions.deleteMeasurement,
},
setMeasurementLabel: { setMeasurementLabel: {
commandFn: actions.setMeasurementLabel, commandFn: actions.setMeasurementLabel,
}, },

View File

@ -9,7 +9,7 @@ export default {
items: [ items: [
{ {
label: 'Delete measurement', label: 'Delete measurement',
commands: 'deleteMeasurement', commands: 'removeMeasurement',
}, },
{ {
label: 'Add Label', label: 'Add Label',

View File

@ -22,7 +22,7 @@ export default {
label: 'Delete Measurement', label: 'Delete Measurement',
commands: [ commands: [
{ {
commandName: 'deleteMeasurement', commandName: 'removeMeasurement',
}, },
], ],
}, },

View File

@ -34,3 +34,7 @@ After:
yarn install yarn install
yarn run dev yarn run dev
``` ```
## CommandsModule
1. Removed the `deleteMeasurements` command from the `CORNERSTONE` context. It should be replaced by `removeMeasurements` command.