fix(measurement label auto-completion): Customization of measurement label auto-completion fails for measurements following arrow annotations. (#4739)

This commit is contained in:
arul-trenser authored and GitHub committed 2025-02-03 10:31:41 -05:00
1 parent 43aa20c372
commit e035ef1dcc
6 files changed
+73 -81

No files matched your search

+1 -1
View File
@@ -89,7 +89,7 @@ function modeFactory({ modeConfiguration }) {
measurementService.clearMeasurements();
// Init Default and SR ToolGroups
initToolGroups(extensionManager, toolGroupService, commandsManager, this.labelConfig);
initToolGroups(extensionManager, toolGroupService, commandsManager);
toolbarService.addButtons([...toolbarButtons, ...moreTools]);
toolbarService.createButtonSection('primary', [
+24 -38
View File
@@ -16,8 +16,7 @@ function initDefaultToolGroup(
extensionManager,
toolGroupService,
commandsManager,
toolGroupId,
modeLabelConfig
toolGroupId
) {
const utilityModule = extensionManager.getModuleEntry(
'@ohif/extension-cornerstone.utilityModule.tools'
@@ -50,23 +49,17 @@ function initDefaultToolGroup(
toolName: toolNames.ArrowAnnotate,
configuration: {
getTextCallback: (callback, eventDetails) => {
if (modeLabelConfig) {
callback(' ');
} else {
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
});
}
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
});
},
changeTextCallback: (data, eventDetails, callback) => {
if (modeLabelConfig === undefined) {
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
});
}
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
});
},
},
},
@@ -178,7 +171,7 @@ function initSRToolGroup(extensionManager, toolGroupService) {
toolGroupService.createToolGroupAndAddTools(toolGroupId, tools);
}
function initMPRToolGroup(extensionManager, toolGroupService, commandsManager, modeLabelConfig) {
function initMPRToolGroup(extensionManager, toolGroupService, commandsManager) {
const utilityModule = extensionManager.getModuleEntry(
'@ohif/extension-cornerstone.utilityModule.tools'
);
@@ -213,23 +206,17 @@ function initMPRToolGroup(extensionManager, toolGroupService, commandsManager, m
toolName: toolNames.ArrowAnnotate,
configuration: {
getTextCallback: (callback, eventDetails) => {
if (modeLabelConfig) {
callback('');
} else {
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
});
}
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
});
},
changeTextCallback: (data, eventDetails, callback) => {
if (modeLabelConfig === undefined) {
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
});
}
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
});
},
},
},
@@ -320,16 +307,15 @@ function initVolume3DToolGroup(extensionManager, toolGroupService) {
toolGroupService.createToolGroupAndAddTools('volume3d', tools);
}
function initToolGroups(extensionManager, toolGroupService, commandsManager, modeLabelConfig) {
function initToolGroups(extensionManager, toolGroupService, commandsManager) {
initDefaultToolGroup(
extensionManager,
toolGroupService,
commandsManager,
'default',
modeLabelConfig
'default'
);
initSRToolGroup(extensionManager, toolGroupService, commandsManager);
initMPRToolGroup(extensionManager, toolGroupService, commandsManager, modeLabelConfig);
initSRToolGroup(extensionManager, toolGroupService);
initMPRToolGroup(extensionManager, toolGroupService, commandsManager);
initVolume3DToolGroup(extensionManager, toolGroupService);
}