feat(segmentation): replace One Click Segment with ClickSegmentTool (#6135)

* feat(segmentation): replace One Click Segment with ClickSegmentTool

Wire OHIF to ClickSegmentTool from Cornerstone3D (#2780), rename the
toolbox button to Click to Segment, and enable it only on PET (PT)
viewports.

* chore(deps): bump @cornerstonejs packages to 5.4.13

Pick up ClickSegmentTool from the published Cornerstone3D release so
OHIF installs the tool from npm without a local CS3D link.
This commit is contained in:
Alireza authored and GitHub committed 2026-07-10 17:05:26 -04:00
1 parent 6d8a275171
commit 9c76afa075
20 files changed
+165 -145

No files matched your search

@@ -41,8 +41,8 @@
},
"dependencies": {
"@babel/runtime": "7.29.7",
"@cornerstonejs/adapters": "5.4.12",
"@cornerstonejs/core": "5.4.12",
"@cornerstonejs/adapters": "5.4.13",
"@cornerstonejs/core": "5.4.13",
"@kitware/vtk.js": "35.5.3"
},
"devDependencies": {
@@ -41,8 +41,8 @@
},
"dependencies": {
"@babel/runtime": "7.29.7",
"@cornerstonejs/adapters": "5.4.12",
"@cornerstonejs/core": "5.4.12",
"@cornerstonejs/adapters": "5.4.13",
"@cornerstonejs/core": "5.4.13",
"@kitware/vtk.js": "35.5.3"
},
"devDependencies": {
+3 -3
View File
@@ -40,9 +40,9 @@
},
"dependencies": {
"@babel/runtime": "7.29.7",
"@cornerstonejs/adapters": "5.4.12",
"@cornerstonejs/core": "5.4.12",
"@cornerstonejs/tools": "5.4.12",
"@cornerstonejs/adapters": "5.4.13",
"@cornerstonejs/core": "5.4.13",
"@cornerstonejs/tools": "5.4.13",
"classnames": "2.5.1"
},
"devDependencies": {
@@ -45,8 +45,8 @@
},
"dependencies": {
"@babel/runtime": "7.29.7",
"@cornerstonejs/core": "5.4.12",
"@cornerstonejs/tools": "5.4.12",
"@cornerstonejs/core": "5.4.13",
"@cornerstonejs/tools": "5.4.13",
"classnames": "2.5.1"
},
"devDependencies": {
+8 -8
View File
@@ -38,7 +38,7 @@
"@cornerstonejs/codec-libjpeg-turbo-8bit": "1.2.2",
"@cornerstonejs/codec-openjpeg": "1.3.0",
"@cornerstonejs/codec-openjph": "2.4.7",
"@cornerstonejs/dicom-image-loader": "5.4.12",
"@cornerstonejs/dicom-image-loader": "5.4.13",
"@ohif/core": "workspace:*",
"@ohif/extension-default": "workspace:*",
"@ohif/ui": "workspace:*",
@@ -52,13 +52,13 @@
},
"dependencies": {
"@babel/runtime": "7.29.7",
"@cornerstonejs/adapters": "5.4.12",
"@cornerstonejs/ai": "5.4.12",
"@cornerstonejs/core": "5.4.12",
"@cornerstonejs/labelmap-interpolation": "5.4.12",
"@cornerstonejs/metadata": "5.4.12",
"@cornerstonejs/polymorphic-segmentation": "5.4.12",
"@cornerstonejs/tools": "5.4.12",
"@cornerstonejs/adapters": "5.4.13",
"@cornerstonejs/ai": "5.4.13",
"@cornerstonejs/core": "5.4.13",
"@cornerstonejs/labelmap-interpolation": "5.4.13",
"@cornerstonejs/metadata": "5.4.13",
"@cornerstonejs/polymorphic-segmentation": "5.4.13",
"@cornerstonejs/tools": "5.4.13",
"@icr/polyseg-wasm": "0.4.0",
"@itk-wasm/morphological-contour-interpolation": "1.1.0",
"@kitware/vtk.js": "35.5.3",
@@ -421,18 +421,23 @@ const segmentationToolbarButtons: Button[] = [
},
},
{
id: 'RegionSegmentPlus',
id: 'ClickSegment',
uiType: 'ohif.toolBoxButton',
props: {
icon: 'icon-tool-click-segment',
label: i18n.t('Buttons:One Click Segment'),
label: i18n.t('Buttons:Click to Segment'),
tooltip: i18n.t(
'Buttons:Detects segmentable regions with one click. Hover for visual feedback—click when a plus sign appears to auto-segment the lesion.'
'Buttons:PET only. Click-to-segment lesions with no configuration. Hover for visual feedback—click when a plus sign appears to segment the lesion.'
),
evaluate: [
{
name: 'evaluate.modality.supported',
supportedModalities: ['PT'],
disabledText: i18n.t('Buttons:Tool not available for this modality'),
},
{
name: 'evaluate.cornerstone.segmentation',
toolNames: ['RegionSegmentPlus'],
toolNames: ['ClickSegment'],
disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),
},
{
@@ -868,7 +873,7 @@ export const segmentationToolboxSections: Record<string, string[]> = {
'LabelmapSlicePropagation',
'BrushTools',
'MarkerLabelmap',
'RegionSegmentPlus',
'ClickSegment',
'Shapes',
'LabelMapEditWithContour',
],
@@ -148,7 +148,7 @@ function getToolGroupToolsCustomization({ commandsManager }) {
...brushInstances,
{ toolName: toolNames.LabelmapSlicePropagation },
{ toolName: toolNames.MarkerLabelmap },
{ toolName: toolNames.RegionSegmentPlus },
{ toolName: toolNames.ClickSegment },
{ toolName: toolNames.LabelMapEditWithContourTool },
{ toolName: toolNames.SegmentSelect },
{ toolName: toolNames.CircleScissors },
@@ -40,7 +40,7 @@ import {
OrientationMarkerTool,
WindowLevelRegionTool,
SegmentSelectTool,
RegionSegmentPlusTool,
ClickSegmentTool,
SegmentLabelTool,
LivewireContourSegmentationTool,
SculptorTool,
@@ -114,7 +114,7 @@ export default function initCornerstoneTools(configuration = {}) {
addTool(SegmentLabelTool);
addTool(LabelmapSlicePropagationTool);
addTool(MarkerLabelmapTool);
addTool(RegionSegmentPlusTool);
addTool(ClickSegmentTool);
addTool(LivewireContourSegmentationTool);
addTool(SculptorTool);
addTool(SplineContourSegmentationTool);
@@ -178,7 +178,7 @@ const toolNames = {
SegmentLabel: SegmentLabelTool.toolName,
LabelmapSlicePropagation: LabelmapSlicePropagationTool.toolName,
MarkerLabelmap: MarkerLabelmapTool.toolName,
RegionSegmentPlus: RegionSegmentPlusTool.toolName,
ClickSegment: ClickSegmentTool.toolName,
LivewireContourSegmentation: LivewireContourSegmentationTool.toolName,
SculptorTool: SculptorTool.toolName,
SplineContourSegmentation: SplineContourSegmentationTool.toolName,
+2 -2
View File
@@ -27,8 +27,8 @@
"start": "pnpm run dev"
},
"peerDependencies": {
"@cornerstonejs/core": "5.4.12",
"@cornerstonejs/tools": "5.4.12",
"@cornerstonejs/core": "5.4.13",
"@cornerstonejs/tools": "5.4.13",
"@ohif/core": "workspace:*",
"@ohif/extension-cornerstone-dicom-sr": "workspace:*",
"@ohif/extension-default": "workspace:*",
+2 -2
View File
@@ -36,8 +36,8 @@
},
"dependencies": {
"@babel/runtime": "7.29.7",
"@cornerstonejs/core": "5.4.12",
"@cornerstonejs/tools": "5.4.12",
"@cornerstonejs/core": "5.4.13",
"@cornerstonejs/tools": "5.4.13",
"@ohif/core": "workspace:*",
"@ohif/extension-cornerstone": "workspace:*",
"@ohif/extension-default": "workspace:*",