@cornerstonejs/adapters 5.0.9 → 5.0.11

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.
@@ -33,7 +33,6 @@ class Angle extends BaseAdapter3D {
33
33
  return state;
34
34
  }
35
35
  static getTID300RepresentationArguments(tool) {
36
- var _cachedStats;
37
36
  let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
38
37
  const data = tool.data,
39
38
  finding = tool.finding,
@@ -51,7 +50,8 @@ class Angle extends BaseAdapter3D {
51
50
  const point2 = toScoord(scoordProps, handles.points[1]);
52
51
  const point3 = toScoord(scoordProps, handles.points[1]);
53
52
  const point4 = toScoord(scoordProps, handles.points[2]);
54
- const angle = (_cachedStats = cachedStats["imageId:".concat(referencedImageId)]) === null || _cachedStats === void 0 ? void 0 : _cachedStats.angle;
53
+ const _super$getCachedStats = super.getCachedStats(cachedStats, metadata),
54
+ angle = _super$getCachedStats.angle;
55
55
  return {
56
56
  point1,
57
57
  point2,
@@ -40,4 +40,5 @@ export default class BaseAdapter3D {
40
40
  commentPositionGroup?: any;
41
41
  };
42
42
  static getTID300RepresentationArguments(tool: any, is3DMeasurement?: boolean): TID300Arguments;
43
+ static getCachedStats(cachedStats: any, metadata: any): any;
43
44
  }
@@ -114,6 +114,11 @@ class BaseAdapter3D {
114
114
  };
115
115
  return tidArguments;
116
116
  }
117
+ static getCachedStats(cachedStats, metadata) {
118
+ const referencedImageId = metadata.referencedImageId,
119
+ volumeId = metadata.volumeId;
120
+ return cachedStats["imageId:".concat(referencedImageId)] || cachedStats["volumeId:".concat(volumeId)] || {};
121
+ }
117
122
  }
118
123
 
119
124
  export { BaseAdapter3D as default };
@@ -78,10 +78,10 @@ class Bidirectional extends BaseAdapter3D {
78
78
  const longAxisEndImage = toScoord(scoordProps, shortAxisPoints[1]);
79
79
  const shortAxisStartImage = toScoord(scoordProps, longAxisPoints[0]);
80
80
  const shortAxisEndImage = toScoord(scoordProps, longAxisPoints[1]);
81
- const _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
82
- length = _ref.length,
83
- width = _ref.width,
84
- unit = _ref.unit;
81
+ const _super$getCachedStats = super.getCachedStats(cachedStats, metadata),
82
+ length = _super$getCachedStats.length,
83
+ width = _super$getCachedStats.width,
84
+ unit = _super$getCachedStats.unit;
85
85
  return {
86
86
  longAxis: {
87
87
  point1: longAxisStartImage,
@@ -55,16 +55,16 @@ class CircleROI extends BaseAdapter3D {
55
55
  };
56
56
  const center = toScoord(scoordProps, handles.points[0]);
57
57
  const end = toScoord(scoordProps, handles.points[1]);
58
- const _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
59
- area = _ref.area,
60
- radius = _ref.radius,
61
- max = _ref.max,
62
- min = _ref.min,
63
- stdDev = _ref.stdDev,
64
- mean = _ref.mean,
65
- modalityUnit = _ref.modalityUnit,
66
- radiusUnit = _ref.radiusUnit,
67
- areaUnit = _ref.areaUnit;
58
+ const _super$getCachedStats = super.getCachedStats(cachedStats, metadata),
59
+ area = _super$getCachedStats.area,
60
+ radius = _super$getCachedStats.radius,
61
+ max = _super$getCachedStats.max,
62
+ min = _super$getCachedStats.min,
63
+ stdDev = _super$getCachedStats.stdDev,
64
+ mean = _super$getCachedStats.mean,
65
+ modalityUnit = _super$getCachedStats.modalityUnit,
66
+ radiusUnit = _super$getCachedStats.radiusUnit,
67
+ areaUnit = _super$getCachedStats.areaUnit;
68
68
  const perimeter = 2 * Math.PI * radius;
69
69
  return {
70
70
  area,
@@ -70,14 +70,14 @@ class EllipticalROI extends BaseAdapter3D {
70
70
  } else {
71
71
  points.push(left, right, top, bottom);
72
72
  }
73
- const _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
74
- area = _ref.area,
75
- max = _ref.max,
76
- min = _ref.min,
77
- mean = _ref.mean,
78
- stdDev = _ref.stdDev,
79
- modalityUnit = _ref.modalityUnit,
80
- areaUnit = _ref.areaUnit;
73
+ const _super$getCachedStats = super.getCachedStats(cachedStats, metadata),
74
+ area = _super$getCachedStats.area,
75
+ max = _super$getCachedStats.max,
76
+ min = _super$getCachedStats.min,
77
+ mean = _super$getCachedStats.mean,
78
+ stdDev = _super$getCachedStats.stdDev,
79
+ modalityUnit = _super$getCachedStats.modalityUnit,
80
+ areaUnit = _super$getCachedStats.areaUnit;
81
81
  const convertedPoints = points.map(point => toScoord(scoordProps, point));
82
82
  return {
83
83
  area,
@@ -51,8 +51,8 @@ class Length extends BaseAdapter3D {
51
51
  };
52
52
  const point1 = toScoord(scoordProps, handles.points[0]);
53
53
  const point2 = toScoord(scoordProps, handles.points[1]);
54
- const _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
55
- distance = _ref.length;
54
+ const _super$getCachedStats = super.getCachedStats(cachedStats, metadata),
55
+ distance = _super$getCachedStats.length;
56
56
  return {
57
57
  point1,
58
58
  point2,
@@ -88,15 +88,15 @@ class PlanarFreehandROI extends BaseAdapter3D {
88
88
  points.push(firstPoint);
89
89
  }
90
90
  const controlPoints = (handles === null || handles === void 0 || (_handles$points = handles.points) === null || _handles$points === void 0 ? void 0 : _handles$points.length) && toScoords(scoordProps, handles.points);
91
- const _ref = data.cachedStats["imageId:".concat(referencedImageId)] || {},
92
- area = _ref.area,
93
- areaUnit = _ref.areaUnit,
94
- modalityUnit = _ref.modalityUnit,
95
- perimeter = _ref.perimeter,
96
- mean = _ref.mean,
97
- max = _ref.max,
98
- stdDev = _ref.stdDev,
99
- length = _ref.length;
91
+ const _super$getCachedStats = super.getCachedStats(data.cachedStats, metadata),
92
+ area = _super$getCachedStats.area,
93
+ areaUnit = _super$getCachedStats.areaUnit,
94
+ modalityUnit = _super$getCachedStats.modalityUnit,
95
+ perimeter = _super$getCachedStats.perimeter,
96
+ mean = _super$getCachedStats.mean,
97
+ max = _super$getCachedStats.max,
98
+ stdDev = _super$getCachedStats.stdDev,
99
+ length = _super$getCachedStats.length;
100
100
  return {
101
101
  points,
102
102
  controlPoints,
@@ -62,14 +62,14 @@ class RectangleROI extends BaseAdapter3D {
62
62
  referencedImageId
63
63
  };
64
64
  const corners = toScoords(scoordProps, data.handles.points);
65
- const _ref = data.cachedStats["imageId:".concat(referencedImageId)] || {},
66
- area = _ref.area,
67
- perimeter = _ref.perimeter,
68
- max = _ref.max,
69
- mean = _ref.mean,
70
- stdDev = _ref.stdDev,
71
- areaUnit = _ref.areaUnit,
72
- modalityUnit = _ref.modalityUnit;
65
+ const _super$getCachedStats = super.getCachedStats(data.cachedStats, metadata),
66
+ area = _super$getCachedStats.area,
67
+ perimeter = _super$getCachedStats.perimeter,
68
+ max = _super$getCachedStats.max,
69
+ mean = _super$getCachedStats.mean,
70
+ stdDev = _super$getCachedStats.stdDev,
71
+ areaUnit = _super$getCachedStats.areaUnit,
72
+ modalityUnit = _super$getCachedStats.modalityUnit;
73
73
  return {
74
74
  points: [corners[0], corners[1], corners[3], corners[2], corners[0]],
75
75
  area,
@@ -1 +1 @@
1
- export declare const version = "5.0.9";
1
+ export declare const version = "5.0.11";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/adapters",
3
- "version": "5.0.9",
3
+ "version": "5.0.11",
4
4
  "description": "Adapters for Cornerstone3D to/from formats including DICOM SR and others",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/esm/index.d.ts",
@@ -89,12 +89,12 @@
89
89
  "ndarray": "1.0.19"
90
90
  },
91
91
  "devDependencies": {
92
- "@cornerstonejs/core": "5.0.9",
93
- "@cornerstonejs/tools": "5.0.9"
92
+ "@cornerstonejs/core": "5.0.11",
93
+ "@cornerstonejs/tools": "5.0.11"
94
94
  },
95
95
  "peerDependencies": {
96
- "@cornerstonejs/core": "5.0.9",
97
- "@cornerstonejs/tools": "5.0.9"
96
+ "@cornerstonejs/core": "5.0.11",
97
+ "@cornerstonejs/tools": "5.0.11"
98
98
  },
99
- "gitHead": "4b587ca7b8befcf3651f025e0c0b4c9fc070deb2"
99
+ "gitHead": "40e7a86b4bc2cdee68df76f9abed9cd762c70dc6"
100
100
  }