@cornerstonejs/tools 2.2.15 → 2.2.17

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.
@@ -20,7 +20,7 @@ function internalAddSegmentationRepresentation(viewportId, representationInput)
20
20
  function getColorLUTIndex(config) {
21
21
  const { colorLUTOrIndex } = config || {};
22
22
  if (colorLUTOrIndex === undefined) {
23
- const index = addColorLUT(CORNERSTONE_COLOR_LUT);
23
+ const index = addColorLUT(JSON.parse(JSON.stringify(CORNERSTONE_COLOR_LUT)));
24
24
  return index;
25
25
  }
26
26
  if (typeof colorLUTOrIndex === 'number') {
@@ -31,7 +31,7 @@ function getColorLUTIndex(config) {
31
31
  const index = addColorLUT(colorLUTOrIndex);
32
32
  return index;
33
33
  }
34
- const index = addColorLUT(CORNERSTONE_COLOR_LUT);
34
+ const index = addColorLUT(JSON.parse(JSON.stringify(CORNERSTONE_COLOR_LUT)));
35
35
  return index;
36
36
  }
37
37
  export { internalAddSegmentationRepresentation };
@@ -39,7 +39,7 @@ class ScaleOverlayTool extends AnnotationDisplayTool {
39
39
  }
40
40
  const { viewUp, viewPlaneNormal } = viewport.getCamera();
41
41
  const viewportCanvasCornersInWorld = csUtils.getViewportImageCornersInWorld(viewport);
42
- let annotation = this.editData.annotation;
42
+ let annotation = this.editData?.annotation;
43
43
  const annotations = getAnnotations(this.getToolName(), viewport.element);
44
44
  if (annotations.length) {
45
45
  annotation = annotations.filter((thisAnnotation) => thisAnnotation.data.viewportId == viewport.id)[0];
@@ -67,7 +67,7 @@ class ScaleOverlayTool extends AnnotationDisplayTool {
67
67
  annotation = newAnnotation;
68
68
  }
69
69
  });
70
- if (this.editData.annotation &&
70
+ if (this.editData?.annotation &&
71
71
  this.editData.annotation.data.viewportId == viewport.id) {
72
72
  this.editData.annotation.data.handles.points =
73
73
  viewportCanvasCornersInWorld;
@@ -283,7 +283,7 @@ class ScaleOverlayTool extends AnnotationDisplayTool {
283
283
  };
284
284
  }
285
285
  renderAnnotation(enabledElement, svgDrawingHelper) {
286
- if (!this.editData.viewport) {
286
+ if (!this.editData || !this.editData.viewport) {
287
287
  return;
288
288
  }
289
289
  const location = this.configuration.scaleLocation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/tools",
3
- "version": "2.2.15",
3
+ "version": "2.2.17",
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.2.15",
107
+ "@cornerstonejs/core": "^2.2.17",
108
108
  "@kitware/vtk.js": "32.1.1",
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": "8ced02a99bf153c9d268449db47f5abfe4a557b3"
126
+ "gitHead": "5652ca06035e63a5d19be9cfe711afc38c67e6b2"
127
127
  }