fix(SegmentationTools): [Bug] Changes of brush/eraser radius with hotkey do not reflect on segmentation tool (#5535)

This commit is contained in:
Vinícius Alves de Faria Resende authored and GitHub committed 2025-11-05 10:34:41 -05:00
1 parent 0c8ab01d34
commit 29bd87c8c0
27 files changed
+472 -267

No files matched your search

+2 -2
View File
@@ -37,8 +37,8 @@
"@cornerstonejs/codec-libjpeg-turbo-8bit": "1.2.2",
"@cornerstonejs/codec-openjpeg": "1.3.0",
"@cornerstonejs/codec-openjph": "2.4.7",
"@cornerstonejs/core": "4.5.20",
"@cornerstonejs/dicom-image-loader": "4.5.20",
"@cornerstonejs/core": "4.9.0",
"@cornerstonejs/dicom-image-loader": "4.9.0",
"@ohif/ui": "3.12.0-beta.80",
"cornerstone-math": "0.1.9",
"dicom-parser": "1.8.21"
@@ -2,7 +2,7 @@ import { CommandsManager } from '../../classes';
import { ExtensionManager } from '../../extensions';
import { PubSubService } from '../_shared/pubSubServiceInterface';
import type { RunCommand } from '../../types/Command';
import { Button, ButtonProps, EvaluateFunction, EvaluatePublic } from './types';
import { Button, ButtonOptions, ButtonProps, EvaluateFunction, EvaluatePublic } from './types';
const EVENTS = {
TOOL_BAR_MODIFIED: 'event::toolBarService:toolBarModified',
@@ -592,7 +592,7 @@ export default class ToolbarService extends PubSubService {
const { id: buttonId, props: componentProps } = btn;
const createEnhancedOptions = (options, itemId) => {
const createEnhancedOptions = (options: ButtonOptions[], itemId) => {
const optionsToUse = Array.isArray(options) ? options : [options];
const toolProps = this.getButtonProps(itemId);
@@ -833,4 +833,14 @@ export default class ToolbarService extends PubSubService {
return { align: 'start', side: 'bottom' };
}
}
/**
* Retrieves an option by its ID from a button's options array.
* @param button - The button object.
* @param optionId - The ID of the option to retrieve.
* @returns The option with the specified ID.
*/
public getOptionById(button: Button, optionId: string) {
return button.props.options?.find(option => option.id === optionId);
}
}
@@ -40,6 +40,7 @@ export type ButtonOptions = {
max?: number;
step?: number;
value?: number | number[] | string;
values: Array<{ value: string; label: string }>;
commands?: RunCommand;
condition?: (props: Record<string, unknown>) => boolean;
children?: React.ReactNode | (() => React.ReactNode);
@@ -50,6 +51,7 @@ export type ButtonOptions = {
export type ButtonProps = {
id: string;
icon: string;
isActive?: boolean;
label: string;
tooltip?: string;
commands?: RunCommand;