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

+6 -2
View File
@@ -44,8 +44,12 @@ function modeFactory({ modeConfiguration }) {
* Lifecycle hooks
*/
onModeEnter: ({ servicesManager, extensionManager, commandsManager }) => {
const { toolbarService, toolGroupService, hangingProtocolService, displaySetService } =
servicesManager.services;
const {
toolbarService,
toolGroupService,
hangingProtocolService,
displaySetService,
} = servicesManager.services;
const utilityModule = extensionManager.getModuleEntry(
'@ohif/extension-cornerstone.utilityModule.tools'
+20 -14
View File
@@ -7,7 +7,7 @@ export const toolGroupIds = {
// MPR: 'mpr',
};
function _initToolGroups(toolNames, Enums, toolGroupService, commandsManager) {
function _initToolGroups(toolNames, Enums, toolGroupService, commandsManager, modeLabelConfig) {
const tools = {
active: [
{
@@ -30,18 +30,24 @@ function _initToolGroups(toolNames, Enums, toolGroupService, commandsManager) {
toolName: toolNames.ArrowAnnotate,
configuration: {
getTextCallback: (callback, eventDetails) => {
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
});
if (modeLabelConfig) {
callback(' ');
} else {
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
});
}
},
changeTextCallback: (data, eventDetails, callback) => {
if (modeLabelConfig === undefined) {
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
});
}
},
changeTextCallback: (data, eventDetails, callback) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
}),
},
},
{ toolName: toolNames.Bidirectional },
@@ -102,8 +108,8 @@ function _initToolGroups(toolNames, Enums, toolGroupService, commandsManager) {
toolGroupService.createToolGroupAndAddTools(toolGroupIds.MIP, mipTools);
}
function initToolGroups(toolNames, Enums, toolGroupService, commandsManager) {
_initToolGroups(toolNames, Enums, toolGroupService, commandsManager);
function initToolGroups(toolNames, Enums, toolGroupService, commandsManager, modeLabelConfig) {
_initToolGroups(toolNames, Enums, toolGroupService, commandsManager, modeLabelConfig);
}
export default initToolGroups;