feat(measurement): Add support measurement label autocompletion (#3855)

This commit is contained in:
nithin-trenser authored and GitHub committed 2024-04-04 22:42:48 -04:00
1 parent 807afb8ce5
commit 56b1eae635
25 files changed
+830 -138

No files matched your search

+56 -30
View File
@@ -1,4 +1,10 @@
function initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, toolGroupId) {
function initDefaultToolGroup(
extensionManager,
toolGroupService,
commandsManager,
toolGroupId,
modeLabelConfig
) {
const utilityModule = extensionManager.getModuleEntry(
'@ohif/extension-cornerstone.utilityModule.tools'
);
@@ -26,18 +32,25 @@ function initDefaultToolGroup(extensionManager, toolGroupService, commandsManage
{
toolName: toolNames.ArrowAnnotate,
configuration: {
getTextCallback: (callback, eventDetails) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
}),
changeTextCallback: (data, eventDetails, callback) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
}),
getTextCallback: (callback, eventDetails) => {
if (modeLabelConfig) {
callback(' ');
} else {
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
});
}
},
changeTextCallback: (data, eventDetails, callback) => {
if (modeLabelConfig === undefined) {
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
});
}
},
},
},
{ toolName: toolNames.Bidirectional },
@@ -126,7 +139,7 @@ function initSRToolGroup(extensionManager, toolGroupService) {
toolGroupService.createToolGroupAndAddTools(toolGroupId, tools);
}
function initMPRToolGroup(extensionManager, toolGroupService, commandsManager) {
function initMPRToolGroup(extensionManager, toolGroupService, commandsManager, modeLabelConfig) {
const utilityModule = extensionManager.getModuleEntry(
'@ohif/extension-cornerstone.utilityModule.tools'
);
@@ -154,18 +167,25 @@ function initMPRToolGroup(extensionManager, toolGroupService, commandsManager) {
{
toolName: toolNames.ArrowAnnotate,
configuration: {
getTextCallback: (callback, eventDetails) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
}),
changeTextCallback: (data, eventDetails, callback) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
}),
getTextCallback: (callback, eventDetails) => {
if (modeLabelConfig) {
callback('');
} else {
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
});
}
},
changeTextCallback: (data, eventDetails, callback) => {
if (modeLabelConfig === undefined) {
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
});
}
},
},
},
{ toolName: toolNames.Bidirectional },
@@ -227,10 +247,16 @@ function initVolume3DToolGroup(extensionManager, toolGroupService) {
toolGroupService.createToolGroupAndAddTools('volume3d', tools);
}
function initToolGroups(extensionManager, toolGroupService, commandsManager) {
initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, 'default');
initSRToolGroup(extensionManager, toolGroupService);
initMPRToolGroup(extensionManager, toolGroupService, commandsManager);
function initToolGroups(extensionManager, toolGroupService, commandsManager, modeLabelConfig) {
initDefaultToolGroup(
extensionManager,
toolGroupService,
commandsManager,
'default',
modeLabelConfig
);
initSRToolGroup(extensionManager, toolGroupService, commandsManager);
initMPRToolGroup(extensionManager, toolGroupService, commandsManager, modeLabelConfig);
initVolume3DToolGroup(extensionManager, toolGroupService);
}