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

This commit is contained in:
Joe Boccanfuso authored and GitHub committed 2025-09-29 15:56:11 -04:00
1 parent 47164463cc
commit dd86a8eabd
3 files changed
+30 -3

No files matched your search

+10 -2
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);