@cornerstonejs/polymorphic-segmentation 3.11.0 → 3.11.1

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.
@@ -3,8 +3,9 @@ import { computeLabelmapData } from './Labelmap/labelmapComputationStrategies';
3
3
  import { computeSurfaceData } from './Surface/surfaceComputationStrategies';
4
4
  import { canComputeRequestedRepresentation } from './canComputeRequestedRepresentation';
5
5
  import { updateSurfaceData } from './Surface/updateSurfaceData';
6
+ import { type PolySegInitOptions } from './registerPolySegWorker';
6
7
  import { clipAndCacheSurfacesForViewport } from './utilities/clipAndCacheSurfacesForViewport';
7
8
  import { extractContourData } from './Contour/utils/extractContourData';
8
9
  import { createAndAddContourSegmentationsFromClippedSurfaces } from './Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces';
9
- declare function init(): void;
10
+ declare function init(options?: PolySegInitOptions): void;
10
11
  export { canComputeRequestedRepresentation, computeContourData, computeLabelmapData, computeSurfaceData, updateSurfaceData, init, clipAndCacheSurfacesForViewport, extractContourData, createAndAddContourSegmentationsFromClippedSurfaces, };
package/dist/esm/index.js CHANGED
@@ -3,11 +3,11 @@ import { computeLabelmapData } from './Labelmap/labelmapComputationStrategies';
3
3
  import { computeSurfaceData } from './Surface/surfaceComputationStrategies';
4
4
  import { canComputeRequestedRepresentation } from './canComputeRequestedRepresentation';
5
5
  import { updateSurfaceData } from './Surface/updateSurfaceData';
6
- import { registerPolySegWorker } from './registerPolySegWorker';
6
+ import { registerPolySegWorker, } from './registerPolySegWorker';
7
7
  import { clipAndCacheSurfacesForViewport } from './utilities/clipAndCacheSurfacesForViewport';
8
8
  import { extractContourData } from './Contour/utils/extractContourData';
9
9
  import { createAndAddContourSegmentationsFromClippedSurfaces } from './Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces';
10
- function init() {
11
- registerPolySegWorker();
10
+ function init(options) {
11
+ registerPolySegWorker(options);
12
12
  }
13
13
  export { canComputeRequestedRepresentation, computeContourData, computeLabelmapData, computeSurfaceData, updateSurfaceData, init, clipAndCacheSurfacesForViewport, extractContourData, createAndAddContourSegmentationsFromClippedSurfaces, };
@@ -1 +1,9 @@
1
- export declare function registerPolySegWorker(): void;
1
+ export type PolySegInitOptions = {
2
+ maxWorkerInstances?: number;
3
+ overwrite?: boolean;
4
+ autoTerminateOnIdle?: {
5
+ enabled?: boolean;
6
+ idleTimeThreshold?: number;
7
+ };
8
+ };
9
+ export declare function registerPolySegWorker(userOptions?: PolySegInitOptions): void;
@@ -1,6 +1,6 @@
1
- import { getWebWorkerManager } from '@cornerstonejs/core';
1
+ import { getWebWorkerManager, utilities } from '@cornerstonejs/core';
2
2
  let registered = false;
3
- export function registerPolySegWorker() {
3
+ export function registerPolySegWorker(userOptions) {
4
4
  if (registered) {
5
5
  return;
6
6
  }
@@ -12,12 +12,13 @@ export function registerPolySegWorker() {
12
12
  });
13
13
  };
14
14
  const workerManager = getWebWorkerManager();
15
- const options = {
15
+ const defaultOptions = {
16
16
  maxWorkerInstances: 1,
17
17
  autoTerminateOnIdle: {
18
18
  enabled: true,
19
19
  idleTimeThreshold: 2000,
20
20
  },
21
21
  };
22
+ const options = utilities.deepMerge(defaultOptions, userOptions);
22
23
  workerManager.registerWorker('polySeg', workerFn, options);
23
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/polymorphic-segmentation",
3
- "version": "3.11.0",
3
+ "version": "3.11.1",
4
4
  "description": "Polymorphic Segmentation utility for Cornerstone3D",
5
5
  "files": [
6
6
  "dist"
@@ -48,9 +48,9 @@
48
48
  "@icr/polyseg-wasm": "0.4.0"
49
49
  },
50
50
  "peerDependencies": {
51
- "@cornerstonejs/core": "^3.11.0",
52
- "@cornerstonejs/tools": "^3.11.0",
51
+ "@cornerstonejs/core": "^3.11.1",
52
+ "@cornerstonejs/tools": "^3.11.1",
53
53
  "@kitware/vtk.js": "32.12.1"
54
54
  },
55
- "gitHead": "e051da49a8fb4e7559861e9d3de08fdeb108c53b"
55
+ "gitHead": "9e71e94884bd1c8734911b98ac67a5676fcaaecb"
56
56
  }