@cornerstonejs/ai 5.0.0-beta.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,6 @@ import { getEnabledElementByViewportId } from '@cornerstonejs/core';
|
|
|
2
2
|
import { LabelmapBaseTool } from '@cornerstonejs/tools';
|
|
3
3
|
import ONNXSegmentationController from './ONNXSegmentationController';
|
|
4
4
|
class LabelmapSlicePropagationTool extends LabelmapBaseTool {
|
|
5
|
-
static { this.toolName = 'LabelmapSlicePropagation'; }
|
|
6
5
|
constructor(toolProps = {}, defaultToolProps = {
|
|
7
6
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
8
7
|
configuration: {
|
|
@@ -105,4 +104,5 @@ class LabelmapSlicePropagationTool extends LabelmapBaseTool {
|
|
|
105
104
|
};
|
|
106
105
|
}
|
|
107
106
|
}
|
|
107
|
+
LabelmapSlicePropagationTool.toolName = 'LabelmapSlicePropagation';
|
|
108
108
|
export default LabelmapSlicePropagationTool;
|
|
@@ -2,7 +2,6 @@ import { getEnabledElementByViewportId } from '@cornerstonejs/core';
|
|
|
2
2
|
import { LabelmapBaseTool, ToolGroupManager, annotation, ProbeTool, addTool, } from '@cornerstonejs/tools';
|
|
3
3
|
import ONNXSegmentationController from './ONNXSegmentationController';
|
|
4
4
|
class MarkerLabelmapTool extends LabelmapBaseTool {
|
|
5
|
-
static { this.toolName = 'MarkerLabelmap'; }
|
|
6
5
|
constructor(toolProps = {}, defaultToolProps = {
|
|
7
6
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
8
7
|
configuration: {
|
|
@@ -193,4 +192,5 @@ class MarkerLabelmapTool extends LabelmapBaseTool {
|
|
|
193
192
|
}));
|
|
194
193
|
}
|
|
195
194
|
}
|
|
195
|
+
MarkerLabelmapTool.toolName = 'MarkerLabelmap';
|
|
196
196
|
export default MarkerLabelmapTool;
|
|
@@ -57,54 +57,7 @@ export var Loggers;
|
|
|
57
57
|
Loggers["Encoder"] = "encoder";
|
|
58
58
|
Loggers["Decoder"] = "decoder";
|
|
59
59
|
})(Loggers || (Loggers = {}));
|
|
60
|
-
|
|
61
|
-
static { this.MarkerInclude = 'MarkerInclude'; }
|
|
62
|
-
static { this.MarkerExclude = 'MarkerExclude'; }
|
|
63
|
-
static { this.BoxPrompt = 'BoxPrompt'; }
|
|
64
|
-
static { this.viewportOptions = {
|
|
65
|
-
displayArea: {
|
|
66
|
-
storeAsInitialCamera: true,
|
|
67
|
-
interpolationType: Enums.InterpolationType.NEAREST,
|
|
68
|
-
imageArea: [1, 1],
|
|
69
|
-
imageCanvasPoint: {
|
|
70
|
-
imagePoint: [0.5, 0.5],
|
|
71
|
-
canvasPoint: [0.5, 0.5],
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
background: [0, 0, 0.2],
|
|
75
|
-
}; }
|
|
76
|
-
static { this.MODELS = {
|
|
77
|
-
sam_l: [
|
|
78
|
-
{
|
|
79
|
-
name: 'sam-l-encoder',
|
|
80
|
-
url: '/sam_l/vit_l_encoder.onnx',
|
|
81
|
-
size: 1224,
|
|
82
|
-
key: 'encoder',
|
|
83
|
-
feedType: 'images',
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: 'sam-l-decoder',
|
|
87
|
-
url: '/sam_l/vit_l_decoder.onnx',
|
|
88
|
-
size: 17,
|
|
89
|
-
key: 'decoder',
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
sam_h: [
|
|
93
|
-
{
|
|
94
|
-
name: 'sam-h-encoder',
|
|
95
|
-
url: '/sam_h/vit_h_encoder.onnx',
|
|
96
|
-
size: 18,
|
|
97
|
-
key: 'encoder',
|
|
98
|
-
feedType: 'images',
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: 'sam-h-decoder',
|
|
102
|
-
url: '/sam_h/vit_h_decoder.onnx',
|
|
103
|
-
size: 1,
|
|
104
|
-
key: 'decoder',
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
}; }
|
|
60
|
+
class ONNXSegmentationController {
|
|
108
61
|
constructor(options = {
|
|
109
62
|
listeners: null,
|
|
110
63
|
getPromptAnnotations: null,
|
|
@@ -1012,6 +965,54 @@ export default class ONNXSegmentationController {
|
|
|
1012
965
|
return config;
|
|
1013
966
|
}
|
|
1014
967
|
}
|
|
968
|
+
ONNXSegmentationController.MarkerInclude = 'MarkerInclude';
|
|
969
|
+
ONNXSegmentationController.MarkerExclude = 'MarkerExclude';
|
|
970
|
+
ONNXSegmentationController.BoxPrompt = 'BoxPrompt';
|
|
971
|
+
ONNXSegmentationController.viewportOptions = {
|
|
972
|
+
displayArea: {
|
|
973
|
+
storeAsInitialCamera: true,
|
|
974
|
+
interpolationType: Enums.InterpolationType.NEAREST,
|
|
975
|
+
imageArea: [1, 1],
|
|
976
|
+
imageCanvasPoint: {
|
|
977
|
+
imagePoint: [0.5, 0.5],
|
|
978
|
+
canvasPoint: [0.5, 0.5],
|
|
979
|
+
},
|
|
980
|
+
},
|
|
981
|
+
background: [0, 0, 0.2],
|
|
982
|
+
};
|
|
983
|
+
ONNXSegmentationController.MODELS = {
|
|
984
|
+
sam_l: [
|
|
985
|
+
{
|
|
986
|
+
name: 'sam-l-encoder',
|
|
987
|
+
url: '/sam_l/vit_l_encoder.onnx',
|
|
988
|
+
size: 1224,
|
|
989
|
+
key: 'encoder',
|
|
990
|
+
feedType: 'images',
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
name: 'sam-l-decoder',
|
|
994
|
+
url: '/sam_l/vit_l_decoder.onnx',
|
|
995
|
+
size: 17,
|
|
996
|
+
key: 'decoder',
|
|
997
|
+
},
|
|
998
|
+
],
|
|
999
|
+
sam_h: [
|
|
1000
|
+
{
|
|
1001
|
+
name: 'sam-h-encoder',
|
|
1002
|
+
url: '/sam_h/vit_h_encoder.onnx',
|
|
1003
|
+
size: 18,
|
|
1004
|
+
key: 'encoder',
|
|
1005
|
+
feedType: 'images',
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
name: 'sam-h-decoder',
|
|
1009
|
+
url: '/sam_h/vit_h_decoder.onnx',
|
|
1010
|
+
size: 1,
|
|
1011
|
+
key: 'decoder',
|
|
1012
|
+
},
|
|
1013
|
+
],
|
|
1014
|
+
};
|
|
1015
|
+
export default ONNXSegmentationController;
|
|
1015
1016
|
async function getOrCreateDir(dir, name) {
|
|
1016
1017
|
return ((await findFileEntry(dir, name)) ||
|
|
1017
1018
|
dir.getDirectoryHandle(name, { create: true }));
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.0.0
|
|
1
|
+
export declare const version = "5.0.0";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.0.0
|
|
1
|
+
export const version = '5.0.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/ai",
|
|
3
|
-
"version": "5.0.0
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "AI and ML Interfaces for Cornerstone3D",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
"prebuild": "node ../../scripts/generate-version.js ./",
|
|
29
29
|
"test": "jest --testTimeout 60000",
|
|
30
30
|
"clean": "rm -rf node_modules/.cache/storybook && shx rm -rf dist",
|
|
31
|
-
"clean:deep": "
|
|
32
|
-
"build": "
|
|
33
|
-
"build:esm": "tsc --project ./tsconfig.json",
|
|
31
|
+
"clean:deep": "pnpm run clean && shx rm -rf node_modules",
|
|
32
|
+
"build": "pnpm run build:esm",
|
|
33
|
+
"build:esm": "pnpm run prebuild && tsc --project ./tsconfig.json",
|
|
34
34
|
"build:esm:watch": "tsc --project ./tsconfig.json --watch",
|
|
35
35
|
"dev": "tsc --project ./tsconfig.json --watch",
|
|
36
|
-
"build:all": "
|
|
36
|
+
"build:all": "pnpm run build:esm",
|
|
37
37
|
"start": "tsc --project ./tsconfig.json --watch",
|
|
38
38
|
"format": "prettier --write 'src/**/*.js' 'test/**/*.js'",
|
|
39
39
|
"lint": "oxlint .",
|
|
40
40
|
"api-check": "api-extractor --debug run ",
|
|
41
|
-
"prepublishOnly": "
|
|
41
|
+
"prepublishOnly": "pnpm run clean && pnpm run build"
|
|
42
42
|
},
|
|
43
43
|
"repository": {
|
|
44
44
|
"type": "git",
|
|
@@ -53,16 +53,20 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@babel/runtime-corejs2": "7.26.10",
|
|
55
55
|
"buffer": "6.0.3",
|
|
56
|
-
"dcmjs": "0.
|
|
56
|
+
"dcmjs": "0.50.1",
|
|
57
57
|
"gl-matrix": "3.4.3",
|
|
58
58
|
"lodash.clonedeep": "4.5.0",
|
|
59
59
|
"ndarray": "1.0.19",
|
|
60
60
|
"onnxruntime-common": "1.17.1",
|
|
61
61
|
"onnxruntime-web": "1.17.1"
|
|
62
62
|
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@cornerstonejs/core": "5.0.0",
|
|
65
|
+
"@cornerstonejs/tools": "5.0.0"
|
|
66
|
+
},
|
|
63
67
|
"peerDependencies": {
|
|
64
|
-
"@cornerstonejs/core": "5.0.0
|
|
65
|
-
"@cornerstonejs/tools": "5.0.0
|
|
68
|
+
"@cornerstonejs/core": "5.0.0",
|
|
69
|
+
"@cornerstonejs/tools": "5.0.0"
|
|
66
70
|
},
|
|
67
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "d6f3fba43abcbaaf7468ff534588f6a88720b875"
|
|
68
72
|
}
|