fix(microscopy): rename measurement in microscopy mode (#5866)

This commit is contained in:
Ghadeer Albattarni authored and GitHub committed 2026-03-04 15:28:41 -05:00
1 parent df22109013
commit 2358a73c3c
5 files changed
+86 -8

No files matched your search

@@ -1,6 +1,7 @@
import { CommandsManager, ExtensionManager } from '@ohif/core';
import { callInputDialog } from '@ohif/extension-default';
import styles from './utils/styles';
import i18n from '@ohif/i18n';
export default function getCommandsModule({
servicesManager,
@@ -24,16 +25,22 @@ export default function getCommandsModule({
}
},
setLabel: ({ uid }) => {
setLabel: async ({ uid }) => {
const roiAnnotation = microscopyService.getAnnotation(uid);
callInputDialog({
if (!roiAnnotation) {
return;
}
const value = await callInputDialog({
uiDialogService,
defaultValue: '',
onSave: (value: string) => {
roiAnnotation.setLabel(value);
microscopyService.triggerRelabel(roiAnnotation);
},
title: i18n.t('Tools:Edit Measurement Label'),
placeholder: roiAnnotation.label || i18n.t('Tools:Enter new label'),
defaultValue: roiAnnotation.label,
});
if (value != null) {
roiAnnotation.setLabel(value);
microscopyService.triggerRelabel(roiAnnotation);
}
},
setToolActive: ({ toolName, toolGroupId = 'MICROSCOPY' }) => {