@cornerstonejs/adapters 2.0.0-beta.7 → 2.0.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 (138) hide show
  1. package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +493 -0
  2. package/dist/esm/adapters/Cornerstone/Angle.d.ts +42 -0
  3. package/dist/esm/adapters/Cornerstone/Angle.js +93 -0
  4. package/dist/esm/adapters/Cornerstone/ArrowAnnotate.d.ts +49 -0
  5. package/dist/esm/adapters/Cornerstone/ArrowAnnotate.js +97 -0
  6. package/dist/esm/adapters/Cornerstone/Bidirectional.d.ts +89 -0
  7. package/dist/esm/adapters/Cornerstone/Bidirectional.js +170 -0
  8. package/dist/esm/adapters/Cornerstone/CircleRoi.d.ts +58 -0
  9. package/dist/esm/adapters/Cornerstone/CircleRoi.js +115 -0
  10. package/dist/esm/adapters/Cornerstone/CobbAngle.d.ts +49 -0
  11. package/dist/esm/adapters/Cornerstone/CobbAngle.js +98 -0
  12. package/dist/esm/adapters/Cornerstone/EllipticalRoi.d.ts +57 -0
  13. package/dist/esm/adapters/Cornerstone/EllipticalRoi.js +178 -0
  14. package/dist/esm/adapters/Cornerstone/FreehandRoi.d.ts +42 -0
  15. package/dist/esm/adapters/Cornerstone/FreehandRoi.js +89 -0
  16. package/dist/esm/adapters/Cornerstone/Length.d.ts +39 -0
  17. package/dist/esm/adapters/Cornerstone/Length.js +82 -0
  18. package/dist/esm/adapters/Cornerstone/MeasurementReport.d.ts +29 -0
  19. package/dist/esm/adapters/Cornerstone/MeasurementReport.js +276 -0
  20. package/dist/esm/adapters/Cornerstone/ParametricMap.d.ts +7 -0
  21. package/dist/esm/adapters/Cornerstone/ParametricMap.js +210 -0
  22. package/dist/esm/adapters/Cornerstone/RectangleRoi.d.ts +44 -0
  23. package/dist/esm/adapters/Cornerstone/RectangleRoi.js +97 -0
  24. package/dist/esm/adapters/Cornerstone/Segmentation.d.ts +7 -0
  25. package/dist/esm/adapters/Cornerstone/Segmentation.js +73 -0
  26. package/dist/esm/adapters/Cornerstone/Segmentation_3X.d.ts +13 -0
  27. package/dist/esm/adapters/Cornerstone/Segmentation_3X.js +411 -0
  28. package/dist/esm/adapters/Cornerstone/Segmentation_4X.d.ts +13 -0
  29. package/dist/esm/adapters/Cornerstone/Segmentation_4X.js +1152 -0
  30. package/dist/esm/adapters/Cornerstone/cornerstone4Tag.d.ts +2 -0
  31. package/dist/esm/adapters/Cornerstone/cornerstone4Tag.js +3 -0
  32. package/dist/esm/adapters/Cornerstone/index.d.ts +34 -0
  33. package/dist/esm/adapters/Cornerstone/index.js +33 -0
  34. package/dist/esm/adapters/Cornerstone3D/Angle.js +109 -0
  35. package/dist/esm/adapters/Cornerstone3D/ArrowAnnotate.d.ts +35 -0
  36. package/dist/esm/adapters/Cornerstone3D/ArrowAnnotate.js +123 -0
  37. package/dist/esm/adapters/Cornerstone3D/Bidirectional.js +147 -0
  38. package/dist/{types → esm}/adapters/Cornerstone3D/CircleROI.d.ts +0 -7
  39. package/dist/esm/adapters/Cornerstone3D/CircleROI.js +96 -0
  40. package/dist/esm/adapters/Cornerstone3D/CobbAngle.js +113 -0
  41. package/dist/esm/adapters/Cornerstone3D/CodingScheme.d.ts +9 -0
  42. package/dist/esm/adapters/Cornerstone3D/CodingScheme.js +15 -0
  43. package/dist/esm/adapters/Cornerstone3D/EllipticalROI.js +160 -0
  44. package/dist/esm/adapters/Cornerstone3D/Length.d.ts +41 -0
  45. package/dist/esm/adapters/Cornerstone3D/Length.js +101 -0
  46. package/dist/{types → esm}/adapters/Cornerstone3D/MeasurementReport.d.ts +1 -8
  47. package/dist/esm/adapters/Cornerstone3D/MeasurementReport.js +281 -0
  48. package/dist/esm/adapters/Cornerstone3D/ParametricMap/generateToolState.d.ts +3 -0
  49. package/dist/esm/adapters/Cornerstone3D/ParametricMap/generateToolState.js +11 -0
  50. package/dist/esm/adapters/Cornerstone3D/ParametricMap/index.d.ts +1 -0
  51. package/dist/esm/adapters/Cornerstone3D/ParametricMap/index.js +1 -0
  52. package/dist/{types → esm}/adapters/Cornerstone3D/PlanarFreehandROI.d.ts +0 -2
  53. package/dist/esm/adapters/Cornerstone3D/PlanarFreehandROI.js +126 -0
  54. package/dist/esm/adapters/Cornerstone3D/Probe.d.ts +33 -0
  55. package/dist/esm/adapters/Cornerstone3D/Probe.js +87 -0
  56. package/dist/esm/adapters/Cornerstone3D/RTStruct/RTSS.d.ts +67 -0
  57. package/dist/esm/adapters/Cornerstone3D/RTStruct/RTSS.js +175 -0
  58. package/dist/esm/adapters/Cornerstone3D/RTStruct/index.js +6 -0
  59. package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getPatientModule.d.ts +13 -0
  60. package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getPatientModule.js +22 -0
  61. package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTROIObservationsSequence.d.ts +6 -0
  62. package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTROIObservationsSequence.js +10 -0
  63. package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTSeriesModule.d.ts +4 -0
  64. package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTSeriesModule.js +9 -0
  65. package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedFrameOfReferenceSequence.d.ts +11 -0
  66. package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedFrameOfReferenceSequence.js +22 -0
  67. package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedSeriesSequence.d.ts +4 -0
  68. package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedSeriesSequence.js +27 -0
  69. package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getStructureSetModule.d.ts +7 -0
  70. package/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getStructureSetModule.js +12 -0
  71. package/dist/esm/adapters/Cornerstone3D/RectangleROI.js +94 -0
  72. package/dist/{types → esm}/adapters/Cornerstone3D/Segmentation/generateLabelMaps2DFrom3D.d.ts +0 -6
  73. package/dist/esm/adapters/Cornerstone3D/Segmentation/generateLabelMaps2DFrom3D.js +34 -0
  74. package/dist/esm/adapters/Cornerstone3D/Segmentation/generateSegmentation.d.ts +2 -0
  75. package/dist/esm/adapters/Cornerstone3D/Segmentation/generateSegmentation.js +29 -0
  76. package/dist/esm/adapters/Cornerstone3D/Segmentation/generateToolState.d.ts +2 -0
  77. package/dist/esm/adapters/Cornerstone3D/Segmentation/generateToolState.js +9 -0
  78. package/dist/esm/adapters/Cornerstone3D/Segmentation/index.js +3 -0
  79. package/dist/esm/adapters/Cornerstone3D/UltrasoundDirectional.js +93 -0
  80. package/dist/esm/adapters/Cornerstone3D/cornerstone3DTag.d.ts +2 -0
  81. package/dist/esm/adapters/Cornerstone3D/cornerstone3DTag.js +3 -0
  82. package/dist/{types → esm}/adapters/Cornerstone3D/index.d.ts +18 -6
  83. package/dist/esm/adapters/Cornerstone3D/index.js +45 -0
  84. package/dist/esm/adapters/Cornerstone3D/isValidCornerstoneTrackingIdentifier.js +18 -0
  85. package/dist/esm/adapters/VTKjs/Segmentation.d.ts +3 -0
  86. package/dist/esm/adapters/VTKjs/Segmentation.js +186 -0
  87. package/dist/esm/adapters/VTKjs/index.d.ts +5 -0
  88. package/dist/esm/adapters/VTKjs/index.js +7 -0
  89. package/dist/{types → esm}/adapters/enums/Events.d.ts +0 -6
  90. package/dist/esm/adapters/enums/Events.js +7 -0
  91. package/dist/esm/adapters/enums/index.js +1 -0
  92. package/dist/esm/adapters/helpers/checkIfPerpendicular.d.ts +1 -0
  93. package/dist/esm/adapters/helpers/checkIfPerpendicular.js +7 -0
  94. package/dist/esm/adapters/helpers/checkOrientation.d.ts +1 -0
  95. package/dist/esm/adapters/helpers/checkOrientation.js +22 -0
  96. package/dist/esm/adapters/helpers/codeMeaningEquals.d.ts +2 -0
  97. package/dist/esm/adapters/helpers/codeMeaningEquals.js +7 -0
  98. package/dist/esm/adapters/helpers/compareArrays.d.ts +1 -0
  99. package/dist/esm/adapters/helpers/compareArrays.js +16 -0
  100. package/dist/esm/adapters/helpers/downloadDICOMData.d.ts +5 -0
  101. package/dist/esm/adapters/helpers/downloadDICOMData.js +26 -0
  102. package/dist/esm/adapters/helpers/getDatasetsFromImages.d.ts +1 -0
  103. package/dist/esm/adapters/helpers/getDatasetsFromImages.js +33 -0
  104. package/dist/esm/adapters/helpers/graphicTypeEquals.d.ts +2 -0
  105. package/dist/esm/adapters/helpers/graphicTypeEquals.js +7 -0
  106. package/dist/esm/adapters/helpers/index.js +4 -0
  107. package/dist/esm/adapters/helpers/toArray.js +5 -0
  108. package/dist/esm/adapters/index.d.ts +66 -0
  109. package/dist/esm/adapters/index.js +24 -0
  110. package/dist/esm/index.d.ts +2 -0
  111. package/dist/esm/index.js +5 -0
  112. package/dist/umd/adapters.umd.js +5769 -0
  113. package/dist/umd/adapters.umd.js.map +1 -0
  114. package/package.json +47 -11
  115. package/dist/adapters.es.js +0 -5623
  116. package/dist/adapters.es.js.map +0 -1
  117. package/dist/types/adapters/Cornerstone/index.d.ts +0 -16
  118. package/dist/types/adapters/Cornerstone3D/RTStruct/RTSS.d.ts +0 -26
  119. package/dist/types/adapters/Cornerstone3D/Segmentation/generateSegmentation.d.ts +0 -8
  120. package/dist/types/adapters/Cornerstone3D/Segmentation/generateToolState.d.ts +0 -16
  121. package/dist/types/adapters/VTKjs/index.d.ts +0 -4
  122. package/dist/types/adapters/helpers/codeMeaningEquals.d.ts +0 -9
  123. package/dist/types/adapters/helpers/downloadDICOMData.d.ts +0 -10
  124. package/dist/types/adapters/helpers/graphicTypeEquals.d.ts +0 -7
  125. package/dist/types/adapters/index.d.ts +0 -49
  126. package/dist/types/index.d.ts +0 -2
  127. /package/dist/{types → esm}/adapters/Cornerstone3D/Angle.d.ts +0 -0
  128. /package/dist/{types → esm}/adapters/Cornerstone3D/Bidirectional.d.ts +0 -0
  129. /package/dist/{types → esm}/adapters/Cornerstone3D/CobbAngle.d.ts +0 -0
  130. /package/dist/{types → esm}/adapters/Cornerstone3D/EllipticalROI.d.ts +0 -0
  131. /package/dist/{types → esm}/adapters/Cornerstone3D/RTStruct/index.d.ts +0 -0
  132. /package/dist/{types → esm}/adapters/Cornerstone3D/RectangleROI.d.ts +0 -0
  133. /package/dist/{types → esm}/adapters/Cornerstone3D/Segmentation/index.d.ts +0 -0
  134. /package/dist/{types → esm}/adapters/Cornerstone3D/UltrasoundDirectional.d.ts +0 -0
  135. /package/dist/{types → esm}/adapters/Cornerstone3D/isValidCornerstoneTrackingIdentifier.d.ts +0 -0
  136. /package/dist/{types → esm}/adapters/enums/index.d.ts +0 -0
  137. /package/dist/{types → esm}/adapters/helpers/index.d.ts +0 -0
  138. /package/dist/{types → esm}/adapters/helpers/toArray.d.ts +0 -0
@@ -0,0 +1,493 @@
1
+ function _arrayLikeToArray(r, a) {
2
+ (null == a || a > r.length) && (a = r.length);
3
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
4
+ return n;
5
+ }
6
+ function _arrayWithHoles(r) {
7
+ if (Array.isArray(r)) return r;
8
+ }
9
+ function _arrayWithoutHoles(r) {
10
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
11
+ }
12
+ function asyncGeneratorStep(n, t, e, r, o, a, c) {
13
+ try {
14
+ var i = n[a](c),
15
+ u = i.value;
16
+ } catch (n) {
17
+ return void e(n);
18
+ }
19
+ i.done ? t(u) : Promise.resolve(u).then(r, o);
20
+ }
21
+ function _asyncToGenerator(n) {
22
+ return function () {
23
+ var t = this,
24
+ e = arguments;
25
+ return new Promise(function (r, o) {
26
+ var a = n.apply(t, e);
27
+ function _next(n) {
28
+ asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
29
+ }
30
+ function _throw(n) {
31
+ asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
32
+ }
33
+ _next(void 0);
34
+ });
35
+ };
36
+ }
37
+ function _classCallCheck(a, n) {
38
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
39
+ }
40
+ function _defineProperties(e, r) {
41
+ for (var t = 0; t < r.length; t++) {
42
+ var o = r[t];
43
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
44
+ }
45
+ }
46
+ function _createClass(e, r, t) {
47
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
48
+ writable: !1
49
+ }), e;
50
+ }
51
+ function _createForOfIteratorHelper(r, e) {
52
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
53
+ if (!t) {
54
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
55
+ t && (r = t);
56
+ var n = 0,
57
+ F = function () {};
58
+ return {
59
+ s: F,
60
+ n: function () {
61
+ return n >= r.length ? {
62
+ done: !0
63
+ } : {
64
+ done: !1,
65
+ value: r[n++]
66
+ };
67
+ },
68
+ e: function (r) {
69
+ throw r;
70
+ },
71
+ f: F
72
+ };
73
+ }
74
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
75
+ }
76
+ var o,
77
+ a = !0,
78
+ u = !1;
79
+ return {
80
+ s: function () {
81
+ t = t.call(r);
82
+ },
83
+ n: function () {
84
+ var r = t.next();
85
+ return a = r.done, r;
86
+ },
87
+ e: function (r) {
88
+ u = !0, o = r;
89
+ },
90
+ f: function () {
91
+ try {
92
+ a || null == t.return || t.return();
93
+ } finally {
94
+ if (u) throw o;
95
+ }
96
+ }
97
+ };
98
+ }
99
+ function _defineProperty(e, r, t) {
100
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
101
+ value: t,
102
+ enumerable: !0,
103
+ configurable: !0,
104
+ writable: !0
105
+ }) : e[r] = t, e;
106
+ }
107
+ function _iterableToArray(r) {
108
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
109
+ }
110
+ function _iterableToArrayLimit(r, l) {
111
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
112
+ if (null != t) {
113
+ var e,
114
+ n,
115
+ i,
116
+ u,
117
+ a = [],
118
+ f = !0,
119
+ o = !1;
120
+ try {
121
+ if (i = (t = t.call(r)).next, 0 === l) {
122
+ if (Object(t) !== t) return;
123
+ f = !1;
124
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
125
+ } catch (r) {
126
+ o = !0, n = r;
127
+ } finally {
128
+ try {
129
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
130
+ } finally {
131
+ if (o) throw n;
132
+ }
133
+ }
134
+ return a;
135
+ }
136
+ }
137
+ function _nonIterableRest() {
138
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
139
+ }
140
+ function _nonIterableSpread() {
141
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
142
+ }
143
+ function ownKeys(e, r) {
144
+ var t = Object.keys(e);
145
+ if (Object.getOwnPropertySymbols) {
146
+ var o = Object.getOwnPropertySymbols(e);
147
+ r && (o = o.filter(function (r) {
148
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
149
+ })), t.push.apply(t, o);
150
+ }
151
+ return t;
152
+ }
153
+ function _objectSpread2(e) {
154
+ for (var r = 1; r < arguments.length; r++) {
155
+ var t = null != arguments[r] ? arguments[r] : {};
156
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
157
+ _defineProperty(e, r, t[r]);
158
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
159
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
160
+ });
161
+ }
162
+ return e;
163
+ }
164
+ function _regeneratorRuntime() {
165
+ _regeneratorRuntime = function () {
166
+ return e;
167
+ };
168
+ var t,
169
+ e = {},
170
+ r = Object.prototype,
171
+ n = r.hasOwnProperty,
172
+ o = Object.defineProperty || function (t, e, r) {
173
+ t[e] = r.value;
174
+ },
175
+ i = "function" == typeof Symbol ? Symbol : {},
176
+ a = i.iterator || "@@iterator",
177
+ c = i.asyncIterator || "@@asyncIterator",
178
+ u = i.toStringTag || "@@toStringTag";
179
+ function define(t, e, r) {
180
+ return Object.defineProperty(t, e, {
181
+ value: r,
182
+ enumerable: !0,
183
+ configurable: !0,
184
+ writable: !0
185
+ }), t[e];
186
+ }
187
+ try {
188
+ define({}, "");
189
+ } catch (t) {
190
+ define = function (t, e, r) {
191
+ return t[e] = r;
192
+ };
193
+ }
194
+ function wrap(t, e, r, n) {
195
+ var i = e && e.prototype instanceof Generator ? e : Generator,
196
+ a = Object.create(i.prototype),
197
+ c = new Context(n || []);
198
+ return o(a, "_invoke", {
199
+ value: makeInvokeMethod(t, r, c)
200
+ }), a;
201
+ }
202
+ function tryCatch(t, e, r) {
203
+ try {
204
+ return {
205
+ type: "normal",
206
+ arg: t.call(e, r)
207
+ };
208
+ } catch (t) {
209
+ return {
210
+ type: "throw",
211
+ arg: t
212
+ };
213
+ }
214
+ }
215
+ e.wrap = wrap;
216
+ var h = "suspendedStart",
217
+ l = "suspendedYield",
218
+ f = "executing",
219
+ s = "completed",
220
+ y = {};
221
+ function Generator() {}
222
+ function GeneratorFunction() {}
223
+ function GeneratorFunctionPrototype() {}
224
+ var p = {};
225
+ define(p, a, function () {
226
+ return this;
227
+ });
228
+ var d = Object.getPrototypeOf,
229
+ v = d && d(d(values([])));
230
+ v && v !== r && n.call(v, a) && (p = v);
231
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
232
+ function defineIteratorMethods(t) {
233
+ ["next", "throw", "return"].forEach(function (e) {
234
+ define(t, e, function (t) {
235
+ return this._invoke(e, t);
236
+ });
237
+ });
238
+ }
239
+ function AsyncIterator(t, e) {
240
+ function invoke(r, o, i, a) {
241
+ var c = tryCatch(t[r], t, o);
242
+ if ("throw" !== c.type) {
243
+ var u = c.arg,
244
+ h = u.value;
245
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
246
+ invoke("next", t, i, a);
247
+ }, function (t) {
248
+ invoke("throw", t, i, a);
249
+ }) : e.resolve(h).then(function (t) {
250
+ u.value = t, i(u);
251
+ }, function (t) {
252
+ return invoke("throw", t, i, a);
253
+ });
254
+ }
255
+ a(c.arg);
256
+ }
257
+ var r;
258
+ o(this, "_invoke", {
259
+ value: function (t, n) {
260
+ function callInvokeWithMethodAndArg() {
261
+ return new e(function (e, r) {
262
+ invoke(t, n, e, r);
263
+ });
264
+ }
265
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
266
+ }
267
+ });
268
+ }
269
+ function makeInvokeMethod(e, r, n) {
270
+ var o = h;
271
+ return function (i, a) {
272
+ if (o === f) throw Error("Generator is already running");
273
+ if (o === s) {
274
+ if ("throw" === i) throw a;
275
+ return {
276
+ value: t,
277
+ done: !0
278
+ };
279
+ }
280
+ for (n.method = i, n.arg = a;;) {
281
+ var c = n.delegate;
282
+ if (c) {
283
+ var u = maybeInvokeDelegate(c, n);
284
+ if (u) {
285
+ if (u === y) continue;
286
+ return u;
287
+ }
288
+ }
289
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
290
+ if (o === h) throw o = s, n.arg;
291
+ n.dispatchException(n.arg);
292
+ } else "return" === n.method && n.abrupt("return", n.arg);
293
+ o = f;
294
+ var p = tryCatch(e, r, n);
295
+ if ("normal" === p.type) {
296
+ if (o = n.done ? s : l, p.arg === y) continue;
297
+ return {
298
+ value: p.arg,
299
+ done: n.done
300
+ };
301
+ }
302
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
303
+ }
304
+ };
305
+ }
306
+ function maybeInvokeDelegate(e, r) {
307
+ var n = r.method,
308
+ o = e.iterator[n];
309
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
310
+ var i = tryCatch(o, e.iterator, r.arg);
311
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
312
+ var a = i.arg;
313
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
314
+ }
315
+ function pushTryEntry(t) {
316
+ var e = {
317
+ tryLoc: t[0]
318
+ };
319
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
320
+ }
321
+ function resetTryEntry(t) {
322
+ var e = t.completion || {};
323
+ e.type = "normal", delete e.arg, t.completion = e;
324
+ }
325
+ function Context(t) {
326
+ this.tryEntries = [{
327
+ tryLoc: "root"
328
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
329
+ }
330
+ function values(e) {
331
+ if (e || "" === e) {
332
+ var r = e[a];
333
+ if (r) return r.call(e);
334
+ if ("function" == typeof e.next) return e;
335
+ if (!isNaN(e.length)) {
336
+ var o = -1,
337
+ i = function next() {
338
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
339
+ return next.value = t, next.done = !0, next;
340
+ };
341
+ return i.next = i;
342
+ }
343
+ }
344
+ throw new TypeError(typeof e + " is not iterable");
345
+ }
346
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
347
+ value: GeneratorFunctionPrototype,
348
+ configurable: !0
349
+ }), o(GeneratorFunctionPrototype, "constructor", {
350
+ value: GeneratorFunction,
351
+ configurable: !0
352
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
353
+ var e = "function" == typeof t && t.constructor;
354
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
355
+ }, e.mark = function (t) {
356
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
357
+ }, e.awrap = function (t) {
358
+ return {
359
+ __await: t
360
+ };
361
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
362
+ return this;
363
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
364
+ void 0 === i && (i = Promise);
365
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
366
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
367
+ return t.done ? t.value : a.next();
368
+ });
369
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
370
+ return this;
371
+ }), define(g, "toString", function () {
372
+ return "[object Generator]";
373
+ }), e.keys = function (t) {
374
+ var e = Object(t),
375
+ r = [];
376
+ for (var n in e) r.push(n);
377
+ return r.reverse(), function next() {
378
+ for (; r.length;) {
379
+ var t = r.pop();
380
+ if (t in e) return next.value = t, next.done = !1, next;
381
+ }
382
+ return next.done = !0, next;
383
+ };
384
+ }, e.values = values, Context.prototype = {
385
+ constructor: Context,
386
+ reset: function (e) {
387
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
388
+ },
389
+ stop: function () {
390
+ this.done = !0;
391
+ var t = this.tryEntries[0].completion;
392
+ if ("throw" === t.type) throw t.arg;
393
+ return this.rval;
394
+ },
395
+ dispatchException: function (e) {
396
+ if (this.done) throw e;
397
+ var r = this;
398
+ function handle(n, o) {
399
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
400
+ }
401
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
402
+ var i = this.tryEntries[o],
403
+ a = i.completion;
404
+ if ("root" === i.tryLoc) return handle("end");
405
+ if (i.tryLoc <= this.prev) {
406
+ var c = n.call(i, "catchLoc"),
407
+ u = n.call(i, "finallyLoc");
408
+ if (c && u) {
409
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
410
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
411
+ } else if (c) {
412
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
413
+ } else {
414
+ if (!u) throw Error("try statement without catch or finally");
415
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
416
+ }
417
+ }
418
+ }
419
+ },
420
+ abrupt: function (t, e) {
421
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
422
+ var o = this.tryEntries[r];
423
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
424
+ var i = o;
425
+ break;
426
+ }
427
+ }
428
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
429
+ var a = i ? i.completion : {};
430
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
431
+ },
432
+ complete: function (t, e) {
433
+ if ("throw" === t.type) throw t.arg;
434
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
435
+ },
436
+ finish: function (t) {
437
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
438
+ var r = this.tryEntries[e];
439
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
440
+ }
441
+ },
442
+ catch: function (t) {
443
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
444
+ var r = this.tryEntries[e];
445
+ if (r.tryLoc === t) {
446
+ var n = r.completion;
447
+ if ("throw" === n.type) {
448
+ var o = n.arg;
449
+ resetTryEntry(r);
450
+ }
451
+ return o;
452
+ }
453
+ }
454
+ throw Error("illegal catch attempt");
455
+ },
456
+ delegateYield: function (e, r, n) {
457
+ return this.delegate = {
458
+ iterator: values(e),
459
+ resultName: r,
460
+ nextLoc: n
461
+ }, "next" === this.method && (this.arg = t), y;
462
+ }
463
+ }, e;
464
+ }
465
+ function _slicedToArray(r, e) {
466
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
467
+ }
468
+ function _toConsumableArray(r) {
469
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
470
+ }
471
+ function _toPrimitive(t, r) {
472
+ if ("object" != typeof t || !t) return t;
473
+ var e = t[Symbol.toPrimitive];
474
+ if (void 0 !== e) {
475
+ var i = e.call(t, r || "default");
476
+ if ("object" != typeof i) return i;
477
+ throw new TypeError("@@toPrimitive must return a primitive value.");
478
+ }
479
+ return ("string" === r ? String : Number)(t);
480
+ }
481
+ function _toPropertyKey(t) {
482
+ var i = _toPrimitive(t, "string");
483
+ return "symbol" == typeof i ? i : i + "";
484
+ }
485
+ function _unsupportedIterableToArray(r, a) {
486
+ if (r) {
487
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
488
+ var t = {}.toString.call(r).slice(8, -1);
489
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
490
+ }
491
+ }
492
+
493
+ export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _asyncToGenerator as asyncToGenerator, _classCallCheck as classCallCheck, _createClass as createClass, _createForOfIteratorHelper as createForOfIteratorHelper, _defineProperty as defineProperty, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _objectSpread2 as objectSpread2, _regeneratorRuntime as regeneratorRuntime, _slicedToArray as slicedToArray, _toConsumableArray as toConsumableArray, _toPrimitive as toPrimitive, _toPropertyKey as toPropertyKey, _unsupportedIterableToArray as unsupportedIterableToArray };
@@ -0,0 +1,42 @@
1
+ export default Angle;
2
+ declare class Angle {
3
+ static getMeasurementData(MeasurementGroup: any): {
4
+ rAngle: any;
5
+ toolType: string;
6
+ handles: {
7
+ start: {};
8
+ middle: {};
9
+ end: {};
10
+ textBox: {
11
+ hasMoved: boolean;
12
+ movesIndependently: boolean;
13
+ drawnIndependently: boolean;
14
+ allowedOutsideImage: boolean;
15
+ hasBoundingBox: boolean;
16
+ };
17
+ };
18
+ sopInstanceUid: any;
19
+ frameIndex: any;
20
+ complete: boolean;
21
+ finding: any;
22
+ findingSites: any[];
23
+ };
24
+ static getTID300RepresentationArguments(tool: any): {
25
+ point1: any;
26
+ point2: any;
27
+ point3: any;
28
+ point4: any;
29
+ rAngle: any;
30
+ trackingIdentifierTextValue: string;
31
+ finding: any;
32
+ findingSites: any;
33
+ };
34
+ }
35
+ declare namespace Angle {
36
+ export { ANGLE as toolType };
37
+ export { ANGLE as utilityToolType };
38
+ export { TID300Angle as TID300Representation };
39
+ export function isValidCornerstoneTrackingIdentifier(TrackingIdentifier: any): boolean;
40
+ }
41
+ declare const ANGLE: "Angle";
42
+ declare const TID300Angle: any;
@@ -0,0 +1,93 @@
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 TID300Angle = utilities.TID300.Angle;
7
+ var ANGLE = "Angle";
8
+ var Angle = /*#__PURE__*/function () {
9
+ function Angle() {
10
+ _classCallCheck(this, Angle);
11
+ }
12
+ return _createClass(Angle, null, [{
13
+ key: "getMeasurementData",
14
+ value:
15
+ /**
16
+ * Generate TID300 measurement data for a plane angle measurement - use a Angle, but label it as Angle
17
+ */
18
+ function getMeasurementData(MeasurementGroup) {
19
+ var _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup),
20
+ defaultState = _MeasurementReport$ge.defaultState,
21
+ NUMGroup = _MeasurementReport$ge.NUMGroup,
22
+ SCOORDGroup = _MeasurementReport$ge.SCOORDGroup;
23
+ var state = _objectSpread2(_objectSpread2({}, defaultState), {}, {
24
+ rAngle: NUMGroup.MeasuredValueSequence.NumericValue,
25
+ toolType: Angle.toolType,
26
+ handles: {
27
+ start: {},
28
+ middle: {},
29
+ end: {},
30
+ textBox: {
31
+ hasMoved: false,
32
+ movesIndependently: false,
33
+ drawnIndependently: true,
34
+ allowedOutsideImage: true,
35
+ hasBoundingBox: true
36
+ }
37
+ }
38
+ });
39
+ var _SCOORDGroup$GraphicD = _slicedToArray(SCOORDGroup.GraphicData, 8);
40
+ state.handles.start.x = _SCOORDGroup$GraphicD[0];
41
+ state.handles.start.y = _SCOORDGroup$GraphicD[1];
42
+ state.handles.middle.x = _SCOORDGroup$GraphicD[2];
43
+ state.handles.middle.y = _SCOORDGroup$GraphicD[3];
44
+ state.handles.middle.x = _SCOORDGroup$GraphicD[4];
45
+ state.handles.middle.y = _SCOORDGroup$GraphicD[5];
46
+ state.handles.end.x = _SCOORDGroup$GraphicD[6];
47
+ state.handles.end.y = _SCOORDGroup$GraphicD[7];
48
+ return state;
49
+ }
50
+ }, {
51
+ key: "getTID300RepresentationArguments",
52
+ value: function getTID300RepresentationArguments(tool) {
53
+ var handles = tool.handles,
54
+ finding = tool.finding,
55
+ findingSites = tool.findingSites;
56
+ var point1 = handles.start;
57
+ var point2 = handles.middle;
58
+ var point3 = handles.middle;
59
+ var point4 = handles.end;
60
+ var rAngle = tool.rAngle;
61
+ var trackingIdentifierTextValue = "cornerstoneTools@^4.0.0:Angle";
62
+ return {
63
+ point1: point1,
64
+ point2: point2,
65
+ point3: point3,
66
+ point4: point4,
67
+ rAngle: rAngle,
68
+ trackingIdentifierTextValue: trackingIdentifierTextValue,
69
+ finding: finding,
70
+ findingSites: findingSites || []
71
+ };
72
+ }
73
+ }]);
74
+ }();
75
+ Angle.toolType = ANGLE;
76
+ Angle.utilityToolType = ANGLE;
77
+ Angle.TID300Representation = TID300Angle;
78
+ Angle.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
79
+ if (!TrackingIdentifier.includes(":")) {
80
+ return false;
81
+ }
82
+ var _TrackingIdentifier$s = TrackingIdentifier.split(":"),
83
+ _TrackingIdentifier$s2 = _slicedToArray(_TrackingIdentifier$s, 2),
84
+ cornerstone4Tag = _TrackingIdentifier$s2[0],
85
+ toolType = _TrackingIdentifier$s2[1];
86
+ if (cornerstone4Tag !== CORNERSTONE_4_TAG) {
87
+ return false;
88
+ }
89
+ return toolType === ANGLE;
90
+ };
91
+ MeasurementReport.registerTool(Angle);
92
+
93
+ export { Angle as default };
@@ -0,0 +1,49 @@
1
+ export default ArrowAnnotate;
2
+ declare class ArrowAnnotate {
3
+ static getMeasurementData(MeasurementGroup: any): {
4
+ toolType: string;
5
+ active: boolean;
6
+ handles: {
7
+ start: {
8
+ x: any;
9
+ y: any;
10
+ highlight: boolean;
11
+ active: boolean;
12
+ };
13
+ end: {
14
+ x: any;
15
+ y: any;
16
+ highlight: boolean;
17
+ active: boolean;
18
+ };
19
+ textBox: {
20
+ hasMoved: boolean;
21
+ movesIndependently: boolean;
22
+ drawnIndependently: boolean;
23
+ allowedOutsideImage: boolean;
24
+ hasBoundingBox: boolean;
25
+ };
26
+ };
27
+ invalidated: boolean;
28
+ text: any;
29
+ visible: boolean;
30
+ sopInstanceUid: any;
31
+ frameIndex: any;
32
+ complete: boolean;
33
+ finding: any;
34
+ findingSites: any[];
35
+ };
36
+ static getTID300RepresentationArguments(tool: any): {
37
+ points: any[];
38
+ trackingIdentifierTextValue: string;
39
+ findingSites: any;
40
+ };
41
+ }
42
+ declare namespace ArrowAnnotate {
43
+ export { ARROW_ANNOTATE as toolType };
44
+ export { ARROW_ANNOTATE as utilityToolType };
45
+ export { TID300Point as TID300Representation };
46
+ export function isValidCornerstoneTrackingIdentifier(TrackingIdentifier: any): boolean;
47
+ }
48
+ declare const ARROW_ANNOTATE: "ArrowAnnotate";
49
+ declare const TID300Point: any;