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

+23 -7
View File
@@ -2,6 +2,8 @@ import type { Button } from '@ohif/core/types';
import { ViewportGridService } from '@ohif/core';
import i18n from 'i18next';
import { MIN_SEGMENTATION_DRAWING_RADIUS, MAX_SEGMENTATION_DRAWING_RADIUS } from './constants';
const setToolActiveToolbar = {
commandName: 'setToolActiveToolbar',
commandOptions: {
@@ -651,6 +653,10 @@ const toolbarButtons: Button[] = [
toolNames: ['CircularBrush', 'SphereBrush'],
disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),
},
{
name: 'evaluate.cornerstone.segmentation.synchronizeDrawingRadius',
radiusOptionId: 'brush-radius',
},
{
name: 'evaluate.cornerstone.hasSegmentationOfType',
segmentationRepresentationType: 'Labelmap',
@@ -667,8 +673,9 @@ const toolbarButtons: Button[] = [
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: [
@@ -894,6 +901,10 @@ const toolbarButtons: Button[] = [
name: 'evaluate.cornerstone.segmentation',
toolNames: ['CircularEraser', 'SphereEraser'],
},
{
name: 'evaluate.cornerstone.segmentation.synchronizeDrawingRadius',
radiusOptionId: 'eraser-radius',
},
{
name: 'evaluate.cornerstone.hasSegmentationOfType',
segmentationRepresentationType: 'Labelmap',
@@ -904,8 +915,9 @@ const toolbarButtons: Button[] = [
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: {
@@ -949,6 +961,10 @@ const toolbarButtons: Button[] = [
'ThresholdSphereBrushDynamic',
],
},
{
name: 'evaluate.cornerstone.segmentation.synchronizeDrawingRadius',
radiusOptionId: 'threshold-radius',
},
{
name: 'evaluate.cornerstone.hasSegmentationOfType',
segmentationRepresentationType: 'Labelmap',
@@ -960,14 +976,14 @@ const toolbarButtons: Button[] = [
segmentationRepresentationType: 'Labelmap',
},
},
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: {