fix(segmentation): Restored segment label tool in longitudinal mode. (#5443)
This commit is contained in:
parent
47164463cc
commit
dd86a8eabd
@ -1858,13 +1858,21 @@ function commandsModule({
|
||||
}
|
||||
});
|
||||
},
|
||||
toggleSegmentLabel: ({ enabled }) => {
|
||||
toggleSegmentLabel: ({ enabled }: { enabled?: boolean }) => {
|
||||
const toolName = cornerstoneTools.SegmentLabelTool.toolName;
|
||||
const toolGroupIds = toolGroupService.getToolGroupIds();
|
||||
|
||||
const isToolOn = toolGroupIds.some(toolGroupId => {
|
||||
const toolGroup = cornerstoneTools.ToolGroupManager.getToolGroup(toolGroupId);
|
||||
const mode = toolGroup.getToolInstance(toolName)?.mode;
|
||||
return mode === 'Active';
|
||||
});
|
||||
|
||||
const enableTool = enabled !== undefined ? enabled : !isToolOn;
|
||||
|
||||
toolGroupIds.forEach(toolGroupId => {
|
||||
const toolGroup = cornerstoneTools.ToolGroupManager.getToolGroup(toolGroupId);
|
||||
if (enabled) {
|
||||
if (enableTool) {
|
||||
toolGroup.setToolActive(toolName);
|
||||
} else {
|
||||
toolGroup.setToolDisabled(toolName);
|
||||
|
||||
@ -160,7 +160,8 @@ function modeFactory({ modeConfiguration }) {
|
||||
'TagBrowser',
|
||||
'AdvancedMagnify',
|
||||
'UltrasoundDirectionalTool',
|
||||
'WindowLevelRegion',
|
||||
'WindowLevelRegion',
|
||||
'SegmentLabelTool',
|
||||
]);
|
||||
|
||||
customizationService.setCustomizations({
|
||||
|
||||
@ -667,6 +667,24 @@ const toolbarButtons: Button[] = [
|
||||
buttonSection: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'SegmentLabelTool',
|
||||
uiType: 'ohif.toolBoxButton',
|
||||
props: {
|
||||
icon: 'tool-segment-label',
|
||||
label: i18n.t('Buttons:Segment Label Display'),
|
||||
tooltip: i18n.t(
|
||||
'Buttons:Click to show or hide segment labels when hovering with your mouse.'
|
||||
),
|
||||
commands: { commandName: 'toggleSegmentLabel' },
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool.toggle',
|
||||
{
|
||||
name: 'evaluate.cornerstone.hasSegmentation',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
// {
|
||||
// id: 'Undo',
|
||||
// uiType: 'ohif.toolButton',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user