@cornerstonejs/adapters 4.9.2 → 4.10.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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import BaseAdapter3D from "./BaseAdapter3D";
|
|
2
2
|
export declare class RectangleROI extends BaseAdapter3D {
|
|
3
|
+
static isValidMeasurement(measurement: any): boolean;
|
|
3
4
|
static getMeasurementData(MeasurementGroup: any, sopInstanceUIDToImageIdMap: any, metadata: any): {
|
|
4
5
|
description?: string;
|
|
5
6
|
sopInstanceUid?: string;
|
|
@@ -10,6 +10,11 @@ const {
|
|
|
10
10
|
Polyline: TID300Polyline
|
|
11
11
|
} = utilities.TID300;
|
|
12
12
|
class RectangleROI extends BaseAdapter3D {
|
|
13
|
+
static isValidMeasurement(measurement) {
|
|
14
|
+
const graphicItem = this.getGraphicItem(measurement);
|
|
15
|
+
const pointsCount = this.getPointsCount(graphicItem);
|
|
16
|
+
return this.getGraphicType(graphicItem) === "POLYLINE" && (pointsCount === 4 || pointsCount === 5);
|
|
17
|
+
}
|
|
13
18
|
static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata) {
|
|
14
19
|
const {
|
|
15
20
|
state,
|
|
@@ -17,6 +22,7 @@ class RectangleROI extends BaseAdapter3D {
|
|
|
17
22
|
referencedImageId,
|
|
18
23
|
ReferencedFrameNumber
|
|
19
24
|
} = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
|
|
25
|
+
const points = worldCoords.length === 5 ? worldCoords.slice(0, 4) : worldCoords;
|
|
20
26
|
const areaGroup = MeasurementGroup.ContentSequence.find(g => g.ValueType === "NUM" && g.ConceptNameCodeSequence[0].CodeMeaning === "Area");
|
|
21
27
|
const cachedStats = referencedImageId ? {
|
|
22
28
|
[`imageId:${referencedImageId}`]: {
|
|
@@ -28,7 +34,7 @@ class RectangleROI extends BaseAdapter3D {
|
|
|
28
34
|
...state.annotation.data,
|
|
29
35
|
handles: {
|
|
30
36
|
...state.annotation.data.handles,
|
|
31
|
-
points: [
|
|
37
|
+
points: [points[0], points[1], points[3], points[2]]
|
|
32
38
|
},
|
|
33
39
|
cachedStats,
|
|
34
40
|
frameNumber: ReferencedFrameNumber
|
|
@@ -70,6 +76,8 @@ _RectangleROI = RectangleROI;
|
|
|
70
76
|
(() => {
|
|
71
77
|
_RectangleROI.init("RectangleROI", TID300Polyline);
|
|
72
78
|
_RectangleROI.registerLegacy();
|
|
79
|
+
_RectangleROI.registerType("DCM:111030", "POLYLINE", 4);
|
|
80
|
+
_RectangleROI.registerType("DCM:111030", "POLYLINE", 5);
|
|
73
81
|
})();
|
|
74
82
|
|
|
75
83
|
export { RectangleROI, RectangleROI as default };
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.
|
|
1
|
+
export declare const version = "4.10.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/adapters",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.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",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
"ndarray": "1.0.19"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
|
-
"@cornerstonejs/core": "4.
|
|
93
|
-
"@cornerstonejs/tools": "4.
|
|
92
|
+
"@cornerstonejs/core": "4.10.0",
|
|
93
|
+
"@cornerstonejs/tools": "4.10.0"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "8dedf178bcca0264eba9b5fcfbebbd796523a592"
|
|
96
96
|
}
|