@cornerstonejs/ai 4.0.0-beta.2 → 4.0.0-beta.4

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Open Health Imaging Foundation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -23,6 +23,7 @@ declare class MarkerLabelmapTool extends LabelmapBaseTool {
23
23
  searchBreadth: number;
24
24
  };
25
25
  });
26
+ shouldResolvePreviewRequests(): boolean;
26
27
  _init: () => Promise<void>;
27
28
  _getToolGroupId: () => import("packages/tools/dist/esm/types").IToolGroup;
28
29
  _addToolInstances: () => void;
@@ -1,5 +1,5 @@
1
1
  import { getEnabledElementByViewportId } from '@cornerstonejs/core';
2
- import { LabelmapBaseTool, ToolGroupManager, Enums, annotation, ProbeTool, RectangleROITool, addTool, } from '@cornerstonejs/tools';
2
+ import { LabelmapBaseTool, ToolGroupManager, annotation, ProbeTool, addTool, } from '@cornerstonejs/tools';
3
3
  import ONNXSegmentationController from './ONNXSegmentationController';
4
4
  class MarkerLabelmapTool extends LabelmapBaseTool {
5
5
  static { this.toolName = 'MarkerLabelmap'; }
@@ -172,5 +172,24 @@ class MarkerLabelmapTool extends LabelmapBaseTool {
172
172
  this.segmentAI.rejectPreview(enabledElement.viewport.element);
173
173
  };
174
174
  }
175
+ shouldResolvePreviewRequests() {
176
+ const MARKER_TOOLS = [
177
+ ONNXSegmentationController.MarkerInclude,
178
+ ONNXSegmentationController.MarkerExclude,
179
+ ONNXSegmentationController.BoxPrompt,
180
+ ];
181
+ const toolGroup = this._getToolGroupId();
182
+ if (!toolGroup) {
183
+ console.debug(`Tool group not found for tool: ${MarkerLabelmapTool.toolName}`);
184
+ return false;
185
+ }
186
+ return (this.hasPreviewData() &&
187
+ MARKER_TOOLS.some((markerToolName) => {
188
+ if (toolGroup.hasTool(markerToolName)) {
189
+ const instance = toolGroup.getToolInstance(markerToolName);
190
+ return instance.mode === 'Active' || instance.mode === 'Enabled';
191
+ }
192
+ }));
193
+ }
175
194
  }
176
195
  export default MarkerLabelmapTool;
@@ -551,7 +551,8 @@ export default class ONNXSegmentationController {
551
551
  renderArguments.viewReference = viewRef;
552
552
  renderArguments.imageId = null;
553
553
  }
554
- imageSession.canvasPosition = await utilities.loadImageToCanvas(renderArguments);
554
+ imageSession.canvasPosition =
555
+ await utilities.loadImageToCanvas(renderArguments);
555
556
  canvas.style.width = size;
556
557
  canvas.style.height = size;
557
558
  if (isCurrent) {
@@ -1 +1 @@
1
- export declare const version = "3.26.2";
1
+ export declare const version = "4.0.0-beta.4";
@@ -1 +1 @@
1
- export const version = '3.26.2';
1
+ export const version = '4.0.0-beta.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/ai",
3
- "version": "4.0.0-beta.2",
3
+ "version": "4.0.0-beta.4",
4
4
  "description": "AI and ML Interfaces for Cornerstone3D",
5
5
  "files": [
6
6
  "dist"
@@ -36,8 +36,7 @@
36
36
  "build:all": "yarn run build:esm",
37
37
  "start": "tsc --project ./tsconfig.json --watch",
38
38
  "format": "prettier --write 'src/**/*.js' 'test/**/*.js'",
39
- "lint": "eslint --fix .",
40
- "format-check": "npx eslint ./src --quiet",
39
+ "lint": "oxlint .",
41
40
  "api-check": "api-extractor --debug run ",
42
41
  "prepublishOnly": "yarn clean && yarn build"
43
42
  },
@@ -54,7 +53,7 @@
54
53
  "dependencies": {
55
54
  "@babel/runtime-corejs2": "^7.17.8",
56
55
  "buffer": "^6.0.3",
57
- "dcmjs": "^0.42.0",
56
+ "dcmjs": "^0.43.1",
58
57
  "gl-matrix": "^3.4.3",
59
58
  "lodash.clonedeep": "^4.5.0",
60
59
  "ndarray": "^1.0.19",
@@ -62,7 +61,8 @@
62
61
  "onnxruntime-web": "1.17.1"
63
62
  },
64
63
  "peerDependencies": {
65
- "@cornerstonejs/core": "^3.26.2",
66
- "@cornerstonejs/tools": "^3.26.2"
67
- }
64
+ "@cornerstonejs/core": "^4.0.0-beta.4",
65
+ "@cornerstonejs/tools": "^4.0.0-beta.4"
66
+ },
67
+ "gitHead": "bd2215216a08cc0c953c6523b16892b3aee6f9be"
68
68
  }