@cornerstonejs/tools 2.18.7 → 2.18.9

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.
@@ -12,7 +12,6 @@ export default {
12
12
  };
13
13
  previewVoxelManager.forEach(callback);
14
14
  }
15
- const inputImage = await getItkImage(segmentationImageData, 'interpolation');
16
15
  let itkModule;
17
16
  try {
18
17
  itkModule = await peerImport('@itk-wasm/morphological-contour-interpolation');
@@ -21,7 +20,18 @@ export default {
21
20
  }
22
21
  }
23
22
  catch (error) {
24
- console.debug("Warning: '@itk-wasm/morphological-contour-interpolation' module not found. Please install it separately.");
23
+ console.warn("Warning: '@itk-wasm/morphological-contour-interpolation' module not found. Please install it separately.");
24
+ return operationData;
25
+ }
26
+ let inputImage;
27
+ try {
28
+ inputImage = await getItkImage(segmentationImageData, 'interpolation');
29
+ if (!inputImage) {
30
+ throw new Error('Failed to get ITK image');
31
+ }
32
+ }
33
+ catch (error) {
34
+ console.warn('Warning: Failed to get ITK image for interpolation');
25
35
  return operationData;
26
36
  }
27
37
  const outputPromise = itkModule.morphologicalContourInterpolation(inputImage, {
@@ -1,14 +1,15 @@
1
+ import { peerImport } from '@cornerstonejs/core';
1
2
  export default async function getItkImage(imageData, imageName) {
2
3
  let Image, ImageType, IntTypes, FloatTypes, PixelTypes;
3
4
  try {
4
- const itkModule = await import('itk-wasm');
5
+ const itkModule = await peerImport('itk-wasm');
5
6
  if (!itkModule) {
6
7
  throw new Error('Module not found');
7
8
  }
8
9
  ({ Image, ImageType, IntTypes, FloatTypes, PixelTypes } = itkModule);
9
10
  }
10
11
  catch (error) {
11
- console.debug("Warning: 'itk-wasm' module not found. Please install it separately.");
12
+ console.warn("Warning: 'itk-wasm' module not found. Please install it separately.");
12
13
  return null;
13
14
  }
14
15
  const dataTypesMap = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/tools",
3
- "version": "2.18.7",
3
+ "version": "2.18.9",
4
4
  "description": "Cornerstone3D Tools",
5
5
  "types": "./dist/esm/index.d.ts",
6
6
  "module": "./dist/esm/index.js",
@@ -104,7 +104,7 @@
104
104
  "canvas": "^2.11.2"
105
105
  },
106
106
  "peerDependencies": {
107
- "@cornerstonejs/core": "^2.18.7",
107
+ "@cornerstonejs/core": "^2.18.9",
108
108
  "@kitware/vtk.js": "32.9.0",
109
109
  "@types/d3-array": "^3.0.4",
110
110
  "@types/d3-interpolate": "^3.0.1",
@@ -123,5 +123,5 @@
123
123
  "type": "individual",
124
124
  "url": "https://ohif.org/donate"
125
125
  },
126
- "gitHead": "313a569eec20e132ea5f0929e10b34bd5ea63ba2"
126
+ "gitHead": "e3ff43396e9170f4350143ed1f48218c8afb90de"
127
127
  }