feat: add segment label tool (#5164)

This commit is contained in:
Pedro Köhler authored and GitHub committed 2025-07-09 14:11:54 -04:00
1 parent d19cd6ec7b
commit ac852485cd
15 files changed
+351 -340

No files matched your search

@@ -1728,6 +1728,17 @@ function commandsModule({
}
});
},
toggleSegmentLabel: ({ toggle }) => {
const toolGroupIds = toolGroupService.getToolGroupIds();
toolGroupIds.forEach(toolGroupId => {
const toolGroup = cornerstoneTools.ToolGroupManager.getToolGroup(toolGroupId);
if (toggle) {
toolGroup.setToolActive(cornerstoneTools.SegmentLabelTool.toolName);
} else {
toolGroup.setToolDisabled(cornerstoneTools.SegmentLabelTool.toolName);
}
});
},
toggleUseCenterSegmentIndex: ({ toggle }) => {
let labelmapTools = getLabelmapTools({ toolGroupService });
labelmapTools = labelmapTools.filter(tool => !tool.toolName.includes('Eraser'));
@@ -2331,6 +2342,7 @@ function commandsModule({
hydrateSecondaryDisplaySet: actions.hydrateSecondaryDisplaySet,
getVolumeIdForDisplaySet: actions.getVolumeIdForDisplaySet,
triggerCreateAnnotationMemo: actions.triggerCreateAnnotationMemo,
toggleSegmentLabel: actions.toggleSegmentLabel,
};
return {