@cornerstonejs/tools 1.66.4 → 1.66.5

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.
Files changed (35) hide show
  1. package/dist/cjs/tools/WindowLevelTool.js +2 -1
  2. package/dist/cjs/tools/WindowLevelTool.js.map +1 -1
  3. package/dist/cjs/tools/segmentation/CircleROIStartEndThresholdTool.js +2 -1
  4. package/dist/cjs/tools/segmentation/CircleROIStartEndThresholdTool.js.map +1 -1
  5. package/dist/cjs/tools/segmentation/RectangleROIStartEndThresholdTool.js +2 -1
  6. package/dist/cjs/tools/segmentation/RectangleROIStartEndThresholdTool.js.map +1 -1
  7. package/dist/cjs/tools/segmentation/RectangleROIThresholdTool.js +2 -1
  8. package/dist/cjs/tools/segmentation/RectangleROIThresholdTool.js.map +1 -1
  9. package/dist/cjs/utilities/index.d.ts +2 -1
  10. package/dist/cjs/utilities/index.js +3 -1
  11. package/dist/cjs/utilities/index.js.map +1 -1
  12. package/dist/esm/tools/WindowLevelTool.js +2 -1
  13. package/dist/esm/tools/WindowLevelTool.js.map +1 -1
  14. package/dist/esm/tools/segmentation/CircleROIStartEndThresholdTool.js +2 -1
  15. package/dist/esm/tools/segmentation/CircleROIStartEndThresholdTool.js.map +1 -1
  16. package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.js +2 -1
  17. package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.js.map +1 -1
  18. package/dist/esm/tools/segmentation/RectangleROIThresholdTool.js +2 -1
  19. package/dist/esm/tools/segmentation/RectangleROIThresholdTool.js.map +1 -1
  20. package/dist/esm/utilities/index.js +2 -1
  21. package/dist/esm/utilities/index.js.map +1 -1
  22. package/dist/types/tools/WindowLevelTool.d.ts.map +1 -1
  23. package/dist/types/tools/segmentation/CircleROIStartEndThresholdTool.d.ts.map +1 -1
  24. package/dist/types/tools/segmentation/RectangleROIStartEndThresholdTool.d.ts.map +1 -1
  25. package/dist/types/tools/segmentation/RectangleROIThresholdTool.d.ts.map +1 -1
  26. package/dist/types/utilities/index.d.ts +2 -1
  27. package/dist/types/utilities/index.d.ts.map +1 -1
  28. package/dist/umd/index.js +1 -1
  29. package/dist/umd/index.js.map +1 -1
  30. package/package.json +3 -3
  31. package/src/tools/WindowLevelTool.ts +2 -1
  32. package/src/tools/segmentation/CircleROIStartEndThresholdTool.ts +2 -1
  33. package/src/tools/segmentation/RectangleROIStartEndThresholdTool.ts +2 -1
  34. package/src/tools/segmentation/RectangleROIThresholdTool.ts +2 -1
  35. package/src/utilities/index.ts +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/tools",
3
- "version": "1.66.4",
3
+ "version": "1.66.5",
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.66.4",
32
+ "@cornerstonejs/core": "^1.66.5",
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": "4d12d9d2ecf38805e7c9ca7e93bf36372bfe85ff"
62
+ "gitHead": "23c01d5231da3a5283a0d042e4eb5abac3aed44e"
63
63
  }
@@ -8,6 +8,7 @@ import {
8
8
  Types,
9
9
  } from '@cornerstonejs/core';
10
10
  import { EventTypes } from '../types';
11
+ import { getVolumeId } from '../utilities/getVolumeId';
11
12
 
12
13
  // Todo: should move to configuration
13
14
  const DEFAULT_MULTIPLIER = 4;
@@ -51,7 +52,7 @@ class WindowLevelTool extends BaseTool {
51
52
  const properties = viewport.getProperties();
52
53
  if (viewport instanceof VolumeViewport) {
53
54
  const targetId = this.getTargetId(viewport as Types.IVolumeViewport);
54
- volumeId = targetId.split(/volumeId:|\?/)[1];
55
+ volumeId = getVolumeId(targetId);
55
56
  viewportsContainingVolumeUID = utilities.getViewportsWithVolumeId(
56
57
  volumeId,
57
58
  renderingEngine.id
@@ -46,6 +46,7 @@ import {
46
46
  } from '../../utilities/math/circle';
47
47
  import { pointInEllipse } from '../../utilities/math/ellipse';
48
48
  import { pointInShapeCallback } from '../../utilities';
49
+ import { getVolumeId } from '../../utilities/getVolumeId';
49
50
 
50
51
  const { transformWorldToIndex } = csUtils;
51
52
 
@@ -111,7 +112,7 @@ class CircleROIStartEndThresholdTool extends CircleROITool {
111
112
  throw new Error('Stack Viewport Not implemented');
112
113
  } else {
113
114
  const targetId = this.getTargetId(viewport);
114
- volumeId = targetId.split(/volumeId:|\?/)[1];
115
+ volumeId = getVolumeId(targetId);
115
116
  imageVolume = cache.getVolume(volumeId);
116
117
 
117
118
  referencedImageId = csUtils.getClosestImageId(
@@ -39,6 +39,7 @@ import { RectangleROIStartEndThresholdAnnotation } from '../../types/ToolSpecifi
39
39
  import RectangleROITool from '../annotation/RectangleROITool';
40
40
  import { StyleSpecifier } from '../../types/AnnotationStyle';
41
41
  import { pointInShapeCallback } from '../../utilities/';
42
+ import { getVolumeId } from '../../utilities/getVolumeId';
42
43
 
43
44
  const { transformWorldToIndex } = csUtils;
44
45
 
@@ -111,7 +112,7 @@ class RectangleROIStartEndThresholdTool extends RectangleROITool {
111
112
  throw new Error('Stack Viewport Not implemented');
112
113
  } else {
113
114
  const targetId = this.getTargetId(viewport);
114
- volumeId = targetId.split(/volumeId:|\?/)[1];
115
+ volumeId = getVolumeId(targetId);
115
116
  imageVolume = cache.getVolume(volumeId);
116
117
  referencedImageId = csUtils.getClosestImageId(
117
118
  imageVolume,
@@ -27,6 +27,7 @@ import {
27
27
  import { RectangleROIThresholdAnnotation } from '../../types/ToolSpecificAnnotationTypes';
28
28
  import RectangleROITool from '../annotation/RectangleROITool';
29
29
  import { StyleSpecifier } from '../../types/AnnotationStyle';
30
+ import { getVolumeId } from '../../utilities/getVolumeId';
30
31
 
31
32
  /**
32
33
  * This tool is exactly the RectangleROITool but only draws a rectangle on the image,
@@ -87,7 +88,7 @@ class RectangleROIThresholdTool extends RectangleROITool {
87
88
  if (viewport instanceof StackViewport) {
88
89
  referencedImageId = targetId.split('imageId:')[1];
89
90
  } else {
90
- volumeId = targetId.split(/volumeId:|\?/)[1];
91
+ volumeId = getVolumeId(targetId);
91
92
  const imageVolume = cache.getVolume(volumeId);
92
93
  referencedImageId = csUtils.getClosestImageId(
93
94
  imageVolume,
@@ -48,6 +48,7 @@ import * as dynamicVolume from './dynamicVolume';
48
48
  import * as polyDataUtils from './polyData/utils';
49
49
  import * as voi from './voi';
50
50
  import * as contourSegmentation from './contourSegmentation';
51
+ import { getVolumeId } from './getVolumeId';
51
52
 
52
53
  const roundNumber = utilities.roundNumber;
53
54
 
@@ -70,6 +71,7 @@ export {
70
71
  getCalibratedLengthUnits,
71
72
  getCalibratedAreaUnits,
72
73
  getCalibratedScale,
74
+ getVolumeId,
73
75
  segmentation,
74
76
  contours,
75
77
  triggerAnnotationRenderForViewportIds,