@cornerstonejs/adapters 3.0.0-beta.4 → 3.0.0-beta.6
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/dist/esm/adapters/Cornerstone/Angle.js +61 -74
- package/dist/esm/adapters/Cornerstone/ArrowAnnotate.js +76 -76
- package/dist/esm/adapters/Cornerstone/Bidirectional.js +130 -146
- package/dist/esm/adapters/Cornerstone/CircleRoi.js +96 -95
- package/dist/esm/adapters/Cornerstone/CobbAngle.js +66 -79
- package/dist/esm/adapters/Cornerstone/EllipticalRoi.js +152 -152
- package/dist/esm/adapters/Cornerstone/FreehandRoi.js +68 -69
- package/dist/esm/adapters/Cornerstone/Length.js +54 -63
- package/dist/esm/adapters/Cornerstone/MeasurementReport.js +221 -224
- package/dist/esm/adapters/Cornerstone/ParametricMap.js +88 -110
- package/dist/esm/adapters/Cornerstone/RectangleRoi.js +72 -78
- package/dist/esm/adapters/Cornerstone/Segmentation.js +7 -7
- package/dist/esm/adapters/Cornerstone/Segmentation_3X.js +113 -104
- package/dist/esm/adapters/Cornerstone/Segmentation_4X.js +434 -462
- package/dist/esm/adapters/Cornerstone/index.js +14 -14
- package/dist/esm/adapters/Cornerstone3D/Angle.d.ts +2 -5
- package/dist/esm/adapters/Cornerstone3D/Angle.js +89 -100
- package/dist/esm/adapters/Cornerstone3D/ArrowAnnotate.d.ts +5 -11
- package/dist/esm/adapters/Cornerstone3D/ArrowAnnotate.js +106 -118
- package/dist/esm/adapters/Cornerstone3D/BaseAdapter3D.d.ts +43 -0
- package/dist/esm/adapters/Cornerstone3D/BaseAdapter3D.js +92 -0
- package/dist/esm/adapters/Cornerstone3D/Bidirectional.d.ts +2 -5
- package/dist/esm/adapters/Cornerstone3D/Bidirectional.js +118 -133
- package/dist/esm/adapters/Cornerstone3D/CircleROI.d.ts +2 -7
- package/dist/esm/adapters/Cornerstone3D/CircleROI.js +85 -85
- package/dist/esm/adapters/Cornerstone3D/CobbAngle.d.ts +2 -5
- package/dist/esm/adapters/Cornerstone3D/CobbAngle.js +93 -104
- package/dist/esm/adapters/Cornerstone3D/CodingScheme.js +5 -5
- package/dist/esm/adapters/Cornerstone3D/EllipticalROI.d.ts +2 -7
- package/dist/esm/adapters/Cornerstone3D/EllipticalROI.js +148 -149
- package/dist/esm/adapters/Cornerstone3D/KeyImage.d.ts +24 -0
- package/dist/esm/adapters/Cornerstone3D/KeyImage.js +49 -0
- package/dist/esm/adapters/Cornerstone3D/Length.d.ts +2 -10
- package/dist/esm/adapters/Cornerstone3D/Length.js +83 -93
- package/dist/esm/adapters/Cornerstone3D/MeasurementReport.d.ts +23 -4
- package/dist/esm/adapters/Cornerstone3D/MeasurementReport.js +259 -240
- package/dist/esm/adapters/Cornerstone3D/ParametricMap/generateToolState.js +8 -4
- package/dist/esm/adapters/Cornerstone3D/PlanarFreehandROI.d.ts +3 -5
- package/dist/esm/adapters/Cornerstone3D/PlanarFreehandROI.js +99 -115
- package/dist/esm/adapters/Cornerstone3D/Probe.d.ts +4 -17
- package/dist/esm/adapters/Cornerstone3D/Probe.js +38 -79
- package/dist/esm/adapters/Cornerstone3D/RTStruct/RTSS.js +60 -52
- package/dist/esm/adapters/Cornerstone3D/RTStruct/index.js +3 -1
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getPatientModule.js +5 -5
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedFrameOfReferenceSequence.js +14 -10
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedSeriesSequence.js +17 -11
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getStructureSetModule.js +3 -1
- package/dist/esm/adapters/Cornerstone3D/RectangleROI.d.ts +2 -5
- package/dist/esm/adapters/Cornerstone3D/RectangleROI.js +73 -85
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateLabelMaps2DFrom3D.js +15 -13
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateSegmentation.js +15 -9
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateToolState.js +10 -10
- package/dist/esm/adapters/Cornerstone3D/Segmentation/labelmapImagesFromBuffer.js +134 -151
- package/dist/esm/adapters/Cornerstone3D/UltrasoundDirectional.d.ts +2 -5
- package/dist/esm/adapters/Cornerstone3D/UltrasoundDirectional.js +68 -84
- package/dist/esm/adapters/Cornerstone3D/index.d.ts +4 -0
- package/dist/esm/adapters/Cornerstone3D/index.js +21 -17
- package/dist/esm/adapters/VTKjs/Segmentation.js +66 -72
- package/dist/esm/adapters/VTKjs/index.js +2 -2
- package/dist/esm/adapters/helpers/checkIfPerpendicular.js +2 -2
- package/dist/esm/adapters/helpers/checkOrientation.js +8 -8
- package/dist/esm/adapters/helpers/codeMeaningEquals.js +2 -2
- package/dist/esm/adapters/helpers/compareArrays.js +4 -2
- package/dist/esm/adapters/helpers/downloadDICOMData.js +6 -4
- package/dist/esm/adapters/helpers/getDatasetsFromImages.js +20 -18
- package/dist/esm/adapters/helpers/graphicTypeEquals.js +2 -2
- package/dist/esm/adapters/helpers/toArray.js +1 -3
- package/dist/esm/adapters/index.d.ts +2 -0
- package/dist/esm/adapters/index.js +6 -5
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/defineProperty.js +18 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +14 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +9 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/typeof.js +11 -0
- package/package.json +4 -4
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +0 -493
- package/dist/esm/adapters/Cornerstone3D/isValidCornerstoneTrackingIdentifier.js +0 -18
|
@@ -1,147 +1,132 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray, createClass as _createClass, defineProperty as _defineProperty, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { utilities } from 'dcmjs';
|
|
3
|
-
import CORNERSTONE_3D_TAG from './cornerstone3DTag.js';
|
|
4
2
|
import MeasurementReport from './MeasurementReport.js';
|
|
5
3
|
import { toArray } from '../helpers/toArray.js';
|
|
6
|
-
import '
|
|
4
|
+
import 'buffer';
|
|
5
|
+
import BaseAdapter3D from './BaseAdapter3D.js';
|
|
7
6
|
|
|
8
7
|
var _Bidirectional;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
8
|
+
const {
|
|
9
|
+
Bidirectional: TID300Bidirectional
|
|
10
|
+
} = utilities.TID300;
|
|
11
|
+
const LONG_AXIS = "Long Axis";
|
|
12
|
+
const SHORT_AXIS = "Short Axis";
|
|
13
|
+
class Bidirectional extends BaseAdapter3D {
|
|
14
|
+
static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata) {
|
|
15
|
+
const {
|
|
16
|
+
defaultState,
|
|
17
|
+
ReferencedFrameNumber
|
|
18
|
+
} = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, Bidirectional.toolType);
|
|
19
|
+
const referencedImageId = defaultState.annotation.metadata.referencedImageId;
|
|
20
|
+
const {
|
|
21
|
+
ContentSequence
|
|
22
|
+
} = MeasurementGroup;
|
|
23
|
+
const longAxisNUMGroup = toArray(ContentSequence).find(group => group.ConceptNameCodeSequence.CodeMeaning === LONG_AXIS);
|
|
24
|
+
const longAxisSCOORDGroup = toArray(longAxisNUMGroup.ContentSequence).find(group => group.ValueType === "SCOORD");
|
|
25
|
+
const shortAxisNUMGroup = toArray(ContentSequence).find(group => group.ConceptNameCodeSequence.CodeMeaning === SHORT_AXIS);
|
|
26
|
+
const shortAxisSCOORDGroup = toArray(shortAxisNUMGroup.ContentSequence).find(group => group.ValueType === "SCOORD");
|
|
27
|
+
const worldCoords = [];
|
|
28
|
+
[longAxisSCOORDGroup, shortAxisSCOORDGroup].forEach(group => {
|
|
29
|
+
const {
|
|
30
|
+
GraphicData
|
|
31
|
+
} = group;
|
|
32
|
+
for (let i = 0; i < GraphicData.length; i += 2) {
|
|
33
|
+
const point = imageToWorldCoords(referencedImageId, [GraphicData[i], GraphicData[i + 1]]);
|
|
34
|
+
worldCoords.push(point);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const state = defaultState;
|
|
38
|
+
state.annotation.data = {
|
|
39
|
+
handles: {
|
|
40
|
+
points: [worldCoords[0], worldCoords[1], worldCoords[2], worldCoords[3]],
|
|
41
|
+
activeHandleIndex: 0,
|
|
42
|
+
textBox: {
|
|
43
|
+
hasMoved: false
|
|
44
44
|
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
handles: {
|
|
49
|
-
points: [worldCoords[0], worldCoords[1], worldCoords[2], worldCoords[3]],
|
|
50
|
-
activeHandleIndex: 0,
|
|
51
|
-
textBox: {
|
|
52
|
-
hasMoved: false
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
cachedStats: _defineProperty({}, "imageId:".concat(referencedImageId), {
|
|
45
|
+
},
|
|
46
|
+
cachedStats: {
|
|
47
|
+
["imageId:".concat(referencedImageId)]: {
|
|
56
48
|
length: longAxisNUMGroup.MeasuredValueSequence.NumericValue,
|
|
57
49
|
width: shortAxisNUMGroup.MeasuredValueSequence.NumericValue
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
frameNumber: ReferencedFrameNumber
|
|
53
|
+
};
|
|
54
|
+
return state;
|
|
55
|
+
}
|
|
56
|
+
static getTID300RepresentationArguments(tool, worldToImageCoords) {
|
|
57
|
+
const {
|
|
58
|
+
data,
|
|
59
|
+
finding,
|
|
60
|
+
findingSites,
|
|
61
|
+
metadata
|
|
62
|
+
} = tool;
|
|
63
|
+
const {
|
|
64
|
+
cachedStats = {},
|
|
65
|
+
handles
|
|
66
|
+
} = data;
|
|
67
|
+
const {
|
|
68
|
+
referencedImageId
|
|
69
|
+
} = metadata;
|
|
70
|
+
if (!referencedImageId) {
|
|
71
|
+
throw new Error("Bidirectional.getTID300RepresentationArguments: referencedImageId is not defined");
|
|
62
72
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
longAxisPoints = firstPointPairs;
|
|
93
|
-
}
|
|
94
|
-
var longAxisStartImage = worldToImageCoords(referencedImageId, shortAxisPoints[0]);
|
|
95
|
-
var longAxisEndImage = worldToImageCoords(referencedImageId, shortAxisPoints[1]);
|
|
96
|
-
var shortAxisStartImage = worldToImageCoords(referencedImageId, longAxisPoints[0]);
|
|
97
|
-
var shortAxisEndImage = worldToImageCoords(referencedImageId, longAxisPoints[1]);
|
|
98
|
-
return {
|
|
99
|
-
longAxis: {
|
|
100
|
-
point1: {
|
|
101
|
-
x: longAxisStartImage[0],
|
|
102
|
-
y: longAxisStartImage[1]
|
|
103
|
-
},
|
|
104
|
-
point2: {
|
|
105
|
-
x: longAxisEndImage[0],
|
|
106
|
-
y: longAxisEndImage[1]
|
|
107
|
-
}
|
|
73
|
+
const {
|
|
74
|
+
length,
|
|
75
|
+
width
|
|
76
|
+
} = cachedStats["imageId:".concat(referencedImageId)] || {};
|
|
77
|
+
const {
|
|
78
|
+
points
|
|
79
|
+
} = handles;
|
|
80
|
+
const firstPointPairs = [points[0], points[1]];
|
|
81
|
+
const secondPointPairs = [points[2], points[3]];
|
|
82
|
+
const firstPointPairsDistance = Math.sqrt(Math.pow(firstPointPairs[0][0] - firstPointPairs[1][0], 2) + Math.pow(firstPointPairs[0][1] - firstPointPairs[1][1], 2) + Math.pow(firstPointPairs[0][2] - firstPointPairs[1][2], 2));
|
|
83
|
+
const secondPointPairsDistance = Math.sqrt(Math.pow(secondPointPairs[0][0] - secondPointPairs[1][0], 2) + Math.pow(secondPointPairs[0][1] - secondPointPairs[1][1], 2) + Math.pow(secondPointPairs[0][2] - secondPointPairs[1][2], 2));
|
|
84
|
+
let shortAxisPoints;
|
|
85
|
+
let longAxisPoints;
|
|
86
|
+
if (firstPointPairsDistance > secondPointPairsDistance) {
|
|
87
|
+
shortAxisPoints = firstPointPairs;
|
|
88
|
+
longAxisPoints = secondPointPairs;
|
|
89
|
+
} else {
|
|
90
|
+
shortAxisPoints = secondPointPairs;
|
|
91
|
+
longAxisPoints = firstPointPairs;
|
|
92
|
+
}
|
|
93
|
+
const longAxisStartImage = worldToImageCoords(referencedImageId, shortAxisPoints[0]);
|
|
94
|
+
const longAxisEndImage = worldToImageCoords(referencedImageId, shortAxisPoints[1]);
|
|
95
|
+
const shortAxisStartImage = worldToImageCoords(referencedImageId, longAxisPoints[0]);
|
|
96
|
+
const shortAxisEndImage = worldToImageCoords(referencedImageId, longAxisPoints[1]);
|
|
97
|
+
return {
|
|
98
|
+
longAxis: {
|
|
99
|
+
point1: {
|
|
100
|
+
x: longAxisStartImage[0],
|
|
101
|
+
y: longAxisStartImage[1]
|
|
108
102
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
103
|
+
point2: {
|
|
104
|
+
x: longAxisEndImage[0],
|
|
105
|
+
y: longAxisEndImage[1]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
shortAxis: {
|
|
109
|
+
point1: {
|
|
110
|
+
x: shortAxisStartImage[0],
|
|
111
|
+
y: shortAxisStartImage[1]
|
|
118
112
|
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
_Bidirectional.utilityToolType = BIDIRECTIONAL;
|
|
131
|
-
_Bidirectional.TID300Representation = TID300Bidirectional;
|
|
132
|
-
_Bidirectional.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
|
|
133
|
-
if (!TrackingIdentifier.includes(":")) {
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
var _TrackingIdentifier$s = TrackingIdentifier.split(":"),
|
|
137
|
-
_TrackingIdentifier$s2 = _slicedToArray(_TrackingIdentifier$s, 2),
|
|
138
|
-
cornerstone3DTag = _TrackingIdentifier$s2[0],
|
|
139
|
-
toolType = _TrackingIdentifier$s2[1];
|
|
140
|
-
if (cornerstone3DTag !== CORNERSTONE_3D_TAG) {
|
|
141
|
-
return false;
|
|
113
|
+
point2: {
|
|
114
|
+
x: shortAxisEndImage[0],
|
|
115
|
+
y: shortAxisEndImage[1]
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
longAxisLength: length,
|
|
119
|
+
shortAxisLength: width,
|
|
120
|
+
trackingIdentifierTextValue: this.trackingIdentifierTextValue,
|
|
121
|
+
finding: finding,
|
|
122
|
+
findingSites: findingSites || []
|
|
123
|
+
};
|
|
142
124
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
125
|
+
}
|
|
126
|
+
_Bidirectional = Bidirectional;
|
|
127
|
+
(() => {
|
|
128
|
+
_Bidirectional.init("Bidirectional", TID300Bidirectional);
|
|
129
|
+
_Bidirectional.registerLegacy();
|
|
130
|
+
})();
|
|
146
131
|
|
|
147
132
|
export { Bidirectional as default };
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare class CircleROI {
|
|
3
|
-
static trackingIdentifierTextValue: string;
|
|
4
|
-
static toolType: string;
|
|
5
|
-
static utilityToolType: string;
|
|
6
|
-
static TID300Representation: any;
|
|
7
|
-
static isValidCornerstoneTrackingIdentifier: typeof isValidCornerstoneTrackingIdentifier;
|
|
1
|
+
import BaseAdapter3D from "./BaseAdapter3D";
|
|
2
|
+
declare class CircleROI extends BaseAdapter3D {
|
|
8
3
|
static getMeasurementData(MeasurementGroup: any, sopInstanceUIDToImageIdMap: any, imageToWorldCoords: any, metadata: any): {
|
|
9
4
|
description: any;
|
|
10
5
|
sopInstanceUid: any;
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
import { createClass as _createClass, defineProperty as _defineProperty, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { utilities } from 'dcmjs';
|
|
3
2
|
import MeasurementReport from './MeasurementReport.js';
|
|
4
|
-
import
|
|
5
|
-
import isValidCornerstoneTrackingIdentifier from './isValidCornerstoneTrackingIdentifier.js';
|
|
3
|
+
import BaseAdapter3D from './BaseAdapter3D.js';
|
|
6
4
|
|
|
7
5
|
var _CircleROI;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
6
|
+
const {
|
|
7
|
+
Circle: TID300Circle
|
|
8
|
+
} = utilities.TID300;
|
|
9
|
+
class CircleROI extends BaseAdapter3D {
|
|
10
|
+
static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata) {
|
|
11
|
+
const {
|
|
12
|
+
defaultState,
|
|
13
|
+
NUMGroup,
|
|
14
|
+
SCOORDGroup,
|
|
15
|
+
ReferencedFrameNumber
|
|
16
|
+
} = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, CircleROI.toolType);
|
|
17
|
+
const referencedImageId = defaultState.annotation.metadata.referencedImageId;
|
|
18
|
+
const {
|
|
19
|
+
GraphicData
|
|
20
|
+
} = SCOORDGroup;
|
|
21
|
+
const pointsWorld = [];
|
|
22
|
+
for (let i = 0; i < GraphicData.length; i += 2) {
|
|
23
|
+
const worldPos = imageToWorldCoords(referencedImageId, [GraphicData[i], GraphicData[i + 1]]);
|
|
24
|
+
pointsWorld.push(worldPos);
|
|
25
|
+
}
|
|
26
|
+
const state = defaultState;
|
|
27
|
+
state.annotation.data = {
|
|
28
|
+
handles: {
|
|
29
|
+
points: [...pointsWorld],
|
|
30
|
+
activeHandleIndex: 0,
|
|
31
|
+
textBox: {
|
|
32
|
+
hasMoved: false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
cachedStats: {
|
|
36
|
+
["imageId:".concat(referencedImageId)]: {
|
|
39
37
|
area: NUMGroup ? NUMGroup.MeasuredValueSequence.NumericValue : 0,
|
|
40
38
|
radius: 0,
|
|
41
39
|
perimeter: 0
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
points.push({
|
|
65
|
-
x: center[0],
|
|
66
|
-
y: center[1]
|
|
67
|
-
});
|
|
68
|
-
points.push({
|
|
69
|
-
x: end[0],
|
|
70
|
-
y: end[1]
|
|
71
|
-
});
|
|
72
|
-
var _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
|
|
73
|
-
area = _ref.area,
|
|
74
|
-
radius = _ref.radius;
|
|
75
|
-
var perimeter = 2 * Math.PI * radius;
|
|
76
|
-
return {
|
|
77
|
-
area: area,
|
|
78
|
-
perimeter: perimeter,
|
|
79
|
-
radius: radius,
|
|
80
|
-
points: points,
|
|
81
|
-
trackingIdentifierTextValue: this.trackingIdentifierTextValue,
|
|
82
|
-
finding: finding,
|
|
83
|
-
findingSites: findingSites || []
|
|
84
|
-
};
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
frameNumber: ReferencedFrameNumber
|
|
43
|
+
};
|
|
44
|
+
return state;
|
|
45
|
+
}
|
|
46
|
+
static getTID300RepresentationArguments(tool, worldToImageCoords) {
|
|
47
|
+
const {
|
|
48
|
+
data,
|
|
49
|
+
finding,
|
|
50
|
+
findingSites,
|
|
51
|
+
metadata
|
|
52
|
+
} = tool;
|
|
53
|
+
const {
|
|
54
|
+
cachedStats = {},
|
|
55
|
+
handles
|
|
56
|
+
} = data;
|
|
57
|
+
const {
|
|
58
|
+
referencedImageId
|
|
59
|
+
} = metadata;
|
|
60
|
+
if (!referencedImageId) {
|
|
61
|
+
throw new Error("CircleROI.getTID300RepresentationArguments: referencedImageId is not defined");
|
|
85
62
|
}
|
|
86
|
-
|
|
87
|
-
|
|
63
|
+
const center = worldToImageCoords(referencedImageId, handles.points[0]);
|
|
64
|
+
const end = worldToImageCoords(referencedImageId, handles.points[1]);
|
|
65
|
+
const points = [];
|
|
66
|
+
points.push({
|
|
67
|
+
x: center[0],
|
|
68
|
+
y: center[1]
|
|
69
|
+
});
|
|
70
|
+
points.push({
|
|
71
|
+
x: end[0],
|
|
72
|
+
y: end[1]
|
|
73
|
+
});
|
|
74
|
+
const {
|
|
75
|
+
area,
|
|
76
|
+
radius
|
|
77
|
+
} = cachedStats["imageId:".concat(referencedImageId)] || {};
|
|
78
|
+
const perimeter = 2 * Math.PI * radius;
|
|
79
|
+
return {
|
|
80
|
+
area,
|
|
81
|
+
perimeter,
|
|
82
|
+
radius,
|
|
83
|
+
points,
|
|
84
|
+
trackingIdentifierTextValue: this.trackingIdentifierTextValue,
|
|
85
|
+
finding,
|
|
86
|
+
findingSites: findingSites || []
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
88
90
|
_CircleROI = CircleROI;
|
|
89
|
-
|
|
90
|
-
_CircleROI.
|
|
91
|
-
_CircleROI.
|
|
92
|
-
|
|
93
|
-
_CircleROI.isValidCornerstoneTrackingIdentifier = isValidCornerstoneTrackingIdentifier;
|
|
94
|
-
MeasurementReport.registerTool(CircleROI);
|
|
91
|
+
(() => {
|
|
92
|
+
_CircleROI.init("CircleROI", TID300Circle);
|
|
93
|
+
_CircleROI.registerLegacy();
|
|
94
|
+
})();
|
|
95
95
|
|
|
96
96
|
export { CircleROI as default };
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
static utilityToolType: string;
|
|
4
|
-
static TID300Representation: any;
|
|
5
|
-
static isValidCornerstoneTrackingIdentifier: (TrackingIdentifier: any) => boolean;
|
|
1
|
+
import BaseAdapter3D from "./BaseAdapter3D";
|
|
2
|
+
declare class CobbAngle extends BaseAdapter3D {
|
|
6
3
|
static getMeasurementData(MeasurementGroup: any, sopInstanceUIDToImageIdMap: any, imageToWorldCoords: any, metadata: any): {
|
|
7
4
|
description: any;
|
|
8
5
|
sopInstanceUid: any;
|