@cornerstonejs/adapters 1.30.1 → 1.32.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.
- package/dist/adapters.es.js +336 -328
- package/dist/adapters.es.js.map +1 -1
- package/package.json +5 -5
package/dist/adapters.es.js
CHANGED
|
@@ -4,354 +4,354 @@ import ndarray from 'ndarray';
|
|
|
4
4
|
import cloneDeep from 'lodash.clonedeep';
|
|
5
5
|
import { vec3 } from 'gl-matrix';
|
|
6
6
|
|
|
7
|
-
function _iterableToArrayLimit(
|
|
8
|
-
var
|
|
9
|
-
if (null !=
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
function _iterableToArrayLimit(r, l) {
|
|
8
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
9
|
+
if (null != t) {
|
|
10
|
+
var e,
|
|
11
|
+
n,
|
|
12
|
+
i,
|
|
13
|
+
u,
|
|
14
|
+
a = [],
|
|
15
|
+
f = !0,
|
|
16
|
+
o = !1;
|
|
17
17
|
try {
|
|
18
|
-
if (
|
|
19
|
-
if (Object(
|
|
20
|
-
|
|
21
|
-
} else for (; !(
|
|
22
|
-
} catch (
|
|
23
|
-
|
|
18
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
19
|
+
if (Object(t) !== t) return;
|
|
20
|
+
f = !1;
|
|
21
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
22
|
+
} catch (r) {
|
|
23
|
+
o = !0, n = r;
|
|
24
24
|
} finally {
|
|
25
25
|
try {
|
|
26
|
-
if (!
|
|
26
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
27
27
|
} finally {
|
|
28
|
-
if (
|
|
28
|
+
if (o) throw n;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
return
|
|
31
|
+
return a;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
function ownKeys(
|
|
35
|
-
var
|
|
34
|
+
function ownKeys(e, r) {
|
|
35
|
+
var t = Object.keys(e);
|
|
36
36
|
if (Object.getOwnPropertySymbols) {
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
return Object.getOwnPropertyDescriptor(
|
|
40
|
-
})),
|
|
37
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
38
|
+
r && (o = o.filter(function (r) {
|
|
39
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
40
|
+
})), t.push.apply(t, o);
|
|
41
41
|
}
|
|
42
|
-
return
|
|
42
|
+
return t;
|
|
43
43
|
}
|
|
44
|
-
function _objectSpread2(
|
|
45
|
-
for (var
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
_defineProperty(
|
|
49
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
50
|
-
Object.defineProperty(
|
|
44
|
+
function _objectSpread2(e) {
|
|
45
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
46
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
47
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
48
|
+
_defineProperty(e, r, t[r]);
|
|
49
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
50
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
return
|
|
53
|
+
return e;
|
|
54
54
|
}
|
|
55
55
|
function _regeneratorRuntime() {
|
|
56
56
|
_regeneratorRuntime = function () {
|
|
57
|
-
return
|
|
57
|
+
return e;
|
|
58
58
|
};
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
var t,
|
|
60
|
+
e = {},
|
|
61
|
+
r = Object.prototype,
|
|
62
|
+
n = r.hasOwnProperty,
|
|
63
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
64
|
+
t[e] = r.value;
|
|
64
65
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
function define(
|
|
70
|
-
return Object.defineProperty(
|
|
71
|
-
value:
|
|
66
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
67
|
+
a = i.iterator || "@@iterator",
|
|
68
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
69
|
+
u = i.toStringTag || "@@toStringTag";
|
|
70
|
+
function define(t, e, r) {
|
|
71
|
+
return Object.defineProperty(t, e, {
|
|
72
|
+
value: r,
|
|
72
73
|
enumerable: !0,
|
|
73
74
|
configurable: !0,
|
|
74
75
|
writable: !0
|
|
75
|
-
}),
|
|
76
|
+
}), t[e];
|
|
76
77
|
}
|
|
77
78
|
try {
|
|
78
79
|
define({}, "");
|
|
79
|
-
} catch (
|
|
80
|
-
define = function (
|
|
81
|
-
return
|
|
80
|
+
} catch (t) {
|
|
81
|
+
define = function (t, e, r) {
|
|
82
|
+
return t[e] = r;
|
|
82
83
|
};
|
|
83
84
|
}
|
|
84
|
-
function wrap(
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return
|
|
89
|
-
value: makeInvokeMethod(
|
|
90
|
-
}),
|
|
85
|
+
function wrap(t, e, r, n) {
|
|
86
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
87
|
+
a = Object.create(i.prototype),
|
|
88
|
+
c = new Context(n || []);
|
|
89
|
+
return o(a, "_invoke", {
|
|
90
|
+
value: makeInvokeMethod(t, r, c)
|
|
91
|
+
}), a;
|
|
91
92
|
}
|
|
92
|
-
function tryCatch(
|
|
93
|
+
function tryCatch(t, e, r) {
|
|
93
94
|
try {
|
|
94
95
|
return {
|
|
95
96
|
type: "normal",
|
|
96
|
-
arg:
|
|
97
|
+
arg: t.call(e, r)
|
|
97
98
|
};
|
|
98
|
-
} catch (
|
|
99
|
+
} catch (t) {
|
|
99
100
|
return {
|
|
100
101
|
type: "throw",
|
|
101
|
-
arg:
|
|
102
|
+
arg: t
|
|
102
103
|
};
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
|
-
|
|
106
|
-
var
|
|
106
|
+
e.wrap = wrap;
|
|
107
|
+
var h = "suspendedStart",
|
|
108
|
+
l = "suspendedYield",
|
|
109
|
+
f = "executing",
|
|
110
|
+
s = "completed",
|
|
111
|
+
y = {};
|
|
107
112
|
function Generator() {}
|
|
108
113
|
function GeneratorFunction() {}
|
|
109
114
|
function GeneratorFunctionPrototype() {}
|
|
110
|
-
var
|
|
111
|
-
define(
|
|
115
|
+
var p = {};
|
|
116
|
+
define(p, a, function () {
|
|
112
117
|
return this;
|
|
113
118
|
});
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
var
|
|
118
|
-
function defineIteratorMethods(
|
|
119
|
-
["next", "throw", "return"].forEach(function (
|
|
120
|
-
define(
|
|
121
|
-
return this._invoke(
|
|
119
|
+
var d = Object.getPrototypeOf,
|
|
120
|
+
v = d && d(d(values([])));
|
|
121
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
122
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
123
|
+
function defineIteratorMethods(t) {
|
|
124
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
125
|
+
define(t, e, function (t) {
|
|
126
|
+
return this._invoke(e, t);
|
|
122
127
|
});
|
|
123
128
|
});
|
|
124
129
|
}
|
|
125
|
-
function AsyncIterator(
|
|
126
|
-
function invoke(
|
|
127
|
-
var
|
|
128
|
-
if ("throw" !==
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
return
|
|
132
|
-
invoke("next",
|
|
133
|
-
}, function (
|
|
134
|
-
invoke("throw",
|
|
135
|
-
}) :
|
|
136
|
-
|
|
137
|
-
}, function (
|
|
138
|
-
return invoke("throw",
|
|
130
|
+
function AsyncIterator(t, e) {
|
|
131
|
+
function invoke(r, o, i, a) {
|
|
132
|
+
var c = tryCatch(t[r], t, o);
|
|
133
|
+
if ("throw" !== c.type) {
|
|
134
|
+
var u = c.arg,
|
|
135
|
+
h = u.value;
|
|
136
|
+
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
137
|
+
invoke("next", t, i, a);
|
|
138
|
+
}, function (t) {
|
|
139
|
+
invoke("throw", t, i, a);
|
|
140
|
+
}) : e.resolve(h).then(function (t) {
|
|
141
|
+
u.value = t, i(u);
|
|
142
|
+
}, function (t) {
|
|
143
|
+
return invoke("throw", t, i, a);
|
|
139
144
|
});
|
|
140
145
|
}
|
|
141
|
-
|
|
146
|
+
a(c.arg);
|
|
142
147
|
}
|
|
143
|
-
var
|
|
144
|
-
|
|
145
|
-
value: function (
|
|
148
|
+
var r;
|
|
149
|
+
o(this, "_invoke", {
|
|
150
|
+
value: function (t, n) {
|
|
146
151
|
function callInvokeWithMethodAndArg() {
|
|
147
|
-
return new
|
|
148
|
-
invoke(
|
|
152
|
+
return new e(function (e, r) {
|
|
153
|
+
invoke(t, n, e, r);
|
|
149
154
|
});
|
|
150
155
|
}
|
|
151
|
-
return
|
|
156
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
152
157
|
}
|
|
153
158
|
});
|
|
154
159
|
}
|
|
155
|
-
function makeInvokeMethod(
|
|
156
|
-
var
|
|
157
|
-
return function (
|
|
158
|
-
if (
|
|
159
|
-
if (
|
|
160
|
-
if ("throw" ===
|
|
161
|
-
return
|
|
160
|
+
function makeInvokeMethod(e, r, n) {
|
|
161
|
+
var o = h;
|
|
162
|
+
return function (i, a) {
|
|
163
|
+
if (o === f) throw new Error("Generator is already running");
|
|
164
|
+
if (o === s) {
|
|
165
|
+
if ("throw" === i) throw a;
|
|
166
|
+
return {
|
|
167
|
+
value: t,
|
|
168
|
+
done: !0
|
|
169
|
+
};
|
|
162
170
|
}
|
|
163
|
-
for (
|
|
164
|
-
var
|
|
165
|
-
if (
|
|
166
|
-
var
|
|
167
|
-
if (
|
|
168
|
-
if (
|
|
169
|
-
return
|
|
171
|
+
for (n.method = i, n.arg = a;;) {
|
|
172
|
+
var c = n.delegate;
|
|
173
|
+
if (c) {
|
|
174
|
+
var u = maybeInvokeDelegate(c, n);
|
|
175
|
+
if (u) {
|
|
176
|
+
if (u === y) continue;
|
|
177
|
+
return u;
|
|
170
178
|
}
|
|
171
179
|
}
|
|
172
|
-
if ("next" ===
|
|
173
|
-
if (
|
|
174
|
-
|
|
175
|
-
} else "return" ===
|
|
176
|
-
|
|
177
|
-
var
|
|
178
|
-
if ("normal" ===
|
|
179
|
-
if (
|
|
180
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
181
|
+
if (o === h) throw o = s, n.arg;
|
|
182
|
+
n.dispatchException(n.arg);
|
|
183
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
184
|
+
o = f;
|
|
185
|
+
var p = tryCatch(e, r, n);
|
|
186
|
+
if ("normal" === p.type) {
|
|
187
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
180
188
|
return {
|
|
181
|
-
value:
|
|
182
|
-
done:
|
|
189
|
+
value: p.arg,
|
|
190
|
+
done: n.done
|
|
183
191
|
};
|
|
184
192
|
}
|
|
185
|
-
"throw" ===
|
|
193
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
186
194
|
}
|
|
187
195
|
};
|
|
188
196
|
}
|
|
189
|
-
function maybeInvokeDelegate(
|
|
190
|
-
var
|
|
191
|
-
|
|
192
|
-
if (
|
|
193
|
-
var
|
|
194
|
-
if ("throw" ===
|
|
195
|
-
var
|
|
196
|
-
return
|
|
197
|
-
}
|
|
198
|
-
function pushTryEntry(
|
|
199
|
-
var
|
|
200
|
-
tryLoc:
|
|
197
|
+
function maybeInvokeDelegate(e, r) {
|
|
198
|
+
var n = r.method,
|
|
199
|
+
o = e.iterator[n];
|
|
200
|
+
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;
|
|
201
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
202
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
203
|
+
var a = i.arg;
|
|
204
|
+
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);
|
|
205
|
+
}
|
|
206
|
+
function pushTryEntry(t) {
|
|
207
|
+
var e = {
|
|
208
|
+
tryLoc: t[0]
|
|
201
209
|
};
|
|
202
|
-
1 in
|
|
210
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
203
211
|
}
|
|
204
|
-
function resetTryEntry(
|
|
205
|
-
var
|
|
206
|
-
|
|
212
|
+
function resetTryEntry(t) {
|
|
213
|
+
var e = t.completion || {};
|
|
214
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
207
215
|
}
|
|
208
|
-
function Context(
|
|
216
|
+
function Context(t) {
|
|
209
217
|
this.tryEntries = [{
|
|
210
218
|
tryLoc: "root"
|
|
211
|
-
}],
|
|
212
|
-
}
|
|
213
|
-
function values(
|
|
214
|
-
if (
|
|
215
|
-
var
|
|
216
|
-
if (
|
|
217
|
-
if ("function" == typeof
|
|
218
|
-
if (!isNaN(
|
|
219
|
-
var
|
|
220
|
-
|
|
221
|
-
for (; ++
|
|
222
|
-
return next.value =
|
|
219
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
220
|
+
}
|
|
221
|
+
function values(e) {
|
|
222
|
+
if (e || "" === e) {
|
|
223
|
+
var r = e[a];
|
|
224
|
+
if (r) return r.call(e);
|
|
225
|
+
if ("function" == typeof e.next) return e;
|
|
226
|
+
if (!isNaN(e.length)) {
|
|
227
|
+
var o = -1,
|
|
228
|
+
i = function next() {
|
|
229
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
230
|
+
return next.value = t, next.done = !0, next;
|
|
223
231
|
};
|
|
224
|
-
return
|
|
232
|
+
return i.next = i;
|
|
225
233
|
}
|
|
226
234
|
}
|
|
227
|
-
|
|
228
|
-
next: doneResult
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
function doneResult() {
|
|
232
|
-
return {
|
|
233
|
-
value: undefined,
|
|
234
|
-
done: !0
|
|
235
|
-
};
|
|
235
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
236
236
|
}
|
|
237
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
237
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
238
238
|
value: GeneratorFunctionPrototype,
|
|
239
239
|
configurable: !0
|
|
240
|
-
}),
|
|
240
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
241
241
|
value: GeneratorFunction,
|
|
242
242
|
configurable: !0
|
|
243
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype,
|
|
244
|
-
var
|
|
245
|
-
return !!
|
|
246
|
-
},
|
|
247
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(
|
|
248
|
-
},
|
|
243
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
244
|
+
var e = "function" == typeof t && t.constructor;
|
|
245
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
246
|
+
}, e.mark = function (t) {
|
|
247
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
248
|
+
}, e.awrap = function (t) {
|
|
249
249
|
return {
|
|
250
|
-
__await:
|
|
250
|
+
__await: t
|
|
251
251
|
};
|
|
252
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
252
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
253
253
|
return this;
|
|
254
|
-
}),
|
|
255
|
-
void 0 ===
|
|
256
|
-
var
|
|
257
|
-
return
|
|
258
|
-
return
|
|
254
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
255
|
+
void 0 === i && (i = Promise);
|
|
256
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
257
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
258
|
+
return t.done ? t.value : a.next();
|
|
259
259
|
});
|
|
260
|
-
}, defineIteratorMethods(
|
|
260
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
261
261
|
return this;
|
|
262
|
-
}), define(
|
|
262
|
+
}), define(g, "toString", function () {
|
|
263
263
|
return "[object Generator]";
|
|
264
|
-
}),
|
|
265
|
-
var
|
|
266
|
-
|
|
267
|
-
for (var
|
|
268
|
-
return
|
|
269
|
-
for (;
|
|
270
|
-
var
|
|
271
|
-
if (
|
|
264
|
+
}), e.keys = function (t) {
|
|
265
|
+
var e = Object(t),
|
|
266
|
+
r = [];
|
|
267
|
+
for (var n in e) r.push(n);
|
|
268
|
+
return r.reverse(), function next() {
|
|
269
|
+
for (; r.length;) {
|
|
270
|
+
var t = r.pop();
|
|
271
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
272
272
|
}
|
|
273
273
|
return next.done = !0, next;
|
|
274
274
|
};
|
|
275
|
-
},
|
|
275
|
+
}, e.values = values, Context.prototype = {
|
|
276
276
|
constructor: Context,
|
|
277
|
-
reset: function (
|
|
278
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
277
|
+
reset: function (e) {
|
|
278
|
+
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);
|
|
279
279
|
},
|
|
280
280
|
stop: function () {
|
|
281
281
|
this.done = !0;
|
|
282
|
-
var
|
|
283
|
-
if ("throw" ===
|
|
282
|
+
var t = this.tryEntries[0].completion;
|
|
283
|
+
if ("throw" === t.type) throw t.arg;
|
|
284
284
|
return this.rval;
|
|
285
285
|
},
|
|
286
|
-
dispatchException: function (
|
|
287
|
-
if (this.done) throw
|
|
288
|
-
var
|
|
289
|
-
function handle(
|
|
290
|
-
return
|
|
286
|
+
dispatchException: function (e) {
|
|
287
|
+
if (this.done) throw e;
|
|
288
|
+
var r = this;
|
|
289
|
+
function handle(n, o) {
|
|
290
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
291
291
|
}
|
|
292
|
-
for (var
|
|
293
|
-
var
|
|
294
|
-
|
|
295
|
-
if ("root" ===
|
|
296
|
-
if (
|
|
297
|
-
var
|
|
298
|
-
|
|
299
|
-
if (
|
|
300
|
-
if (this.prev <
|
|
301
|
-
if (this.prev <
|
|
302
|
-
} else if (
|
|
303
|
-
if (this.prev <
|
|
292
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
293
|
+
var i = this.tryEntries[o],
|
|
294
|
+
a = i.completion;
|
|
295
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
296
|
+
if (i.tryLoc <= this.prev) {
|
|
297
|
+
var c = n.call(i, "catchLoc"),
|
|
298
|
+
u = n.call(i, "finallyLoc");
|
|
299
|
+
if (c && u) {
|
|
300
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
301
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
302
|
+
} else if (c) {
|
|
303
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
304
304
|
} else {
|
|
305
|
-
if (!
|
|
306
|
-
if (this.prev <
|
|
305
|
+
if (!u) throw new Error("try statement without catch or finally");
|
|
306
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
},
|
|
311
|
-
abrupt: function (
|
|
312
|
-
for (var
|
|
313
|
-
var
|
|
314
|
-
if (
|
|
315
|
-
var
|
|
311
|
+
abrupt: function (t, e) {
|
|
312
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
313
|
+
var o = this.tryEntries[r];
|
|
314
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
315
|
+
var i = o;
|
|
316
316
|
break;
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
|
|
320
|
-
var
|
|
321
|
-
return
|
|
319
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
320
|
+
var a = i ? i.completion : {};
|
|
321
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
322
322
|
},
|
|
323
|
-
complete: function (
|
|
324
|
-
if ("throw" ===
|
|
325
|
-
return "break" ===
|
|
323
|
+
complete: function (t, e) {
|
|
324
|
+
if ("throw" === t.type) throw t.arg;
|
|
325
|
+
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;
|
|
326
326
|
},
|
|
327
|
-
finish: function (
|
|
328
|
-
for (var
|
|
329
|
-
var
|
|
330
|
-
if (
|
|
327
|
+
finish: function (t) {
|
|
328
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
329
|
+
var r = this.tryEntries[e];
|
|
330
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
331
331
|
}
|
|
332
332
|
},
|
|
333
|
-
catch: function (
|
|
334
|
-
for (var
|
|
335
|
-
var
|
|
336
|
-
if (
|
|
337
|
-
var
|
|
338
|
-
if ("throw" ===
|
|
339
|
-
var
|
|
340
|
-
resetTryEntry(
|
|
333
|
+
catch: function (t) {
|
|
334
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
335
|
+
var r = this.tryEntries[e];
|
|
336
|
+
if (r.tryLoc === t) {
|
|
337
|
+
var n = r.completion;
|
|
338
|
+
if ("throw" === n.type) {
|
|
339
|
+
var o = n.arg;
|
|
340
|
+
resetTryEntry(r);
|
|
341
341
|
}
|
|
342
|
-
return
|
|
342
|
+
return o;
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
throw new Error("illegal catch attempt");
|
|
346
346
|
},
|
|
347
|
-
delegateYield: function (
|
|
347
|
+
delegateYield: function (e, r, n) {
|
|
348
348
|
return this.delegate = {
|
|
349
|
-
iterator: values(
|
|
350
|
-
resultName:
|
|
351
|
-
nextLoc:
|
|
352
|
-
}, "next" === this.method && (this.arg =
|
|
349
|
+
iterator: values(e),
|
|
350
|
+
resultName: r,
|
|
351
|
+
nextLoc: n
|
|
352
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
353
353
|
}
|
|
354
|
-
},
|
|
354
|
+
}, e;
|
|
355
355
|
}
|
|
356
356
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
357
357
|
try {
|
|
@@ -2814,32 +2814,33 @@ function checkSEGsOverlapping(pixelData, multiframe, imageIds, validOrientations
|
|
|
2814
2814
|
|
|
2815
2815
|
var frameSegmentsMapping = new Map();
|
|
2816
2816
|
var _loop3 = function _loop3() {
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
}
|
|
2822
|
-
var imageId = findReferenceSourceImageId(multiframe, frameSegment, imageIds, metadataProvider, tolerance, sopUIDImageIdIndexMap);
|
|
2823
|
-
if (!imageId) {
|
|
2824
|
-
console.warn("Image not present in stack, can't import frame : " + frameSegment + ".");
|
|
2825
|
-
return "continue";
|
|
2826
|
-
}
|
|
2827
|
-
var imageIdIndex = imageIds.findIndex(function (element) {
|
|
2828
|
-
return element === imageId;
|
|
2829
|
-
});
|
|
2830
|
-
if (frameSegmentsMapping.has(imageIdIndex)) {
|
|
2831
|
-
var segmentArray = frameSegmentsMapping.get(imageIdIndex);
|
|
2832
|
-
if (!segmentArray.includes(frameSegment)) {
|
|
2833
|
-
segmentArray.push(frameSegment);
|
|
2834
|
-
frameSegmentsMapping.set(imageIdIndex, segmentArray);
|
|
2817
|
+
var segmentIndex = getSegmentIndex(multiframe, frameSegment);
|
|
2818
|
+
if (segmentIndex === undefined) {
|
|
2819
|
+
console.warn("Could not retrieve the segment index for frame segment " + frameSegment + ", skipping this frame.");
|
|
2820
|
+
return 0; // continue
|
|
2835
2821
|
}
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2822
|
+
var imageId = findReferenceSourceImageId(multiframe, frameSegment, imageIds, metadataProvider, tolerance, sopUIDImageIdIndexMap);
|
|
2823
|
+
if (!imageId) {
|
|
2824
|
+
console.warn("Image not present in stack, can't import frame : " + frameSegment + ".");
|
|
2825
|
+
return 0; // continue
|
|
2826
|
+
}
|
|
2827
|
+
var imageIdIndex = imageIds.findIndex(function (element) {
|
|
2828
|
+
return element === imageId;
|
|
2829
|
+
});
|
|
2830
|
+
if (frameSegmentsMapping.has(imageIdIndex)) {
|
|
2831
|
+
var segmentArray = frameSegmentsMapping.get(imageIdIndex);
|
|
2832
|
+
if (!segmentArray.includes(frameSegment)) {
|
|
2833
|
+
segmentArray.push(frameSegment);
|
|
2834
|
+
frameSegmentsMapping.set(imageIdIndex, segmentArray);
|
|
2835
|
+
}
|
|
2836
|
+
} else {
|
|
2837
|
+
frameSegmentsMapping.set(imageIdIndex, [frameSegment]);
|
|
2838
|
+
}
|
|
2839
|
+
},
|
|
2840
|
+
_ret;
|
|
2840
2841
|
for (var frameSegment = 0; frameSegment < groupsLen; ++frameSegment) {
|
|
2841
|
-
|
|
2842
|
-
if (_ret ===
|
|
2842
|
+
_ret = _loop3();
|
|
2843
|
+
if (_ret === 0) continue;
|
|
2843
2844
|
}
|
|
2844
2845
|
var _iterator = _createForOfIteratorHelper(frameSegmentsMapping.entries()),
|
|
2845
2846
|
_step;
|
|
@@ -2907,77 +2908,78 @@ function insertOverlappingPixelDataPlanar(segmentsOnFrame, segmentsOnFrameArray,
|
|
|
2907
2908
|
var numberOfSegs = multiframe.SegmentSequence.length;
|
|
2908
2909
|
for (var segmentIndexToProcess = 1; segmentIndexToProcess <= numberOfSegs; ++segmentIndexToProcess) {
|
|
2909
2910
|
var _loop4 = function _loop4(_i2) {
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2911
|
+
var PerFrameFunctionalGroups = PerFrameFunctionalGroupsSequence[_i2];
|
|
2912
|
+
var segmentIndex = getSegmentIndex(multiframe, _i2);
|
|
2913
|
+
if (segmentIndex === undefined) {
|
|
2914
|
+
throw new Error("Could not retrieve the segment index. Aborting segmentation loading.");
|
|
2915
|
+
}
|
|
2916
|
+
if (segmentIndex !== segmentIndexToProcess) {
|
|
2917
|
+
i = _i2;
|
|
2918
|
+
return 0; // continue
|
|
2919
|
+
}
|
|
2920
|
+
var ImageOrientationPatientI = sharedImageOrientationPatient || PerFrameFunctionalGroups.PlaneOrientationSequence.ImageOrientationPatient;
|
|
2921
|
+
|
|
2922
|
+
// Since we moved to the chunks approach, we need to read the data
|
|
2923
|
+
// and handle scenarios where the portion of data is in one chunk
|
|
2924
|
+
// and the other portion is in another chunk
|
|
2925
|
+
var view = readFromUnpackedChunks(pixelData, _i2 * sliceLength, sliceLength);
|
|
2926
|
+
var pixelDataI2D = ndarray(view, [Rows, Columns]);
|
|
2927
|
+
var alignedPixelDataI = alignPixelDataWithSourceData(pixelDataI2D, ImageOrientationPatientI, validOrientations, tolerance);
|
|
2928
|
+
if (!alignedPixelDataI) {
|
|
2929
|
+
throw new Error("Individual SEG frames are out of plane with respect to the first SEG frame. " + "This is not yet supported. Aborting segmentation loading.");
|
|
2930
|
+
}
|
|
2931
|
+
var imageId = findReferenceSourceImageId(multiframe, _i2, imageIds, metadataProvider, tolerance, sopUIDImageIdIndexMap);
|
|
2932
|
+
if (!imageId) {
|
|
2933
|
+
console.warn("Image not present in stack, can't import frame : " + _i2 + ".");
|
|
2934
|
+
i = _i2;
|
|
2935
|
+
return 0; // continue
|
|
2936
|
+
}
|
|
2937
|
+
var sourceImageMetadata = metadataProvider.get("instance", imageId);
|
|
2938
|
+
if (Rows !== sourceImageMetadata.Rows || Columns !== sourceImageMetadata.Columns) {
|
|
2939
|
+
throw new Error("Individual SEG frames have different geometry dimensions (Rows and Columns) " + "respect to the source image reference frame. This is not yet supported. " + "Aborting segmentation loading. ");
|
|
2940
|
+
}
|
|
2941
|
+
var imageIdIndex = imageIds.findIndex(function (element) {
|
|
2942
|
+
return element === imageId;
|
|
2943
|
+
});
|
|
2944
|
+
var byteOffset = sliceLength * imageIdIndex * TypedArrayConstructor.BYTES_PER_ELEMENT;
|
|
2945
|
+
var labelmap2DView = new TypedArrayConstructor(tempBuffer, byteOffset, sliceLength);
|
|
2946
|
+
var data = alignedPixelDataI.data;
|
|
2947
|
+
var segmentOnFrame = false;
|
|
2948
|
+
for (var j = 0, len = alignedPixelDataI.data.length; j < len; ++j) {
|
|
2949
|
+
if (data[j]) {
|
|
2950
|
+
if (labelmap2DView[j] !== 0) {
|
|
2951
|
+
m++;
|
|
2952
|
+
if (m >= M) {
|
|
2953
|
+
labelmapBufferArray[m] = new ArrayBuffer(arrayBufferLength);
|
|
2954
|
+
segmentsOnFrameArray[m] = [];
|
|
2955
|
+
M++;
|
|
2956
|
+
}
|
|
2957
|
+
tempBuffer = labelmapBufferArray[m].slice(0);
|
|
2958
|
+
tempSegmentsOnFrame = cloneDeep(segmentsOnFrameArray[m]);
|
|
2959
|
+
_i2 = 0;
|
|
2960
|
+
break;
|
|
2961
|
+
} else {
|
|
2962
|
+
labelmap2DView[j] = segmentIndex;
|
|
2963
|
+
segmentOnFrame = true;
|
|
2955
2964
|
}
|
|
2956
|
-
tempBuffer = labelmapBufferArray[m].slice(0);
|
|
2957
|
-
tempSegmentsOnFrame = cloneDeep(segmentsOnFrameArray[m]);
|
|
2958
|
-
_i2 = 0;
|
|
2959
|
-
break;
|
|
2960
|
-
} else {
|
|
2961
|
-
labelmap2DView[j] = segmentIndex;
|
|
2962
|
-
segmentOnFrame = true;
|
|
2963
2965
|
}
|
|
2964
2966
|
}
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2967
|
+
if (segmentOnFrame) {
|
|
2968
|
+
if (!tempSegmentsOnFrame[imageIdIndex]) {
|
|
2969
|
+
tempSegmentsOnFrame[imageIdIndex] = [];
|
|
2970
|
+
}
|
|
2971
|
+
tempSegmentsOnFrame[imageIdIndex].push(segmentIndex);
|
|
2972
|
+
if (!segmentsOnFrame[imageIdIndex]) {
|
|
2973
|
+
segmentsOnFrame[imageIdIndex] = [];
|
|
2974
|
+
}
|
|
2975
|
+
segmentsOnFrame[imageIdIndex].push(segmentIndex);
|
|
2973
2976
|
}
|
|
2974
|
-
|
|
2975
|
-
}
|
|
2976
|
-
|
|
2977
|
-
};
|
|
2977
|
+
i = _i2;
|
|
2978
|
+
},
|
|
2979
|
+
_ret2;
|
|
2978
2980
|
for (var i = 0, groupsLen = PerFrameFunctionalGroupsSequence.length; i < groupsLen; ++i) {
|
|
2979
|
-
|
|
2980
|
-
if (_ret2 ===
|
|
2981
|
+
_ret2 = _loop4(i);
|
|
2982
|
+
if (_ret2 === 0) continue;
|
|
2981
2983
|
}
|
|
2982
2984
|
labelmapBufferArray[m] = tempBuffer.slice(0);
|
|
2983
2985
|
segmentsOnFrameArray[m] = cloneDeep(tempSegmentsOnFrame);
|
|
@@ -3547,6 +3549,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
3547
3549
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
3548
3550
|
PERFORMANCE OF THIS SOFTWARE.
|
|
3549
3551
|
***************************************************************************** */
|
|
3552
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
3553
|
+
|
|
3550
3554
|
var __assign = function () {
|
|
3551
3555
|
__assign = Object.assign || function __assign(t) {
|
|
3552
3556
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -3566,6 +3570,10 @@ function __spreadArray(to, from, pack) {
|
|
|
3566
3570
|
}
|
|
3567
3571
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
3568
3572
|
}
|
|
3573
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
3574
|
+
var e = new Error(message);
|
|
3575
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
3576
|
+
};
|
|
3569
3577
|
|
|
3570
3578
|
var CORNERSTONE_3D_TAG = "Cornerstone3DTools@^0.1.0";
|
|
3571
3579
|
|