@cornerstonejs/tools 2.14.12 → 2.15.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.
@@ -382,7 +382,7 @@ class PlanarFreehandROITool extends ContourSegmentationBaseTool {
382
382
  }
383
383
  }
384
384
  updateClosedCachedStats({ viewport, points, imageData, metadata, cachedStats, targetId, modalityUnit, canvasCoordinates, calibratedScale, }) {
385
- const { scale, areaUnit, units } = calibratedScale;
385
+ const { scale, areaUnit, unit } = calibratedScale;
386
386
  const { voxelManager } = viewport.getImageData();
387
387
  const canvasPoint = canvasCoordinates[0];
388
388
  const originalWorldPoint = viewport.canvasToWorld(canvasPoint);
@@ -486,7 +486,7 @@ class PlanarFreehandROITool extends ContourSegmentationBaseTool {
486
486
  pointsInShape: pointsInShape,
487
487
  areaUnit,
488
488
  modalityUnit,
489
- unit: units,
489
+ unit,
490
490
  };
491
491
  }
492
492
  updateOpenCachedStats({ targetId, metadata, canvasCoordinates, cachedStats, modalityUnit, calibratedScale, }) {
@@ -21,7 +21,10 @@ function activateDraw(evt, annotation, viewportIdsToRender) {
21
21
  const { viewport } = enabledElement;
22
22
  const contourHoleProcessingEnabled = getMouseModifierKey(evt.detail.event) ===
23
23
  this.configuration.contourHoleAdditionModifierKey;
24
- const { spacing, xDir, yDir } = getSubPixelSpacingAndXYDirections(viewport, this.configuration.subPixelResolution);
24
+ const { spacing, xDir, yDir } = getSubPixelSpacingAndXYDirections(viewport, this.configuration.subPixelResolution) || {};
25
+ if (!spacing || !xDir || !yDir) {
26
+ return;
27
+ }
25
28
  this.drawData = {
26
29
  canvasPoints: [canvasPos],
27
30
  polylineIndex: 0,
@@ -7,6 +7,9 @@ const getSubPixelSpacingAndXYDirections = (viewport, subPixelResolution) => {
7
7
  let yDir;
8
8
  if (viewport instanceof StackViewport) {
9
9
  const imageData = viewport.getImageData();
10
+ if (!imageData) {
11
+ return;
12
+ }
10
13
  xDir = imageData.direction.slice(0, 3);
11
14
  yDir = imageData.direction.slice(3, 6);
12
15
  spacing = imageData.spacing;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/tools",
3
- "version": "2.14.12",
3
+ "version": "2.15.1",
4
4
  "description": "Cornerstone3D Tools",
5
5
  "types": "./dist/esm/index.d.ts",
6
6
  "module": "./dist/esm/index.js",
@@ -104,8 +104,8 @@
104
104
  "canvas": "^2.11.2"
105
105
  },
106
106
  "peerDependencies": {
107
- "@cornerstonejs/core": "^2.14.12",
108
- "@kitware/vtk.js": "32.1.1",
107
+ "@cornerstonejs/core": "^2.15.1",
108
+ "@kitware/vtk.js": "32.9.0",
109
109
  "@types/d3-array": "^3.0.4",
110
110
  "@types/d3-interpolate": "^3.0.1",
111
111
  "d3-array": "^3.2.3",
@@ -123,5 +123,5 @@
123
123
  "type": "individual",
124
124
  "url": "https://ohif.org/donate"
125
125
  },
126
- "gitHead": "3062aecefb4115e44735550afbf9f33996cf8a02"
126
+ "gitHead": "6247f60fdb23abe38b30d606b441176a0aefeab5"
127
127
  }