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

+42 -19
View File
@@ -1,6 +1,8 @@
import { toolGroupIds } from './initToolGroups';
import i18n from 'i18next';
import { MIN_SEGMENTATION_DRAWING_RADIUS, MAX_SEGMENTATION_DRAWING_RADIUS } from './constants';
const setToolActiveToolbar = {
commandName: 'setToolActiveToolbar',
commandOptions: {
@@ -205,18 +207,25 @@ const toolbarButtons = [
props: {
icon: 'icon-tool-brush',
label: i18n.t('Buttons:Brush'),
evaluate: {
name: 'evaluate.cornerstone.segmentation',
toolNames: ['CircularBrush', 'SphereBrush'],
disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),
},
evaluate: [
{
name: 'evaluate.cornerstone.segmentation',
toolNames: ['CircularBrush', 'SphereBrush'],
disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),
},
{
name: 'evaluate.cornerstone.segmentation.synchronizeDrawingRadius',
radiusOptionId: 'brush-radius',
},
],
options: [
{
name: 'Radius (mm)',
id: 'brush-radius',
type: 'range',
min: 0.5,
max: 99.5,
explicitRunOnly: true,
min: MIN_SEGMENTATION_DRAWING_RADIUS,
max: MAX_SEGMENTATION_DRAWING_RADIUS,
step: 0.5,
value: 25,
commands: {
@@ -244,17 +253,24 @@ const toolbarButtons = [
props: {
icon: 'icon-tool-eraser',
label: i18n.t('Buttons:Eraser'),
evaluate: {
name: 'evaluate.cornerstone.segmentation',
toolNames: ['CircularEraser', 'SphereEraser'],
},
evaluate: [
{
name: 'evaluate.cornerstone.segmentation',
toolNames: ['CircularEraser', 'SphereEraser'],
},
{
name: 'evaluate.cornerstone.segmentation.synchronizeDrawingRadius',
radiusOptionId: 'eraser-radius',
},
],
options: [
{
name: 'Radius (mm)',
id: 'eraser-radius',
type: 'range',
min: 0.5,
max: 99.5,
explicitRunOnly: true,
min: MIN_SEGMENTATION_DRAWING_RADIUS,
max: MAX_SEGMENTATION_DRAWING_RADIUS,
step: 0.5,
value: 25,
commands: {
@@ -282,17 +298,24 @@ const toolbarButtons = [
props: {
icon: 'icon-tool-threshold',
label: i18n.t('Buttons:Threshold Tool'),
evaluate: {
name: 'evaluate.cornerstone.segmentation',
toolNames: ['ThresholdCircularBrush', 'ThresholdSphereBrush'],
},
evaluate: [
{
name: 'evaluate.cornerstone.segmentation',
toolNames: ['ThresholdCircularBrush', 'ThresholdSphereBrush'],
},
{
name: 'evaluate.cornerstone.segmentation.synchronizeDrawingRadius',
radiusOptionId: 'threshold-radius',
},
],
options: [
{
name: 'Radius (mm)',
id: 'threshold-radius',
type: 'range',
min: 0.5,
max: 99.5,
explicitRunOnly: true,
min: MIN_SEGMENTATION_DRAWING_RADIUS,
max: MAX_SEGMENTATION_DRAWING_RADIUS,
step: 0.5,
value: 25,
commands: {