feat: improve segment label (#5217)
Co-authored-by: Joe Boccanfuso <joe.boccanfuso@radicalimaging.com>
This commit is contained in:
1 parent
dd896fea25
commit
271b84f78f
22 files changed
+163
-44
No files matched your search
@@ -122,6 +122,7 @@ function modeFactory({ modeConfiguration }) {
|
||||
'LabelmapSlicePropagation',
|
||||
'InterpolateLabelmap',
|
||||
'SegmentBidirectional',
|
||||
'SegmentLabelTool',
|
||||
]);
|
||||
toolbarService.updateSection('SegmentationTools', [
|
||||
'BrushTools',
|
||||
|
||||
@@ -10,9 +10,10 @@ const colorsByOrientation = {
|
||||
coronal: 'rgb(0, 200, 0)',
|
||||
};
|
||||
|
||||
function createTools(utilityModule) {
|
||||
function createTools({ utilityModule, commandsManager }) {
|
||||
const { toolNames, Enums } = utilityModule.exports;
|
||||
return {
|
||||
|
||||
const tools = {
|
||||
active: [
|
||||
{ toolName: toolNames.WindowLevel, bindings: [{ mouseButton: Enums.MouseBindings.Primary }] },
|
||||
{ toolName: toolNames.Pan, bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }] },
|
||||
@@ -114,24 +115,19 @@ function createTools(utilityModule) {
|
||||
|
||||
{ toolName: toolNames.UltrasoundDirectional },
|
||||
],
|
||||
disabled: [
|
||||
{ toolName: toolNames.ReferenceLines },
|
||||
{ toolName: toolNames.AdvancedMagnify },
|
||||
{
|
||||
toolName: toolNames.SegmentLabel,
|
||||
configuration: {
|
||||
hoverTimeout: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
disabled: [{ toolName: toolNames.ReferenceLines }, { toolName: toolNames.AdvancedMagnify }],
|
||||
};
|
||||
|
||||
const updatedTools = commandsManager.run('initializeSegmentLabelTool', { tools });
|
||||
|
||||
return updatedTools;
|
||||
}
|
||||
|
||||
function initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, toolGroupId) {
|
||||
const utilityModule = extensionManager.getModuleEntry(
|
||||
'@ohif/extension-cornerstone.utilityModule.tools'
|
||||
);
|
||||
const tools = createTools(utilityModule);
|
||||
const tools = createTools({ commandsManager, utilityModule });
|
||||
toolGroupService.createToolGroupAndAddTools(toolGroupId, tools);
|
||||
}
|
||||
|
||||
@@ -141,7 +137,7 @@ function initMPRToolGroup(extensionManager, toolGroupService, commandsManager) {
|
||||
);
|
||||
const servicesManager = extensionManager._servicesManager;
|
||||
const { cornerstoneViewportService } = servicesManager.services;
|
||||
const tools = createTools(utilityModule);
|
||||
const tools = createTools({ commandsManager, utilityModule });
|
||||
tools.disabled.push(
|
||||
{
|
||||
toolName: utilityModule.exports.toolNames.Crosshairs,
|
||||
|
||||
@@ -739,6 +739,22 @@ const toolbarButtons: Button[] = [
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'SegmentLabelTool',
|
||||
uiType: 'ohif.toolBoxButton',
|
||||
props: {
|
||||
icon: 'tool-segment-label',
|
||||
label: 'Segment Label Display',
|
||||
tooltip: 'Click to show or hide segment labels when hovering with your mouse.',
|
||||
commands: { commandName: 'toggleSegmentLabel' },
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool.toggle',
|
||||
{
|
||||
name: 'evaluate.cornerstone.hasSegmentation',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export default toolbarButtons;
|
||||
Reference in new issue
Block a user