@cornerstonejs/tools 1.83.1 → 1.83.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/tools",
3
- "version": "1.83.1",
3
+ "version": "1.83.3",
4
4
  "description": "Cornerstone3D Tools",
5
5
  "main": "src/index.ts",
6
6
  "types": "dist/types/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js"
30
30
  },
31
31
  "dependencies": {
32
- "@cornerstonejs/core": "^1.83.1",
32
+ "@cornerstonejs/core": "^1.83.3",
33
33
  "@icr/polyseg-wasm": "0.4.0",
34
34
  "@types/offscreencanvas": "2019.7.3",
35
35
  "comlink": "^4.4.1",
@@ -59,5 +59,5 @@
59
59
  "type": "individual",
60
60
  "url": "https://ohif.org/donate"
61
61
  },
62
- "gitHead": "9188c116a405de35977a9bf379ef23ad0ae64264"
62
+ "gitHead": "ef300bc029ea075f451a5909cecb43cbddb12fdb"
63
63
  }
@@ -118,28 +118,33 @@ class ScaleOverlayTool extends AnnotationDisplayTool {
118
118
 
119
119
  // viewportsWithAnnotations stores which viewports have an annotation,
120
120
  // if the viewport does not have an annotation, create a new one
121
- if (!viewportsWithAnnotations.includes(viewport.id)) {
122
- const newAnnotation: ScaleOverlayAnnotation = {
123
- metadata: {
124
- toolName: this.getToolName(),
125
- viewPlaneNormal: <Types.Point3>[...viewPlaneNormal],
126
- viewUp: <Types.Point3>[...viewUp],
127
- FrameOfReferenceUID,
128
- referencedImageId: null,
129
- },
130
- data: {
131
- handles: {
132
- points: viewportCanvasCornersInWorld,
121
+ enabledElements.forEach((element) => {
122
+ const { viewport } = element;
123
+ if (!viewportsWithAnnotations.includes(viewport.id)) {
124
+ const newAnnotation: ScaleOverlayAnnotation = {
125
+ metadata: {
126
+ toolName: this.getToolName(),
127
+ viewPlaneNormal: <Types.Point3>[...viewPlaneNormal],
128
+ viewUp: <Types.Point3>[...viewUp],
129
+ FrameOfReferenceUID,
130
+ referencedImageId: null,
133
131
  },
134
- viewportId: viewport.id,
135
- },
136
- };
132
+ data: {
133
+ handles: {
134
+ points: csUtils.getViewportImageCornersInWorld(viewport),
135
+ },
136
+ viewportId: viewport.id,
137
+ },
138
+ };
139
+
140
+ viewportsWithAnnotations.push(viewport.id);
137
141
 
138
- viewportsWithAnnotations.push(viewport.id);
142
+ addAnnotation(newAnnotation, viewport.element);
143
+ annotation = newAnnotation;
144
+ }
145
+ });
139
146
 
140
- addAnnotation(newAnnotation, viewport.element);
141
- annotation = newAnnotation;
142
- } else if (
147
+ if (
143
148
  this.editData.annotation &&
144
149
  this.editData.annotation.data.viewportId == viewport.id
145
150
  ) {