feat(segmentation): Enhance Segmentation with New AI and Once Click Tools (#4910)

This commit is contained in:
Alireza authored and GitHub committed 2025-04-01 14:19:03 -04:00
1 parent 908482d2e0
commit c75a3f3af5
29 files changed
+846 -556

No files matched your search

+4
View File
@@ -100,6 +100,10 @@ module.exports = (env, argv) => {
ignore: ['**/config/**', '**/html-templates/**', '.DS_Store'],
},
},
{
from: '../../../node_modules/onnxruntime-web/dist',
to: `${DIST_DIR}/ort`,
},
// Short term solution to make sure GCloud config is available in output
// for our docker implementation
{
+1 -1
View File
@@ -54,7 +54,7 @@
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2",
"@cornerstonejs/codec-openjpeg": "^1.2.4",
"@cornerstonejs/codec-openjph": "^2.4.5",
"@cornerstonejs/dicom-image-loader": "^3.7.17",
"@cornerstonejs/dicom-image-loader": "^3.8.2",
"@emotion/serialize": "^1.1.3",
"@ohif/core": "3.10.0-beta.143",
"@ohif/extension-cornerstone": "3.10.0-beta.143",
+1 -1
View File
@@ -37,7 +37,7 @@
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2",
"@cornerstonejs/codec-openjpeg": "^1.2.4",
"@cornerstonejs/codec-openjph": "^2.4.5",
"@cornerstonejs/dicom-image-loader": "^3.7.17",
"@cornerstonejs/dicom-image-loader": "^3.8.2",
"@ohif/ui": "3.10.0-beta.143",
"cornerstone-math": "0.1.9",
"dicom-parser": "^1.8.21"
+18 -13
View File
@@ -177,19 +177,24 @@ const bindings = [
label: 'Reject Preview',
keys: ['esc'],
},
// after we have the ui for undo/redo, we can add these back in
// {
// commandName: 'undo',
// label: 'Undo',
// keys: ['ctrl+z'],
// isEditable: true,
// },
// {
// commandName: 'redo',
// label: 'Redo',
// keys: ['ctrl+y'],
// isEditable: true,
// },
{
commandName: 'undo',
label: 'Undo',
keys: ['ctrl+z'],
isEditable: true,
},
{
commandName: 'redo',
label: 'Redo',
keys: ['ctrl+y'],
isEditable: true,
},
{
commandName: 'interpolateScrollForMarkerLabelmap',
label: 'Interpolate Scroll',
keys: ['n'],
isEditable: true,
},
];
export default bindings;
@@ -132,6 +132,7 @@ import {
ToolSegmentAnything,
ToolContract,
ToolExpand,
ToolClickSegment,
} from './Sources/Tools';
import ActionNewDialog from './Sources/ActionNewDialog';
import NotificationInfo from './Sources/NotificationInfo';
@@ -597,9 +598,10 @@ export const Icons = {
'checkbox-active': (props: IconProps) => CheckBoxChecked(props),
'icon-tool-eraser': (props: IconProps) => ToolEraser(props),
'icon-tool-brush': (props: IconProps) => ToolBrush(props),
'icon-tool-labelmap-assist': (props: IconProps) => ToolLabelmapAssist(props),
'icon-tool-segment-anything': (props: IconProps) => ToolSegmentAnything(props),
'icon-labelmap-slice-propagation': (props: IconProps) => ToolLabelmapAssist(props),
'icon-marker-labelmap': (props: IconProps) => ToolSegmentAnything(props),
'icon-tool-threshold': (props: IconProps) => ToolThreshold(props),
'icon-tool-click-segment': (props: IconProps) => ToolClickSegment(props),
'icon-tool-pet-segment': (props: IconProps) => ToolPETSegment(props),
'icon-tool-interpolation': (props: IconProps) => ToolInterpolation(props),
'icon-tool-bidirectional-segment': (props: IconProps) => ToolBidirectionalSegment(props),
@@ -97,6 +97,27 @@ export const ToolLayout = (props: IconProps) => (
</svg>
);
export const ToolClickSegment = (props: IconProps) => (
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
{...props}
>
<path
d="M18.7855 10.7063C19.0677 8.68223 18.754 6.39013 17.3334 4.86666C15.7881 3.20953 13.3171 2.78346 11.098 3.09398C9.51269 3.31581 7.93737 4.03721 6.63198 5.25454C5.24718 6.54592 4.39791 8.17926 4.11016 9.84527C3.74697 11.9481 4.27832 14.1031 5.75643 15.6882C7.30168 17.3453 9.54033 18.0136 11.7594 17.7031"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
/>
<path
d="M15.0003 18.562L15.0714 12.3038C15.0714 12.1629 15.1293 12.0689 15.2452 12.0219C15.3663 11.9749 15.4769 12.0036 15.577 12.108L19.8981 16.502C20.0034 16.6169 20.0271 16.7318 19.9692 16.8467C19.9165 16.9615 19.8164 17.0216 19.669 17.0268L17.9627 17.0973L19.353 20.2929C19.3899 20.366 19.3951 20.4391 19.3688 20.5123C19.3477 20.5854 19.303 20.6376 19.2345 20.6689L18.4445 20.9822C18.3708 21.0083 18.2997 21.0057 18.2312 20.9744C18.1628 20.943 18.1128 20.8908 18.0812 20.8177L16.754 17.5673L15.5533 18.7656C15.4532 18.8648 15.3347 18.8935 15.1978 18.8518C15.0609 18.81 14.995 18.7134 15.0003 18.562Z"
fill="currentColor"
/>
</svg>
);
export const ToolLength = (props: IconProps) => (
<svg
width="28px"
@@ -2,12 +2,14 @@ import React from 'react';
import RowInputRange from './RowInputRange';
import RowSegmentedControl from './RowSegmentedControl';
import RowDoubleRange from './RowDoubleRange';
import { Button } from '../Button';
const SETTING_TYPES = {
RANGE: 'range',
RADIO: 'radio',
CUSTOM: 'custom',
DOUBLE_RANGE: 'double-range',
BUTTON: 'button',
};
function ToolSettings({ options }) {
@@ -35,6 +37,8 @@ function ToolSettings({ options }) {
return renderDoubleRangeSetting(option);
case SETTING_TYPES.CUSTOM:
return renderCustomSetting(option);
case SETTING_TYPES.BUTTON:
return renderButtonSetting(option);
default:
return null;
}
@@ -97,4 +101,16 @@ const renderCustomSetting = option => {
);
};
const renderButtonSetting = option => {
return (
<Button
className="bg-primary"
key={option.id}
onClick={() => option.onChange()}
>
{option.name}
</Button>
);
};
export default ToolSettings;