@cornerstonejs/adapters 3.14.3 → 3.15.0

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 (28) hide show
  1. package/dist/esm/adapters/Cornerstone3D/Angle.d.ts +66 -14
  2. package/dist/esm/adapters/Cornerstone3D/Angle.js +102 -2
  3. package/dist/esm/adapters/Cornerstone3D/ArrowAnnotate.d.ts +27 -15
  4. package/dist/esm/adapters/Cornerstone3D/ArrowAnnotate.js +110 -1
  5. package/dist/esm/adapters/Cornerstone3D/BaseAdapter3D.d.ts +18 -9
  6. package/dist/esm/adapters/Cornerstone3D/BaseAdapter3D.js +25 -1
  7. package/dist/esm/adapters/Cornerstone3D/Bidirectional.d.ts +84 -14
  8. package/dist/esm/adapters/Cornerstone3D/Bidirectional.js +133 -9
  9. package/dist/esm/adapters/Cornerstone3D/CircleROI.d.ts +33 -15
  10. package/dist/esm/adapters/Cornerstone3D/CircleROI.js +97 -2
  11. package/dist/esm/adapters/Cornerstone3D/CobbAngle.d.ts +66 -14
  12. package/dist/esm/adapters/Cornerstone3D/CobbAngle.js +107 -2
  13. package/dist/esm/adapters/Cornerstone3D/EllipticalROI.d.ts +30 -15
  14. package/dist/esm/adapters/Cornerstone3D/EllipticalROI.js +151 -2
  15. package/dist/esm/adapters/Cornerstone3D/KeyImage.d.ts +17 -15
  16. package/dist/esm/adapters/Cornerstone3D/Length.d.ts +46 -14
  17. package/dist/esm/adapters/Cornerstone3D/Length.js +93 -6
  18. package/dist/esm/adapters/Cornerstone3D/MeasurementReport.d.ts +82 -12
  19. package/dist/esm/adapters/Cornerstone3D/MeasurementReport.js +181 -44
  20. package/dist/esm/adapters/Cornerstone3D/PlanarFreehandROI.d.ts +41 -15
  21. package/dist/esm/adapters/Cornerstone3D/PlanarFreehandROI.js +112 -2
  22. package/dist/esm/adapters/Cornerstone3D/Probe.d.ts +39 -14
  23. package/dist/esm/adapters/Cornerstone3D/Probe.js +112 -1
  24. package/dist/esm/adapters/Cornerstone3D/RectangleROI.d.ts +31 -15
  25. package/dist/esm/adapters/Cornerstone3D/RectangleROI.js +82 -2
  26. package/dist/esm/adapters/Cornerstone3D/UltrasoundDirectional.d.ts +8 -9
  27. package/dist/esm/version.d.ts +1 -1
  28. package/package.json +5 -5
@@ -1,28 +1,44 @@
1
1
  import BaseAdapter3D from "./BaseAdapter3D";
2
2
  declare class RectangleROI extends BaseAdapter3D {
3
- static getMeasurementData(MeasurementGroup: any, sopInstanceUIDToImageIdMap: any, imageToWorldCoords: any, metadata: any): {
4
- description: any;
5
- sopInstanceUid: any;
6
- annotation: {
7
- annotationUID: any;
8
- metadata: {
9
- toolName: any;
10
- referencedImageId: any;
11
- FrameOfReferenceUID: any;
12
- label: string;
13
- };
14
- data: any;
15
- };
3
+ static getMeasurementData(MeasurementGroup: any, sopInstanceUIDToImageIdMap: any, imageToWorldCoords: any, metadata: any): any;
4
+ static getMeasurementDataFromScoord({ defaultState, SCOORDGroup, imageToWorldCoords, NUMGroup, ReferencedFrameNumber }: {
5
+ defaultState: any;
6
+ SCOORDGroup: any;
7
+ imageToWorldCoords: any;
8
+ NUMGroup: any;
9
+ ReferencedFrameNumber: any;
10
+ }): any;
11
+ static getMeasurementDataFromScoord3D({ SCOORD3DGroup, defaultState }: {
12
+ SCOORD3DGroup: any;
13
+ defaultState: any;
14
+ }): any;
15
+ static getTID300RepresentationArguments(tool: any, worldToImageCoords: any): {
16
+ points: any[];
17
+ area: any;
18
+ perimeter: any;
19
+ trackingIdentifierTextValue: string;
16
20
  finding: any;
17
- findingSites: any[];
21
+ findingSites: any;
22
+ ReferencedFrameOfReferenceUID: any;
23
+ use3DSpatialCoordinates: boolean;
24
+ } | {
25
+ points: any[];
26
+ area: any;
27
+ perimeter: any;
28
+ trackingIdentifierTextValue: string;
29
+ finding: any;
30
+ findingSites: any;
31
+ use3DSpatialCoordinates: boolean;
18
32
  };
19
- static getTID300RepresentationArguments(tool: any, worldToImageCoords: any): {
33
+ static getTID300RepresentationArgumentsSCOORD3D(tool: any): {
20
34
  points: any[];
21
35
  area: any;
22
36
  perimeter: any;
23
37
  trackingIdentifierTextValue: string;
24
38
  finding: any;
25
39
  findingSites: any;
40
+ ReferencedFrameOfReferenceUID: any;
41
+ use3DSpatialCoordinates: boolean;
26
42
  };
27
43
  }
28
44
  export default RectangleROI;
@@ -12,8 +12,34 @@ class RectangleROI extends BaseAdapter3D {
12
12
  defaultState,
13
13
  NUMGroup,
14
14
  SCOORDGroup,
15
+ SCOORD3DGroup,
15
16
  ReferencedFrameNumber
16
17
  } = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, RectangleROI.toolType);
18
+ if (SCOORDGroup) {
19
+ return this.getMeasurementDataFromScoord({
20
+ defaultState,
21
+ SCOORDGroup,
22
+ imageToWorldCoords,
23
+ NUMGroup,
24
+ ReferencedFrameNumber
25
+ });
26
+ } else if (SCOORD3DGroup) {
27
+ return this.getMeasurementDataFromScoord3D({
28
+ SCOORD3DGroup,
29
+ defaultState
30
+ });
31
+ } else {
32
+ throw new Error("Can't get measurement data with missing SCOORD and SCOORD3D groups.");
33
+ }
34
+ }
35
+ static getMeasurementDataFromScoord(_ref) {
36
+ let {
37
+ defaultState,
38
+ SCOORDGroup,
39
+ imageToWorldCoords,
40
+ NUMGroup,
41
+ ReferencedFrameNumber
42
+ } = _ref;
17
43
  const referencedImageId = defaultState.annotation.metadata.referencedImageId;
18
44
  const {
19
45
  GraphicData
@@ -41,6 +67,32 @@ class RectangleROI extends BaseAdapter3D {
41
67
  };
42
68
  return state;
43
69
  }
70
+ static getMeasurementDataFromScoord3D(_ref2) {
71
+ let {
72
+ SCOORD3DGroup,
73
+ defaultState
74
+ } = _ref2;
75
+ const {
76
+ GraphicData
77
+ } = SCOORD3DGroup;
78
+ const worldCoords = [];
79
+ for (let i = 0; i < GraphicData.length; i += 3) {
80
+ const point = [GraphicData[i], GraphicData[i + 1], GraphicData[i + 2]];
81
+ worldCoords.push(point);
82
+ }
83
+ const state = defaultState;
84
+ state.annotation.data = {
85
+ handles: {
86
+ points: [worldCoords[0], worldCoords[1], worldCoords[3], worldCoords[2]],
87
+ activeHandleIndex: 0,
88
+ textBox: {
89
+ hasMoved: false
90
+ }
91
+ },
92
+ cachedStats: {}
93
+ };
94
+ return state;
95
+ }
44
96
  static getTID300RepresentationArguments(tool, worldToImageCoords) {
45
97
  const {
46
98
  data,
@@ -56,7 +108,7 @@ class RectangleROI extends BaseAdapter3D {
56
108
  referencedImageId
57
109
  } = metadata;
58
110
  if (!referencedImageId) {
59
- throw new Error("CobbAngle.getTID300RepresentationArguments: referencedImageId is not defined");
111
+ return this.getTID300RepresentationArgumentsSCOORD3D(tool);
60
112
  }
61
113
  const corners = handles.points.map(point => worldToImageCoords(referencedImageId, point));
62
114
  const {
@@ -69,7 +121,35 @@ class RectangleROI extends BaseAdapter3D {
69
121
  perimeter,
70
122
  trackingIdentifierTextValue: this.trackingIdentifierTextValue,
71
123
  finding,
72
- findingSites: findingSites || []
124
+ findingSites: findingSites || [],
125
+ use3DSpatialCoordinates: false
126
+ };
127
+ }
128
+ static getTID300RepresentationArgumentsSCOORD3D(tool) {
129
+ const {
130
+ data,
131
+ finding,
132
+ findingSites,
133
+ metadata
134
+ } = tool;
135
+ const {
136
+ cachedStats = {},
137
+ handles
138
+ } = data;
139
+ const corners = handles.points;
140
+ const {
141
+ area,
142
+ perimeter
143
+ } = cachedStats;
144
+ return {
145
+ points: [corners[0], corners[1], corners[3], corners[2], corners[0]],
146
+ area,
147
+ perimeter,
148
+ trackingIdentifierTextValue: this.trackingIdentifierTextValue,
149
+ finding,
150
+ findingSites: findingSites || [],
151
+ ReferencedFrameOfReferenceUID: metadata.FrameOfReferenceUID,
152
+ use3DSpatialCoordinates: true
73
153
  };
74
154
  }
75
155
  }
@@ -1,20 +1,19 @@
1
1
  import BaseAdapter3D from "./BaseAdapter3D";
2
2
  declare class UltrasoundDirectional extends BaseAdapter3D {
3
3
  static getMeasurementData(MeasurementGroup: any, sopInstanceUIDToImageIdMap: any, imageToWorldCoords: any, metadata: any): {
4
- description: any;
5
- sopInstanceUid: any;
4
+ description?: string;
5
+ sopInstanceUid?: string;
6
6
  annotation: {
7
- annotationUID: any;
7
+ annotationUID: string;
8
8
  metadata: {
9
- toolName: any;
10
- referencedImageId: any;
11
- FrameOfReferenceUID: any;
9
+ toolName: string;
10
+ referencedImageId?: string;
11
+ FrameOfReferenceUID: string;
12
12
  label: string;
13
13
  };
14
- data: any;
15
14
  };
16
- finding: any;
17
- findingSites: any[];
15
+ finding?: unknown;
16
+ findingSites?: unknown;
18
17
  };
19
18
  static getTID300RepresentationArguments(tool: any, worldToImageCoords: any): {
20
19
  point1: {
@@ -1 +1 @@
1
- export declare const version = "3.14.3";
1
+ export declare const version = "3.15.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/adapters",
3
- "version": "3.14.3",
3
+ "version": "3.15.0",
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",
@@ -85,13 +85,13 @@
85
85
  "dependencies": {
86
86
  "@babel/runtime-corejs2": "^7.17.8",
87
87
  "buffer": "^6.0.3",
88
- "dcmjs": "^0.29.8",
88
+ "dcmjs": "^0.40.0",
89
89
  "gl-matrix": "^3.4.3",
90
90
  "ndarray": "^1.0.19"
91
91
  },
92
92
  "peerDependencies": {
93
- "@cornerstonejs/core": "^3.14.3",
94
- "@cornerstonejs/tools": "^3.14.3"
93
+ "@cornerstonejs/core": "^3.15.0",
94
+ "@cornerstonejs/tools": "^3.15.0"
95
95
  },
96
- "gitHead": "902ff8c03f0bb19963532fcf6286155ecbdd2d98"
96
+ "gitHead": "77edfa9761d0f7dcf841386dd453dca9fbc83ca9"
97
97
  }