fix(segmentation): Restored segment label tool in longitudinal mode. (#5443)

This commit is contained in:
Joe Boccanfuso 2025-09-29 15:56:11 -04:00 committed by GitHub
parent 47164463cc
commit dd86a8eabd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 30 additions and 3 deletions

View File

@ -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);

View File

@ -160,7 +160,8 @@ function modeFactory({ modeConfiguration }) {
'TagBrowser',
'AdvancedMagnify',
'UltrasoundDirectionalTool',
'WindowLevelRegion',
'WindowLevelRegion',
'SegmentLabelTool',
]);
customizationService.setCustomizations({

View File

@ -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',