@ohif/app 3.8.0-beta.8 → 3.8.0-beta.80

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 (99) hide show
  1. package/dist/{220.bundle.f7e1c96c94245e70f2be.js → 109.bundle.b4fee2a22b622839baf5.js} +4466 -3715
  2. package/dist/{471.bundle.49c8d281adbae4a2c4df.js → 121.bundle.787f5a848ed632a4d5fc.js} +90 -112
  3. package/dist/141.bundle.556b4c1e4cab770417ac.js +8620 -0
  4. package/dist/{687.bundle.9065db35c01823286f08.js → 164.bundle.d4598e491783753a8b6b.js} +22 -38
  5. package/dist/17dd54813d5acc10bf8f.wasm +0 -0
  6. package/dist/183.bundle.72bf18ad23ee6624986d.js +30394 -0
  7. package/dist/{506.bundle.5731bb4349e266491225.js → 188.bundle.b80554ec7df7dcd435a5.js} +23 -28
  8. package/dist/{342.bundle.e7c3d500f86fdfcc62b5.js → 206.bundle.f957e0d1cdff66dbac69.js} +1963 -1142
  9. package/dist/20fc4c659b85ccd2a9c0.wasm +0 -0
  10. package/dist/217.bundle.be1cc412f8e26be87d21.js +115079 -0
  11. package/dist/{451.bundle.57c21db5d003c75e9d61.js → 295.bundle.6f734abf8fa85b1a310d.js} +107 -127
  12. package/dist/{125.bundle.253395f320b72180da63.js → 297.bundle.194d8985ab974839b5b6.js} +7 -8
  13. package/dist/{19.bundle.f77c5787b6d8ac0b638b.js → 325.bundle.84909a08305556e9f924.js} +479 -371
  14. package/dist/335.bundle.c39d4aefe33aecab958f.js +2590 -0
  15. package/dist/{202.bundle.d3490836f71e001dd30f.js → 342.bundle.e6d0bba29351b5650a8c.js} +566 -868
  16. package/dist/{776.bundle.a2dedb405a12ffd7699b.js → 41.bundle.7c943bb857ed37831905.js} +7295 -3536
  17. package/dist/422.bundle.bd6529c536f59807fbee.js +881 -0
  18. package/dist/{957.bundle.9ea4506963ef8b2d84ba.js → 433.bundle.4c77c1fe8fc90ac14218.js} +14737 -27555
  19. package/dist/445.bundle.38c6d2af64e41cd7c614.js +7835 -0
  20. package/dist/{126.bundle.6e7111d58bcc937ffd80.js → 448.bundle.deedeff5744e77510734.js} +362 -430
  21. package/dist/487.bundle.7890ca42826941ebcd60.js +1875 -0
  22. package/dist/{886.bundle.c8dd3ecc42a4253de278.js → 530.bundle.7c94543955552475c56a.js} +98 -127
  23. package/dist/{663.bundle.d7be28450db14266cdd0.js → 540.bundle.079d43a6717e95c24392.js} +225 -188
  24. package/dist/{250.bundle.aea3335667054bdefe36.js → 544.bundle.1c1f57118560046649c1.js} +37 -62
  25. package/dist/574.bundle.be075ac52fb52b442a8b.js +2641 -0
  26. package/dist/{181.css → 574.css} +1 -1
  27. package/dist/{410.bundle.15c855b0ff4a1a674fb8.js → 594.bundle.0b1165661dd638820082.js} +183 -221
  28. package/dist/{221.bundle.aef554202c58483cb34e.js → 633.bundle.c1658e76f104cbd14cab.js} +349 -552
  29. package/dist/{774.bundle.4b2dc46a35012b898e1a.js → 644.bundle.1e77691d2eeb96a423b0.js} +1852 -8945
  30. package/dist/699.bundle.4f01772e7ce6637de339.js +768 -0
  31. package/dist/702.bundle.963481fbf871984b646f.js +8426 -0
  32. package/dist/722.bundle.afab1fe6bfcd569130ac.js +1083 -0
  33. package/dist/{359.bundle.45ecb3d28e8c22142606.js → 724.bundle.e5794460c391ee9cba2c.js} +164 -259
  34. package/dist/{757.bundle.ec8301d8e70d2b990f65.js → 726.bundle.0b3d9277d22fe7e15b89.js} +512 -879
  35. package/dist/{530.bundle.a03b6f942ace3e1baa1e.js → 835.bundle.15aff0b7433bb0dd6d6d.js} +37 -30
  36. package/dist/{822.bundle.82cdc418f8f56da6060b.js → 862.bundle.c0ee6e1d4d97e1353213.js} +77 -96
  37. package/dist/{236.bundle.4e9924934a747afac132.js → 889.bundle.7858e4b7ca1a2b12b64f.js} +207 -199
  38. package/dist/{281.bundle.deb7492d143e7768d8bf.js → 905.bundle.170908fe660fc6b40649.js} +157 -124
  39. package/dist/{814.bundle.c8c951d20039b63b865a.js → 907.bundle.dee4e30420caf07caea6.js} +16 -30
  40. package/dist/{417.bundle.af0a207c29b109f84159.js → 931.bundle.d270a1fda9a2836c3cc5.js} +26 -26
  41. package/dist/{686.bundle.dccef1f36e4bc79bcc48.js → 939.bundle.9d93b2e47c52338747a2.js} +7 -8
  42. package/dist/94.bundle.c452d9b0645277c2cf4e.js +784 -0
  43. package/dist/{12.bundle.b5ca13e5363f170ecb3b.js → 961.bundle.aaaaaba0ec015a3b85d8.js} +20 -33
  44. package/dist/app-config.js +1 -0
  45. package/dist/{app.bundle.a978edc59b9d82f2eb22.js → app.bundle.6c090a2d6d3ccc97a81d.js} +183240 -87650
  46. package/dist/app.bundle.css +16 -13
  47. package/dist/assets/images/CT-AAA.png +0 -0
  48. package/dist/assets/images/CT-AAA2.png +0 -0
  49. package/dist/assets/images/CT-Air.png +0 -0
  50. package/dist/assets/images/CT-Bone.png +0 -0
  51. package/dist/assets/images/CT-Bones.png +0 -0
  52. package/dist/assets/images/CT-Cardiac.png +0 -0
  53. package/dist/assets/images/CT-Cardiac2.png +0 -0
  54. package/dist/assets/images/CT-Cardiac3.png +0 -0
  55. package/dist/assets/images/CT-Chest-Contrast-Enhanced.png +0 -0
  56. package/dist/assets/images/CT-Chest-Vessels.png +0 -0
  57. package/dist/assets/images/CT-Coronary-Arteries-2.png +0 -0
  58. package/dist/assets/images/CT-Coronary-Arteries-3.png +0 -0
  59. package/dist/assets/images/CT-Coronary-Arteries.png +0 -0
  60. package/dist/assets/images/CT-Cropped-Volume-Bone.png +0 -0
  61. package/dist/assets/images/CT-Fat.png +0 -0
  62. package/dist/assets/images/CT-Liver-Vasculature.png +0 -0
  63. package/dist/assets/images/CT-Lung.png +0 -0
  64. package/dist/assets/images/CT-MIP.png +0 -0
  65. package/dist/assets/images/CT-Muscle.png +0 -0
  66. package/dist/assets/images/CT-Pulmonary-Arteries.png +0 -0
  67. package/dist/assets/images/CT-Soft-Tissue.png +0 -0
  68. package/dist/assets/images/DTI-FA-Brain.png +0 -0
  69. package/dist/assets/images/MR-Angio.png +0 -0
  70. package/dist/assets/images/MR-Default.png +0 -0
  71. package/dist/assets/images/MR-MIP.png +0 -0
  72. package/dist/assets/images/MR-T2-Brain.png +0 -0
  73. package/dist/assets/images/VolumeRendering.png +0 -0
  74. package/dist/cornerstoneDICOMImageLoader.min.js +1 -1
  75. package/dist/cornerstoneDICOMImageLoader.min.js.map +1 -1
  76. package/dist/{dicom-microscopy-viewer.bundle.2c146384eb9466d02ff8.js → dicom-microscopy-viewer.bundle.d3a56dc9f62df5e11019.js} +3 -3
  77. package/dist/histogram-worker.bundle.829e14ec12c2b41a4323.js +359 -0
  78. package/dist/index.html +1 -1
  79. package/dist/{index.worker.e62ecca63f1a2e124230.worker.js → index.worker.64c896c4316fcd506666.worker.js} +2 -2
  80. package/dist/index.worker.64c896c4316fcd506666.worker.js.map +1 -0
  81. package/dist/polySeg.bundle.63011312c3c79e717ea9.js +249 -0
  82. package/dist/serve.json +12 -0
  83. package/dist/sw.js +1 -1
  84. package/package.json +26 -22
  85. package/dist/181.bundle.a62b9f0ec692299acb35.js +0 -1527
  86. package/dist/23.bundle.e008ad788170f2ed5569.js +0 -900
  87. package/dist/604.bundle.a51f83e64004bca5f497.js +0 -1848
  88. package/dist/613.bundle.9e7072e5b575354fe51e.js +0 -532
  89. package/dist/743.bundle.489f7df3a089d4d374e1.js +0 -78007
  90. package/dist/75788f12450d4c5ed494.wasm +0 -0
  91. package/dist/775.bundle.2285e7e0e67878948c0d.js +0 -1009
  92. package/dist/788.bundle.207ac23c0dfa70cbe3fb.js +0 -2682
  93. package/dist/82.bundle.d6fdcca0f67540bb226a.js +0 -1049
  94. package/dist/index.worker.e62ecca63f1a2e124230.worker.js.map +0 -1
  95. /package/dist/{19.css → 325.css} +0 -0
  96. /package/dist/{776.css → 41.css} +0 -0
  97. /package/dist/{579.css → 481.css} +0 -0
  98. /package/dist/{250.css → 544.css} +0 -0
  99. /package/dist/{221.css → 633.css} +0 -0
@@ -1,377 +1,379 @@
1
- (self["webpackChunk"] = self["webpackChunk"] || []).push([[202],{
1
+ (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[342],{
2
2
 
3
- /***/ 91202:
3
+ /***/ 83342:
4
4
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5
5
 
6
6
  "use strict";
7
7
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8
- /* harmony export */ Y: () => (/* binding */ index),
9
- /* harmony export */ adaptersRT: () => (/* binding */ adaptersRT),
10
- /* harmony export */ adaptersSEG: () => (/* binding */ adaptersSEG),
11
- /* harmony export */ adaptersSR: () => (/* binding */ adaptersSR),
12
- /* harmony export */ helpers: () => (/* binding */ index$1)
8
+ /* harmony export */ QX: () => (/* binding */ adaptersSR),
9
+ /* harmony export */ _$: () => (/* binding */ index$1),
10
+ /* harmony export */ fX: () => (/* binding */ index),
11
+ /* harmony export */ f_: () => (/* binding */ adaptersRT),
12
+ /* harmony export */ ql: () => (/* binding */ adaptersSEG)
13
13
  /* harmony export */ });
14
- /* harmony import */ var dcmjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67540);
15
- /* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58955);
16
- /* harmony import */ var ndarray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(87513);
14
+ /* harmony import */ var dcmjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31426);
15
+ /* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58181);
16
+ /* harmony import */ var ndarray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29133);
17
17
  /* harmony import */ var ndarray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(ndarray__WEBPACK_IMPORTED_MODULE_2__);
18
- /* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11677);
18
+ /* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(48463);
19
19
  /* harmony import */ var lodash_clonedeep__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep__WEBPACK_IMPORTED_MODULE_3__);
20
- /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(45451);
20
+ /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(44753);
21
+ /* harmony import */ var _cornerstonejs_tools__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24542);
21
22
 
22
23
 
23
24
 
24
25
 
25
26
 
26
27
 
27
- function _iterableToArrayLimit(arr, i) {
28
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
29
- if (null != _i) {
30
- var _s,
31
- _e,
32
- _x,
33
- _r,
34
- _arr = [],
35
- _n = !0,
36
- _d = !1;
28
+
29
+ function _iterableToArrayLimit(r, l) {
30
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
31
+ if (null != t) {
32
+ var e,
33
+ n,
34
+ i,
35
+ u,
36
+ a = [],
37
+ f = !0,
38
+ o = !1;
37
39
  try {
38
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
39
- if (Object(_i) !== _i) return;
40
- _n = !1;
41
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
42
- } catch (err) {
43
- _d = !0, _e = err;
40
+ if (i = (t = t.call(r)).next, 0 === l) {
41
+ if (Object(t) !== t) return;
42
+ f = !1;
43
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
44
+ } catch (r) {
45
+ o = !0, n = r;
44
46
  } finally {
45
47
  try {
46
- if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
48
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
47
49
  } finally {
48
- if (_d) throw _e;
50
+ if (o) throw n;
49
51
  }
50
52
  }
51
- return _arr;
53
+ return a;
52
54
  }
53
55
  }
54
- function ownKeys(object, enumerableOnly) {
55
- var keys = Object.keys(object);
56
+ function ownKeys(e, r) {
57
+ var t = Object.keys(e);
56
58
  if (Object.getOwnPropertySymbols) {
57
- var symbols = Object.getOwnPropertySymbols(object);
58
- enumerableOnly && (symbols = symbols.filter(function (sym) {
59
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
60
- })), keys.push.apply(keys, symbols);
59
+ var o = Object.getOwnPropertySymbols(e);
60
+ r && (o = o.filter(function (r) {
61
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
62
+ })), t.push.apply(t, o);
61
63
  }
62
- return keys;
64
+ return t;
63
65
  }
64
- function _objectSpread2(target) {
65
- for (var i = 1; i < arguments.length; i++) {
66
- var source = null != arguments[i] ? arguments[i] : {};
67
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
68
- _defineProperty(target, key, source[key]);
69
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
70
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
66
+ function _objectSpread2(e) {
67
+ for (var r = 1; r < arguments.length; r++) {
68
+ var t = null != arguments[r] ? arguments[r] : {};
69
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
70
+ _defineProperty(e, r, t[r]);
71
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
72
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
71
73
  });
72
74
  }
73
- return target;
75
+ return e;
74
76
  }
75
77
  function _regeneratorRuntime() {
76
78
  _regeneratorRuntime = function () {
77
- return exports;
79
+ return e;
78
80
  };
79
- var exports = {},
80
- Op = Object.prototype,
81
- hasOwn = Op.hasOwnProperty,
82
- defineProperty = Object.defineProperty || function (obj, key, desc) {
83
- obj[key] = desc.value;
81
+ var t,
82
+ e = {},
83
+ r = Object.prototype,
84
+ n = r.hasOwnProperty,
85
+ o = Object.defineProperty || function (t, e, r) {
86
+ t[e] = r.value;
84
87
  },
85
- $Symbol = "function" == typeof Symbol ? Symbol : {},
86
- iteratorSymbol = $Symbol.iterator || "@@iterator",
87
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
88
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
89
- function define(obj, key, value) {
90
- return Object.defineProperty(obj, key, {
91
- value: value,
88
+ i = "function" == typeof Symbol ? Symbol : {},
89
+ a = i.iterator || "@@iterator",
90
+ c = i.asyncIterator || "@@asyncIterator",
91
+ u = i.toStringTag || "@@toStringTag";
92
+ function define(t, e, r) {
93
+ return Object.defineProperty(t, e, {
94
+ value: r,
92
95
  enumerable: !0,
93
96
  configurable: !0,
94
97
  writable: !0
95
- }), obj[key];
98
+ }), t[e];
96
99
  }
97
100
  try {
98
101
  define({}, "");
99
- } catch (err) {
100
- define = function (obj, key, value) {
101
- return obj[key] = value;
102
+ } catch (t) {
103
+ define = function (t, e, r) {
104
+ return t[e] = r;
102
105
  };
103
106
  }
104
- function wrap(innerFn, outerFn, self, tryLocsList) {
105
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
106
- generator = Object.create(protoGenerator.prototype),
107
- context = new Context(tryLocsList || []);
108
- return defineProperty(generator, "_invoke", {
109
- value: makeInvokeMethod(innerFn, self, context)
110
- }), generator;
107
+ function wrap(t, e, r, n) {
108
+ var i = e && e.prototype instanceof Generator ? e : Generator,
109
+ a = Object.create(i.prototype),
110
+ c = new Context(n || []);
111
+ return o(a, "_invoke", {
112
+ value: makeInvokeMethod(t, r, c)
113
+ }), a;
111
114
  }
112
- function tryCatch(fn, obj, arg) {
115
+ function tryCatch(t, e, r) {
113
116
  try {
114
117
  return {
115
118
  type: "normal",
116
- arg: fn.call(obj, arg)
119
+ arg: t.call(e, r)
117
120
  };
118
- } catch (err) {
121
+ } catch (t) {
119
122
  return {
120
123
  type: "throw",
121
- arg: err
124
+ arg: t
122
125
  };
123
126
  }
124
127
  }
125
- exports.wrap = wrap;
126
- var ContinueSentinel = {};
128
+ e.wrap = wrap;
129
+ var h = "suspendedStart",
130
+ l = "suspendedYield",
131
+ f = "executing",
132
+ s = "completed",
133
+ y = {};
127
134
  function Generator() {}
128
135
  function GeneratorFunction() {}
129
136
  function GeneratorFunctionPrototype() {}
130
- var IteratorPrototype = {};
131
- define(IteratorPrototype, iteratorSymbol, function () {
137
+ var p = {};
138
+ define(p, a, function () {
132
139
  return this;
133
140
  });
134
- var getProto = Object.getPrototypeOf,
135
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
136
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
137
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
138
- function defineIteratorMethods(prototype) {
139
- ["next", "throw", "return"].forEach(function (method) {
140
- define(prototype, method, function (arg) {
141
- return this._invoke(method, arg);
141
+ var d = Object.getPrototypeOf,
142
+ v = d && d(d(values([])));
143
+ v && v !== r && n.call(v, a) && (p = v);
144
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
145
+ function defineIteratorMethods(t) {
146
+ ["next", "throw", "return"].forEach(function (e) {
147
+ define(t, e, function (t) {
148
+ return this._invoke(e, t);
142
149
  });
143
150
  });
144
151
  }
145
- function AsyncIterator(generator, PromiseImpl) {
146
- function invoke(method, arg, resolve, reject) {
147
- var record = tryCatch(generator[method], generator, arg);
148
- if ("throw" !== record.type) {
149
- var result = record.arg,
150
- value = result.value;
151
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
152
- invoke("next", value, resolve, reject);
153
- }, function (err) {
154
- invoke("throw", err, resolve, reject);
155
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
156
- result.value = unwrapped, resolve(result);
157
- }, function (error) {
158
- return invoke("throw", error, resolve, reject);
152
+ function AsyncIterator(t, e) {
153
+ function invoke(r, o, i, a) {
154
+ var c = tryCatch(t[r], t, o);
155
+ if ("throw" !== c.type) {
156
+ var u = c.arg,
157
+ h = u.value;
158
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
159
+ invoke("next", t, i, a);
160
+ }, function (t) {
161
+ invoke("throw", t, i, a);
162
+ }) : e.resolve(h).then(function (t) {
163
+ u.value = t, i(u);
164
+ }, function (t) {
165
+ return invoke("throw", t, i, a);
159
166
  });
160
167
  }
161
- reject(record.arg);
168
+ a(c.arg);
162
169
  }
163
- var previousPromise;
164
- defineProperty(this, "_invoke", {
165
- value: function (method, arg) {
170
+ var r;
171
+ o(this, "_invoke", {
172
+ value: function (t, n) {
166
173
  function callInvokeWithMethodAndArg() {
167
- return new PromiseImpl(function (resolve, reject) {
168
- invoke(method, arg, resolve, reject);
174
+ return new e(function (e, r) {
175
+ invoke(t, n, e, r);
169
176
  });
170
177
  }
171
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
178
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
172
179
  }
173
180
  });
174
181
  }
175
- function makeInvokeMethod(innerFn, self, context) {
176
- var state = "suspendedStart";
177
- return function (method, arg) {
178
- if ("executing" === state) throw new Error("Generator is already running");
179
- if ("completed" === state) {
180
- if ("throw" === method) throw arg;
181
- return doneResult();
182
+ function makeInvokeMethod(e, r, n) {
183
+ var o = h;
184
+ return function (i, a) {
185
+ if (o === f) throw new Error("Generator is already running");
186
+ if (o === s) {
187
+ if ("throw" === i) throw a;
188
+ return {
189
+ value: t,
190
+ done: !0
191
+ };
182
192
  }
183
- for (context.method = method, context.arg = arg;;) {
184
- var delegate = context.delegate;
185
- if (delegate) {
186
- var delegateResult = maybeInvokeDelegate(delegate, context);
187
- if (delegateResult) {
188
- if (delegateResult === ContinueSentinel) continue;
189
- return delegateResult;
193
+ for (n.method = i, n.arg = a;;) {
194
+ var c = n.delegate;
195
+ if (c) {
196
+ var u = maybeInvokeDelegate(c, n);
197
+ if (u) {
198
+ if (u === y) continue;
199
+ return u;
190
200
  }
191
201
  }
192
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
193
- if ("suspendedStart" === state) throw state = "completed", context.arg;
194
- context.dispatchException(context.arg);
195
- } else "return" === context.method && context.abrupt("return", context.arg);
196
- state = "executing";
197
- var record = tryCatch(innerFn, self, context);
198
- if ("normal" === record.type) {
199
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
202
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
203
+ if (o === h) throw o = s, n.arg;
204
+ n.dispatchException(n.arg);
205
+ } else "return" === n.method && n.abrupt("return", n.arg);
206
+ o = f;
207
+ var p = tryCatch(e, r, n);
208
+ if ("normal" === p.type) {
209
+ if (o = n.done ? s : l, p.arg === y) continue;
200
210
  return {
201
- value: record.arg,
202
- done: context.done
211
+ value: p.arg,
212
+ done: n.done
203
213
  };
204
214
  }
205
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
215
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
206
216
  }
207
217
  };
208
218
  }
209
- function maybeInvokeDelegate(delegate, context) {
210
- var methodName = context.method,
211
- method = delegate.iterator[methodName];
212
- if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
213
- var record = tryCatch(method, delegate.iterator, context.arg);
214
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
215
- var info = record.arg;
216
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
217
- }
218
- function pushTryEntry(locs) {
219
- var entry = {
220
- tryLoc: locs[0]
219
+ function maybeInvokeDelegate(e, r) {
220
+ var n = r.method,
221
+ o = e.iterator[n];
222
+ 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;
223
+ var i = tryCatch(o, e.iterator, r.arg);
224
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
225
+ var a = i.arg;
226
+ 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);
227
+ }
228
+ function pushTryEntry(t) {
229
+ var e = {
230
+ tryLoc: t[0]
221
231
  };
222
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
232
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
223
233
  }
224
- function resetTryEntry(entry) {
225
- var record = entry.completion || {};
226
- record.type = "normal", delete record.arg, entry.completion = record;
234
+ function resetTryEntry(t) {
235
+ var e = t.completion || {};
236
+ e.type = "normal", delete e.arg, t.completion = e;
227
237
  }
228
- function Context(tryLocsList) {
238
+ function Context(t) {
229
239
  this.tryEntries = [{
230
240
  tryLoc: "root"
231
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
232
- }
233
- function values(iterable) {
234
- if (iterable) {
235
- var iteratorMethod = iterable[iteratorSymbol];
236
- if (iteratorMethod) return iteratorMethod.call(iterable);
237
- if ("function" == typeof iterable.next) return iterable;
238
- if (!isNaN(iterable.length)) {
239
- var i = -1,
240
- next = function next() {
241
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
242
- return next.value = undefined, next.done = !0, next;
241
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
242
+ }
243
+ function values(e) {
244
+ if (e || "" === e) {
245
+ var r = e[a];
246
+ if (r) return r.call(e);
247
+ if ("function" == typeof e.next) return e;
248
+ if (!isNaN(e.length)) {
249
+ var o = -1,
250
+ i = function next() {
251
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
252
+ return next.value = t, next.done = !0, next;
243
253
  };
244
- return next.next = next;
254
+ return i.next = i;
245
255
  }
246
256
  }
247
- return {
248
- next: doneResult
249
- };
257
+ throw new TypeError(typeof e + " is not iterable");
250
258
  }
251
- function doneResult() {
252
- return {
253
- value: undefined,
254
- done: !0
255
- };
256
- }
257
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
259
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
258
260
  value: GeneratorFunctionPrototype,
259
261
  configurable: !0
260
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
262
+ }), o(GeneratorFunctionPrototype, "constructor", {
261
263
  value: GeneratorFunction,
262
264
  configurable: !0
263
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
264
- var ctor = "function" == typeof genFun && genFun.constructor;
265
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
266
- }, exports.mark = function (genFun) {
267
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
268
- }, exports.awrap = function (arg) {
265
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
266
+ var e = "function" == typeof t && t.constructor;
267
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
268
+ }, e.mark = function (t) {
269
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
270
+ }, e.awrap = function (t) {
269
271
  return {
270
- __await: arg
272
+ __await: t
271
273
  };
272
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
274
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
273
275
  return this;
274
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
275
- void 0 === PromiseImpl && (PromiseImpl = Promise);
276
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
277
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
278
- return result.done ? result.value : iter.next();
276
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
277
+ void 0 === i && (i = Promise);
278
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
279
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
280
+ return t.done ? t.value : a.next();
279
281
  });
280
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
282
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
281
283
  return this;
282
- }), define(Gp, "toString", function () {
284
+ }), define(g, "toString", function () {
283
285
  return "[object Generator]";
284
- }), exports.keys = function (val) {
285
- var object = Object(val),
286
- keys = [];
287
- for (var key in object) keys.push(key);
288
- return keys.reverse(), function next() {
289
- for (; keys.length;) {
290
- var key = keys.pop();
291
- if (key in object) return next.value = key, next.done = !1, next;
286
+ }), e.keys = function (t) {
287
+ var e = Object(t),
288
+ r = [];
289
+ for (var n in e) r.push(n);
290
+ return r.reverse(), function next() {
291
+ for (; r.length;) {
292
+ var t = r.pop();
293
+ if (t in e) return next.value = t, next.done = !1, next;
292
294
  }
293
295
  return next.done = !0, next;
294
296
  };
295
- }, exports.values = values, Context.prototype = {
297
+ }, e.values = values, Context.prototype = {
296
298
  constructor: Context,
297
- reset: function (skipTempReset) {
298
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
299
+ reset: function (e) {
300
+ 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);
299
301
  },
300
302
  stop: function () {
301
303
  this.done = !0;
302
- var rootRecord = this.tryEntries[0].completion;
303
- if ("throw" === rootRecord.type) throw rootRecord.arg;
304
+ var t = this.tryEntries[0].completion;
305
+ if ("throw" === t.type) throw t.arg;
304
306
  return this.rval;
305
307
  },
306
- dispatchException: function (exception) {
307
- if (this.done) throw exception;
308
- var context = this;
309
- function handle(loc, caught) {
310
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
308
+ dispatchException: function (e) {
309
+ if (this.done) throw e;
310
+ var r = this;
311
+ function handle(n, o) {
312
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
311
313
  }
312
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
313
- var entry = this.tryEntries[i],
314
- record = entry.completion;
315
- if ("root" === entry.tryLoc) return handle("end");
316
- if (entry.tryLoc <= this.prev) {
317
- var hasCatch = hasOwn.call(entry, "catchLoc"),
318
- hasFinally = hasOwn.call(entry, "finallyLoc");
319
- if (hasCatch && hasFinally) {
320
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
321
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
322
- } else if (hasCatch) {
323
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
314
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
315
+ var i = this.tryEntries[o],
316
+ a = i.completion;
317
+ if ("root" === i.tryLoc) return handle("end");
318
+ if (i.tryLoc <= this.prev) {
319
+ var c = n.call(i, "catchLoc"),
320
+ u = n.call(i, "finallyLoc");
321
+ if (c && u) {
322
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
323
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
324
+ } else if (c) {
325
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
324
326
  } else {
325
- if (!hasFinally) throw new Error("try statement without catch or finally");
326
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
327
+ if (!u) throw new Error("try statement without catch or finally");
328
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
327
329
  }
328
330
  }
329
331
  }
330
332
  },
331
- abrupt: function (type, arg) {
332
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
333
- var entry = this.tryEntries[i];
334
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
335
- var finallyEntry = entry;
333
+ abrupt: function (t, e) {
334
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
335
+ var o = this.tryEntries[r];
336
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
337
+ var i = o;
336
338
  break;
337
339
  }
338
340
  }
339
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
340
- var record = finallyEntry ? finallyEntry.completion : {};
341
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
341
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
342
+ var a = i ? i.completion : {};
343
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
342
344
  },
343
- complete: function (record, afterLoc) {
344
- if ("throw" === record.type) throw record.arg;
345
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
345
+ complete: function (t, e) {
346
+ if ("throw" === t.type) throw t.arg;
347
+ 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;
346
348
  },
347
- finish: function (finallyLoc) {
348
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
349
- var entry = this.tryEntries[i];
350
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
349
+ finish: function (t) {
350
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
351
+ var r = this.tryEntries[e];
352
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
351
353
  }
352
354
  },
353
- catch: function (tryLoc) {
354
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
355
- var entry = this.tryEntries[i];
356
- if (entry.tryLoc === tryLoc) {
357
- var record = entry.completion;
358
- if ("throw" === record.type) {
359
- var thrown = record.arg;
360
- resetTryEntry(entry);
355
+ catch: function (t) {
356
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
357
+ var r = this.tryEntries[e];
358
+ if (r.tryLoc === t) {
359
+ var n = r.completion;
360
+ if ("throw" === n.type) {
361
+ var o = n.arg;
362
+ resetTryEntry(r);
361
363
  }
362
- return thrown;
364
+ return o;
363
365
  }
364
366
  }
365
367
  throw new Error("illegal catch attempt");
366
368
  },
367
- delegateYield: function (iterable, resultName, nextLoc) {
369
+ delegateYield: function (e, r, n) {
368
370
  return this.delegate = {
369
- iterator: values(iterable),
370
- resultName: resultName,
371
- nextLoc: nextLoc
372
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
371
+ iterator: values(e),
372
+ resultName: r,
373
+ nextLoc: n
374
+ }, "next" === this.method && (this.arg = t), y;
373
375
  }
374
- }, exports;
376
+ }, e;
375
377
  }
376
378
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
377
379
  try {
@@ -565,7 +567,7 @@ var graphicTypeEquals = function (graphicType) {
565
567
  };
566
568
  };
567
569
 
568
- var datasetToDict = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .aT.datasetToDict;
570
+ var datasetToDict = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .p.datasetToDict;
569
571
  /**
570
572
  * Trigger file download from an array buffer
571
573
  * @param bufferOrDataset - ArrayBuffer or DicomDataset
@@ -580,7 +582,7 @@ function downloadDICOMData(bufferOrDataset, filename) {
580
582
  if (!bufferOrDataset._meta) {
581
583
  throw new Error("Dataset must have a _meta property");
582
584
  }
583
- var buffer = buffer__WEBPACK_IMPORTED_MODULE_1__/* .Buffer */ .lW.from(datasetToDict(bufferOrDataset).write());
585
+ var buffer = buffer__WEBPACK_IMPORTED_MODULE_1__/* .Buffer */ .hp.from(datasetToDict(bufferOrDataset).write());
584
586
  blob = new Blob([buffer], { type: "application/dicom" });
585
587
  }
586
588
  var link = document.createElement("a");
@@ -597,13 +599,13 @@ var index$1 = /*#__PURE__*/Object.freeze({
597
599
  toArray: toArray
598
600
  });
599
601
 
600
- var TID1500$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID1500,
601
- addAccessors$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.addAccessors;
602
- var StructuredReport$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .derivations */ .U7.StructuredReport;
603
- var Normalizer$4 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .normalizers */ .oq.Normalizer;
602
+ var TID1500$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID1500,
603
+ addAccessors$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.addAccessors;
604
+ var StructuredReport$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .derivations */ .h4.StructuredReport;
605
+ var Normalizer$4 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .normalizers */ .z8.Normalizer;
604
606
  var TID1500MeasurementReport$1 = TID1500$1.TID1500MeasurementReport,
605
607
  TID1501MeasurementGroup$1 = TID1500$1.TID1501MeasurementGroup;
606
- var DicomMetaDictionary$4 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .aT.DicomMetaDictionary;
608
+ var DicomMetaDictionary$4 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .p.DicomMetaDictionary;
607
609
  var FINDING$2 = {
608
610
  CodingSchemeDesignator: "DCM",
609
611
  CodeValue: "121071"
@@ -867,7 +869,7 @@ MeasurementReport$1.CORNERSTONE_TOOL_CLASSES_BY_TOOL_TYPE = {};
867
869
 
868
870
  var CORNERSTONE_4_TAG = "cornerstoneTools@^4.0.0";
869
871
 
870
- var TID300Length$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Length;
872
+ var TID300Length$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Length;
871
873
  var LENGTH$1 = "Length";
872
874
  var Length$1 = /*#__PURE__*/function () {
873
875
  function Length() {
@@ -928,7 +930,7 @@ var Length$1 = /*#__PURE__*/function () {
928
930
  }();
929
931
  Length$1.toolType = LENGTH$1;
930
932
  Length$1.utilityToolType = LENGTH$1;
931
- Length$1.TID300Representation = TID300Length$1;
933
+ Length$1.TID300Representation = TID300Length$2;
932
934
  Length$1.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
933
935
  if (!TrackingIdentifier.includes(":")) {
934
936
  return false;
@@ -944,7 +946,7 @@ Length$1.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
944
946
  };
945
947
  MeasurementReport$1.registerTool(Length$1);
946
948
 
947
- var TID300Polyline$3 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Polyline;
949
+ var TID300Polyline$3 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Polyline;
948
950
  var FreehandRoi = /*#__PURE__*/function () {
949
951
  function FreehandRoi() {
950
952
  _classCallCheck(this, FreehandRoi);
@@ -1028,7 +1030,7 @@ FreehandRoi.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier)
1028
1030
  };
1029
1031
  MeasurementReport$1.registerTool(FreehandRoi);
1030
1032
 
1031
- var TID300Bidirectional$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Bidirectional;
1033
+ var TID300Bidirectional$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Bidirectional;
1032
1034
  var BIDIRECTIONAL$1 = "Bidirectional";
1033
1035
  var LONG_AXIS$1 = "Long Axis";
1034
1036
  var SHORT_AXIS$1 = "Short Axis";
@@ -1191,7 +1193,7 @@ Bidirectional$1.isValidCornerstoneTrackingIdentifier = function (TrackingIdentif
1191
1193
  };
1192
1194
  MeasurementReport$1.registerTool(Bidirectional$1);
1193
1195
 
1194
- var TID300Ellipse$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Ellipse;
1196
+ var TID300Ellipse$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Ellipse;
1195
1197
  var ELLIPTICALROI$1 = "EllipticalRoi";
1196
1198
  var EllipticalRoi = /*#__PURE__*/function () {
1197
1199
  function EllipticalRoi() {
@@ -1364,7 +1366,7 @@ EllipticalRoi.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifie
1364
1366
  };
1365
1367
  MeasurementReport$1.registerTool(EllipticalRoi);
1366
1368
 
1367
- var TID300Circle$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Circle;
1369
+ var TID300Circle$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Circle;
1368
1370
  var CIRCLEROI$1 = "CircleRoi";
1369
1371
  var CircleRoi = /*#__PURE__*/function () {
1370
1372
  function CircleRoi() {
@@ -1474,7 +1476,7 @@ CircleRoi.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
1474
1476
  };
1475
1477
  MeasurementReport$1.registerTool(CircleRoi);
1476
1478
 
1477
- var TID300Point$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Point;
1479
+ var TID300Point$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Point;
1478
1480
  var ARROW_ANNOTATE$1 = "ArrowAnnotate";
1479
1481
  var CORNERSTONEFREETEXT$1 = "CORNERSTONEFREETEXT";
1480
1482
  var ArrowAnnotate$1 = /*#__PURE__*/function () {
@@ -1566,7 +1568,7 @@ ArrowAnnotate$1.isValidCornerstoneTrackingIdentifier = function (TrackingIdentif
1566
1568
  };
1567
1569
  MeasurementReport$1.registerTool(ArrowAnnotate$1);
1568
1570
 
1569
- var TID300CobbAngle$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.CobbAngle;
1571
+ var TID300CobbAngle$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.CobbAngle;
1570
1572
  var COBB_ANGLE = "CobbAngle";
1571
1573
  var CobbAngle$1 = /*#__PURE__*/function () {
1572
1574
  function CobbAngle() {
@@ -1659,7 +1661,7 @@ CobbAngle$1.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier)
1659
1661
  };
1660
1662
  MeasurementReport$1.registerTool(CobbAngle$1);
1661
1663
 
1662
- var TID300Angle = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Angle;
1664
+ var TID300Angle = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Angle;
1663
1665
  var ANGLE = "Angle";
1664
1666
  var Angle$1 = /*#__PURE__*/function () {
1665
1667
  function Angle() {
@@ -1747,7 +1749,7 @@ Angle$1.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
1747
1749
  };
1748
1750
  MeasurementReport$1.registerTool(Angle$1);
1749
1751
 
1750
- var TID300Polyline$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Polyline;
1752
+ var TID300Polyline$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Polyline;
1751
1753
  var RectangleRoi = /*#__PURE__*/function () {
1752
1754
  function RectangleRoi() {
1753
1755
  _classCallCheck(this, RectangleRoi);
@@ -1839,17 +1841,17 @@ RectangleRoi.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier
1839
1841
  };
1840
1842
  MeasurementReport$1.registerTool(RectangleRoi);
1841
1843
 
1842
- var _utilities$orientatio$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.orientation,
1844
+ var _utilities$orientatio$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.orientation,
1843
1845
  rotateDirectionCosinesInPlane$1 = _utilities$orientatio$1.rotateDirectionCosinesInPlane,
1844
1846
  flipIOP$1 = _utilities$orientatio$1.flipImageOrientationPatient,
1845
1847
  flipMatrix2D$1 = _utilities$orientatio$1.flipMatrix2D,
1846
1848
  rotateMatrix902D$1 = _utilities$orientatio$1.rotateMatrix902D;
1847
- var datasetToBlob = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.datasetToBlob,
1848
- BitArray$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.BitArray,
1849
- DicomMessage$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.DicomMessage,
1850
- DicomMetaDictionary$3 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.DicomMetaDictionary;
1851
- var Normalizer$3 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .normalizers */ .oq.Normalizer;
1852
- var SegmentationDerivation$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .derivations */ .U7.Segmentation;
1849
+ var datasetToBlob = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.datasetToBlob,
1850
+ BitArray$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.BitArray,
1851
+ DicomMessage$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.DicomMessage,
1852
+ DicomMetaDictionary$3 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.DicomMetaDictionary;
1853
+ var Normalizer$3 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .normalizers */ .z8.Normalizer;
1854
+ var SegmentationDerivation$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .derivations */ .h4.Segmentation;
1853
1855
  var Segmentation$5 = {
1854
1856
  generateSegmentation: generateSegmentation$3,
1855
1857
  generateToolState: generateToolState$3
@@ -2071,10 +2073,10 @@ function unpackPixelData$1(multiframe) {
2071
2073
  return element !== 0 && element !== max;
2072
2074
  }) === undefined;
2073
2075
  if (!onlyMaxAndZero) {
2074
- dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .log */ .cM.warn("This is a fractional segmentation, which is not currently supported.");
2076
+ dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .log */ .Rm.warn("This is a fractional segmentation, which is not currently supported.");
2075
2077
  return;
2076
2078
  }
2077
- dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .log */ .cM.warn("This segmentation object is actually binary... processing as such.");
2079
+ dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .log */ .Rm.warn("This segmentation object is actually binary... processing as such.");
2078
2080
  return pixelData;
2079
2081
  }
2080
2082
 
@@ -2279,18 +2281,18 @@ var index = /*#__PURE__*/Object.freeze({
2279
2281
  Events: Events$1
2280
2282
  });
2281
2283
 
2282
- var _utilities$orientatio = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.orientation,
2284
+ var _utilities$orientatio = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.orientation,
2283
2285
  rotateDirectionCosinesInPlane = _utilities$orientatio.rotateDirectionCosinesInPlane,
2284
2286
  flipIOP = _utilities$orientatio.flipImageOrientationPatient,
2285
2287
  flipMatrix2D = _utilities$orientatio.flipMatrix2D,
2286
2288
  rotateMatrix902D = _utilities$orientatio.rotateMatrix902D,
2287
2289
  nearlyEqual = _utilities$orientatio.nearlyEqual;
2288
- var BitArray$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .aT.BitArray,
2289
- DicomMessage = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .aT.DicomMessage,
2290
- DicomMetaDictionary$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .aT.DicomMetaDictionary;
2291
- var Normalizer$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .normalizers */ .oq.Normalizer;
2292
- var SegmentationDerivation$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .derivations */ .U7.Segmentation;
2293
- var _utilities$compressio = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.compression,
2290
+ var BitArray$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .p.BitArray,
2291
+ DicomMessage = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .p.DicomMessage,
2292
+ DicomMetaDictionary$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .p.DicomMetaDictionary;
2293
+ var Normalizer$2 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .normalizers */ .z8.Normalizer;
2294
+ var SegmentationDerivation$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .derivations */ .h4.Segmentation;
2295
+ var _utilities$compressio = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.compression,
2294
2296
  encode = _utilities$compressio.encode,
2295
2297
  decode = _utilities$compressio.decode;
2296
2298
 
@@ -2624,7 +2626,7 @@ function generateToolState$2(_x, _x2, _x3, _x4) {
2624
2626
  */
2625
2627
  function _generateToolState() {
2626
2628
  _generateToolState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(imageIds, arrayBuffer, metadataProvider, options) {
2627
- var _options$skipOverlapp, skipOverlapping, _options$tolerance, tolerance, _options$TypedArrayCo, TypedArrayConstructor, _options$maxBytesPerC, maxBytesPerChunk, eventTarget, triggerEvent, dicomData, dataset, multiframe, imagePlaneModule, generalSeriesModule, SeriesInstanceUID, ImageOrientationPatient, validOrientations, sliceLength, segMetadata, TransferSyntaxUID, pixelData, pixelDataChunks, rleEncodedFrames, orientation, sopUIDImageIdIndexMap, overlapping, insertFunction, segmentsOnFrameArray, segmentsOnFrame, arrayBufferLength, labelmapBufferArray, imageIdMaps, segmentsPixelIndices, centroidXYZ;
2629
+ var _options$skipOverlapp, skipOverlapping, _options$tolerance, tolerance, _options$TypedArrayCo, TypedArrayConstructor, _options$maxBytesPerC, maxBytesPerChunk, eventTarget, triggerEvent, dicomData, dataset, multiframe, imagePlaneModule, generalSeriesModule, SeriesInstanceUID, ImageOrientationPatient, validOrientations, sliceLength, segMetadata, TransferSyntaxUID, pixelData, pixelDataChunks, rleEncodedFrames, orientation, sopUIDImageIdIndexMap, overlapping, insertFunction, segmentsOnFrameArray, segmentsOnFrame, arrayBufferLength, labelmapBufferArray, imageIdMaps, segmentsPixelIndices, overlappingSegments, centroidXYZ;
2628
2630
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2629
2631
  while (1) switch (_context.prev = _context.next) {
2630
2632
  case 0:
@@ -2676,8 +2678,8 @@ function _generateToolState() {
2676
2678
  // and over again.
2677
2679
  sopUIDImageIdIndexMap = imageIds.reduce(function (acc, imageId) {
2678
2680
  var _metadataProvider$get = metadataProvider.get("generalImageModule", imageId),
2679
- sopInstanceUid = _metadataProvider$get.sopInstanceUid;
2680
- acc[sopInstanceUid] = imageId;
2681
+ sopInstanceUID = _metadataProvider$get.sopInstanceUID;
2682
+ acc[sopInstanceUID] = imageId;
2681
2683
  return acc;
2682
2684
  }, {});
2683
2685
  overlapping = false;
@@ -2711,7 +2713,7 @@ function _generateToolState() {
2711
2713
  labelmapBufferArray = [];
2712
2714
  labelmapBufferArray[0] = new ArrayBuffer(arrayBufferLength);
2713
2715
 
2714
- // Precompute the indices and metadata so that we don't have to call
2716
+ // Pre-compute the indices and metadata so that we don't have to call
2715
2717
  // a function for each imageId in the for loop.
2716
2718
  imageIdMaps = imageIds.reduce(function (acc, curr, index) {
2717
2719
  acc.indices[curr] = index;
@@ -2728,6 +2730,7 @@ function _generateToolState() {
2728
2730
  _context.next = 47;
2729
2731
  return insertFunction(segmentsOnFrame, segmentsOnFrameArray, labelmapBufferArray, pixelDataChunks, multiframe, imageIds, validOrientations, metadataProvider, tolerance, TypedArrayConstructor, segmentsPixelIndices, sopUIDImageIdIndexMap, imageIdMaps, eventTarget, triggerEvent);
2730
2732
  case 47:
2733
+ overlappingSegments = _context.sent;
2731
2734
  // calculate the centroid of each segment
2732
2735
  centroidXYZ = new Map();
2733
2736
  segmentsPixelIndices.forEach(function (imageIdIndexBufferIndex, segmentIndex) {
@@ -2747,9 +2750,10 @@ function _generateToolState() {
2747
2750
  segMetadata: segMetadata,
2748
2751
  segmentsOnFrame: segmentsOnFrame,
2749
2752
  segmentsOnFrameArray: segmentsOnFrameArray,
2750
- centroids: centroidXYZ
2753
+ centroids: centroidXYZ,
2754
+ overlappingSegments: overlappingSegments
2751
2755
  });
2752
- case 50:
2756
+ case 51:
2753
2757
  case "end":
2754
2758
  return _context.stop();
2755
2759
  }
@@ -2774,9 +2778,7 @@ function findReferenceSourceImageId(multiframe, frameSegment, imageIds, metadata
2774
2778
  return imageId;
2775
2779
  }
2776
2780
  var frameSourceImageSequence = undefined;
2777
- if (SourceImageSequence && SourceImageSequence.length !== 0) {
2778
- frameSourceImageSequence = SourceImageSequence[frameSegment];
2779
- } else if (PerFrameFunctionalGroup.DerivationImageSequence) {
2781
+ if (PerFrameFunctionalGroup.DerivationImageSequence) {
2780
2782
  var DerivationImageSequence = PerFrameFunctionalGroup.DerivationImageSequence;
2781
2783
  if (Array.isArray(DerivationImageSequence)) {
2782
2784
  if (DerivationImageSequence.length !== 0) {
@@ -2795,6 +2797,9 @@ function findReferenceSourceImageId(multiframe, frameSegment, imageIds, metadata
2795
2797
  }
2796
2798
  }
2797
2799
  }
2800
+ } else if (SourceImageSequence && SourceImageSequence.length !== 0) {
2801
+ console.warn("DerivationImageSequence not present, using SourceImageSequence assuming SEG has the same geometry as the source image.");
2802
+ frameSourceImageSequence = SourceImageSequence[frameSegment];
2798
2803
  }
2799
2804
  if (frameSourceImageSequence) {
2800
2805
  imageId = getImageIdOfSourceImageBySourceImageSequence(frameSourceImageSequence, sopUIDImageIdIndexMap);
@@ -2834,32 +2839,33 @@ function checkSEGsOverlapping(pixelData, multiframe, imageIds, validOrientations
2834
2839
 
2835
2840
  var frameSegmentsMapping = new Map();
2836
2841
  var _loop3 = function _loop3() {
2837
- var segmentIndex = getSegmentIndex(multiframe, frameSegment);
2838
- if (segmentIndex === undefined) {
2839
- console.warn("Could not retrieve the segment index for frame segment " + frameSegment + ", skipping this frame.");
2840
- return "continue";
2841
- }
2842
- var imageId = findReferenceSourceImageId(multiframe, frameSegment, imageIds, metadataProvider, tolerance, sopUIDImageIdIndexMap);
2843
- if (!imageId) {
2844
- console.warn("Image not present in stack, can't import frame : " + frameSegment + ".");
2845
- return "continue";
2846
- }
2847
- var imageIdIndex = imageIds.findIndex(function (element) {
2848
- return element === imageId;
2849
- });
2850
- if (frameSegmentsMapping.has(imageIdIndex)) {
2851
- var segmentArray = frameSegmentsMapping.get(imageIdIndex);
2852
- if (!segmentArray.includes(frameSegment)) {
2853
- segmentArray.push(frameSegment);
2854
- frameSegmentsMapping.set(imageIdIndex, segmentArray);
2842
+ var segmentIndex = getSegmentIndex(multiframe, frameSegment);
2843
+ if (segmentIndex === undefined) {
2844
+ console.warn("Could not retrieve the segment index for frame segment " + frameSegment + ", skipping this frame.");
2845
+ return 0; // continue
2855
2846
  }
2856
- } else {
2857
- frameSegmentsMapping.set(imageIdIndex, [frameSegment]);
2858
- }
2859
- };
2847
+ var imageId = findReferenceSourceImageId(multiframe, frameSegment, imageIds, metadataProvider, tolerance, sopUIDImageIdIndexMap);
2848
+ if (!imageId) {
2849
+ console.warn("Image not present in stack, can't import frame : " + frameSegment + ".");
2850
+ return 0; // continue
2851
+ }
2852
+ var imageIdIndex = imageIds.findIndex(function (element) {
2853
+ return element === imageId;
2854
+ });
2855
+ if (frameSegmentsMapping.has(imageIdIndex)) {
2856
+ var segmentArray = frameSegmentsMapping.get(imageIdIndex);
2857
+ if (!segmentArray.includes(frameSegment)) {
2858
+ segmentArray.push(frameSegment);
2859
+ frameSegmentsMapping.set(imageIdIndex, segmentArray);
2860
+ }
2861
+ } else {
2862
+ frameSegmentsMapping.set(imageIdIndex, [frameSegment]);
2863
+ }
2864
+ },
2865
+ _ret;
2860
2866
  for (var frameSegment = 0; frameSegment < groupsLen; ++frameSegment) {
2861
- var _ret = _loop3();
2862
- if (_ret === "continue") continue;
2867
+ _ret = _loop3();
2868
+ if (_ret === 0) continue;
2863
2869
  }
2864
2870
  var _iterator = _createForOfIteratorHelper(frameSegmentsMapping.entries()),
2865
2871
  _step;
@@ -2927,77 +2933,78 @@ function insertOverlappingPixelDataPlanar(segmentsOnFrame, segmentsOnFrameArray,
2927
2933
  var numberOfSegs = multiframe.SegmentSequence.length;
2928
2934
  for (var segmentIndexToProcess = 1; segmentIndexToProcess <= numberOfSegs; ++segmentIndexToProcess) {
2929
2935
  var _loop4 = function _loop4(_i2) {
2930
- var PerFrameFunctionalGroups = PerFrameFunctionalGroupsSequence[_i2];
2931
- var segmentIndex = getSegmentIndex(multiframe, _i2);
2932
- if (segmentIndex === undefined) {
2933
- throw new Error("Could not retrieve the segment index. Aborting segmentation loading.");
2934
- }
2935
- if (segmentIndex !== segmentIndexToProcess) {
2936
- i = _i2;
2937
- return "continue";
2938
- }
2939
- var ImageOrientationPatientI = sharedImageOrientationPatient || PerFrameFunctionalGroups.PlaneOrientationSequence.ImageOrientationPatient;
2940
-
2941
- // Since we moved to the chunks approach, we need to read the data
2942
- // and handle scenarios where the portion of data is in one chunk
2943
- // and the other portion is in another chunk
2944
- var view = readFromUnpackedChunks(pixelData, _i2 * sliceLength, sliceLength);
2945
- var pixelDataI2D = ndarray__WEBPACK_IMPORTED_MODULE_2___default()(view, [Rows, Columns]);
2946
- var alignedPixelDataI = alignPixelDataWithSourceData(pixelDataI2D, ImageOrientationPatientI, validOrientations, tolerance);
2947
- if (!alignedPixelDataI) {
2948
- 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.");
2949
- }
2950
- var imageId = findReferenceSourceImageId(multiframe, _i2, imageIds, metadataProvider, tolerance, sopUIDImageIdIndexMap);
2951
- if (!imageId) {
2952
- console.warn("Image not present in stack, can't import frame : " + _i2 + ".");
2953
- i = _i2;
2954
- return "continue";
2955
- }
2956
- var sourceImageMetadata = metadataProvider.get("instance", imageId);
2957
- if (Rows !== sourceImageMetadata.Rows || Columns !== sourceImageMetadata.Columns) {
2958
- 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. ");
2959
- }
2960
- var imageIdIndex = imageIds.findIndex(function (element) {
2961
- return element === imageId;
2962
- });
2963
- var byteOffset = sliceLength * imageIdIndex * TypedArrayConstructor.BYTES_PER_ELEMENT;
2964
- var labelmap2DView = new TypedArrayConstructor(tempBuffer, byteOffset, sliceLength);
2965
- var data = alignedPixelDataI.data;
2966
- var segmentOnFrame = false;
2967
- for (var j = 0, len = alignedPixelDataI.data.length; j < len; ++j) {
2968
- if (data[j]) {
2969
- if (labelmap2DView[j] !== 0) {
2970
- m++;
2971
- if (m >= M) {
2972
- labelmapBufferArray[m] = new ArrayBuffer(arrayBufferLength);
2973
- segmentsOnFrameArray[m] = [];
2974
- M++;
2936
+ var PerFrameFunctionalGroups = PerFrameFunctionalGroupsSequence[_i2];
2937
+ var segmentIndex = getSegmentIndex(multiframe, _i2);
2938
+ if (segmentIndex === undefined) {
2939
+ throw new Error("Could not retrieve the segment index. Aborting segmentation loading.");
2940
+ }
2941
+ if (segmentIndex !== segmentIndexToProcess) {
2942
+ i = _i2;
2943
+ return 0; // continue
2944
+ }
2945
+ var ImageOrientationPatientI = sharedImageOrientationPatient || PerFrameFunctionalGroups.PlaneOrientationSequence.ImageOrientationPatient;
2946
+
2947
+ // Since we moved to the chunks approach, we need to read the data
2948
+ // and handle scenarios where the portion of data is in one chunk
2949
+ // and the other portion is in another chunk
2950
+ var view = readFromUnpackedChunks(pixelData, _i2 * sliceLength, sliceLength);
2951
+ var pixelDataI2D = ndarray__WEBPACK_IMPORTED_MODULE_2___default()(view, [Rows, Columns]);
2952
+ var alignedPixelDataI = alignPixelDataWithSourceData(pixelDataI2D, ImageOrientationPatientI, validOrientations, tolerance);
2953
+ if (!alignedPixelDataI) {
2954
+ 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.");
2955
+ }
2956
+ var imageId = findReferenceSourceImageId(multiframe, _i2, imageIds, metadataProvider, tolerance, sopUIDImageIdIndexMap);
2957
+ if (!imageId) {
2958
+ console.warn("Image not present in stack, can't import frame : " + _i2 + ".");
2959
+ i = _i2;
2960
+ return 0; // continue
2961
+ }
2962
+ var sourceImageMetadata = metadataProvider.get("instance", imageId);
2963
+ if (Rows !== sourceImageMetadata.Rows || Columns !== sourceImageMetadata.Columns) {
2964
+ 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. ");
2965
+ }
2966
+ var imageIdIndex = imageIds.findIndex(function (element) {
2967
+ return element === imageId;
2968
+ });
2969
+ var byteOffset = sliceLength * imageIdIndex * TypedArrayConstructor.BYTES_PER_ELEMENT;
2970
+ var labelmap2DView = new TypedArrayConstructor(tempBuffer, byteOffset, sliceLength);
2971
+ var data = alignedPixelDataI.data;
2972
+ var segmentOnFrame = false;
2973
+ for (var j = 0, len = alignedPixelDataI.data.length; j < len; ++j) {
2974
+ if (data[j]) {
2975
+ if (labelmap2DView[j] !== 0) {
2976
+ m++;
2977
+ if (m >= M) {
2978
+ labelmapBufferArray[m] = new ArrayBuffer(arrayBufferLength);
2979
+ segmentsOnFrameArray[m] = [];
2980
+ M++;
2981
+ }
2982
+ tempBuffer = labelmapBufferArray[m].slice(0);
2983
+ tempSegmentsOnFrame = lodash_clonedeep__WEBPACK_IMPORTED_MODULE_3___default()(segmentsOnFrameArray[m]);
2984
+ _i2 = 0;
2985
+ break;
2986
+ } else {
2987
+ labelmap2DView[j] = segmentIndex;
2988
+ segmentOnFrame = true;
2975
2989
  }
2976
- tempBuffer = labelmapBufferArray[m].slice(0);
2977
- tempSegmentsOnFrame = lodash_clonedeep__WEBPACK_IMPORTED_MODULE_3___default()(segmentsOnFrameArray[m]);
2978
- _i2 = 0;
2979
- break;
2980
- } else {
2981
- labelmap2DView[j] = segmentIndex;
2982
- segmentOnFrame = true;
2983
2990
  }
2984
2991
  }
2985
- }
2986
- if (segmentOnFrame) {
2987
- if (!tempSegmentsOnFrame[imageIdIndex]) {
2988
- tempSegmentsOnFrame[imageIdIndex] = [];
2989
- }
2990
- tempSegmentsOnFrame[imageIdIndex].push(segmentIndex);
2991
- if (!segmentsOnFrame[imageIdIndex]) {
2992
- segmentsOnFrame[imageIdIndex] = [];
2992
+ if (segmentOnFrame) {
2993
+ if (!tempSegmentsOnFrame[imageIdIndex]) {
2994
+ tempSegmentsOnFrame[imageIdIndex] = [];
2995
+ }
2996
+ tempSegmentsOnFrame[imageIdIndex].push(segmentIndex);
2997
+ if (!segmentsOnFrame[imageIdIndex]) {
2998
+ segmentsOnFrame[imageIdIndex] = [];
2999
+ }
3000
+ segmentsOnFrame[imageIdIndex].push(segmentIndex);
2993
3001
  }
2994
- segmentsOnFrame[imageIdIndex].push(segmentIndex);
2995
- }
2996
- i = _i2;
2997
- };
3002
+ i = _i2;
3003
+ },
3004
+ _ret2;
2998
3005
  for (var i = 0, groupsLen = PerFrameFunctionalGroupsSequence.length; i < groupsLen; ++i) {
2999
- var _ret2 = _loop4(i);
3000
- if (_ret2 === "continue") continue;
3006
+ _ret2 = _loop4(i);
3007
+ if (_ret2 === 0) continue;
3001
3008
  }
3002
3009
  labelmapBufferArray[m] = tempBuffer.slice(0);
3003
3010
  segmentsOnFrameArray[m] = lodash_clonedeep__WEBPACK_IMPORTED_MODULE_3___default()(tempSegmentsOnFrame);
@@ -3026,7 +3033,7 @@ function insertPixelDataPlanar(segmentsOnFrame, segmentsOnFrameArray, labelmapBu
3026
3033
  var chunkSize = Math.ceil(groupsLen / 10); // 10% of total length
3027
3034
 
3028
3035
  var shouldTriggerEvent = triggerEvent && eventTarget;
3029
-
3036
+ var overlapping = false;
3030
3037
  // Below, we chunk the processing of the frames to avoid blocking the main thread
3031
3038
  // if the segmentation is large. We also use a promise to allow the caller to
3032
3039
  // wait for the processing to finish.
@@ -3067,6 +3074,9 @@ function insertPixelDataPlanar(segmentsOnFrame, segmentsOnFrameArray, labelmapBu
3067
3074
  if (data[j]) {
3068
3075
  for (var x = j; x < len; ++x) {
3069
3076
  if (data[x]) {
3077
+ if (!overlapping && labelmap2DView[x] !== 0) {
3078
+ overlapping = true;
3079
+ }
3070
3080
  labelmap2DView[x] = segmentIndex;
3071
3081
  indexCache.push(x);
3072
3082
  }
@@ -3096,7 +3106,7 @@ function insertPixelDataPlanar(segmentsOnFrame, segmentsOnFrameArray, labelmapBu
3096
3106
  setTimeout(processInChunks, 0);
3097
3107
  } else {
3098
3108
  // resolve the Promise when all chunks have been processed
3099
- resolve();
3109
+ resolve(overlapping);
3100
3110
  }
3101
3111
  }
3102
3112
  processInChunks();
@@ -3154,7 +3164,7 @@ function unpackPixelData(multiframe, options) {
3154
3164
  data = multiframe.PixelData;
3155
3165
  }
3156
3166
  if (data === undefined) {
3157
- dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .log */ .cM.error("This segmentation pixeldata is undefined.");
3167
+ dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .log */ .Rm.error("This segmentation pixeldata is undefined.");
3158
3168
  }
3159
3169
  if (segType === "BINARY") {
3160
3170
  // For extreme big data, we can't unpack the data at once and we need to
@@ -3171,7 +3181,7 @@ function unpackPixelData(multiframe, options) {
3171
3181
  // This is a fractional segmentation, which is not currently supported.
3172
3182
  return;
3173
3183
  }
3174
- dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .log */ .cM.warn("This segmentation object is actually binary... processing as such.");
3184
+ dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .log */ .Rm.warn("This segmentation object is actually binary... processing as such.");
3175
3185
  return pixelData;
3176
3186
  }
3177
3187
  function getUnpackedChunks(data, maxBytesPerChunk) {
@@ -3567,6 +3577,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
3567
3577
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
3568
3578
  PERFORMANCE OF THIS SOFTWARE.
3569
3579
  ***************************************************************************** */
3580
+ /* global Reflect, Promise, SuppressedError, Symbol */
3581
+
3570
3582
  var __assign = function () {
3571
3583
  __assign = Object.assign || function __assign(t) {
3572
3584
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -3586,6 +3598,10 @@ function __spreadArray(to, from, pack) {
3586
3598
  }
3587
3599
  return to.concat(ar || Array.prototype.slice.call(from));
3588
3600
  }
3601
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
3602
+ var e = new Error(message);
3603
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
3604
+ };
3589
3605
 
3590
3606
  var CORNERSTONE_3D_TAG = "Cornerstone3DTools@^0.1.0";
3591
3607
 
@@ -3603,11 +3619,11 @@ var CodingScheme = {
3603
3619
  }
3604
3620
  };
3605
3621
 
3606
- var TID1500 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID1500, addAccessors = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.addAccessors;
3607
- var StructuredReport = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .derivations */ .U7.StructuredReport;
3608
- var Normalizer$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .normalizers */ .oq.Normalizer;
3622
+ var TID1500 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID1500, addAccessors = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.addAccessors;
3623
+ var StructuredReport = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .derivations */ .h4.StructuredReport;
3624
+ var Normalizer$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .normalizers */ .z8.Normalizer;
3609
3625
  var TID1500MeasurementReport = TID1500.TID1500MeasurementReport, TID1501MeasurementGroup = TID1500.TID1501MeasurementGroup;
3610
- var DicomMetaDictionary$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .aT.DicomMetaDictionary;
3626
+ var DicomMetaDictionary$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .p.DicomMetaDictionary;
3611
3627
  var FINDING = { CodingSchemeDesignator: "DCM", CodeValue: "121071" };
3612
3628
  var FINDING_SITE = { CodingSchemeDesignator: "SCT", CodeValue: "363698007" };
3613
3629
  var FINDING_SITE_OLD = { CodingSchemeDesignator: "SRT", CodeValue: "G-C0E3" };
@@ -3807,6 +3823,7 @@ var MeasurementReport = /** @class */ (function () {
3807
3823
  var REPORT = "Imaging Measurements";
3808
3824
  var GROUP = "Measurement Group";
3809
3825
  var TRACKING_IDENTIFIER = "Tracking Identifier";
3826
+ var TRACKING_UNIQUE_IDENTIFIER = "Tracking Unique Identifier";
3810
3827
  // Identify the Imaging Measurements
3811
3828
  var imagingMeasurementContent = toArray(dataset.ContentSequence).find(codeMeaningEquals(REPORT));
3812
3829
  // Retrieve the Measurements themselves
@@ -3828,12 +3845,19 @@ var MeasurementReport = /** @class */ (function () {
3828
3845
  TRACKING_IDENTIFIER;
3829
3846
  });
3830
3847
  var TrackingIdentifierValue_1 = TrackingIdentifierGroup.TextValue;
3848
+ var TrackingUniqueIdentifierGroup = measurementGroupContentSequence.find(function (contentItem) {
3849
+ return contentItem.ConceptNameCodeSequence.CodeMeaning ===
3850
+ TRACKING_UNIQUE_IDENTIFIER;
3851
+ });
3852
+ var TrackingUniqueIdentifierValue = TrackingUniqueIdentifierGroup === null || TrackingUniqueIdentifierGroup === void 0 ? void 0 : TrackingUniqueIdentifierGroup.UID;
3831
3853
  var toolClass = ((_a = hooks === null || hooks === void 0 ? void 0 : hooks.getToolClass) === null || _a === void 0 ? void 0 : _a.call(hooks, measurementGroup, dataset, registeredToolClasses)) ||
3832
3854
  registeredToolClasses.find(function (tc) {
3833
3855
  return tc.isValidCornerstoneTrackingIdentifier(TrackingIdentifierValue_1);
3834
3856
  });
3835
3857
  if (toolClass) {
3836
3858
  var measurement = toolClass.getMeasurementData(measurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata);
3859
+ measurement.TrackingUniqueIdentifier =
3860
+ TrackingUniqueIdentifierValue;
3837
3861
  console.log("=== ".concat(toolClass.toolType, " ==="));
3838
3862
  console.log(measurement);
3839
3863
  measurementData[toolClass.toolType].push(measurement);
@@ -3872,9 +3896,9 @@ var MeasurementReport = /** @class */ (function () {
3872
3896
  return MeasurementReport;
3873
3897
  }());
3874
3898
 
3875
- var TID300Point$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Point;
3899
+ var TID300Point$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Point;
3876
3900
  var ARROW_ANNOTATE = "ArrowAnnotate";
3877
- var trackingIdentifierTextValue$7 = "".concat(CORNERSTONE_3D_TAG, ":").concat(ARROW_ANNOTATE);
3901
+ var trackingIdentifierTextValue$8 = "".concat(CORNERSTONE_3D_TAG, ":").concat(ARROW_ANNOTATE);
3878
3902
  var codeValues = CodingScheme.codeValues,
3879
3903
  CodingSchemeDesignator = CodingScheme.CodingSchemeDesignator;
3880
3904
  var ArrowAnnotate = /*#__PURE__*/function () {
@@ -3953,7 +3977,7 @@ var ArrowAnnotate = /*#__PURE__*/function () {
3953
3977
  x: pointImage[0],
3954
3978
  y: pointImage[1]
3955
3979
  }],
3956
- trackingIdentifierTextValue: trackingIdentifierTextValue$7,
3980
+ trackingIdentifierTextValue: trackingIdentifierTextValue$8,
3957
3981
  findingSites: findingSites || []
3958
3982
  };
3959
3983
 
@@ -3989,11 +4013,11 @@ ArrowAnnotate.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifie
3989
4013
  };
3990
4014
  MeasurementReport.registerTool(ArrowAnnotate);
3991
4015
 
3992
- var TID300Bidirectional = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Bidirectional;
4016
+ var TID300Bidirectional = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Bidirectional;
3993
4017
  var BIDIRECTIONAL = "Bidirectional";
3994
4018
  var LONG_AXIS = "Long Axis";
3995
4019
  var SHORT_AXIS = "Short Axis";
3996
- var trackingIdentifierTextValue$6 = "".concat(CORNERSTONE_3D_TAG, ":").concat(BIDIRECTIONAL);
4020
+ var trackingIdentifierTextValue$7 = "".concat(CORNERSTONE_3D_TAG, ":").concat(BIDIRECTIONAL);
3997
4021
  var Bidirectional = /** @class */ (function () {
3998
4022
  function Bidirectional() {
3999
4023
  }
@@ -4096,7 +4120,7 @@ var Bidirectional = /** @class */ (function () {
4096
4120
  },
4097
4121
  longAxisLength: length,
4098
4122
  shortAxisLength: width,
4099
- trackingIdentifierTextValue: trackingIdentifierTextValue$6,
4123
+ trackingIdentifierTextValue: trackingIdentifierTextValue$7,
4100
4124
  finding: finding,
4101
4125
  findingSites: findingSites || []
4102
4126
  };
@@ -4118,9 +4142,9 @@ var Bidirectional = /** @class */ (function () {
4118
4142
  }());
4119
4143
  MeasurementReport.registerTool(Bidirectional);
4120
4144
 
4121
- var TID300CobbAngle$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.CobbAngle;
4145
+ var TID300CobbAngle$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.CobbAngle;
4122
4146
  var MEASUREMENT_TYPE$1 = "Angle";
4123
- var trackingIdentifierTextValue$5 = "".concat(CORNERSTONE_3D_TAG, ":").concat(MEASUREMENT_TYPE$1);
4147
+ var trackingIdentifierTextValue$6 = "".concat(CORNERSTONE_3D_TAG, ":").concat(MEASUREMENT_TYPE$1);
4124
4148
  var Angle = /** @class */ (function () {
4125
4149
  function Angle() {
4126
4150
  }
@@ -4180,7 +4204,7 @@ var Angle = /** @class */ (function () {
4180
4204
  point3: point3,
4181
4205
  point4: point4,
4182
4206
  rAngle: angle,
4183
- trackingIdentifierTextValue: trackingIdentifierTextValue$5,
4207
+ trackingIdentifierTextValue: trackingIdentifierTextValue$6,
4184
4208
  finding: finding,
4185
4209
  findingSites: findingSites || []
4186
4210
  };
@@ -4202,9 +4226,9 @@ var Angle = /** @class */ (function () {
4202
4226
  }());
4203
4227
  MeasurementReport.registerTool(Angle);
4204
4228
 
4205
- var TID300CobbAngle = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.CobbAngle;
4229
+ var TID300CobbAngle = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.CobbAngle;
4206
4230
  var MEASUREMENT_TYPE = "CobbAngle";
4207
- var trackingIdentifierTextValue$4 = "".concat(CORNERSTONE_3D_TAG, ":").concat(MEASUREMENT_TYPE);
4231
+ var trackingIdentifierTextValue$5 = "".concat(CORNERSTONE_3D_TAG, ":").concat(MEASUREMENT_TYPE);
4208
4232
  var CobbAngle = /** @class */ (function () {
4209
4233
  function CobbAngle() {
4210
4234
  }
@@ -4269,7 +4293,7 @@ var CobbAngle = /** @class */ (function () {
4269
4293
  point3: point3,
4270
4294
  point4: point4,
4271
4295
  rAngle: angle,
4272
- trackingIdentifierTextValue: trackingIdentifierTextValue$4,
4296
+ trackingIdentifierTextValue: trackingIdentifierTextValue$5,
4273
4297
  finding: finding,
4274
4298
  findingSites: findingSites || []
4275
4299
  };
@@ -4304,7 +4328,7 @@ function isValidCornerstoneTrackingIdentifier(trackingIdentifier) {
4304
4328
  return toolType.toLowerCase() === this.toolType.toLowerCase();
4305
4329
  }
4306
4330
 
4307
- var TID300Circle = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Circle;
4331
+ var TID300Circle = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Circle;
4308
4332
  var CIRCLEROI = "CircleROI";
4309
4333
  var CircleROI = /** @class */ (function () {
4310
4334
  function CircleROI() {
@@ -4386,7 +4410,7 @@ var CircleROI = /** @class */ (function () {
4386
4410
  }());
4387
4411
  MeasurementReport.registerTool(CircleROI);
4388
4412
 
4389
- var TID300Ellipse = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Ellipse;
4413
+ var TID300Ellipse = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Ellipse;
4390
4414
  var ELLIPTICALROI = "EllipticalROI";
4391
4415
  var EPSILON = 1e-4;
4392
4416
  var EllipticalROI = /** @class */ (function () {
@@ -4409,26 +4433,26 @@ var EllipticalROI = /** @class */ (function () {
4409
4433
  ]);
4410
4434
  pointsWorld.push(worldPos);
4411
4435
  }
4412
- var majorAxisStart = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.fromValues */ .R3.fromValues.apply(gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3 */ .R3, pointsWorld[0]);
4413
- var majorAxisEnd = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.fromValues */ .R3.fromValues.apply(gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3 */ .R3, pointsWorld[1]);
4414
- var minorAxisStart = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.fromValues */ .R3.fromValues.apply(gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3 */ .R3, pointsWorld[2]);
4415
- var minorAxisEnd = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.fromValues */ .R3.fromValues.apply(gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3 */ .R3, pointsWorld[3]);
4416
- var majorAxisVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.create */ .R3.create();
4417
- gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.sub */ .R3.sub(majorAxisVec, majorAxisEnd, majorAxisStart);
4436
+ var majorAxisStart = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.fromValues */ .eR.fromValues.apply(gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3 */ .eR, pointsWorld[0]);
4437
+ var majorAxisEnd = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.fromValues */ .eR.fromValues.apply(gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3 */ .eR, pointsWorld[1]);
4438
+ var minorAxisStart = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.fromValues */ .eR.fromValues.apply(gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3 */ .eR, pointsWorld[2]);
4439
+ var minorAxisEnd = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.fromValues */ .eR.fromValues.apply(gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3 */ .eR, pointsWorld[3]);
4440
+ var majorAxisVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.create */ .eR.create();
4441
+ gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.sub */ .eR.sub(majorAxisVec, majorAxisEnd, majorAxisStart);
4418
4442
  // normalize majorAxisVec to avoid scaling issues
4419
- gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.normalize */ .R3.normalize(majorAxisVec, majorAxisVec);
4420
- var minorAxisVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.create */ .R3.create();
4421
- gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.sub */ .R3.sub(minorAxisVec, minorAxisEnd, minorAxisStart);
4422
- gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.normalize */ .R3.normalize(minorAxisVec, minorAxisVec);
4443
+ gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.normalize */ .eR.normalize(majorAxisVec, majorAxisVec);
4444
+ var minorAxisVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.create */ .eR.create();
4445
+ gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.sub */ .eR.sub(minorAxisVec, minorAxisEnd, minorAxisStart);
4446
+ gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.normalize */ .eR.normalize(minorAxisVec, minorAxisVec);
4423
4447
  var imagePlaneModule = metadata.get("imagePlaneModule", referencedImageId);
4424
4448
  if (!imagePlaneModule) {
4425
4449
  throw new Error("imageId does not have imagePlaneModule metadata");
4426
4450
  }
4427
4451
  var columnCosines = imagePlaneModule.columnCosines;
4428
4452
  // find which axis is parallel to the columnCosines
4429
- var columnCosinesVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.fromValues */ .R3.fromValues(columnCosines[0], columnCosines[1], columnCosines[2]);
4430
- var projectedMajorAxisOnColVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.dot */ .R3.dot(columnCosinesVec, majorAxisVec);
4431
- var projectedMinorAxisOnColVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.dot */ .R3.dot(columnCosinesVec, minorAxisVec);
4453
+ var columnCosinesVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.fromValues */ .eR.fromValues(columnCosines[0], columnCosines[1], columnCosines[2]);
4454
+ var projectedMajorAxisOnColVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.dot */ .eR.dot(columnCosinesVec, majorAxisVec);
4455
+ var projectedMinorAxisOnColVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.dot */ .eR.dot(columnCosinesVec, minorAxisVec);
4432
4456
  var absoluteOfMajorDotProduct = Math.abs(projectedMajorAxisOnColVec);
4433
4457
  var absoluteOfMinorDotProduct = Math.abs(projectedMinorAxisOnColVec);
4434
4458
  var ellipsePoints = [];
@@ -4531,9 +4555,9 @@ var EllipticalROI = /** @class */ (function () {
4531
4555
  }());
4532
4556
  MeasurementReport.registerTool(EllipticalROI);
4533
4557
 
4534
- var TID300Polyline$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Polyline;
4558
+ var TID300Polyline$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Polyline;
4535
4559
  var TOOLTYPE = "RectangleROI";
4536
- var trackingIdentifierTextValue$3 = "".concat(CORNERSTONE_3D_TAG, ":").concat(TOOLTYPE);
4560
+ var trackingIdentifierTextValue$4 = "".concat(CORNERSTONE_3D_TAG, ":").concat(TOOLTYPE);
4537
4561
  var RectangleROI = /** @class */ (function () {
4538
4562
  function RectangleROI() {
4539
4563
  }
@@ -4596,7 +4620,7 @@ var RectangleROI = /** @class */ (function () {
4596
4620
  ],
4597
4621
  area: area,
4598
4622
  perimeter: perimeter,
4599
- trackingIdentifierTextValue: trackingIdentifierTextValue$3,
4623
+ trackingIdentifierTextValue: trackingIdentifierTextValue$4,
4600
4624
  finding: finding,
4601
4625
  findingSites: findingSites || []
4602
4626
  };
@@ -4618,9 +4642,9 @@ var RectangleROI = /** @class */ (function () {
4618
4642
  }());
4619
4643
  MeasurementReport.registerTool(RectangleROI);
4620
4644
 
4621
- var TID300Length = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Length;
4645
+ var TID300Length$1 = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Length;
4622
4646
  var LENGTH = "Length";
4623
- var trackingIdentifierTextValue$2 = "".concat(CORNERSTONE_3D_TAG, ":").concat(LENGTH);
4647
+ var trackingIdentifierTextValue$3 = "".concat(CORNERSTONE_3D_TAG, ":").concat(LENGTH);
4624
4648
  var Length = /*#__PURE__*/function () {
4625
4649
  function Length() {
4626
4650
  _classCallCheck(this, Length);
@@ -4688,7 +4712,7 @@ var Length = /*#__PURE__*/function () {
4688
4712
  point1: point1,
4689
4713
  point2: point2,
4690
4714
  distance: distance,
4691
- trackingIdentifierTextValue: trackingIdentifierTextValue$2,
4715
+ trackingIdentifierTextValue: trackingIdentifierTextValue$3,
4692
4716
  finding: finding,
4693
4717
  findingSites: findingSites || []
4694
4718
  };
@@ -4698,7 +4722,7 @@ var Length = /*#__PURE__*/function () {
4698
4722
  }();
4699
4723
  Length.toolType = LENGTH;
4700
4724
  Length.utilityToolType = LENGTH;
4701
- Length.TID300Representation = TID300Length;
4725
+ Length.TID300Representation = TID300Length$1;
4702
4726
  Length.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
4703
4727
  if (!TrackingIdentifier.includes(":")) {
4704
4728
  return false;
@@ -4714,15 +4738,16 @@ Length.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
4714
4738
  };
4715
4739
  MeasurementReport.registerTool(Length);
4716
4740
 
4717
- var TID300Polyline = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Polyline;
4741
+ var TID300Polyline = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Polyline;
4718
4742
  var PLANARFREEHANDROI = "PlanarFreehandROI";
4719
- var trackingIdentifierTextValue$1 = "".concat(CORNERSTONE_3D_TAG, ":").concat(PLANARFREEHANDROI);
4743
+ var trackingIdentifierTextValue$2 = "".concat(CORNERSTONE_3D_TAG, ":").concat(PLANARFREEHANDROI);
4720
4744
  var closedContourThreshold = 1e-5;
4721
4745
  var PlanarFreehandROI = /** @class */ (function () {
4722
4746
  function PlanarFreehandROI() {
4723
4747
  }
4724
4748
  PlanarFreehandROI.getMeasurementData = function (MeasurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata) {
4725
- var _a = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, PlanarFreehandROI.toolType), defaultState = _a.defaultState, SCOORDGroup = _a.SCOORDGroup, ReferencedFrameNumber = _a.ReferencedFrameNumber;
4749
+ var _a;
4750
+ var _b = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, PlanarFreehandROI.toolType), defaultState = _b.defaultState, NUMGroup = _b.NUMGroup, SCOORDGroup = _b.SCOORDGroup, ReferencedFrameNumber = _b.ReferencedFrameNumber;
4726
4751
  var referencedImageId = defaultState.annotation.metadata.referencedImageId;
4727
4752
  var GraphicData = SCOORDGroup.GraphicData;
4728
4753
  var worldCoords = [];
@@ -4733,7 +4758,7 @@ var PlanarFreehandROI = /** @class */ (function () {
4733
4758
  ]);
4734
4759
  worldCoords.push(point);
4735
4760
  }
4736
- var distanceBetweenFirstAndLastPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.distance */ .R3.distance(worldCoords[worldCoords.length - 1], worldCoords[0]);
4761
+ var distanceBetweenFirstAndLastPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_4__/* .vec3.distance */ .eR.distance(worldCoords[worldCoords.length - 1], worldCoords[0]);
4737
4762
  var isOpenContour = true;
4738
4763
  // If the contour is closed, this should have been encoded as exactly the same point, so check for a very small difference.
4739
4764
  if (distanceBetweenFirstAndLastPoint < closedContourThreshold) {
@@ -4746,8 +4771,7 @@ var PlanarFreehandROI = /** @class */ (function () {
4746
4771
  }
4747
4772
  var state = defaultState;
4748
4773
  state.annotation.data = {
4749
- polyline: worldCoords,
4750
- isOpenContour: isOpenContour,
4774
+ contour: { polyline: worldCoords, closed: !isOpenContour },
4751
4775
  handles: {
4752
4776
  points: points,
4753
4777
  activeHandleIndex: null,
@@ -4755,13 +4779,21 @@ var PlanarFreehandROI = /** @class */ (function () {
4755
4779
  hasMoved: false
4756
4780
  }
4757
4781
  },
4782
+ cachedStats: (_a = {},
4783
+ _a["imageId:".concat(referencedImageId)] = {
4784
+ area: NUMGroup
4785
+ ? NUMGroup.MeasuredValueSequence.NumericValue
4786
+ : null
4787
+ },
4788
+ _a),
4758
4789
  frameNumber: ReferencedFrameNumber
4759
4790
  };
4760
4791
  return state;
4761
4792
  };
4762
4793
  PlanarFreehandROI.getTID300RepresentationArguments = function (tool, worldToImageCoords) {
4763
4794
  var data = tool.data, finding = tool.finding, findingSites = tool.findingSites, metadata = tool.metadata;
4764
- var isOpenContour = data.isOpenContour, polyline = data.polyline;
4795
+ var _a = data.contour, polyline = _a.polyline, closed = _a.closed;
4796
+ var isOpenContour = closed !== true;
4765
4797
  var referencedImageId = metadata.referencedImageId;
4766
4798
  if (!referencedImageId) {
4767
4799
  throw new Error("PlanarFreehandROI.getTID300RepresentationArguments: referencedImageId is not defined");
@@ -4775,13 +4807,19 @@ var PlanarFreehandROI = /** @class */ (function () {
4775
4807
  // Explicitly expand to avoid ciruclar references.
4776
4808
  points.push([firstPoint[0], firstPoint[1]]);
4777
4809
  }
4778
- var area = 0; // TODO -> The tool doesn't have these stats yet.
4779
- var perimeter = 0;
4810
+ var _b = data.cachedStats["imageId:".concat(referencedImageId)] || {}, area = _b.area, areaUnit = _b.areaUnit, modalityUnit = _b.modalityUnit, perimeter = _b.perimeter, mean = _b.mean, max = _b.max, stdDev = _b.stdDev;
4780
4811
  return {
4812
+ /** From cachedStats */
4781
4813
  points: points,
4782
4814
  area: area,
4815
+ areaUnit: areaUnit,
4783
4816
  perimeter: perimeter,
4784
- trackingIdentifierTextValue: trackingIdentifierTextValue$1,
4817
+ modalityUnit: modalityUnit,
4818
+ mean: mean,
4819
+ max: max,
4820
+ stdDev: stdDev,
4821
+ /** Other */
4822
+ trackingIdentifierTextValue: trackingIdentifierTextValue$2,
4785
4823
  finding: finding,
4786
4824
  findingSites: findingSites || []
4787
4825
  };
@@ -4803,9 +4841,9 @@ var PlanarFreehandROI = /** @class */ (function () {
4803
4841
  }());
4804
4842
  MeasurementReport.registerTool(PlanarFreehandROI);
4805
4843
 
4806
- var TID300Point = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .hC.TID300.Point;
4844
+ var TID300Point = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Point;
4807
4845
  var PROBE = "Probe";
4808
- var trackingIdentifierTextValue = "".concat(CORNERSTONE_3D_TAG, ":").concat(PROBE);
4846
+ var trackingIdentifierTextValue$1 = "".concat(CORNERSTONE_3D_TAG, ":").concat(PROBE);
4809
4847
  var Probe = /*#__PURE__*/function () {
4810
4848
  function Probe() {
4811
4849
  _classCallCheck(this, Probe);
@@ -4858,7 +4896,7 @@ var Probe = /*#__PURE__*/function () {
4858
4896
  });
4859
4897
  var TID300RepresentationArguments = {
4860
4898
  points: pointsImage,
4861
- trackingIdentifierTextValue: trackingIdentifierTextValue,
4899
+ trackingIdentifierTextValue: trackingIdentifierTextValue$1,
4862
4900
  findingSites: findingSites || [],
4863
4901
  finding: finding
4864
4902
  };
@@ -4885,8 +4923,77 @@ Probe.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
4885
4923
  };
4886
4924
  MeasurementReport.registerTool(Probe);
4887
4925
 
4888
- var Normalizer = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .normalizers */ .oq.Normalizer;
4889
- var SegmentationDerivation = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .derivations */ .U7.Segmentation;
4926
+ var TID300Length = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .utilities */ .BF.TID300.Length;
4927
+ var ULTRASOUND_DIRECTIONAL = "UltrasoundDirectionalTool";
4928
+ var trackingIdentifierTextValue = "".concat(CORNERSTONE_3D_TAG, ":").concat(ULTRASOUND_DIRECTIONAL);
4929
+ var UltrasoundDirectional = /** @class */ (function () {
4930
+ function UltrasoundDirectional() {
4931
+ }
4932
+ // TODO: this function is required for all Cornerstone Tool Adapters, since it is called by MeasurementReport.
4933
+ UltrasoundDirectional.getMeasurementData = function (MeasurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata) {
4934
+ var _a = MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, UltrasoundDirectional.toolType), defaultState = _a.defaultState, SCOORDGroup = _a.SCOORDGroup, ReferencedFrameNumber = _a.ReferencedFrameNumber;
4935
+ var referencedImageId = defaultState.annotation.metadata.referencedImageId;
4936
+ var GraphicData = SCOORDGroup.GraphicData;
4937
+ var worldCoords = [];
4938
+ for (var i = 0; i < GraphicData.length; i += 2) {
4939
+ var point = imageToWorldCoords(referencedImageId, [
4940
+ GraphicData[i],
4941
+ GraphicData[i + 1]
4942
+ ]);
4943
+ worldCoords.push(point);
4944
+ }
4945
+ var state = defaultState;
4946
+ state.annotation.data = {
4947
+ handles: {
4948
+ points: [worldCoords[0], worldCoords[1]],
4949
+ activeHandleIndex: 0,
4950
+ textBox: {
4951
+ hasMoved: false
4952
+ }
4953
+ },
4954
+ cachedStats: {},
4955
+ frameNumber: ReferencedFrameNumber
4956
+ };
4957
+ return state;
4958
+ };
4959
+ UltrasoundDirectional.getTID300RepresentationArguments = function (tool, worldToImageCoords) {
4960
+ var data = tool.data, finding = tool.finding, findingSites = tool.findingSites, metadata = tool.metadata;
4961
+ var handles = data.handles;
4962
+ var referencedImageId = metadata.referencedImageId;
4963
+ if (!referencedImageId) {
4964
+ throw new Error("UltrasoundDirectionalTool.getTID300RepresentationArguments: referencedImageId is not defined");
4965
+ }
4966
+ var start = worldToImageCoords(referencedImageId, handles.points[0]);
4967
+ var end = worldToImageCoords(referencedImageId, handles.points[1]);
4968
+ var point1 = { x: start[0], y: start[1] };
4969
+ var point2 = { x: end[0], y: end[1] };
4970
+ return {
4971
+ point1: point1,
4972
+ point2: point2,
4973
+ trackingIdentifierTextValue: trackingIdentifierTextValue,
4974
+ finding: finding,
4975
+ findingSites: findingSites || []
4976
+ };
4977
+ };
4978
+ UltrasoundDirectional.toolType = ULTRASOUND_DIRECTIONAL;
4979
+ UltrasoundDirectional.utilityToolType = ULTRASOUND_DIRECTIONAL;
4980
+ UltrasoundDirectional.TID300Representation = TID300Length;
4981
+ UltrasoundDirectional.isValidCornerstoneTrackingIdentifier = function (TrackingIdentifier) {
4982
+ if (!TrackingIdentifier.includes(":")) {
4983
+ return false;
4984
+ }
4985
+ var _a = TrackingIdentifier.split(":"), cornerstone3DTag = _a[0], toolType = _a[1];
4986
+ if (cornerstone3DTag !== CORNERSTONE_3D_TAG) {
4987
+ return false;
4988
+ }
4989
+ return toolType === ULTRASOUND_DIRECTIONAL;
4990
+ };
4991
+ return UltrasoundDirectional;
4992
+ }());
4993
+ MeasurementReport.registerTool(UltrasoundDirectional);
4994
+
4995
+ var Normalizer = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .normalizers */ .z8.Normalizer;
4996
+ var SegmentationDerivation = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .derivations */ .h4.Segmentation;
4890
4997
  /**
4891
4998
  * generateSegmentation - Generates a DICOM Segmentation object given cornerstoneTools data.
4892
4999
  *
@@ -4994,415 +5101,6 @@ var Segmentation$1 = /*#__PURE__*/Object.freeze({
4994
5101
  generateToolState: generateToolState
4995
5102
  });
4996
5103
 
4997
- /**
4998
- * Checks if point is within array
4999
- * @param {*} array
5000
- * @param {*} pt
5001
- * @returns
5002
- */
5003
- function ptInArray(array, pt) {
5004
- var index = -1;
5005
- for (var i = 0; i < array.length; i++) {
5006
- if (isSamePoint(pt, array[i])) {
5007
- index = i;
5008
- }
5009
- }
5010
- return index;
5011
- }
5012
-
5013
- /**
5014
- * Checks if point A and point B contain same values
5015
- * @param {*} ptA
5016
- * @param {*} ptB
5017
- * @returns
5018
- */
5019
- function isSamePoint(ptA, ptB) {
5020
- if (ptA[0] == ptB[0] && ptA[1] == ptB[1] && ptA[2] == ptB[2]) {
5021
- return true;
5022
- } else {
5023
- return false;
5024
- }
5025
- }
5026
-
5027
- /**
5028
- * Goes through linesArray and replaces all references of old index with new index
5029
- * @param {*} linesArray
5030
- * @param {*} oldIndex
5031
- * @param {*} newIndex
5032
- */
5033
- function replacePointIndexReferences(linesArray, oldIndex, newIndex) {
5034
- for (var i = 0; i < linesArray.length; i++) {
5035
- var line = linesArray[i];
5036
- if (line.a == oldIndex) {
5037
- line.a = newIndex;
5038
- } else if (line.b == oldIndex) {
5039
- line.b = newIndex;
5040
- }
5041
- }
5042
- }
5043
-
5044
- /**
5045
- * Iterate through polyData from vtkjs and merge any points that are the same
5046
- * then update merged point references within lines array
5047
- * @param {*} polyData
5048
- * @param {*} bypass
5049
- * @returns
5050
- */
5051
- function removeDuplicatePoints(polyData, bypass) {
5052
- var points = polyData.getPoints();
5053
- var lines = polyData.getLines();
5054
- var pointsArray = [];
5055
- for (var i = 0; i < points.getNumberOfPoints(); i++) {
5056
- var pt = points.getPoint(i).slice();
5057
- pointsArray.push(pt);
5058
- }
5059
- var linesArray = [];
5060
- for (var _i = 0; _i < lines.getNumberOfCells(); _i++) {
5061
- var cell = lines.getCell(_i * 3).slice();
5062
- //console.log(JSON.stringify(cell));
5063
- var a = cell[0];
5064
- var b = cell[1];
5065
- var line = {
5066
- a: a,
5067
- b: b
5068
- };
5069
- linesArray.push(line);
5070
- }
5071
- if (bypass) {
5072
- return {
5073
- points: pointsArray,
5074
- lines: linesArray
5075
- };
5076
- }
5077
-
5078
- // Iterate through points and replace any duplicates
5079
- var newPoints = [];
5080
- for (var _i2 = 0; _i2 < pointsArray.length; _i2++) {
5081
- var _pt = pointsArray[_i2];
5082
- var index = ptInArray(newPoints, _pt);
5083
- if (index >= 0) {
5084
- // Duplicate Point -> replace references in lines
5085
- replacePointIndexReferences(linesArray, _i2, index);
5086
- } else {
5087
- index = newPoints.length;
5088
- newPoints.push(_pt);
5089
- replacePointIndexReferences(linesArray, _i2, index);
5090
- }
5091
- }
5092
-
5093
- // Final pass through lines, remove any that refer to exact same point
5094
- var newLines = [];
5095
- linesArray.forEach(function (line) {
5096
- if (line.a != line.b) {
5097
- newLines.push(line);
5098
- }
5099
- });
5100
- return {
5101
- points: newPoints,
5102
- lines: newLines
5103
- };
5104
- }
5105
-
5106
- function findNextLink(line, lines, contourPoints) {
5107
- var index = -1;
5108
- lines.forEach(function (cell, i) {
5109
- if (index >= 0) {
5110
- return;
5111
- }
5112
- if (cell.a == line.b) {
5113
- index = i;
5114
- }
5115
- });
5116
- if (index >= 0) {
5117
- var nextLine = lines[index];
5118
- lines.splice(index, 1);
5119
- contourPoints.push(nextLine.b);
5120
- if (contourPoints[0] == nextLine.b) {
5121
- return {
5122
- remainingLines: lines,
5123
- contourPoints: contourPoints,
5124
- type: "CLOSED_PLANAR"
5125
- //type: 'CLOSEDPLANAR_XOR',
5126
- };
5127
- }
5128
-
5129
- return findNextLink(nextLine, lines, contourPoints);
5130
- }
5131
- return {
5132
- remainingLines: lines,
5133
- contourPoints: contourPoints,
5134
- type: "OPEN_PLANAR"
5135
- };
5136
- }
5137
-
5138
- /**
5139
- *
5140
- * @param {*} lines
5141
- */
5142
- function findContours(lines) {
5143
- if (lines.length == 0) {
5144
- return [];
5145
- }
5146
- var contourPoints = [];
5147
- var firstCell = lines.shift();
5148
- contourPoints.push(firstCell.a);
5149
- contourPoints.push(firstCell.b);
5150
- var result = findNextLink(firstCell, lines, contourPoints);
5151
- if (result.remainingLines.length == 0) {
5152
- return [{
5153
- type: result.type,
5154
- contourPoints: result.contourPoints
5155
- }];
5156
- } else {
5157
- var extraContours = findContours(result.remainingLines);
5158
- extraContours.push({
5159
- type: result.type,
5160
- contourPoints: result.contourPoints
5161
- });
5162
- return extraContours;
5163
- }
5164
- }
5165
- function findContoursFromReducedSet(lines, points) {
5166
- return findContours(lines);
5167
- }
5168
-
5169
- function generateContourSetsFromLabelmap(_ref) {
5170
- var segmentations = _ref.segmentations,
5171
- cornerstoneCache = _ref.cornerstoneCache,
5172
- cornerstoneToolsEnums = _ref.cornerstoneToolsEnums,
5173
- vtkUtils = _ref.vtkUtils;
5174
- var LABELMAP = cornerstoneToolsEnums.SegmentationRepresentations.Labelmap;
5175
- var representationData = segmentations.representationData,
5176
- segments = segmentations.segments;
5177
- var segVolumeId = representationData[LABELMAP].volumeId;
5178
-
5179
- // Get segmentation volume
5180
- var vol = cornerstoneCache.getVolume(segVolumeId);
5181
- if (!vol) {
5182
- console.warn("No volume found for ".concat(segVolumeId));
5183
- return;
5184
- }
5185
- var numSlices = vol.dimensions[2];
5186
-
5187
- // Get image volume segmentation references
5188
- var imageVol = cornerstoneCache.getVolume(vol.referencedVolumeId);
5189
- if (!imageVol) {
5190
- console.warn("No volume found for ".concat(vol.referencedVolumeId));
5191
- return;
5192
- }
5193
-
5194
- // NOTE: Workaround for marching squares not finding closed contours at
5195
- // boundary of image volume, clear pixels along x-y border of volume
5196
- var segData = vol.imageData.getPointData().getScalars().getData();
5197
- var pixelsPerSlice = vol.dimensions[0] * vol.dimensions[1];
5198
- for (var z = 0; z < numSlices; z++) {
5199
- for (var y = 0; y < vol.dimensions[1]; y++) {
5200
- for (var x = 0; x < vol.dimensions[0]; x++) {
5201
- var index = x + y * vol.dimensions[0] + z * pixelsPerSlice;
5202
- if (x === 0 || y === 0 || x === vol.dimensions[0] - 1 || y === vol.dimensions[1] - 1) {
5203
- segData[index] = 0;
5204
- }
5205
- }
5206
- }
5207
- }
5208
-
5209
- // end workaround
5210
- //
5211
- //
5212
- var ContourSets = [];
5213
-
5214
- // Iterate through all segments in current segmentation set
5215
- var numSegments = segments.length;
5216
- for (var segIndex = 0; segIndex < numSegments; segIndex++) {
5217
- var segment = segments[segIndex];
5218
-
5219
- // Skip empty segments
5220
- if (!segment) {
5221
- continue;
5222
- }
5223
- var contourSequence = [];
5224
- for (var sliceIndex = 0; sliceIndex < numSlices; sliceIndex++) {
5225
- // Check if the slice is empty before running marching cube
5226
- if (isSliceEmptyForSegment(sliceIndex, segData, pixelsPerSlice, segIndex)) {
5227
- continue;
5228
- }
5229
- try {
5230
- var _reducedSet$points;
5231
- var scalars = vtkUtils.vtkDataArray.newInstance({
5232
- name: "Scalars",
5233
- values: Array.from(segData),
5234
- numberOfComponents: 1
5235
- });
5236
-
5237
- // Modify segData for this specific segment directly
5238
- var segmentIndexFound = false;
5239
- for (var i = 0; i < segData.length; i++) {
5240
- var value = segData[i];
5241
- if (value === segIndex) {
5242
- segmentIndexFound = true;
5243
- scalars.setValue(i, 1);
5244
- } else {
5245
- scalars.setValue(i, 0);
5246
- }
5247
- }
5248
- if (!segmentIndexFound) {
5249
- continue;
5250
- }
5251
- var mSquares = vtkUtils.vtkImageMarchingSquares.newInstance({
5252
- slice: sliceIndex
5253
- });
5254
-
5255
- // filter out the scalar data so that only it has background and
5256
- // the current segment index
5257
- var imageDataCopy = vtkUtils.vtkImageData.newInstance();
5258
- imageDataCopy.shallowCopy(vol.imageData);
5259
- imageDataCopy.getPointData().setScalars(scalars);
5260
-
5261
- // Connect pipeline
5262
- mSquares.setInputData(imageDataCopy);
5263
- var cValues = [];
5264
- cValues[0] = 1;
5265
- mSquares.setContourValues(cValues);
5266
- mSquares.setMergePoints(false);
5267
-
5268
- // Perform marching squares
5269
- var msOutput = mSquares.getOutputData();
5270
-
5271
- // Clean up output from marching squares
5272
- var reducedSet = removeDuplicatePoints(msOutput);
5273
- if ((_reducedSet$points = reducedSet.points) !== null && _reducedSet$points !== void 0 && _reducedSet$points.length) {
5274
- var contours = findContoursFromReducedSet(reducedSet.lines, reducedSet.points);
5275
- contourSequence.push({
5276
- referencedImageId: imageVol.imageIds[sliceIndex],
5277
- contours: contours,
5278
- polyData: reducedSet
5279
- });
5280
- }
5281
- } catch (e) {
5282
- console.warn(sliceIndex);
5283
- console.warn(e);
5284
- }
5285
- }
5286
- var metadata = {
5287
- referencedImageId: imageVol.imageIds[0],
5288
- // just use 0
5289
- FrameOfReferenceUID: imageVol.metadata.FrameOfReferenceUID
5290
- };
5291
- var ContourSet = {
5292
- label: segment.label,
5293
- color: segment.color,
5294
- metadata: metadata,
5295
- sliceContours: contourSequence
5296
- };
5297
- ContourSets.push(ContourSet);
5298
- }
5299
- return ContourSets;
5300
- }
5301
- function isSliceEmptyForSegment(sliceIndex, segData, pixelsPerSlice, segIndex) {
5302
- var startIdx = sliceIndex * pixelsPerSlice;
5303
- var endIdx = startIdx + pixelsPerSlice;
5304
- for (var i = startIdx; i < endIdx; i++) {
5305
- if (segData[i] === segIndex) {
5306
- return false;
5307
- }
5308
- }
5309
- return true;
5310
- }
5311
-
5312
- // comment
5313
- var RectangleROIStartEndThreshold = /*#__PURE__*/function () {
5314
- function RectangleROIStartEndThreshold() {
5315
- _classCallCheck(this, RectangleROIStartEndThreshold);
5316
- } // empty
5317
- _createClass(RectangleROIStartEndThreshold, null, [{
5318
- key: "getContourSequence",
5319
- value: function getContourSequence(toolData, metadataProvider) {
5320
- var data = toolData.data;
5321
- var _data$cachedStats = data.cachedStats,
5322
- projectionPoints = _data$cachedStats.projectionPoints,
5323
- projectionPointsImageIds = _data$cachedStats.projectionPointsImageIds;
5324
- return projectionPoints.map(function (point, index) {
5325
- var ContourData = getPointData(point);
5326
- var ContourImageSequence = getContourImageSequence(projectionPointsImageIds[index], metadataProvider);
5327
- return {
5328
- NumberOfContourPoints: ContourData.length / 3,
5329
- ContourImageSequence: ContourImageSequence,
5330
- ContourGeometricType: "CLOSED_PLANAR",
5331
- ContourData: ContourData
5332
- };
5333
- });
5334
- }
5335
- }]);
5336
- return RectangleROIStartEndThreshold;
5337
- }();
5338
- RectangleROIStartEndThreshold.toolName = "RectangleROIStartEndThreshold";
5339
- function getPointData(points) {
5340
- // Since this is a closed contour, the order of the points is important.
5341
- // re-order the points to be in the correct order clockwise
5342
- // Spread to make sure Float32Arrays are converted to arrays
5343
- var orderedPoints = [].concat(_toConsumableArray(points[0]), _toConsumableArray(points[1]), _toConsumableArray(points[3]), _toConsumableArray(points[2]));
5344
- var pointsArray = orderedPoints.flat();
5345
-
5346
- // reduce the precision of the points to 2 decimal places
5347
- var pointsArrayWithPrecision = pointsArray.map(function (point) {
5348
- return point.toFixed(2);
5349
- });
5350
- return pointsArrayWithPrecision;
5351
- }
5352
- function getContourImageSequence(imageId, metadataProvider) {
5353
- var sopCommon = metadataProvider.get("sopCommonModule", imageId);
5354
- return {
5355
- ReferencedSOPClassUID: sopCommon.sopClassUID,
5356
- ReferencedSOPInstanceUID: sopCommon.sopInstanceUID
5357
- };
5358
- }
5359
-
5360
- function validateAnnotation(annotation) {
5361
- if (!(annotation !== null && annotation !== void 0 && annotation.data)) {
5362
- throw new Error("Tool data is empty");
5363
- }
5364
- if (!annotation.metadata || annotation.metadata.referenceImageId) {
5365
- throw new Error("Tool data is not associated with any imageId");
5366
- }
5367
- }
5368
- var AnnotationToPointData = /*#__PURE__*/function () {
5369
- function AnnotationToPointData() {
5370
- _classCallCheck(this, AnnotationToPointData);
5371
- } // empty
5372
- _createClass(AnnotationToPointData, null, [{
5373
- key: "convert",
5374
- value: function convert(annotation, index, metadataProvider) {
5375
- validateAnnotation(annotation);
5376
- var toolName = annotation.metadata.toolName;
5377
- var toolClass = AnnotationToPointData.TOOL_NAMES[toolName];
5378
- if (!toolClass) {
5379
- throw new Error("Unknown tool type: ".concat(toolName, ", cannot convert to RTSSReport"));
5380
- }
5381
-
5382
- // Each toolData should become a list of contours, ContourSequence
5383
- // contains a list of contours with their pointData, their geometry
5384
- // type and their length.
5385
- var ContourSequence = toolClass.getContourSequence(annotation, metadataProvider);
5386
-
5387
- // Todo: random rgb color for now, options should be passed in
5388
- var color = [Math.floor(Math.random() * 255), Math.floor(Math.random() * 255), Math.floor(Math.random() * 255)];
5389
- return {
5390
- ReferencedROINumber: index + 1,
5391
- ROIDisplayColor: color,
5392
- ContourSequence: ContourSequence
5393
- };
5394
- }
5395
- }, {
5396
- key: "register",
5397
- value: function register(toolClass) {
5398
- AnnotationToPointData.TOOL_NAMES[toolClass.toolName] = toolClass;
5399
- }
5400
- }]);
5401
- return AnnotationToPointData;
5402
- }();
5403
- AnnotationToPointData.TOOL_NAMES = {};
5404
- AnnotationToPointData.register(RectangleROIStartEndThreshold);
5405
-
5406
5104
  function getPatientModule(imageId, metadataProvider) {
5407
5105
  var generalSeriesModule = metadataProvider.get("generalSeriesModule", imageId);
5408
5106
  var generalStudyModule = metadataProvider.get("generalStudyModule", imageId);
@@ -5497,7 +5195,8 @@ function getStructureSetModule(contour, index) {
5497
5195
  };
5498
5196
  }
5499
5197
 
5500
- var DicomMetaDictionary = dcmjs__WEBPACK_IMPORTED_MODULE_0__["default"].data.DicomMetaDictionary;
5198
+ var _a = _cornerstonejs_tools__WEBPACK_IMPORTED_MODULE_5__.utilities.contours, generateContourSetsFromLabelmap$1 = _a.generateContourSetsFromLabelmap, AnnotationToPointData = _a.AnnotationToPointData;
5199
+ var DicomMetaDictionary = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* ["default"].data */ .Ay.data.DicomMetaDictionary;
5501
5200
  /**
5502
5201
  * Convert handles to RTSS report containing the dcmjs dicom dataset.
5503
5202
  *
@@ -5511,14 +5210,11 @@ var DicomMetaDictionary = dcmjs__WEBPACK_IMPORTED_MODULE_0__["default"].data.Dic
5511
5210
  * @param csTools - cornerstone tool instance
5512
5211
  * @returns Report object containing the dataset
5513
5212
  */
5514
- function generateRTSSFromSegmentations(segmentations, metadataProvider, DicomMetadataStore, cornerstoneCache, cornerstoneToolsEnums, vtkUtils) {
5213
+ function generateRTSSFromSegmentations(segmentations, metadataProvider, DicomMetadataStore) {
5515
5214
  // Convert segmentations to ROIContours
5516
5215
  var roiContours = [];
5517
- var contourSets = generateContourSetsFromLabelmap({
5518
- segmentations: segmentations,
5519
- cornerstoneCache: cornerstoneCache,
5520
- cornerstoneToolsEnums: cornerstoneToolsEnums,
5521
- vtkUtils: vtkUtils
5216
+ var contourSets = generateContourSetsFromLabelmap$1({
5217
+ segmentations: segmentations
5522
5218
  });
5523
5219
  contourSets.forEach(function (contourSet, segIndex) {
5524
5220
  // Check contour set isn't undefined
@@ -5639,19 +5335,18 @@ function generateRTSSFromSegmentations(segmentations, metadataProvider, DicomMet
5639
5335
  * Note: The tool data needs to be formatted in a specific way, and currently
5640
5336
  * it is limited to the RectangleROIStartEndTool in the Cornerstone.
5641
5337
  *
5642
- * @param annotations Array of Cornerstone tool annotation data
5643
- * @param metadataProvider Metadata provider
5644
- * @param options report generation options
5338
+ * @param annotations - Array of Cornerstone tool annotation data
5339
+ * @param metadataProvider - Metadata provider
5645
5340
  * @returns Report object containing the dataset
5646
5341
  */
5647
- function generateRTSSFromAnnotations(annotations, metadataProvider, DicomMetadataStore, options) {
5342
+ function generateRTSSFromAnnotations(annotations, metadataProvider, DicomMetadataStore) {
5648
5343
  var rtMetadata = {
5649
5344
  name: "RTSS from Annotations",
5650
5345
  label: "RTSS from Annotations"
5651
5346
  };
5652
5347
  var dataset = _initializeDataset(rtMetadata, annotations[0].metadata, metadataProvider);
5653
5348
  annotations.forEach(function (annotation, index) {
5654
- var ContourSequence = AnnotationToPointData.convert(annotation, index, metadataProvider, options);
5349
+ var ContourSequence = AnnotationToPointData.convert(annotation, index, metadataProvider);
5655
5350
  dataset.StructureSetROISequence.push(getStructureSetModule(annotation, index));
5656
5351
  dataset.ROIContourSequence.push(ContourSequence);
5657
5352
  dataset.RTROIObservationsSequence.push(getRTROIObservationsSequence(annotation, index));
@@ -5704,9 +5399,11 @@ function _initializeDataset(rtMetadata, imgMetadata, metadataProvider) {
5704
5399
  var studyInstanceUID = metadataProvider.get("generalSeriesModule", imageId).studyInstanceUID;
5705
5400
  var patientModule = getPatientModule(imageId, metadataProvider);
5706
5401
  var rtSeriesModule = getRTSeriesModule(DicomMetaDictionary);
5707
- return __assign(__assign(__assign({ StructureSetROISequence: [], ROIContourSequence: [], RTROIObservationsSequence: [], ReferencedSeriesSequence: [], ReferencedFrameOfReferenceSequence: [] }, patientModule), rtSeriesModule), { StudyInstanceUID: studyInstanceUID, SOPClassUID: "1.2.840.10008.5.1.4.1.1.481.3", SOPInstanceUID: rtSOPInstanceUID, Manufacturer: "dcmjs", Modality: "RTSTRUCT", FrameOfReferenceUID: FrameOfReferenceUID, PositionReferenceIndicator: "", StructureSetLabel: rtMetadata.label || "", StructureSetName: rtMetadata.name || "", ReferringPhysicianName: "", OperatorsName: "", StructureSetDate: DicomMetaDictionary.date(), StructureSetTime: DicomMetaDictionary.time() });
5402
+ return __assign(__assign(__assign({ StructureSetROISequence: [], ROIContourSequence: [], RTROIObservationsSequence: [], ReferencedSeriesSequence: [], ReferencedFrameOfReferenceSequence: [] }, patientModule), rtSeriesModule), { StudyInstanceUID: studyInstanceUID, SOPClassUID: "1.2.840.10008.5.1.4.1.1.481.3", SOPInstanceUID: rtSOPInstanceUID, Manufacturer: "dcmjs", Modality: "RTSTRUCT", FrameOfReferenceUID: FrameOfReferenceUID, PositionReferenceIndicator: "", StructureSetLabel: rtMetadata.label || "", StructureSetName: rtMetadata.name || "", ReferringPhysicianName: "", OperatorsName: "", StructureSetDate: DicomMetaDictionary.date(), StructureSetTime: DicomMetaDictionary.time(), _meta: null });
5708
5403
  }
5709
5404
 
5405
+ var generateContourSetsFromLabelmap = _cornerstonejs_tools__WEBPACK_IMPORTED_MODULE_5__.utilities.contours.generateContourSetsFromLabelmap;
5406
+
5710
5407
  var RTSS = /*#__PURE__*/Object.freeze({
5711
5408
  __proto__: null,
5712
5409
  generateContourSetsFromLabelmap: generateContourSetsFromLabelmap,
@@ -5725,6 +5422,7 @@ var Cornerstone3DSR = {
5725
5422
  ArrowAnnotate: ArrowAnnotate,
5726
5423
  Probe: Probe,
5727
5424
  PlanarFreehandROI: PlanarFreehandROI,
5425
+ UltrasoundDirectional: UltrasoundDirectional,
5728
5426
  MeasurementReport: MeasurementReport,
5729
5427
  CodeScheme: CodingScheme,
5730
5428
  CORNERSTONE_3D_TAG: CORNERSTONE_3D_TAG
@@ -5736,8 +5434,8 @@ var Cornerstone3DRT = {
5736
5434
  RTSS: RTSS
5737
5435
  };
5738
5436
 
5739
- var Colors = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .aT.Colors,
5740
- BitArray = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .aT.BitArray;
5437
+ var Colors = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .p.Colors,
5438
+ BitArray = dcmjs__WEBPACK_IMPORTED_MODULE_0__/* .data */ .p.BitArray;
5741
5439
 
5742
5440
  // TODO: Is there a better name for this? RGBAInt?
5743
5441
  // Should we move it to Colors.js
@@ -5941,7 +5639,7 @@ var adaptersRT = {
5941
5639
 
5942
5640
  /***/ }),
5943
5641
 
5944
- /***/ 27318:
5642
+ /***/ 92145:
5945
5643
  /***/ ((module) => {
5946
5644
 
5947
5645
  "use strict";
@@ -5959,7 +5657,7 @@ module.exports = iota
5959
5657
 
5960
5658
  /***/ }),
5961
5659
 
5962
- /***/ 8516:
5660
+ /***/ 29924:
5963
5661
  /***/ ((module) => {
5964
5662
 
5965
5663
  /*!
@@ -5977,11 +5675,11 @@ module.exports = function isBuffer (obj) {
5977
5675
 
5978
5676
  /***/ }),
5979
5677
 
5980
- /***/ 87513:
5678
+ /***/ 29133:
5981
5679
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5982
5680
 
5983
- var iota = __webpack_require__(27318)
5984
- var isBuffer = __webpack_require__(8516)
5681
+ var iota = __webpack_require__(92145)
5682
+ var isBuffer = __webpack_require__(29924)
5985
5683
 
5986
5684
  var hasTypedArrays = ((typeof Float64Array) !== "undefined")
5987
5685