@cornerstonejs/adapters 2.0.0-beta.8 → 2.0.1
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/_virtual/_rollupPluginBabelHelpers.js +493 -0
- package/dist/esm/adapters/Cornerstone/Angle.d.ts +42 -0
- package/dist/esm/adapters/Cornerstone/Angle.js +93 -0
- package/dist/esm/adapters/Cornerstone/ArrowAnnotate.d.ts +49 -0
- package/dist/esm/adapters/Cornerstone/ArrowAnnotate.js +97 -0
- package/dist/esm/adapters/Cornerstone/Bidirectional.d.ts +89 -0
- package/dist/esm/adapters/Cornerstone/Bidirectional.js +170 -0
- package/dist/esm/adapters/Cornerstone/CircleRoi.d.ts +58 -0
- package/dist/esm/adapters/Cornerstone/CircleRoi.js +115 -0
- package/dist/esm/adapters/Cornerstone/CobbAngle.d.ts +49 -0
- package/dist/esm/adapters/Cornerstone/CobbAngle.js +98 -0
- package/dist/esm/adapters/Cornerstone/EllipticalRoi.d.ts +57 -0
- package/dist/esm/adapters/Cornerstone/EllipticalRoi.js +178 -0
- package/dist/esm/adapters/Cornerstone/FreehandRoi.d.ts +42 -0
- package/dist/esm/adapters/Cornerstone/FreehandRoi.js +89 -0
- package/dist/esm/adapters/Cornerstone/Length.d.ts +39 -0
- package/dist/esm/adapters/Cornerstone/Length.js +82 -0
- package/dist/esm/adapters/Cornerstone/MeasurementReport.d.ts +29 -0
- package/dist/esm/adapters/Cornerstone/MeasurementReport.js +276 -0
- package/dist/esm/adapters/Cornerstone/ParametricMap.d.ts +7 -0
- package/dist/esm/adapters/Cornerstone/ParametricMap.js +210 -0
- package/dist/esm/adapters/Cornerstone/RectangleRoi.d.ts +44 -0
- package/dist/esm/adapters/Cornerstone/RectangleRoi.js +97 -0
- package/dist/esm/adapters/Cornerstone/Segmentation.d.ts +7 -0
- package/dist/esm/adapters/Cornerstone/Segmentation.js +73 -0
- package/dist/esm/adapters/Cornerstone/Segmentation_3X.d.ts +13 -0
- package/dist/esm/adapters/Cornerstone/Segmentation_3X.js +411 -0
- package/dist/esm/adapters/Cornerstone/Segmentation_4X.d.ts +13 -0
- package/dist/esm/adapters/Cornerstone/Segmentation_4X.js +1152 -0
- package/dist/esm/adapters/Cornerstone/cornerstone4Tag.d.ts +2 -0
- package/dist/esm/adapters/Cornerstone/cornerstone4Tag.js +3 -0
- package/dist/esm/adapters/Cornerstone/index.d.ts +34 -0
- package/dist/esm/adapters/Cornerstone/index.js +33 -0
- package/dist/esm/adapters/Cornerstone3D/Angle.js +109 -0
- package/dist/esm/adapters/Cornerstone3D/ArrowAnnotate.d.ts +35 -0
- package/dist/esm/adapters/Cornerstone3D/ArrowAnnotate.js +123 -0
- package/dist/esm/adapters/Cornerstone3D/Bidirectional.js +147 -0
- package/dist/{types → esm}/adapters/Cornerstone3D/CircleROI.d.ts +0 -7
- package/dist/esm/adapters/Cornerstone3D/CircleROI.js +96 -0
- package/dist/esm/adapters/Cornerstone3D/CobbAngle.js +113 -0
- package/dist/esm/adapters/Cornerstone3D/CodingScheme.d.ts +9 -0
- package/dist/esm/adapters/Cornerstone3D/CodingScheme.js +15 -0
- package/dist/esm/adapters/Cornerstone3D/EllipticalROI.js +160 -0
- package/dist/esm/adapters/Cornerstone3D/Length.d.ts +41 -0
- package/dist/esm/adapters/Cornerstone3D/Length.js +101 -0
- package/dist/{types → esm}/adapters/Cornerstone3D/MeasurementReport.d.ts +1 -8
- package/dist/esm/adapters/Cornerstone3D/MeasurementReport.js +281 -0
- package/dist/esm/adapters/Cornerstone3D/ParametricMap/generateToolState.d.ts +3 -0
- package/dist/esm/adapters/Cornerstone3D/ParametricMap/generateToolState.js +11 -0
- package/dist/esm/adapters/Cornerstone3D/ParametricMap/index.d.ts +1 -0
- package/dist/esm/adapters/Cornerstone3D/ParametricMap/index.js +1 -0
- package/dist/{types → esm}/adapters/Cornerstone3D/PlanarFreehandROI.d.ts +0 -2
- package/dist/esm/adapters/Cornerstone3D/PlanarFreehandROI.js +126 -0
- package/dist/esm/adapters/Cornerstone3D/Probe.d.ts +33 -0
- package/dist/esm/adapters/Cornerstone3D/Probe.js +87 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/RTSS.d.ts +67 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/RTSS.js +175 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/index.js +6 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getPatientModule.d.ts +13 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getPatientModule.js +22 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTROIObservationsSequence.d.ts +6 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTROIObservationsSequence.js +10 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTSeriesModule.d.ts +4 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTSeriesModule.js +9 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedFrameOfReferenceSequence.d.ts +11 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedFrameOfReferenceSequence.js +22 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedSeriesSequence.d.ts +4 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedSeriesSequence.js +27 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getStructureSetModule.d.ts +7 -0
- package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getStructureSetModule.js +12 -0
- package/dist/esm/adapters/Cornerstone3D/RectangleROI.js +94 -0
- package/dist/{types → esm}/adapters/Cornerstone3D/Segmentation/generateLabelMaps2DFrom3D.d.ts +0 -6
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateLabelMaps2DFrom3D.js +34 -0
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateSegmentation.d.ts +2 -0
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateSegmentation.js +29 -0
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateToolState.d.ts +2 -0
- package/dist/esm/adapters/Cornerstone3D/Segmentation/generateToolState.js +9 -0
- package/dist/esm/adapters/Cornerstone3D/Segmentation/index.js +3 -0
- package/dist/esm/adapters/Cornerstone3D/UltrasoundDirectional.js +93 -0
- package/dist/esm/adapters/Cornerstone3D/cornerstone3DTag.d.ts +2 -0
- package/dist/esm/adapters/Cornerstone3D/cornerstone3DTag.js +3 -0
- package/dist/{types → esm}/adapters/Cornerstone3D/index.d.ts +18 -6
- package/dist/esm/adapters/Cornerstone3D/index.js +45 -0
- package/dist/esm/adapters/Cornerstone3D/isValidCornerstoneTrackingIdentifier.js +18 -0
- package/dist/esm/adapters/VTKjs/Segmentation.d.ts +3 -0
- package/dist/esm/adapters/VTKjs/Segmentation.js +186 -0
- package/dist/esm/adapters/VTKjs/index.d.ts +5 -0
- package/dist/esm/adapters/VTKjs/index.js +7 -0
- package/dist/{types → esm}/adapters/enums/Events.d.ts +0 -6
- package/dist/esm/adapters/enums/Events.js +7 -0
- package/dist/esm/adapters/enums/index.js +1 -0
- package/dist/esm/adapters/helpers/checkIfPerpendicular.d.ts +1 -0
- package/dist/esm/adapters/helpers/checkIfPerpendicular.js +7 -0
- package/dist/esm/adapters/helpers/checkOrientation.d.ts +1 -0
- package/dist/esm/adapters/helpers/checkOrientation.js +22 -0
- package/dist/esm/adapters/helpers/codeMeaningEquals.d.ts +2 -0
- package/dist/esm/adapters/helpers/codeMeaningEquals.js +7 -0
- package/dist/esm/adapters/helpers/compareArrays.d.ts +1 -0
- package/dist/esm/adapters/helpers/compareArrays.js +16 -0
- package/dist/esm/adapters/helpers/downloadDICOMData.d.ts +5 -0
- package/dist/esm/adapters/helpers/downloadDICOMData.js +26 -0
- package/dist/esm/adapters/helpers/getDatasetsFromImages.d.ts +1 -0
- package/dist/esm/adapters/helpers/getDatasetsFromImages.js +33 -0
- package/dist/esm/adapters/helpers/graphicTypeEquals.d.ts +2 -0
- package/dist/esm/adapters/helpers/graphicTypeEquals.js +7 -0
- package/dist/esm/adapters/helpers/index.js +4 -0
- package/dist/esm/adapters/helpers/toArray.js +5 -0
- package/dist/esm/adapters/index.d.ts +66 -0
- package/dist/esm/adapters/index.js +24 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +5 -0
- package/dist/umd/adapters.umd.js +5769 -0
- package/dist/umd/adapters.umd.js.map +1 -0
- package/package.json +47 -11
- package/dist/adapters.es.js +0 -5585
- package/dist/adapters.es.js.map +0 -1
- package/dist/types/adapters/Cornerstone/index.d.ts +0 -16
- package/dist/types/adapters/Cornerstone3D/RTStruct/RTSS.d.ts +0 -26
- package/dist/types/adapters/Cornerstone3D/Segmentation/generateSegmentation.d.ts +0 -8
- package/dist/types/adapters/Cornerstone3D/Segmentation/generateToolState.d.ts +0 -16
- package/dist/types/adapters/VTKjs/index.d.ts +0 -4
- package/dist/types/adapters/helpers/codeMeaningEquals.d.ts +0 -9
- package/dist/types/adapters/helpers/downloadDICOMData.d.ts +0 -10
- package/dist/types/adapters/helpers/graphicTypeEquals.d.ts +0 -7
- package/dist/types/adapters/index.d.ts +0 -49
- package/dist/types/index.d.ts +0 -2
- /package/dist/{types → esm}/adapters/Cornerstone3D/Angle.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/Bidirectional.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/CobbAngle.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/EllipticalROI.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/RTStruct/index.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/RectangleROI.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/Segmentation/index.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/UltrasoundDirectional.d.ts +0 -0
- /package/dist/{types → esm}/adapters/Cornerstone3D/isValidCornerstoneTrackingIdentifier.d.ts +0 -0
- /package/dist/{types → esm}/adapters/enums/index.d.ts +0 -0
- /package/dist/{types → esm}/adapters/helpers/index.d.ts +0 -0
- /package/dist/{types → esm}/adapters/helpers/toArray.d.ts +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export default EllipticalRoi;
|
|
2
|
+
declare class EllipticalRoi {
|
|
3
|
+
static getMeasurementData(MeasurementGroup: any): {
|
|
4
|
+
toolType: string;
|
|
5
|
+
active: boolean;
|
|
6
|
+
cachedStats: {
|
|
7
|
+
area: any;
|
|
8
|
+
};
|
|
9
|
+
handles: {
|
|
10
|
+
end: {
|
|
11
|
+
x: any;
|
|
12
|
+
y: any;
|
|
13
|
+
highlight: boolean;
|
|
14
|
+
active: boolean;
|
|
15
|
+
};
|
|
16
|
+
initialRotation: number;
|
|
17
|
+
start: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
highlight: boolean;
|
|
21
|
+
active: boolean;
|
|
22
|
+
};
|
|
23
|
+
textBox: {
|
|
24
|
+
hasMoved: boolean;
|
|
25
|
+
movesIndependently: boolean;
|
|
26
|
+
drawnIndependently: boolean;
|
|
27
|
+
allowedOutsideImage: boolean;
|
|
28
|
+
hasBoundingBox: boolean;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
invalidated: boolean;
|
|
32
|
+
visible: boolean;
|
|
33
|
+
sopInstanceUid: any;
|
|
34
|
+
frameIndex: any;
|
|
35
|
+
complete: boolean;
|
|
36
|
+
finding: any;
|
|
37
|
+
findingSites: any[];
|
|
38
|
+
};
|
|
39
|
+
static getTID300RepresentationArguments(tool: any): {
|
|
40
|
+
area: any;
|
|
41
|
+
points: {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
}[];
|
|
45
|
+
trackingIdentifierTextValue: string;
|
|
46
|
+
finding: any;
|
|
47
|
+
findingSites: any;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
declare namespace EllipticalRoi {
|
|
51
|
+
export { ELLIPTICALROI as toolType };
|
|
52
|
+
export { ELLIPTICALROI as utilityToolType };
|
|
53
|
+
export { TID300Ellipse as TID300Representation };
|
|
54
|
+
export function isValidCornerstoneTrackingIdentifier(TrackingIdentifier: any): boolean;
|
|
55
|
+
}
|
|
56
|
+
declare const ELLIPTICALROI: "EllipticalRoi";
|
|
57
|
+
declare const TID300Ellipse: any;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { slicedToArray as _slicedToArray, createClass as _createClass, objectSpread2 as _objectSpread2, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { utilities } from 'dcmjs';
|
|
3
|
+
import MeasurementReport from './MeasurementReport.js';
|
|
4
|
+
import CORNERSTONE_4_TAG from './cornerstone4Tag.js';
|
|
5
|
+
|
|
6
|
+
var TID300Ellipse = utilities.TID300.Ellipse;
|
|
7
|
+
var ELLIPTICALROI = "EllipticalRoi";
|
|
8
|
+
var EllipticalRoi = /*#__PURE__*/function () {
|
|
9
|
+
function EllipticalRoi() {
|
|
10
|
+
_classCallCheck(this, EllipticalRoi);
|
|
11
|
+
}
|
|
12
|
+
return _createClass(EllipticalRoi, null, [{
|
|
13
|
+
key: "getMeasurementData",
|
|
14
|
+
value:
|
|
15
|
+
// TODO: this function is required for all Cornerstone Tool Adapters, since it is called by MeasurementReport.
|
|
16
|
+
function getMeasurementData(MeasurementGroup) {
|
|
17
|
+
var _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup),
|
|
18
|
+
defaultState = _MeasurementReport$ge.defaultState,
|
|
19
|
+
NUMGroup = _MeasurementReport$ge.NUMGroup,
|
|
20
|
+
SCOORDGroup = _MeasurementReport$ge.SCOORDGroup;
|
|
21
|
+
var GraphicData = SCOORDGroup.GraphicData;
|
|
22
|
+
var majorAxis = [{
|
|
23
|
+
x: GraphicData[0],
|
|
24
|
+
y: GraphicData[1]
|
|
25
|
+
}, {
|
|
26
|
+
x: GraphicData[2],
|
|
27
|
+
y: GraphicData[3]
|
|
28
|
+
}];
|
|
29
|
+
var minorAxis = [{
|
|
30
|
+
x: GraphicData[4],
|
|
31
|
+
y: GraphicData[5]
|
|
32
|
+
}, {
|
|
33
|
+
x: GraphicData[6],
|
|
34
|
+
y: GraphicData[7]
|
|
35
|
+
}];
|
|
36
|
+
|
|
37
|
+
// Calculate two opposite corners of box defined by two axes.
|
|
38
|
+
|
|
39
|
+
var minorAxisLength = Math.sqrt(Math.pow(minorAxis[0].x - minorAxis[1].x, 2) + Math.pow(minorAxis[0].y - minorAxis[1].y, 2));
|
|
40
|
+
var minorAxisDirection = {
|
|
41
|
+
x: (minorAxis[1].x - minorAxis[0].x) / minorAxisLength,
|
|
42
|
+
y: (minorAxis[1].y - minorAxis[0].y) / minorAxisLength
|
|
43
|
+
};
|
|
44
|
+
var halfMinorAxisLength = minorAxisLength / 2;
|
|
45
|
+
|
|
46
|
+
// First end point of major axis + half minor axis vector
|
|
47
|
+
var corner1 = {
|
|
48
|
+
x: majorAxis[0].x + minorAxisDirection.x * halfMinorAxisLength,
|
|
49
|
+
y: majorAxis[0].y + minorAxisDirection.y * halfMinorAxisLength
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// Second end point of major axis - half of minor axis vector
|
|
53
|
+
var corner2 = {
|
|
54
|
+
x: majorAxis[1].x - minorAxisDirection.x * halfMinorAxisLength,
|
|
55
|
+
y: majorAxis[1].y - minorAxisDirection.y * halfMinorAxisLength
|
|
56
|
+
};
|
|
57
|
+
var state = _objectSpread2(_objectSpread2({}, defaultState), {}, {
|
|
58
|
+
toolType: EllipticalRoi.toolType,
|
|
59
|
+
active: false,
|
|
60
|
+
cachedStats: {
|
|
61
|
+
area: NUMGroup ? NUMGroup.MeasuredValueSequence.NumericValue : 0
|
|
62
|
+
},
|
|
63
|
+
handles: {
|
|
64
|
+
end: {
|
|
65
|
+
x: corner1.x,
|
|
66
|
+
y: corner1.y,
|
|
67
|
+
highlight: false,
|
|
68
|
+
active: false
|
|
69
|
+
},
|
|
70
|
+
initialRotation: 0,
|
|
71
|
+
start: {
|
|
72
|
+
x: corner2.x,
|
|
73
|
+
y: corner2.y,
|
|
74
|
+
highlight: false,
|
|
75
|
+
active: false
|
|
76
|
+
},
|
|
77
|
+
textBox: {
|
|
78
|
+
hasMoved: false,
|
|
79
|
+
movesIndependently: false,
|
|
80
|
+
drawnIndependently: true,
|
|
81
|
+
allowedOutsideImage: true,
|
|
82
|
+
hasBoundingBox: true
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
invalidated: true,
|
|
86
|
+
visible: true
|
|
87
|
+
});
|
|
88
|
+
return state;
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
key: "getTID300RepresentationArguments",
|
|
92
|
+
value: function getTID300RepresentationArguments(tool) {
|
|
93
|
+
var _tool$cachedStats = tool.cachedStats,
|
|
94
|
+
cachedStats = _tool$cachedStats === void 0 ? {} : _tool$cachedStats,
|
|
95
|
+
handles = tool.handles,
|
|
96
|
+
finding = tool.finding,
|
|
97
|
+
findingSites = tool.findingSites;
|
|
98
|
+
var start = handles.start,
|
|
99
|
+
end = handles.end;
|
|
100
|
+
var area = cachedStats.area;
|
|
101
|
+
var halfXLength = Math.abs(start.x - end.x) / 2;
|
|
102
|
+
var halfYLength = Math.abs(start.y - end.y) / 2;
|
|
103
|
+
var points = [];
|
|
104
|
+
var center = {
|
|
105
|
+
x: (start.x + end.x) / 2,
|
|
106
|
+
y: (start.y + end.y) / 2
|
|
107
|
+
};
|
|
108
|
+
if (halfXLength > halfYLength) {
|
|
109
|
+
// X-axis major
|
|
110
|
+
// Major axis
|
|
111
|
+
points.push({
|
|
112
|
+
x: center.x - halfXLength,
|
|
113
|
+
y: center.y
|
|
114
|
+
});
|
|
115
|
+
points.push({
|
|
116
|
+
x: center.x + halfXLength,
|
|
117
|
+
y: center.y
|
|
118
|
+
});
|
|
119
|
+
// Minor axis
|
|
120
|
+
points.push({
|
|
121
|
+
x: center.x,
|
|
122
|
+
y: center.y - halfYLength
|
|
123
|
+
});
|
|
124
|
+
points.push({
|
|
125
|
+
x: center.x,
|
|
126
|
+
y: center.y + halfYLength
|
|
127
|
+
});
|
|
128
|
+
} else {
|
|
129
|
+
// Y-axis major
|
|
130
|
+
// Major axis
|
|
131
|
+
points.push({
|
|
132
|
+
x: center.x,
|
|
133
|
+
y: center.y - halfYLength
|
|
134
|
+
});
|
|
135
|
+
points.push({
|
|
136
|
+
x: center.x,
|
|
137
|
+
y: center.y + halfYLength
|
|
138
|
+
});
|
|
139
|
+
// Minor axis
|
|
140
|
+
points.push({
|
|
141
|
+
x: center.x - halfXLength,
|
|
142
|
+
y: center.y
|
|
143
|
+
});
|
|
144
|
+
points.push({
|
|
145
|
+
x: center.x + halfXLength,
|
|
146
|
+
y: center.y
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
var trackingIdentifierTextValue = "cornerstoneTools@^4.0.0:EllipticalRoi";
|
|
150
|
+
return {
|
|
151
|
+
area: area,
|
|
152
|
+
points: points,
|
|
153
|
+
trackingIdentifierTextValue: trackingIdentifierTextValue,
|
|
154
|
+
finding: finding,
|
|
155
|
+
findingSites: findingSites || []
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}]);
|
|
159
|
+
}();
|
|
160
|
+
EllipticalRoi.toolType = ELLIPTICALROI;
|
|
161
|
+
EllipticalRoi.utilityToolType = ELLIPTICALROI;
|
|
162
|
+
EllipticalRoi.TID300Representation = TID300Ellipse;
|
|
163
|
+
EllipticalRoi.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
|
|
164
|
+
if (!TrackingIdentifier.includes(":")) {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
var _TrackingIdentifier$s = TrackingIdentifier.split(":"),
|
|
168
|
+
_TrackingIdentifier$s2 = _slicedToArray(_TrackingIdentifier$s, 2),
|
|
169
|
+
cornerstone4Tag = _TrackingIdentifier$s2[0],
|
|
170
|
+
toolType = _TrackingIdentifier$s2[1];
|
|
171
|
+
if (cornerstone4Tag !== CORNERSTONE_4_TAG) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
return toolType === ELLIPTICALROI;
|
|
175
|
+
};
|
|
176
|
+
MeasurementReport.registerTool(EllipticalRoi);
|
|
177
|
+
|
|
178
|
+
export { EllipticalRoi as default };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export default FreehandRoi;
|
|
2
|
+
declare class FreehandRoi {
|
|
3
|
+
static getMeasurementData(MeasurementGroup: any): {
|
|
4
|
+
toolType: string;
|
|
5
|
+
handles: {
|
|
6
|
+
points: any[];
|
|
7
|
+
textBox: {
|
|
8
|
+
active: boolean;
|
|
9
|
+
hasMoved: boolean;
|
|
10
|
+
movesIndependently: boolean;
|
|
11
|
+
drawnIndependently: boolean;
|
|
12
|
+
allowedOutsideImage: boolean;
|
|
13
|
+
hasBoundingBox: boolean;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
cachedStats: {
|
|
17
|
+
area: any;
|
|
18
|
+
};
|
|
19
|
+
color: any;
|
|
20
|
+
invalidated: boolean;
|
|
21
|
+
sopInstanceUid: any;
|
|
22
|
+
frameIndex: any;
|
|
23
|
+
complete: boolean;
|
|
24
|
+
finding: any;
|
|
25
|
+
findingSites: any[];
|
|
26
|
+
};
|
|
27
|
+
static getTID300RepresentationArguments(tool: any): {
|
|
28
|
+
points: any;
|
|
29
|
+
area: any;
|
|
30
|
+
perimeter: any;
|
|
31
|
+
trackingIdentifierTextValue: string;
|
|
32
|
+
finding: any;
|
|
33
|
+
findingSites: any;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
declare namespace FreehandRoi {
|
|
37
|
+
export let toolType: string;
|
|
38
|
+
export let utilityToolType: string;
|
|
39
|
+
export { TID300Polyline as TID300Representation };
|
|
40
|
+
export function isValidCornerstoneTrackingIdentifier(TrackingIdentifier: any): boolean;
|
|
41
|
+
}
|
|
42
|
+
declare const TID300Polyline: any;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { slicedToArray as _slicedToArray, createClass as _createClass, objectSpread2 as _objectSpread2, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { utilities } from 'dcmjs';
|
|
3
|
+
import MeasurementReport from './MeasurementReport.js';
|
|
4
|
+
import CORNERSTONE_4_TAG from './cornerstone4Tag.js';
|
|
5
|
+
|
|
6
|
+
var TID300Polyline = utilities.TID300.Polyline;
|
|
7
|
+
var FreehandRoi = /*#__PURE__*/function () {
|
|
8
|
+
function FreehandRoi() {
|
|
9
|
+
_classCallCheck(this, FreehandRoi);
|
|
10
|
+
}
|
|
11
|
+
return _createClass(FreehandRoi, null, [{
|
|
12
|
+
key: "getMeasurementData",
|
|
13
|
+
value: function getMeasurementData(MeasurementGroup) {
|
|
14
|
+
var _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup),
|
|
15
|
+
defaultState = _MeasurementReport$ge.defaultState,
|
|
16
|
+
SCOORDGroup = _MeasurementReport$ge.SCOORDGroup,
|
|
17
|
+
NUMGroup = _MeasurementReport$ge.NUMGroup;
|
|
18
|
+
var state = _objectSpread2(_objectSpread2({}, defaultState), {}, {
|
|
19
|
+
toolType: FreehandRoi.toolType,
|
|
20
|
+
handles: {
|
|
21
|
+
points: [],
|
|
22
|
+
textBox: {
|
|
23
|
+
active: false,
|
|
24
|
+
hasMoved: false,
|
|
25
|
+
movesIndependently: false,
|
|
26
|
+
drawnIndependently: true,
|
|
27
|
+
allowedOutsideImage: true,
|
|
28
|
+
hasBoundingBox: true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
cachedStats: {
|
|
32
|
+
area: NUMGroup ? NUMGroup.MeasuredValueSequence.NumericValue : 0
|
|
33
|
+
},
|
|
34
|
+
color: undefined,
|
|
35
|
+
invalidated: true
|
|
36
|
+
});
|
|
37
|
+
var GraphicData = SCOORDGroup.GraphicData;
|
|
38
|
+
for (var i = 0; i < GraphicData.length; i += 2) {
|
|
39
|
+
state.handles.points.push({
|
|
40
|
+
x: GraphicData[i],
|
|
41
|
+
y: GraphicData[i + 1]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return state;
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
key: "getTID300RepresentationArguments",
|
|
48
|
+
value: function getTID300RepresentationArguments(tool) {
|
|
49
|
+
var handles = tool.handles,
|
|
50
|
+
finding = tool.finding,
|
|
51
|
+
findingSites = tool.findingSites,
|
|
52
|
+
_tool$cachedStats = tool.cachedStats,
|
|
53
|
+
cachedStats = _tool$cachedStats === void 0 ? {} : _tool$cachedStats;
|
|
54
|
+
var points = handles.points;
|
|
55
|
+
var _cachedStats$area = cachedStats.area,
|
|
56
|
+
area = _cachedStats$area === void 0 ? 0 : _cachedStats$area,
|
|
57
|
+
_cachedStats$perimete = cachedStats.perimeter,
|
|
58
|
+
perimeter = _cachedStats$perimete === void 0 ? 0 : _cachedStats$perimete;
|
|
59
|
+
var trackingIdentifierTextValue = "cornerstoneTools@^4.0.0:FreehandRoi";
|
|
60
|
+
return {
|
|
61
|
+
points: points,
|
|
62
|
+
area: area,
|
|
63
|
+
perimeter: perimeter,
|
|
64
|
+
trackingIdentifierTextValue: trackingIdentifierTextValue,
|
|
65
|
+
finding: finding,
|
|
66
|
+
findingSites: findingSites || []
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}]);
|
|
70
|
+
}();
|
|
71
|
+
FreehandRoi.toolType = "FreehandRoi";
|
|
72
|
+
FreehandRoi.utilityToolType = "FreehandRoi";
|
|
73
|
+
FreehandRoi.TID300Representation = TID300Polyline;
|
|
74
|
+
FreehandRoi.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
|
|
75
|
+
if (!TrackingIdentifier.includes(":")) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
var _TrackingIdentifier$s = TrackingIdentifier.split(":"),
|
|
79
|
+
_TrackingIdentifier$s2 = _slicedToArray(_TrackingIdentifier$s, 2),
|
|
80
|
+
cornerstone4Tag = _TrackingIdentifier$s2[0],
|
|
81
|
+
toolType = _TrackingIdentifier$s2[1];
|
|
82
|
+
if (cornerstone4Tag !== CORNERSTONE_4_TAG) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
return toolType === FreehandRoi.toolType;
|
|
86
|
+
};
|
|
87
|
+
MeasurementReport.registerTool(FreehandRoi);
|
|
88
|
+
|
|
89
|
+
export { FreehandRoi as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export default Length;
|
|
2
|
+
declare class Length {
|
|
3
|
+
static getMeasurementData(MeasurementGroup: any): {
|
|
4
|
+
length: any;
|
|
5
|
+
toolType: string;
|
|
6
|
+
handles: {
|
|
7
|
+
start: {};
|
|
8
|
+
end: {};
|
|
9
|
+
textBox: {
|
|
10
|
+
hasMoved: boolean;
|
|
11
|
+
movesIndependently: boolean;
|
|
12
|
+
drawnIndependently: boolean;
|
|
13
|
+
allowedOutsideImage: boolean;
|
|
14
|
+
hasBoundingBox: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
sopInstanceUid: any;
|
|
18
|
+
frameIndex: any;
|
|
19
|
+
complete: boolean;
|
|
20
|
+
finding: any;
|
|
21
|
+
findingSites: any[];
|
|
22
|
+
};
|
|
23
|
+
static getTID300RepresentationArguments(tool: any): {
|
|
24
|
+
point1: any;
|
|
25
|
+
point2: any;
|
|
26
|
+
distance: any;
|
|
27
|
+
trackingIdentifierTextValue: string;
|
|
28
|
+
finding: any;
|
|
29
|
+
findingSites: any;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
declare namespace Length {
|
|
33
|
+
export { LENGTH as toolType };
|
|
34
|
+
export { LENGTH as utilityToolType };
|
|
35
|
+
export { TID300Length as TID300Representation };
|
|
36
|
+
export function isValidCornerstoneTrackingIdentifier(TrackingIdentifier: any): boolean;
|
|
37
|
+
}
|
|
38
|
+
declare const LENGTH: "Length";
|
|
39
|
+
declare const TID300Length: any;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { slicedToArray as _slicedToArray, createClass as _createClass, objectSpread2 as _objectSpread2, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { utilities } from 'dcmjs';
|
|
3
|
+
import MeasurementReport from './MeasurementReport.js';
|
|
4
|
+
import CORNERSTONE_4_TAG from './cornerstone4Tag.js';
|
|
5
|
+
|
|
6
|
+
var TID300Length = utilities.TID300.Length;
|
|
7
|
+
var LENGTH = "Length";
|
|
8
|
+
var Length = /*#__PURE__*/function () {
|
|
9
|
+
function Length() {
|
|
10
|
+
_classCallCheck(this, Length);
|
|
11
|
+
}
|
|
12
|
+
return _createClass(Length, null, [{
|
|
13
|
+
key: "getMeasurementData",
|
|
14
|
+
value:
|
|
15
|
+
// TODO: this function is required for all Cornerstone Tool Adapters, since it is called by MeasurementReport.
|
|
16
|
+
function getMeasurementData(MeasurementGroup) {
|
|
17
|
+
var _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup),
|
|
18
|
+
defaultState = _MeasurementReport$ge.defaultState,
|
|
19
|
+
NUMGroup = _MeasurementReport$ge.NUMGroup,
|
|
20
|
+
SCOORDGroup = _MeasurementReport$ge.SCOORDGroup;
|
|
21
|
+
var state = _objectSpread2(_objectSpread2({}, defaultState), {}, {
|
|
22
|
+
length: NUMGroup.MeasuredValueSequence.NumericValue,
|
|
23
|
+
toolType: Length.toolType,
|
|
24
|
+
handles: {
|
|
25
|
+
start: {},
|
|
26
|
+
end: {},
|
|
27
|
+
textBox: {
|
|
28
|
+
hasMoved: false,
|
|
29
|
+
movesIndependently: false,
|
|
30
|
+
drawnIndependently: true,
|
|
31
|
+
allowedOutsideImage: true,
|
|
32
|
+
hasBoundingBox: true
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
var _SCOORDGroup$GraphicD = _slicedToArray(SCOORDGroup.GraphicData, 4);
|
|
37
|
+
state.handles.start.x = _SCOORDGroup$GraphicD[0];
|
|
38
|
+
state.handles.start.y = _SCOORDGroup$GraphicD[1];
|
|
39
|
+
state.handles.end.x = _SCOORDGroup$GraphicD[2];
|
|
40
|
+
state.handles.end.y = _SCOORDGroup$GraphicD[3];
|
|
41
|
+
return state;
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
key: "getTID300RepresentationArguments",
|
|
45
|
+
value: function getTID300RepresentationArguments(tool) {
|
|
46
|
+
var handles = tool.handles,
|
|
47
|
+
finding = tool.finding,
|
|
48
|
+
findingSites = tool.findingSites;
|
|
49
|
+
var point1 = handles.start;
|
|
50
|
+
var point2 = handles.end;
|
|
51
|
+
var distance = tool.length;
|
|
52
|
+
var trackingIdentifierTextValue = "cornerstoneTools@^4.0.0:Length";
|
|
53
|
+
return {
|
|
54
|
+
point1: point1,
|
|
55
|
+
point2: point2,
|
|
56
|
+
distance: distance,
|
|
57
|
+
trackingIdentifierTextValue: trackingIdentifierTextValue,
|
|
58
|
+
finding: finding,
|
|
59
|
+
findingSites: findingSites || []
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}]);
|
|
63
|
+
}();
|
|
64
|
+
Length.toolType = LENGTH;
|
|
65
|
+
Length.utilityToolType = LENGTH;
|
|
66
|
+
Length.TID300Representation = TID300Length;
|
|
67
|
+
Length.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
|
|
68
|
+
if (!TrackingIdentifier.includes(":")) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
var _TrackingIdentifier$s = TrackingIdentifier.split(":"),
|
|
72
|
+
_TrackingIdentifier$s2 = _slicedToArray(_TrackingIdentifier$s, 2),
|
|
73
|
+
cornerstone4Tag = _TrackingIdentifier$s2[0],
|
|
74
|
+
toolType = _TrackingIdentifier$s2[1];
|
|
75
|
+
if (cornerstone4Tag !== CORNERSTONE_4_TAG) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
return toolType === LENGTH;
|
|
79
|
+
};
|
|
80
|
+
MeasurementReport.registerTool(Length);
|
|
81
|
+
|
|
82
|
+
export { Length as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare class MeasurementReport {
|
|
2
|
+
static getSetupMeasurementData(MeasurementGroup: any): {
|
|
3
|
+
defaultState: {
|
|
4
|
+
sopInstanceUid: any;
|
|
5
|
+
frameIndex: any;
|
|
6
|
+
complete: boolean;
|
|
7
|
+
finding: any;
|
|
8
|
+
findingSites: any[];
|
|
9
|
+
};
|
|
10
|
+
findingGroup: any;
|
|
11
|
+
findingSiteGroups: any[];
|
|
12
|
+
NUMGroup: any;
|
|
13
|
+
SCOORDGroup: any;
|
|
14
|
+
ReferencedSOPSequence: any;
|
|
15
|
+
ReferencedSOPInstanceUID: any;
|
|
16
|
+
ReferencedFrameNumber: any;
|
|
17
|
+
};
|
|
18
|
+
static generateReport(toolState: any, metadataProvider: any, options: any): any;
|
|
19
|
+
static generateToolState(dataset: object, hooks?: {
|
|
20
|
+
getToolClass: Function;
|
|
21
|
+
}): {};
|
|
22
|
+
static registerTool(toolClass: any): void;
|
|
23
|
+
}
|
|
24
|
+
declare namespace MeasurementReport {
|
|
25
|
+
let MEASUREMENT_BY_TOOLTYPE: {};
|
|
26
|
+
let CORNERSTONE_TOOL_CLASSES_BY_UTILITY_TYPE: {};
|
|
27
|
+
let CORNERSTONE_TOOL_CLASSES_BY_TOOL_TYPE: {};
|
|
28
|
+
}
|
|
29
|
+
export default MeasurementReport;
|