fix(segmentation): Restored segment label tool in longitudinal mode. (#5443)
This commit is contained in:
1 parent
47164463cc
commit
dd86a8eabd
3 files changed
+30
-3
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user