@ohif/app 3.13.0-beta.74 → 3.13.0-beta.75

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 (40) hide show
  1. package/dist/{2075.bundle.23265b8e7597c398db4f.js → 2075.bundle.ba9ac60662f1fa739378.js} +10 -5
  2. package/dist/{2851.bundle.0f1057b18a3b58ff7f95.js → 2851.bundle.e3b829ca4c54f03f1108.js} +2 -2
  3. package/dist/{4287.bundle.b7840e7b94cbbc102236.js → 4287.bundle.4f28e48c1e39a46dfc87.js} +4 -1
  4. package/dist/{4579.bundle.0a6b2f49a7e136a79e37.js → 4579.bundle.1c315389368cc476aed3.js} +910 -1262
  5. package/dist/{6386.bundle.5d82d1f41d1c37a0358d.js → 6386.bundle.dc7e3b159d6b4733647f.js} +21 -4
  6. package/dist/{7537.bundle.889ba5f2707418c6fd88.js → 7537.bundle.88314e5a6269f96a0bae.js} +11 -13
  7. package/dist/{9039.bundle.f72736f47fedeff521e2.js → 9039.bundle.f5db80328c99cd11293b.js} +38 -24
  8. package/dist/{9205.bundle.ed7bce8436a7a431955e.js → 9205.bundle.f2121894550d46d17398.js} +29 -20
  9. package/dist/{app.bundle.577e4476293935af2cc0.js → app.bundle.b5d3bfc6bf7b26dd9c8f.js} +27 -23
  10. package/dist/{compute.bundle.b7c2ea55f1a69f4a736b.js → compute.bundle.5e9691bc58308d865058.js} +1 -1
  11. package/dist/index.html +1 -1
  12. package/dist/{polySeg.bundle.e1f6f05d81ea1352bef3.js → polySeg.bundle.c394421c24d8c27d54ca.js} +1 -1
  13. package/dist/sw.js +1 -1
  14. package/package.json +21 -21
  15. /package/dist/{1459.bundle.6b50602d8c6953a77a28.js → 1459.bundle.307b1d992b10a412ccaf.js} +0 -0
  16. /package/dist/{1933.bundle.fec17714a2e2cdd72747.js → 1933.bundle.7958eca620bd3092d3b6.js} +0 -0
  17. /package/dist/{2018.bundle.c1dcb8f51302db969ca5.js → 2018.bundle.ab1933fd53b1e7b6dfcd.js} +0 -0
  18. /package/dist/{213.bundle.11d39c0cd6d33a67b8c7.js → 213.bundle.2b6cefeb87db0378706e.js} +0 -0
  19. /package/dist/{2424.bundle.c7ae51b65497c5792106.js → 2424.bundle.458254eefb5424770857.js} +0 -0
  20. /package/dist/{3138.bundle.19b47310d6d29d39ed17.js → 3138.bundle.34c26967c4194ff641b7.js} +0 -0
  21. /package/dist/{3461.bundle.b69dece36103bdf70e67.js → 3461.bundle.73daa7b70ec099846302.js} +0 -0
  22. /package/dist/{3754.bundle.fd4b67c2a29c4bc4a840.js → 3754.bundle.d2435bb372912595708c.js} +0 -0
  23. /package/dist/{4507.bundle.3e858e473b2efca86ae4.js → 4507.bundle.26958dc36e5d19f54908.js} +0 -0
  24. /package/dist/{4819.bundle.bf9352d276de4386bfba.js → 4819.bundle.46c39f9d976924f808b4.js} +0 -0
  25. /package/dist/{5015.bundle.a8978eb57bbd00a4ada7.js → 5015.bundle.ff4f5033218290f06c83.js} +0 -0
  26. /package/dist/{5028.bundle.526e217fcb875ceec28a.js → 5028.bundle.614a39b9b5b6fda9809f.js} +0 -0
  27. /package/dist/{5457.bundle.a2bea9789e0a545d1c59.js → 5457.bundle.33a9a2ccbc4cf8b52fdb.js} +0 -0
  28. /package/dist/{5485.bundle.72d5cbd960a6df6e2598.js → 5485.bundle.c8add9363816b19b569b.js} +0 -0
  29. /package/dist/{5802.bundle.26f84db0ff8851532c36.js → 5802.bundle.cd36386cbe1613913ed4.js} +0 -0
  30. /package/dist/{6027.bundle.a4dab1075c901128740a.js → 6027.bundle.5a63cda4a330534b47e7.js} +0 -0
  31. /package/dist/{7166.bundle.ae95b245b43077a934d9.js → 7166.bundle.769f582d28bc0ded97c0.js} +0 -0
  32. /package/dist/{7431.bundle.5e14641f2c71e852abe7.js → 7431.bundle.a9b4dbf97a8c196efe51.js} +0 -0
  33. /package/dist/{7639.bundle.e4683ed12f33f03f926e.js → 7639.bundle.0661f010d95ecc5754a9.js} +0 -0
  34. /package/dist/{8305.bundle.45bbc5d4d168a95a318d.js → 8305.bundle.5f9d97c20ec058506cd4.js} +0 -0
  35. /package/dist/{8499.bundle.a3227ecec452013f5985.js → 8499.bundle.766e8a98ec82e06e83bf.js} +0 -0
  36. /package/dist/{85.bundle.7d0416939f5505006533.js → 85.bundle.ca66aa5f6357064e3a2c.js} +0 -0
  37. /package/dist/{8558.bundle.e7266297e1791d0d221e.js → 8558.bundle.fa25b02ff0d177dced95.js} +0 -0
  38. /package/dist/{8583.bundle.16fbd2fdf5ea18a1a0e8.js → 8583.bundle.dc2a92d16cca059212f6.js} +0 -0
  39. /package/dist/{9862.bundle.a5f7925840868fa4ecdb.js → 9862.bundle.6d793a997f85d73002e9.js} +0 -0
  40. /package/dist/{9927.bundle.d600536c28059370794c.js → 9927.bundle.152d699dc13ef046f16c.js} +0 -0
@@ -78,31 +78,104 @@ const codeMeaningEquals = codeMeaningName => {
78
78
 
79
79
 
80
80
 
81
+ ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/helpers/downloadDICOMData.js
82
+
83
+
84
+ const datasetToBlob = dcmjs_es/* data */.p.datasetToBlob;
85
+ function downloadDICOMData(bufferOrDataset, filename) {
86
+ let blob;
87
+ if (bufferOrDataset instanceof ArrayBuffer) {
88
+ blob = new Blob([bufferOrDataset], {
89
+ type: 'application/dicom'
90
+ });
91
+ } else {
92
+ if (!bufferOrDataset._meta) {
93
+ throw new Error('Dataset must have a _meta property');
94
+ }
95
+ blob = datasetToBlob(bufferOrDataset);
96
+ }
97
+ const link = document.createElement('a');
98
+ link.href = window.URL.createObjectURL(blob);
99
+ link.download = filename;
100
+ link.click();
101
+ }
102
+
103
+
104
+
81
105
  // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 1 modules
82
106
  var esm = __webpack_require__(15327);
107
+ ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/helpers/toScoordType.js
108
+
109
+
110
+ const globalWorldToImageCoords = esm.utilities.worldToImageCoords;
111
+ let useWorldToImageCoords = globalWorldToImageCoords;
112
+ function toScoord(_ref, point) {
113
+ let is3DMeasurement = _ref.is3DMeasurement,
114
+ referencedImageId = _ref.referencedImageId;
115
+ if (is3DMeasurement) {
116
+ return {
117
+ x: point[0],
118
+ y: point[1],
119
+ z: point[2]
120
+ };
121
+ }
122
+ const point2 = useWorldToImageCoords(referencedImageId, point);
123
+ return {
124
+ x: point2[0],
125
+ y: point2[1]
126
+ };
127
+ }
128
+ function toScoords(scoordArgs, points) {
129
+ return points.map(point => toScoord(scoordArgs, point));
130
+ }
131
+ function setWorldToImageCoords() {
132
+ let worldToImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : globalWorldToImageCoords;
133
+ useWorldToImageCoords = worldToImage;
134
+ }
135
+
136
+
137
+
138
+ ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/helpers/scoordToWorld.js
139
+
140
+
141
+ const imageToWorldCoords = esm.utilities.imageToWorldCoords;
142
+ function scoordToWorld(_ref, scoord) {
143
+ let is3DMeasurement = _ref.is3DMeasurement,
144
+ referencedImageId = _ref.referencedImageId;
145
+ const worldCoords = [];
146
+ if (is3DMeasurement) {
147
+ const GraphicData = scoord.GraphicData;
148
+ for (let i = 0; i < GraphicData.length; i += 3) {
149
+ const point = [GraphicData[i], GraphicData[i + 1], GraphicData[i + 2]];
150
+ worldCoords.push(point);
151
+ }
152
+ } else {
153
+ const GraphicData = scoord.GraphicData;
154
+ for (let i = 0; i < GraphicData.length; i += 2) {
155
+ const point = imageToWorldCoords(referencedImageId, [GraphicData[i], GraphicData[i + 1]]);
156
+ worldCoords.push(point);
157
+ }
158
+ }
159
+ return worldCoords;
160
+ }
161
+
162
+
163
+
83
164
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone/MeasurementReport.js
84
165
 
85
166
 
86
167
 
87
168
 
88
169
 
89
- const {
90
- TID1500,
91
- addAccessors
92
- } = dcmjs_es/* utilities */.BF;
93
- const {
94
- StructuredReport
95
- } = dcmjs_es/* derivations */.h4;
96
- const {
97
- Normalizer
98
- } = dcmjs_es/* normalizers */.z8;
99
- const {
100
- TID1500MeasurementReport,
101
- TID1501MeasurementGroup
102
- } = TID1500;
103
- const {
104
- DicomMetaDictionary
105
- } = dcmjs_es/* data */.p;
170
+
171
+
172
+ const TID1500 = dcmjs_es/* utilities */.BF.TID1500,
173
+ addAccessors = dcmjs_es/* utilities */.BF.addAccessors;
174
+ const StructuredReport = dcmjs_es/* derivations */.h4.StructuredReport;
175
+ const Normalizer = dcmjs_es/* normalizers */.z8.Normalizer;
176
+ const TID1500MeasurementReport = TID1500.TID1500MeasurementReport,
177
+ TID1501MeasurementGroup = TID1500.TID1501MeasurementGroup;
178
+ const DicomMetaDictionary = dcmjs_es/* data */.p.DicomMetaDictionary;
106
179
  const FINDING = {
107
180
  CodingSchemeDesignator: 'DCM',
108
181
  CodeValue: '121071'
@@ -116,16 +189,12 @@ const FINDING_SITE_OLD = {
116
189
  CodeValue: 'G-C0E3'
117
190
  };
118
191
  const codeValueMatch = (group, code, oldCode) => {
119
- const {
120
- ConceptNameCodeSequence
121
- } = group;
192
+ const ConceptNameCodeSequence = group.ConceptNameCodeSequence;
122
193
  if (!ConceptNameCodeSequence) {
123
194
  return;
124
195
  }
125
- const {
126
- CodingSchemeDesignator,
127
- CodeValue
128
- } = ConceptNameCodeSequence;
196
+ const CodingSchemeDesignator = ConceptNameCodeSequence.CodingSchemeDesignator,
197
+ CodeValue = ConceptNameCodeSequence.CodeValue;
129
198
  return CodingSchemeDesignator == code.CodingSchemeDesignator && CodeValue == code.CodeValue || oldCode && CodingSchemeDesignator == oldCode.CodingSchemeDesignator && CodeValue == oldCode.CodeValue;
130
199
  };
131
200
  function getTID300ContentItem(tool, ReferencedSOPSequence, adapterClass) {
@@ -151,21 +220,15 @@ function getMeasurementGroup(toolType, toolData, ReferencedSOPSequence) {
151
220
  }
152
221
  class MeasurementReport {
153
222
  static getSetupMeasurementData(MeasurementGroup) {
154
- const {
155
- ContentSequence
156
- } = MeasurementGroup;
223
+ const ContentSequence = MeasurementGroup.ContentSequence;
157
224
  const contentSequenceArr = toArray(ContentSequence);
158
225
  const findingGroup = contentSequenceArr.find(group => codeValueMatch(group, FINDING));
159
226
  const findingSiteGroups = contentSequenceArr.filter(group => codeValueMatch(group, FINDING_SITE, FINDING_SITE_OLD)) || [];
160
227
  const NUMGroup = contentSequenceArr.find(group => group.ValueType === 'NUM');
161
228
  const SCOORDGroup = toArray(NUMGroup.ContentSequence).find(group => group.ValueType === 'SCOORD');
162
- const {
163
- ReferencedSOPSequence
164
- } = SCOORDGroup.ContentSequence;
165
- const {
166
- ReferencedSOPInstanceUID,
167
- ReferencedFrameNumber
168
- } = ReferencedSOPSequence;
229
+ const ReferencedSOPSequence = SCOORDGroup.ContentSequence.ReferencedSOPSequence;
230
+ const ReferencedSOPInstanceUID = ReferencedSOPSequence.ReferencedSOPInstanceUID,
231
+ ReferencedFrameNumber = ReferencedSOPSequence.ReferencedFrameNumber;
169
232
  const defaultState = {
170
233
  sopInstanceUid: ReferencedSOPInstanceUID,
171
234
  frameIndex: ReferencedFrameNumber || 1,
@@ -216,10 +279,8 @@ class MeasurementReport {
216
279
  // NOTE: We are getting the Series and Study UIDs from the first imageId of the toolState
217
280
  // which means that if the toolState is for multiple series, the report will have the incorrect
218
281
  // SeriesInstanceUIDs
219
- const {
220
- studyInstanceUID,
221
- seriesInstanceUID
222
- } = generalSeriesModule;
282
+ const studyInstanceUID = generalSeriesModule.studyInstanceUID,
283
+ seriesInstanceUID = generalSeriesModule.seriesInstanceUID;
223
284
 
224
285
  // Loop through each image in the toolData
225
286
  Object.keys(toolState).forEach(imageId => {
@@ -356,6 +417,8 @@ MeasurementReport.CORNERSTONE_TOOL_CLASSES_BY_TOOL_TYPE = {};
356
417
 
357
418
 
358
419
 
420
+ // EXTERNAL MODULE: ../../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
421
+ var slicedToArray = __webpack_require__(12492);
359
422
  // EXTERNAL MODULE: ../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
360
423
  var defineProperty = __webpack_require__(36111);
361
424
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone/cornerstone4Tag.js
@@ -369,20 +432,18 @@ var CORNERSTONE_4_TAG = 'cornerstoneTools@^4.0.0';
369
432
 
370
433
 
371
434
 
435
+
372
436
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
373
437
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
374
- const {
375
- Length: TID300Length
376
- } = dcmjs_es/* utilities */.BF.TID300;
438
+ const TID300Length = dcmjs_es/* utilities */.BF.TID300.Length;
377
439
  const LENGTH = 'Length';
378
440
  class Length {
379
441
  // TODO: this function is required for all Cornerstone Tool Adapters, since it is called by MeasurementReport.
380
442
  static getMeasurementData(MeasurementGroup) {
381
- const {
382
- defaultState,
383
- NUMGroup,
384
- SCOORDGroup
385
- } = MeasurementReport.getSetupMeasurementData(MeasurementGroup);
443
+ const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup),
444
+ defaultState = _MeasurementReport$ge.defaultState,
445
+ NUMGroup = _MeasurementReport$ge.NUMGroup,
446
+ SCOORDGroup = _MeasurementReport$ge.SCOORDGroup;
386
447
  const state = _objectSpread(_objectSpread({}, defaultState), {}, {
387
448
  length: NUMGroup.MeasuredValueSequence.NumericValue,
388
449
  toolType: Length.toolType,
@@ -398,15 +459,17 @@ class Length {
398
459
  }
399
460
  }
400
461
  });
401
- [state.handles.start.x, state.handles.start.y, state.handles.end.x, state.handles.end.y] = SCOORDGroup.GraphicData;
462
+ var _SCOORDGroup$GraphicD = (0,slicedToArray/* default */.A)(SCOORDGroup.GraphicData, 4);
463
+ state.handles.start.x = _SCOORDGroup$GraphicD[0];
464
+ state.handles.start.y = _SCOORDGroup$GraphicD[1];
465
+ state.handles.end.x = _SCOORDGroup$GraphicD[2];
466
+ state.handles.end.y = _SCOORDGroup$GraphicD[3];
402
467
  return state;
403
468
  }
404
469
  static getTID300RepresentationArguments(tool) {
405
- const {
406
- handles,
407
- finding,
408
- findingSites
409
- } = tool;
470
+ const handles = tool.handles,
471
+ finding = tool.finding,
472
+ findingSites = tool.findingSites;
410
473
  const point1 = handles.start;
411
474
  const point2 = handles.end;
412
475
  const distance = tool.length;
@@ -428,7 +491,10 @@ Length.isValidCornerstoneTrackingIdentifier = TrackingIdentifier => {
428
491
  if (!TrackingIdentifier.includes(':')) {
429
492
  return false;
430
493
  }
431
- const [cornerstone4Tag, toolType] = TrackingIdentifier.split(':');
494
+ const _TrackingIdentifier$s = TrackingIdentifier.split(':'),
495
+ _TrackingIdentifier$s2 = (0,slicedToArray/* default */.A)(_TrackingIdentifier$s, 2),
496
+ cornerstone4Tag = _TrackingIdentifier$s2[0],
497
+ toolType = _TrackingIdentifier$s2[1];
432
498
  if (cornerstone4Tag !== CORNERSTONE_4_TAG) {
433
499
  return false;
434
500
  }
@@ -444,18 +510,16 @@ MeasurementReport.registerTool(Length);
444
510
 
445
511
 
446
512
 
513
+
447
514
  function FreehandRoi_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
448
515
  function FreehandRoi_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? FreehandRoi_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : FreehandRoi_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
449
- const {
450
- Polyline: TID300Polyline
451
- } = dcmjs_es/* utilities */.BF.TID300;
516
+ const TID300Polyline = dcmjs_es/* utilities */.BF.TID300.Polyline;
452
517
  class FreehandRoi {
453
518
  static getMeasurementData(MeasurementGroup) {
454
- const {
455
- defaultState,
456
- SCOORDGroup,
457
- NUMGroup
458
- } = MeasurementReport.getSetupMeasurementData(MeasurementGroup);
519
+ const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup),
520
+ defaultState = _MeasurementReport$ge.defaultState,
521
+ SCOORDGroup = _MeasurementReport$ge.SCOORDGroup,
522
+ NUMGroup = _MeasurementReport$ge.NUMGroup;
459
523
  const state = FreehandRoi_objectSpread(FreehandRoi_objectSpread({}, defaultState), {}, {
460
524
  toolType: FreehandRoi.toolType,
461
525
  handles: {
@@ -475,9 +539,7 @@ class FreehandRoi {
475
539
  color: undefined,
476
540
  invalidated: true
477
541
  });
478
- const {
479
- GraphicData
480
- } = SCOORDGroup;
542
+ const GraphicData = SCOORDGroup.GraphicData;
481
543
  for (let i = 0; i < GraphicData.length; i += 2) {
482
544
  state.handles.points.push({
483
545
  x: GraphicData[i],
@@ -487,19 +549,16 @@ class FreehandRoi {
487
549
  return state;
488
550
  }
489
551
  static getTID300RepresentationArguments(tool) {
490
- const {
491
- handles,
492
- finding,
493
- findingSites,
494
- cachedStats = {}
495
- } = tool;
496
- const {
497
- points
498
- } = handles;
499
- const {
500
- area = 0,
501
- perimeter = 0
502
- } = cachedStats;
552
+ const handles = tool.handles,
553
+ finding = tool.finding,
554
+ findingSites = tool.findingSites,
555
+ _tool$cachedStats = tool.cachedStats,
556
+ cachedStats = _tool$cachedStats === void 0 ? {} : _tool$cachedStats;
557
+ const points = handles.points;
558
+ const _cachedStats$area = cachedStats.area,
559
+ area = _cachedStats$area === void 0 ? 0 : _cachedStats$area,
560
+ _cachedStats$perimete = cachedStats.perimeter,
561
+ perimeter = _cachedStats$perimete === void 0 ? 0 : _cachedStats$perimete;
503
562
  const trackingIdentifierTextValue = 'cornerstoneTools@^4.0.0:FreehandRoi';
504
563
  return {
505
564
  points,
@@ -518,7 +577,10 @@ FreehandRoi.isValidCornerstoneTrackingIdentifier = TrackingIdentifier => {
518
577
  if (!TrackingIdentifier.includes(':')) {
519
578
  return false;
520
579
  }
521
- const [cornerstone4Tag, toolType] = TrackingIdentifier.split(':');
580
+ const _TrackingIdentifier$s = TrackingIdentifier.split(':'),
581
+ _TrackingIdentifier$s2 = (0,slicedToArray/* default */.A)(_TrackingIdentifier$s, 2),
582
+ cornerstone4Tag = _TrackingIdentifier$s2[0],
583
+ toolType = _TrackingIdentifier$s2[1];
522
584
  if (cornerstone4Tag !== CORNERSTONE_4_TAG) {
523
585
  return false;
524
586
  }
@@ -535,9 +597,10 @@ MeasurementReport.registerTool(FreehandRoi);
535
597
 
536
598
 
537
599
 
538
- const {
539
- Bidirectional: TID300Bidirectional
540
- } = dcmjs_es/* utilities */.BF.TID300;
600
+
601
+
602
+
603
+ const TID300Bidirectional = dcmjs_es/* utilities */.BF.TID300.Bidirectional;
541
604
  const BIDIRECTIONAL = 'Bidirectional';
542
605
  const LONG_AXIS = 'Long Axis';
543
606
  const SHORT_AXIS = 'Short Axis';
@@ -546,22 +609,16 @@ const Bidirectional_FINDING_SITE = 'G-C0E3';
546
609
  class Bidirectional {
547
610
  // TODO: this function is required for all Cornerstone Tool Adapters, since it is called by MeasurementReport.
548
611
  static getMeasurementData(MeasurementGroup) {
549
- const {
550
- ContentSequence
551
- } = MeasurementGroup;
612
+ const ContentSequence = MeasurementGroup.ContentSequence;
552
613
  const findingGroup = toArray(ContentSequence).find(group => group.ConceptNameCodeSequence.CodeValue === Bidirectional_FINDING);
553
614
  const findingSiteGroups = toArray(ContentSequence).filter(group => group.ConceptNameCodeSequence.CodeValue === Bidirectional_FINDING_SITE);
554
615
  const longAxisNUMGroup = toArray(ContentSequence).find(group => group.ConceptNameCodeSequence.CodeMeaning === LONG_AXIS);
555
616
  const longAxisSCOORDGroup = toArray(longAxisNUMGroup.ContentSequence).find(group => group.ValueType === 'SCOORD');
556
617
  const shortAxisNUMGroup = toArray(ContentSequence).find(group => group.ConceptNameCodeSequence.CodeMeaning === SHORT_AXIS);
557
618
  const shortAxisSCOORDGroup = toArray(shortAxisNUMGroup.ContentSequence).find(group => group.ValueType === 'SCOORD');
558
- const {
559
- ReferencedSOPSequence
560
- } = longAxisSCOORDGroup.ContentSequence;
561
- const {
562
- ReferencedSOPInstanceUID,
563
- ReferencedFrameNumber
564
- } = ReferencedSOPSequence;
619
+ const ReferencedSOPSequence = longAxisSCOORDGroup.ContentSequence.ReferencedSOPSequence;
620
+ const ReferencedSOPInstanceUID = ReferencedSOPSequence.ReferencedSOPInstanceUID,
621
+ ReferencedFrameNumber = ReferencedSOPSequence.ReferencedFrameNumber;
565
622
 
566
623
  // Long axis
567
624
 
@@ -637,18 +694,15 @@ class Bidirectional {
637
694
  return state;
638
695
  }
639
696
  static getTID300RepresentationArguments(tool) {
640
- const {
641
- start,
642
- end,
643
- perpendicularStart,
644
- perpendicularEnd
645
- } = tool.handles;
646
- const {
647
- shortestDiameter,
648
- longestDiameter,
649
- finding,
650
- findingSites
651
- } = tool;
697
+ const _tool$handles = tool.handles,
698
+ start = _tool$handles.start,
699
+ end = _tool$handles.end,
700
+ perpendicularStart = _tool$handles.perpendicularStart,
701
+ perpendicularEnd = _tool$handles.perpendicularEnd;
702
+ const shortestDiameter = tool.shortestDiameter,
703
+ longestDiameter = tool.longestDiameter,
704
+ finding = tool.finding,
705
+ findingSites = tool.findingSites;
652
706
  const trackingIdentifierTextValue = 'cornerstoneTools@^4.0.0:Bidirectional';
653
707
  return {
654
708
  longAxis: {
@@ -674,7 +728,10 @@ Bidirectional.isValidCornerstoneTrackingIdentifier = TrackingIdentifier => {
674
728
  if (!TrackingIdentifier.includes(':')) {
675
729
  return false;
676
730
  }
677
- const [cornerstone4Tag, toolType] = TrackingIdentifier.split(':');
731
+ const _TrackingIdentifier$s = TrackingIdentifier.split(':'),
732
+ _TrackingIdentifier$s2 = (0,slicedToArray/* default */.A)(_TrackingIdentifier$s, 2),
733
+ cornerstone4Tag = _TrackingIdentifier$s2[0],
734
+ toolType = _TrackingIdentifier$s2[1];
678
735
  if (cornerstone4Tag !== CORNERSTONE_4_TAG) {
679
736
  return false;
680
737
  }
@@ -690,23 +747,19 @@ MeasurementReport.registerTool(Bidirectional);
690
747
 
691
748
 
692
749
 
750
+
693
751
  function EllipticalRoi_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
694
752
  function EllipticalRoi_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? EllipticalRoi_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : EllipticalRoi_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
695
- const {
696
- Ellipse: TID300Ellipse
697
- } = dcmjs_es/* utilities */.BF.TID300;
753
+ const TID300Ellipse = dcmjs_es/* utilities */.BF.TID300.Ellipse;
698
754
  const ELLIPTICALROI = 'EllipticalRoi';
699
755
  class EllipticalRoi {
700
756
  // TODO: this function is required for all Cornerstone Tool Adapters, since it is called by MeasurementReport.
701
757
  static getMeasurementData(MeasurementGroup) {
702
- const {
703
- defaultState,
704
- NUMGroup,
705
- SCOORDGroup
706
- } = MeasurementReport.getSetupMeasurementData(MeasurementGroup);
707
- const {
708
- GraphicData
709
- } = SCOORDGroup;
758
+ const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup),
759
+ defaultState = _MeasurementReport$ge.defaultState,
760
+ NUMGroup = _MeasurementReport$ge.NUMGroup,
761
+ SCOORDGroup = _MeasurementReport$ge.SCOORDGroup;
762
+ const GraphicData = SCOORDGroup.GraphicData;
710
763
  const majorAxis = [{
711
764
  x: GraphicData[0],
712
765
  y: GraphicData[1]
@@ -776,19 +829,14 @@ class EllipticalRoi {
776
829
  return state;
777
830
  }
778
831
  static getTID300RepresentationArguments(tool) {
779
- const {
780
- cachedStats = {},
781
- handles,
782
- finding,
783
- findingSites
784
- } = tool;
785
- const {
786
- start,
787
- end
788
- } = handles;
789
- const {
790
- area
791
- } = cachedStats;
832
+ const _tool$cachedStats = tool.cachedStats,
833
+ cachedStats = _tool$cachedStats === void 0 ? {} : _tool$cachedStats,
834
+ handles = tool.handles,
835
+ finding = tool.finding,
836
+ findingSites = tool.findingSites;
837
+ const start = handles.start,
838
+ end = handles.end;
839
+ const area = cachedStats.area;
792
840
  const halfXLength = Math.abs(start.x - end.x) / 2;
793
841
  const halfYLength = Math.abs(start.y - end.y) / 2;
794
842
  const points = [];
@@ -854,7 +902,10 @@ EllipticalRoi.isValidCornerstoneTrackingIdentifier = TrackingIdentifier => {
854
902
  if (!TrackingIdentifier.includes(':')) {
855
903
  return false;
856
904
  }
857
- const [cornerstone4Tag, toolType] = TrackingIdentifier.split(':');
905
+ const _TrackingIdentifier$s = TrackingIdentifier.split(':'),
906
+ _TrackingIdentifier$s2 = (0,slicedToArray/* default */.A)(_TrackingIdentifier$s, 2),
907
+ cornerstone4Tag = _TrackingIdentifier$s2[0],
908
+ toolType = _TrackingIdentifier$s2[1];
858
909
  if (cornerstone4Tag !== CORNERSTONE_4_TAG) {
859
910
  return false;
860
911
  }
@@ -870,23 +921,19 @@ MeasurementReport.registerTool(EllipticalRoi);
870
921
 
871
922
 
872
923
 
924
+
873
925
  function CircleRoi_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
874
926
  function CircleRoi_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? CircleRoi_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : CircleRoi_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
875
- const {
876
- Circle: TID300Circle
877
- } = dcmjs_es/* utilities */.BF.TID300;
927
+ const TID300Circle = dcmjs_es/* utilities */.BF.TID300.Circle;
878
928
  const CIRCLEROI = 'CircleRoi';
879
929
  class CircleRoi {
880
930
  /** Gets the measurement data for cornerstone, given DICOM SR measurement data. */
881
931
  static getMeasurementData(MeasurementGroup) {
882
- const {
883
- defaultState,
884
- NUMGroup,
885
- SCOORDGroup
886
- } = MeasurementReport.getSetupMeasurementData(MeasurementGroup);
887
- const {
888
- GraphicData
889
- } = SCOORDGroup;
932
+ const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup),
933
+ defaultState = _MeasurementReport$ge.defaultState,
934
+ NUMGroup = _MeasurementReport$ge.NUMGroup,
935
+ SCOORDGroup = _MeasurementReport$ge.SCOORDGroup;
936
+ const GraphicData = SCOORDGroup.GraphicData;
890
937
  const center = {
891
938
  x: GraphicData[0],
892
939
  y: GraphicData[1]
@@ -935,20 +982,15 @@ class CircleRoi {
935
982
  * @returns
936
983
  */
937
984
  static getTID300RepresentationArguments(tool) {
938
- const {
939
- cachedStats = {},
940
- handles,
941
- finding,
942
- findingSites
943
- } = tool;
944
- const {
945
- start: center,
946
- end
947
- } = handles;
948
- const {
949
- area,
950
- radius
951
- } = cachedStats;
985
+ const _tool$cachedStats = tool.cachedStats,
986
+ cachedStats = _tool$cachedStats === void 0 ? {} : _tool$cachedStats,
987
+ handles = tool.handles,
988
+ finding = tool.finding,
989
+ findingSites = tool.findingSites;
990
+ const center = handles.start,
991
+ end = handles.end;
992
+ const area = cachedStats.area,
993
+ radius = cachedStats.radius;
952
994
  const perimeter = 2 * Math.PI * radius;
953
995
  const points = [];
954
996
  points.push(center);
@@ -972,7 +1014,10 @@ CircleRoi.isValidCornerstoneTrackingIdentifier = TrackingIdentifier => {
972
1014
  if (!TrackingIdentifier.includes(':')) {
973
1015
  return false;
974
1016
  }
975
- const [cornerstone4Tag, toolType] = TrackingIdentifier.split(':');
1017
+ const _TrackingIdentifier$s = TrackingIdentifier.split(':'),
1018
+ _TrackingIdentifier$s2 = (0,slicedToArray/* default */.A)(_TrackingIdentifier$s, 2),
1019
+ cornerstone4Tag = _TrackingIdentifier$s2[0],
1020
+ toolType = _TrackingIdentifier$s2[1];
976
1021
  if (cornerstone4Tag !== CORNERSTONE_4_TAG) {
977
1022
  return false;
978
1023
  }
@@ -988,23 +1033,19 @@ MeasurementReport.registerTool(CircleRoi);
988
1033
 
989
1034
 
990
1035
 
1036
+
991
1037
  function ArrowAnnotate_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
992
1038
  function ArrowAnnotate_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ArrowAnnotate_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ArrowAnnotate_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
993
- const {
994
- Point: TID300Point
995
- } = dcmjs_es/* utilities */.BF.TID300;
1039
+ const TID300Point = dcmjs_es/* utilities */.BF.TID300.Point;
996
1040
  const ARROW_ANNOTATE = 'ArrowAnnotate';
997
1041
  const CORNERSTONEFREETEXT = 'CORNERSTONEFREETEXT';
998
1042
  class ArrowAnnotate {
999
1043
  static getMeasurementData(MeasurementGroup) {
1000
- const {
1001
- defaultState,
1002
- SCOORDGroup,
1003
- findingGroup
1004
- } = MeasurementReport.getSetupMeasurementData(MeasurementGroup);
1005
- const {
1006
- GraphicData
1007
- } = SCOORDGroup;
1044
+ const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup),
1045
+ defaultState = _MeasurementReport$ge.defaultState,
1046
+ SCOORDGroup = _MeasurementReport$ge.SCOORDGroup;
1047
+ _MeasurementReport$ge.findingGroup;
1048
+ const GraphicData = SCOORDGroup.GraphicData;
1008
1049
  const state = ArrowAnnotate_objectSpread(ArrowAnnotate_objectSpread({}, defaultState), {}, {
1009
1050
  toolType: ArrowAnnotate.toolType,
1010
1051
  active: false,
@@ -1038,12 +1079,8 @@ class ArrowAnnotate {
1038
1079
  }
1039
1080
  static getTID300RepresentationArguments(tool) {
1040
1081
  const points = [tool.handles.start, tool.handles.end];
1041
- const {
1042
- findingSites
1043
- } = tool;
1044
- let {
1045
- finding
1046
- } = tool;
1082
+ const findingSites = tool.findingSites;
1083
+ let finding = tool.finding;
1047
1084
  const TID300RepresentationArguments = {
1048
1085
  points,
1049
1086
  trackingIdentifierTextValue: "cornerstoneTools@^4.0.0:ArrowAnnotate",
@@ -1069,7 +1106,10 @@ ArrowAnnotate.isValidCornerstoneTrackingIdentifier = TrackingIdentifier => {
1069
1106
  if (!TrackingIdentifier.includes(':')) {
1070
1107
  return false;
1071
1108
  }
1072
- const [cornerstone4Tag, toolType] = TrackingIdentifier.split(':');
1109
+ const _TrackingIdentifier$s = TrackingIdentifier.split(':'),
1110
+ _TrackingIdentifier$s2 = (0,slicedToArray/* default */.A)(_TrackingIdentifier$s, 2),
1111
+ cornerstone4Tag = _TrackingIdentifier$s2[0],
1112
+ toolType = _TrackingIdentifier$s2[1];
1073
1113
  if (cornerstone4Tag !== CORNERSTONE_4_TAG) {
1074
1114
  return false;
1075
1115
  }
@@ -1085,20 +1125,18 @@ MeasurementReport.registerTool(ArrowAnnotate);
1085
1125
 
1086
1126
 
1087
1127
 
1128
+
1088
1129
  function CobbAngle_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1089
1130
  function CobbAngle_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? CobbAngle_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : CobbAngle_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1090
- const {
1091
- CobbAngle: TID300CobbAngle
1092
- } = dcmjs_es/* utilities */.BF.TID300;
1131
+ const TID300CobbAngle = dcmjs_es/* utilities */.BF.TID300.CobbAngle;
1093
1132
  const COBB_ANGLE = 'CobbAngle';
1094
1133
  class CobbAngle {
1095
1134
  // TODO: this function is required for all Cornerstone Tool Adapters, since it is called by MeasurementReport.
1096
1135
  static getMeasurementData(MeasurementGroup) {
1097
- const {
1098
- defaultState,
1099
- NUMGroup,
1100
- SCOORDGroup
1101
- } = MeasurementReport.getSetupMeasurementData(MeasurementGroup);
1136
+ const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup),
1137
+ defaultState = _MeasurementReport$ge.defaultState,
1138
+ NUMGroup = _MeasurementReport$ge.NUMGroup,
1139
+ SCOORDGroup = _MeasurementReport$ge.SCOORDGroup;
1102
1140
  const state = CobbAngle_objectSpread(CobbAngle_objectSpread({}, defaultState), {}, {
1103
1141
  rAngle: NUMGroup.MeasuredValueSequence.NumericValue,
1104
1142
  toolType: CobbAngle.toolType,
@@ -1122,15 +1160,21 @@ class CobbAngle {
1122
1160
  }
1123
1161
  }
1124
1162
  });
1125
- [state.handles.start.x, state.handles.start.y, state.handles.end.x, state.handles.end.y, state.handles.start2.x, state.handles.start2.y, state.handles.end2.x, state.handles.end2.y] = SCOORDGroup.GraphicData;
1163
+ var _SCOORDGroup$GraphicD = (0,slicedToArray/* default */.A)(SCOORDGroup.GraphicData, 8);
1164
+ state.handles.start.x = _SCOORDGroup$GraphicD[0];
1165
+ state.handles.start.y = _SCOORDGroup$GraphicD[1];
1166
+ state.handles.end.x = _SCOORDGroup$GraphicD[2];
1167
+ state.handles.end.y = _SCOORDGroup$GraphicD[3];
1168
+ state.handles.start2.x = _SCOORDGroup$GraphicD[4];
1169
+ state.handles.start2.y = _SCOORDGroup$GraphicD[5];
1170
+ state.handles.end2.x = _SCOORDGroup$GraphicD[6];
1171
+ state.handles.end2.y = _SCOORDGroup$GraphicD[7];
1126
1172
  return state;
1127
1173
  }
1128
1174
  static getTID300RepresentationArguments(tool) {
1129
- const {
1130
- handles,
1131
- finding,
1132
- findingSites
1133
- } = tool;
1175
+ const handles = tool.handles,
1176
+ finding = tool.finding,
1177
+ findingSites = tool.findingSites;
1134
1178
  const point1 = handles.start;
1135
1179
  const point2 = handles.end;
1136
1180
  const point3 = handles.start2;
@@ -1156,7 +1200,10 @@ CobbAngle.isValidCornerstoneTrackingIdentifier = TrackingIdentifier => {
1156
1200
  if (!TrackingIdentifier.includes(':')) {
1157
1201
  return false;
1158
1202
  }
1159
- const [cornerstone4Tag, toolType] = TrackingIdentifier.split(':');
1203
+ const _TrackingIdentifier$s = TrackingIdentifier.split(':'),
1204
+ _TrackingIdentifier$s2 = (0,slicedToArray/* default */.A)(_TrackingIdentifier$s, 2),
1205
+ cornerstone4Tag = _TrackingIdentifier$s2[0],
1206
+ toolType = _TrackingIdentifier$s2[1];
1160
1207
  if (cornerstone4Tag !== CORNERSTONE_4_TAG) {
1161
1208
  return false;
1162
1209
  }
@@ -1172,22 +1219,20 @@ MeasurementReport.registerTool(CobbAngle);
1172
1219
 
1173
1220
 
1174
1221
 
1222
+
1175
1223
  function Angle_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1176
1224
  function Angle_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Angle_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Angle_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1177
- const {
1178
- Angle: TID300Angle
1179
- } = dcmjs_es/* utilities */.BF.TID300;
1225
+ const TID300Angle = dcmjs_es/* utilities */.BF.TID300.Angle;
1180
1226
  const ANGLE = 'Angle';
1181
1227
  class Angle {
1182
1228
  /**
1183
1229
  * Generate TID300 measurement data for a plane angle measurement - use a Angle, but label it as Angle
1184
1230
  */
1185
1231
  static getMeasurementData(MeasurementGroup) {
1186
- const {
1187
- defaultState,
1188
- NUMGroup,
1189
- SCOORDGroup
1190
- } = MeasurementReport.getSetupMeasurementData(MeasurementGroup);
1232
+ const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup),
1233
+ defaultState = _MeasurementReport$ge.defaultState,
1234
+ NUMGroup = _MeasurementReport$ge.NUMGroup,
1235
+ SCOORDGroup = _MeasurementReport$ge.SCOORDGroup;
1191
1236
  const state = Angle_objectSpread(Angle_objectSpread({}, defaultState), {}, {
1192
1237
  rAngle: NUMGroup.MeasuredValueSequence.NumericValue,
1193
1238
  toolType: Angle.toolType,
@@ -1204,15 +1249,21 @@ class Angle {
1204
1249
  }
1205
1250
  }
1206
1251
  });
1207
- [state.handles.start.x, state.handles.start.y, state.handles.middle.x, state.handles.middle.y, state.handles.middle.x, state.handles.middle.y, state.handles.end.x, state.handles.end.y] = SCOORDGroup.GraphicData;
1252
+ var _SCOORDGroup$GraphicD = (0,slicedToArray/* default */.A)(SCOORDGroup.GraphicData, 8);
1253
+ state.handles.start.x = _SCOORDGroup$GraphicD[0];
1254
+ state.handles.start.y = _SCOORDGroup$GraphicD[1];
1255
+ state.handles.middle.x = _SCOORDGroup$GraphicD[2];
1256
+ state.handles.middle.y = _SCOORDGroup$GraphicD[3];
1257
+ state.handles.middle.x = _SCOORDGroup$GraphicD[4];
1258
+ state.handles.middle.y = _SCOORDGroup$GraphicD[5];
1259
+ state.handles.end.x = _SCOORDGroup$GraphicD[6];
1260
+ state.handles.end.y = _SCOORDGroup$GraphicD[7];
1208
1261
  return state;
1209
1262
  }
1210
1263
  static getTID300RepresentationArguments(tool) {
1211
- const {
1212
- handles,
1213
- finding,
1214
- findingSites
1215
- } = tool;
1264
+ const handles = tool.handles,
1265
+ finding = tool.finding,
1266
+ findingSites = tool.findingSites;
1216
1267
  const point1 = handles.start;
1217
1268
  const point2 = handles.middle;
1218
1269
  const point3 = handles.middle;
@@ -1238,7 +1289,10 @@ Angle.isValidCornerstoneTrackingIdentifier = TrackingIdentifier => {
1238
1289
  if (!TrackingIdentifier.includes(':')) {
1239
1290
  return false;
1240
1291
  }
1241
- const [cornerstone4Tag, toolType] = TrackingIdentifier.split(':');
1292
+ const _TrackingIdentifier$s = TrackingIdentifier.split(':'),
1293
+ _TrackingIdentifier$s2 = (0,slicedToArray/* default */.A)(_TrackingIdentifier$s, 2),
1294
+ cornerstone4Tag = _TrackingIdentifier$s2[0],
1295
+ toolType = _TrackingIdentifier$s2[1];
1242
1296
  if (cornerstone4Tag !== CORNERSTONE_4_TAG) {
1243
1297
  return false;
1244
1298
  }
@@ -1254,18 +1308,16 @@ MeasurementReport.registerTool(Angle);
1254
1308
 
1255
1309
 
1256
1310
 
1311
+
1257
1312
  function RectangleRoi_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1258
1313
  function RectangleRoi_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? RectangleRoi_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : RectangleRoi_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1259
- const {
1260
- Polyline: RectangleRoi_TID300Polyline
1261
- } = dcmjs_es/* utilities */.BF.TID300;
1314
+ const RectangleRoi_TID300Polyline = dcmjs_es/* utilities */.BF.TID300.Polyline;
1262
1315
  class RectangleRoi {
1263
1316
  static getMeasurementData(MeasurementGroup) {
1264
- const {
1265
- defaultState,
1266
- SCOORDGroup,
1267
- NUMGroup
1268
- } = MeasurementReport.getSetupMeasurementData(MeasurementGroup);
1317
+ const _MeasurementReport$ge = MeasurementReport.getSetupMeasurementData(MeasurementGroup),
1318
+ defaultState = _MeasurementReport$ge.defaultState,
1319
+ SCOORDGroup = _MeasurementReport$ge.SCOORDGroup,
1320
+ NUMGroup = _MeasurementReport$ge.NUMGroup;
1269
1321
  const state = RectangleRoi_objectSpread(RectangleRoi_objectSpread({}, defaultState), {}, {
1270
1322
  toolType: RectangleRoi.toolType,
1271
1323
  handles: {
@@ -1287,21 +1339,23 @@ class RectangleRoi {
1287
1339
  color: undefined,
1288
1340
  invalidated: true
1289
1341
  });
1290
- const intermediate = {};
1291
- [state.handles.start.x, state.handles.start.y, intermediate.x, intermediate.y, state.handles.end.x, state.handles.end.y] = SCOORDGroup.GraphicData;
1342
+ var _SCOORDGroup$GraphicD = (0,slicedToArray/* default */.A)(SCOORDGroup.GraphicData, 6);
1343
+ state.handles.start.x = _SCOORDGroup$GraphicD[0];
1344
+ state.handles.start.y = _SCOORDGroup$GraphicD[1];
1345
+ _SCOORDGroup$GraphicD[2];
1346
+ _SCOORDGroup$GraphicD[3];
1347
+ state.handles.end.x = _SCOORDGroup$GraphicD[4];
1348
+ state.handles.end.y = _SCOORDGroup$GraphicD[5];
1292
1349
  return state;
1293
1350
  }
1294
1351
  static getTID300RepresentationArguments(tool) {
1295
- const {
1296
- finding,
1297
- findingSites,
1298
- cachedStats = {},
1299
- handles
1300
- } = tool;
1301
- const {
1302
- start,
1303
- end
1304
- } = handles;
1352
+ const finding = tool.finding,
1353
+ findingSites = tool.findingSites,
1354
+ _tool$cachedStats = tool.cachedStats,
1355
+ cachedStats = _tool$cachedStats === void 0 ? {} : _tool$cachedStats,
1356
+ handles = tool.handles;
1357
+ const start = handles.start,
1358
+ end = handles.end;
1305
1359
  const points = [start, {
1306
1360
  x: start.x,
1307
1361
  y: end.y
@@ -1309,10 +1363,8 @@ class RectangleRoi {
1309
1363
  x: end.x,
1310
1364
  y: start.y
1311
1365
  }];
1312
- const {
1313
- area,
1314
- perimeter
1315
- } = cachedStats;
1366
+ const area = cachedStats.area,
1367
+ perimeter = cachedStats.perimeter;
1316
1368
  const trackingIdentifierTextValue = 'cornerstoneTools@^4.0.0:RectangleRoi';
1317
1369
  return {
1318
1370
  points,
@@ -1331,7 +1383,10 @@ RectangleRoi.isValidCornerstoneTrackingIdentifier = TrackingIdentifier => {
1331
1383
  if (!TrackingIdentifier.includes(':')) {
1332
1384
  return false;
1333
1385
  }
1334
- const [cornerstone4Tag, toolType] = TrackingIdentifier.split(':');
1386
+ const _TrackingIdentifier$s = TrackingIdentifier.split(':'),
1387
+ _TrackingIdentifier$s2 = (0,slicedToArray/* default */.A)(_TrackingIdentifier$s, 2),
1388
+ cornerstone4Tag = _TrackingIdentifier$s2[0],
1389
+ toolType = _TrackingIdentifier$s2[1];
1335
1390
  if (cornerstone4Tag !== CORNERSTONE_4_TAG) {
1336
1391
  return false;
1337
1392
  }
@@ -1347,13 +1402,9 @@ var ndarray_default = /*#__PURE__*/__webpack_require__.n(ndarray);
1347
1402
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/helpers/getDatasetsFromImages.js
1348
1403
 
1349
1404
 
1350
- const {
1351
- DicomMessage,
1352
- DicomMetaDictionary: getDatasetsFromImages_DicomMetaDictionary
1353
- } = dcmjs_es/* data */.p;
1354
- const {
1355
- Normalizer: getDatasetsFromImages_Normalizer
1356
- } = dcmjs_es/* normalizers */.z8;
1405
+ const DicomMessage = dcmjs_es/* data */.p.DicomMessage,
1406
+ getDatasetsFromImages_DicomMetaDictionary = dcmjs_es/* data */.p.DicomMetaDictionary;
1407
+ const getDatasetsFromImages_Normalizer = dcmjs_es/* normalizers */.z8.Normalizer;
1357
1408
  function getDatasetsFromImages(images, isMultiframe, options) {
1358
1409
  const datasets = [];
1359
1410
  if (isMultiframe) {
@@ -1386,24 +1437,17 @@ function getDatasetsFromImages(images, isMultiframe, options) {
1386
1437
 
1387
1438
 
1388
1439
 
1389
- const {
1390
- rotateDirectionCosinesInPlane,
1391
- flipImageOrientationPatient: flipIOP,
1392
- flipMatrix2D,
1393
- rotateMatrix902D
1394
- } = dcmjs_es/* utilities */.BF.orientation;
1395
- const {
1396
- datasetToBlob,
1397
- BitArray,
1398
- DicomMessage: Segmentation_3X_DicomMessage,
1399
- DicomMetaDictionary: Segmentation_3X_DicomMetaDictionary
1400
- } = dcmjs_es/* utilities */.BF;
1401
- const {
1402
- Normalizer: Segmentation_3X_Normalizer
1403
- } = dcmjs_es/* normalizers */.z8;
1404
- const {
1405
- Segmentation: SegmentationDerivation
1406
- } = dcmjs_es/* derivations */.h4;
1440
+ const _utilities$orientatio = dcmjs_es/* utilities */.BF.orientation,
1441
+ rotateDirectionCosinesInPlane = _utilities$orientatio.rotateDirectionCosinesInPlane,
1442
+ flipIOP = _utilities$orientatio.flipImageOrientationPatient,
1443
+ flipMatrix2D = _utilities$orientatio.flipMatrix2D,
1444
+ rotateMatrix902D = _utilities$orientatio.rotateMatrix902D;
1445
+ const Segmentation_3X_datasetToBlob = dcmjs_es/* utilities */.BF.datasetToBlob,
1446
+ BitArray = dcmjs_es/* utilities */.BF.BitArray,
1447
+ Segmentation_3X_DicomMessage = dcmjs_es/* utilities */.BF.DicomMessage,
1448
+ Segmentation_3X_DicomMetaDictionary = dcmjs_es/* utilities */.BF.DicomMetaDictionary;
1449
+ const Segmentation_3X_Normalizer = dcmjs_es/* normalizers */.z8.Normalizer;
1450
+ const SegmentationDerivation = dcmjs_es/* derivations */.h4.Segmentation;
1407
1451
  const Segmentation = {
1408
1452
  generateSegmentation,
1409
1453
  generateToolState
@@ -1429,10 +1473,8 @@ function generateSegmentation(images, brushData) {
1429
1473
  let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
1430
1474
  includeSliceSpacing: true
1431
1475
  };
1432
- const {
1433
- toolState,
1434
- segments
1435
- } = brushData;
1476
+ const toolState = brushData.toolState,
1477
+ segments = brushData.segments;
1436
1478
 
1437
1479
  // Calculate the dimensions of the data cube.
1438
1480
  const image0 = images[0];
@@ -1448,10 +1490,9 @@ function generateSegmentation(images, brushData) {
1448
1490
  }
1449
1491
  const isMultiframe = image0.imageId.includes('?frame');
1450
1492
  const seg = _createSegFromImages(images, isMultiframe, options);
1451
- const {
1452
- referencedFramesPerSegment,
1453
- segmentIndicies
1454
- } = _getNumberOfFramesPerSegment(toolState, images, segments);
1493
+ const _getNumberOfFramesPer = _getNumberOfFramesPerSegment(toolState, images, segments),
1494
+ referencedFramesPerSegment = _getNumberOfFramesPer.referencedFramesPerSegment,
1495
+ segmentIndicies = _getNumberOfFramesPer.segmentIndicies;
1455
1496
  let NumberOfFrames = 0;
1456
1497
  for (let i = 0; i < referencedFramesPerSegment.length; i++) {
1457
1498
  NumberOfFrames += referencedFramesPerSegment[i].length;
@@ -1469,7 +1510,7 @@ function generateSegmentation(images, brushData) {
1469
1510
  seg.addSegment(segment, _extractCornerstoneToolsPixelData(segmentIndex, referencedFrameIndicies, toolState, images, dims), referencedFrameNumbers);
1470
1511
  }
1471
1512
  seg.bitPackPixelData();
1472
- const segBlob = datasetToBlob(seg.dataset);
1513
+ const segBlob = Segmentation_3X_datasetToBlob(seg.dataset);
1473
1514
  return segBlob;
1474
1515
  }
1475
1516
  function _extractCornerstoneToolsPixelData(segmentIndex, referencedFrames, toolState, images, dims) {
@@ -1658,10 +1699,8 @@ function addImageIdSpecificBrushToolState(toolState, imageId, segmentIndex, pixe
1658
1699
  * @return {String} The corresponding imageId.
1659
1700
  */
1660
1701
  function getImageIdOfSourceImage(SourceImageSequence, imageIds, metadataProvider) {
1661
- const {
1662
- ReferencedSOPInstanceUID,
1663
- ReferencedFrameNumber
1664
- } = SourceImageSequence;
1702
+ const ReferencedSOPInstanceUID = SourceImageSequence.ReferencedSOPInstanceUID,
1703
+ ReferencedFrameNumber = SourceImageSequence.ReferencedFrameNumber;
1665
1704
  return ReferencedFrameNumber ? getImageIdOfReferencedFrame(ReferencedSOPInstanceUID, ReferencedFrameNumber, imageIds, metadataProvider) : getImageIdOfReferencedSingleFramedSOPInstance(ReferencedSOPInstanceUID, imageIds, metadataProvider);
1666
1705
  }
1667
1706
 
@@ -1817,10 +1856,8 @@ function checkIfPerpendicular(iop1, iop2, tolerance) {
1817
1856
 
1818
1857
 
1819
1858
  function checkOrientation(multiframe, validOrientations, sourceDataDimensions, tolerance) {
1820
- const {
1821
- SharedFunctionalGroupsSequence,
1822
- PerFrameFunctionalGroupsSequence
1823
- } = multiframe;
1859
+ const SharedFunctionalGroupsSequence = multiframe.SharedFunctionalGroupsSequence,
1860
+ PerFrameFunctionalGroupsSequence = multiframe.PerFrameFunctionalGroupsSequence;
1824
1861
  const sharedImageOrientationPatient = SharedFunctionalGroupsSequence.PlaneOrientationSequence ? SharedFunctionalGroupsSequence.PlaneOrientationSequence.ImageOrientationPatient : undefined;
1825
1862
  const PerFrameFunctionalGroups = PerFrameFunctionalGroupsSequence[0];
1826
1863
  const iop = sharedImageOrientationPatient || PerFrameFunctionalGroups.PlaneOrientationSequence.ImageOrientationPatient;
@@ -1852,27 +1889,20 @@ var Events;
1852
1889
 
1853
1890
 
1854
1891
 
1855
- const {
1856
- rotateDirectionCosinesInPlane: Segmentation_4X_rotateDirectionCosinesInPlane,
1857
- flipImageOrientationPatient: Segmentation_4X_flipIOP,
1858
- flipMatrix2D: Segmentation_4X_flipMatrix2D,
1859
- rotateMatrix902D: Segmentation_4X_rotateMatrix902D
1860
- } = dcmjs_es/* utilities */.BF.orientation;
1861
- const {
1862
- BitArray: Segmentation_4X_BitArray,
1863
- DicomMessage: Segmentation_4X_DicomMessage,
1864
- DicomMetaDictionary: Segmentation_4X_DicomMetaDictionary
1865
- } = dcmjs_es/* data */.p;
1866
- const {
1867
- Normalizer: Segmentation_4X_Normalizer
1868
- } = dcmjs_es/* normalizers */.z8;
1869
- const {
1870
- Segmentation: Segmentation_4X_SegmentationDerivation
1871
- } = dcmjs_es/* derivations */.h4;
1872
- const {
1873
- encode,
1874
- decode
1875
- } = dcmjs_es/* utilities */.BF.compression;
1892
+
1893
+ const Segmentation_4X_utilities$orientatio = dcmjs_es/* utilities */.BF.orientation,
1894
+ Segmentation_4X_rotateDirectionCosinesInPlane = Segmentation_4X_utilities$orientatio.rotateDirectionCosinesInPlane,
1895
+ Segmentation_4X_flipIOP = Segmentation_4X_utilities$orientatio.flipImageOrientationPatient,
1896
+ Segmentation_4X_flipMatrix2D = Segmentation_4X_utilities$orientatio.flipMatrix2D,
1897
+ Segmentation_4X_rotateMatrix902D = Segmentation_4X_utilities$orientatio.rotateMatrix902D;
1898
+ const Segmentation_4X_BitArray = dcmjs_es/* data */.p.BitArray,
1899
+ Segmentation_4X_DicomMessage = dcmjs_es/* data */.p.DicomMessage,
1900
+ Segmentation_4X_DicomMetaDictionary = dcmjs_es/* data */.p.DicomMetaDictionary;
1901
+ const Segmentation_4X_Normalizer = dcmjs_es/* normalizers */.z8.Normalizer;
1902
+ const Segmentation_4X_SegmentationDerivation = dcmjs_es/* derivations */.h4.Segmentation;
1903
+ const _utilities$compressio = dcmjs_es/* utilities */.BF.compression,
1904
+ encode = _utilities$compressio.encode,
1905
+ decode = _utilities$compressio.decode;
1876
1906
 
1877
1907
  /**
1878
1908
  *
@@ -1922,10 +1952,8 @@ function fillSegmentation(segmentation, inputLabelmaps3D) {
1922
1952
  const referencedFramesPerLabelmap = [];
1923
1953
  for (let labelmapIndex = 0; labelmapIndex < labelmaps3D.length; labelmapIndex++) {
1924
1954
  const labelmap3D = labelmaps3D[labelmapIndex];
1925
- const {
1926
- labelmaps2D,
1927
- metadata
1928
- } = labelmap3D;
1955
+ const labelmaps2D = labelmap3D.labelmaps2D,
1956
+ metadata = labelmap3D.metadata;
1929
1957
  const referencedFramesPerSegment = [];
1930
1958
  for (let i = 1; i < metadata.length; i++) {
1931
1959
  if (metadata[i]) {
@@ -1935,9 +1963,7 @@ function fillSegmentation(segmentation, inputLabelmaps3D) {
1935
1963
  for (let i = 0; i < labelmaps2D.length; i++) {
1936
1964
  const labelmap2D = labelmaps2D[i];
1937
1965
  if (labelmaps2D[i]) {
1938
- const {
1939
- segmentsOnLabelmap
1940
- } = labelmap2D;
1966
+ const segmentsOnLabelmap = labelmap2D.segmentsOnLabelmap;
1941
1967
  segmentsOnLabelmap.forEach(segmentIndex => {
1942
1968
  if (segmentIndex !== 0) {
1943
1969
  referencedFramesPerSegment[segmentIndex].push(i);
@@ -1952,9 +1978,7 @@ function fillSegmentation(segmentation, inputLabelmaps3D) {
1952
1978
  for (let labelmapIndex = 0; labelmapIndex < labelmaps3D.length; labelmapIndex++) {
1953
1979
  const referencedFramesPerSegment = referencedFramesPerLabelmap[labelmapIndex];
1954
1980
  const labelmap3D = labelmaps3D[labelmapIndex];
1955
- const {
1956
- metadata
1957
- } = labelmap3D;
1981
+ const metadata = labelmap3D.metadata;
1958
1982
  for (let segmentIndex = 1; segmentIndex < referencedFramesPerSegment.length; segmentIndex++) {
1959
1983
  const referencedFrameIndicies = referencedFramesPerSegment[segmentIndex];
1960
1984
  if (referencedFrameIndicies) {
@@ -1996,9 +2020,7 @@ function fillSegmentation(segmentation, inputLabelmaps3D) {
1996
2020
  return segmentation;
1997
2021
  }
1998
2022
  function _getLabelmapsFromReferencedFrameIndicies(labelmap3D, referencedFrameIndicies) {
1999
- const {
2000
- labelmaps2D
2001
- } = labelmap3D;
2023
+ const labelmaps2D = labelmap3D.labelmaps2D;
2002
2024
  const labelmaps = [];
2003
2025
  for (let i = 0; i < referencedFrameIndicies.length; i++) {
2004
2026
  const frame = referencedFrameIndicies[i];
@@ -2035,14 +2057,18 @@ function Segmentation_4X_createSegFromImages(images, isMultiframe, options) {
2035
2057
  * (available only for the overlapping case).
2036
2058
  */
2037
2059
  async function Segmentation_4X_generateToolState(referencedImageIds, arrayBuffer, metadataProvider, options) {
2038
- const {
2039
- skipOverlapping = false,
2040
- tolerance = 1e-3,
2041
- TypedArrayConstructor = Uint8Array,
2042
- maxBytesPerChunk = 199000000,
2043
- eventTarget = null,
2044
- triggerEvent = null
2045
- } = options;
2060
+ const _options$skipOverlapp = options.skipOverlapping,
2061
+ skipOverlapping = _options$skipOverlapp === void 0 ? false : _options$skipOverlapp,
2062
+ _options$tolerance = options.tolerance,
2063
+ tolerance = _options$tolerance === void 0 ? 1e-3 : _options$tolerance,
2064
+ _options$TypedArrayCo = options.TypedArrayConstructor,
2065
+ TypedArrayConstructor = _options$TypedArrayCo === void 0 ? Uint8Array : _options$TypedArrayCo,
2066
+ _options$maxBytesPerC = options.maxBytesPerChunk,
2067
+ maxBytesPerChunk = _options$maxBytesPerC === void 0 ? 199000000 : _options$maxBytesPerC,
2068
+ _options$eventTarget = options.eventTarget,
2069
+ eventTarget = _options$eventTarget === void 0 ? null : _options$eventTarget,
2070
+ _options$triggerEvent = options.triggerEvent,
2071
+ triggerEvent = _options$triggerEvent === void 0 ? null : _options$triggerEvent;
2046
2072
  const dicomData = Segmentation_4X_DicomMessage.readFile(arrayBuffer);
2047
2073
  const dataset = Segmentation_4X_DicomMetaDictionary.naturalizeDataset(dicomData.dict);
2048
2074
  dataset._meta = Segmentation_4X_DicomMetaDictionary.namifyDataset(dicomData.meta);
@@ -2086,9 +2112,8 @@ async function Segmentation_4X_generateToolState(referencedImageIds, arrayBuffer
2086
2112
  // we don't have to call metadataProvider.get() for each imageId over
2087
2113
  // and over again.
2088
2114
  const sopUIDImageIdIndexMap = referencedImageIds.reduce((acc, imageId) => {
2089
- const {
2090
- sopInstanceUID
2091
- } = metadataProvider.get('generalImageModule', imageId);
2115
+ const _metadataProvider$get = metadataProvider.get('generalImageModule', imageId),
2116
+ sopInstanceUID = _metadataProvider$get.sopInstanceUID;
2092
2117
  acc[sopInstanceUID] = imageId;
2093
2118
  return acc;
2094
2119
  }, {});
@@ -2346,12 +2371,10 @@ function findReferenceSourceImageId(multiframe, frameSegment, imageIds, metadata
2346
2371
  if (!multiframe) {
2347
2372
  return imageId;
2348
2373
  }
2349
- const {
2350
- FrameOfReferenceUID,
2351
- PerFrameFunctionalGroupsSequence,
2352
- SourceImageSequence,
2353
- ReferencedSeriesSequence
2354
- } = multiframe;
2374
+ const FrameOfReferenceUID = multiframe.FrameOfReferenceUID,
2375
+ PerFrameFunctionalGroupsSequence = multiframe.PerFrameFunctionalGroupsSequence,
2376
+ SourceImageSequence = multiframe.SourceImageSequence,
2377
+ ReferencedSeriesSequence = multiframe.ReferencedSeriesSequence;
2355
2378
  if (!PerFrameFunctionalGroupsSequence || PerFrameFunctionalGroupsSequence.length === 0) {
2356
2379
  return imageId;
2357
2380
  }
@@ -2400,13 +2423,11 @@ function findReferenceSourceImageId(multiframe, frameSegment, imageIds, metadata
2400
2423
  */
2401
2424
 
2402
2425
  function checkSEGsOverlapping(pixelData, multiframe, imageIds, validOrientations, metadataProvider, tolerance, TypedArrayConstructor, sopUIDImageIdIndexMap) {
2403
- const {
2404
- SharedFunctionalGroupsSequence,
2405
- PerFrameFunctionalGroupsSequence,
2406
- SegmentSequence,
2407
- Rows,
2408
- Columns
2409
- } = multiframe;
2426
+ const SharedFunctionalGroupsSequence = multiframe.SharedFunctionalGroupsSequence,
2427
+ PerFrameFunctionalGroupsSequence = multiframe.PerFrameFunctionalGroupsSequence,
2428
+ SegmentSequence = multiframe.SegmentSequence,
2429
+ Rows = multiframe.Rows,
2430
+ Columns = multiframe.Columns;
2410
2431
  let numberOfSegs = SegmentSequence.length;
2411
2432
  if (numberOfSegs < 2) {
2412
2433
  return false;
@@ -2444,7 +2465,9 @@ function checkSEGsOverlapping(pixelData, multiframe, imageIds, validOrientations
2444
2465
  frameSegmentsMapping.set(imageIdIndex, [frameSegment]);
2445
2466
  }
2446
2467
  }
2447
- for (let [, role] of frameSegmentsMapping.entries()) {
2468
+ for (let _ref of frameSegmentsMapping.entries()) {
2469
+ var _ref2 = (0,slicedToArray/* default */.A)(_ref, 2);
2470
+ let role = _ref2[1];
2448
2471
  let temp2DArray = new TypedArrayConstructor(sliceLength).fill(0);
2449
2472
  for (let i = 0; i < role.length; ++i) {
2450
2473
  const frameSegment = role[i];
@@ -2471,12 +2494,10 @@ function checkSEGsOverlapping(pixelData, multiframe, imageIds, validOrientations
2471
2494
  return false;
2472
2495
  }
2473
2496
  function insertOverlappingPixelDataPlanar(segmentsOnFrame, segmentsOnFrameArray, labelmapBufferArray, pixelData, multiframe, imageIds, validOrientations, metadataProvider, tolerance, TypedArrayConstructor, segmentsPixelIndices, sopUIDImageIdIndexMap) {
2474
- const {
2475
- SharedFunctionalGroupsSequence,
2476
- PerFrameFunctionalGroupsSequence,
2477
- Rows,
2478
- Columns
2479
- } = multiframe;
2497
+ const SharedFunctionalGroupsSequence = multiframe.SharedFunctionalGroupsSequence,
2498
+ PerFrameFunctionalGroupsSequence = multiframe.PerFrameFunctionalGroupsSequence,
2499
+ Rows = multiframe.Rows,
2500
+ Columns = multiframe.Columns;
2480
2501
  const sharedImageOrientationPatient = SharedFunctionalGroupsSequence.PlaneOrientationSequence ? SharedFunctionalGroupsSequence.PlaneOrientationSequence.ImageOrientationPatient : undefined;
2481
2502
  const sliceLength = Columns * Rows;
2482
2503
  const arrayBufferLength = sliceLength * imageIds.length * TypedArrayConstructor.BYTES_PER_ELEMENT;
@@ -2575,20 +2596,16 @@ function insertOverlappingPixelDataPlanar(segmentsOnFrame, segmentsOnFrameArray,
2575
2596
  }
2576
2597
  }
2577
2598
  const getSegmentIndex = (multiframe, frame) => {
2578
- const {
2579
- PerFrameFunctionalGroupsSequence,
2580
- SharedFunctionalGroupsSequence
2581
- } = multiframe;
2599
+ const PerFrameFunctionalGroupsSequence = multiframe.PerFrameFunctionalGroupsSequence,
2600
+ SharedFunctionalGroupsSequence = multiframe.SharedFunctionalGroupsSequence;
2582
2601
  const PerFrameFunctionalGroups = PerFrameFunctionalGroupsSequence[frame];
2583
2602
  return PerFrameFunctionalGroups && PerFrameFunctionalGroups.SegmentIdentificationSequence ? PerFrameFunctionalGroups.SegmentIdentificationSequence.ReferencedSegmentNumber : SharedFunctionalGroupsSequence.SegmentIdentificationSequence ? SharedFunctionalGroupsSequence.SegmentIdentificationSequence.ReferencedSegmentNumber : undefined;
2584
2603
  };
2585
2604
  function insertPixelDataPlanar(segmentsOnFrame, segmentsOnFrameArray, labelmapBufferArray, pixelData, multiframe, imageIds, validOrientations, metadataProvider, tolerance, TypedArrayConstructor, segmentsPixelIndices, sopUIDImageIdIndexMap, imageIdMaps, eventTarget, triggerEvent) {
2586
- const {
2587
- SharedFunctionalGroupsSequence,
2588
- PerFrameFunctionalGroupsSequence,
2589
- Rows,
2590
- Columns
2591
- } = multiframe;
2605
+ const SharedFunctionalGroupsSequence = multiframe.SharedFunctionalGroupsSequence,
2606
+ PerFrameFunctionalGroupsSequence = multiframe.PerFrameFunctionalGroupsSequence,
2607
+ Rows = multiframe.Rows,
2608
+ Columns = multiframe.Columns;
2592
2609
  const sharedImageOrientationPatient = SharedFunctionalGroupsSequence.PlaneOrientationSequence ? SharedFunctionalGroupsSequence.PlaneOrientationSequence.ImageOrientationPatient : undefined;
2593
2610
  const sliceLength = Columns * Rows;
2594
2611
  let i = 0;
@@ -2748,10 +2765,8 @@ function getUnpackedChunks(data, maxBytesPerChunk) {
2748
2765
  * @return {String} The corresponding imageId.
2749
2766
  */
2750
2767
  function getImageIdOfSourceImageBySourceImageSequence(SourceImageSequence, sopUIDImageIdIndexMap) {
2751
- const {
2752
- ReferencedSOPInstanceUID,
2753
- ReferencedFrameNumber
2754
- } = SourceImageSequence;
2768
+ const ReferencedSOPInstanceUID = SourceImageSequence.ReferencedSOPInstanceUID,
2769
+ ReferencedFrameNumber = SourceImageSequence.ReferencedFrameNumber;
2755
2770
  const baseImageId = sopUIDImageIdIndexMap[ReferencedSOPInstanceUID];
2756
2771
  if (!baseImageId) {
2757
2772
  console.warn("No imageId found for SOPInstanceUID: ".concat(ReferencedSOPInstanceUID));
@@ -2817,8 +2832,8 @@ function getImageIdOfSourceImagebyGeometry(ReferencedSeriesInstanceUID, FrameOfR
2817
2832
 
2818
2833
  // For multiframe images, check each frame's position
2819
2834
  if (isMultiframe) {
2820
- var _metadataProvider$get;
2821
- const framePosition = (_metadataProvider$get = metadataProvider.get('imagePlaneModule', imageId)) === null || _metadataProvider$get === void 0 ? void 0 : _metadataProvider$get.imagePositionPatient;
2835
+ var _metadataProvider$get2;
2836
+ const framePosition = (_metadataProvider$get2 = metadataProvider.get('imagePlaneModule', imageId)) === null || _metadataProvider$get2 === void 0 ? void 0 : _metadataProvider$get2.imagePositionPatient;
2822
2837
  if (framePosition && esm.utilities.isEqual(segFramePosition, framePosition, tolerance)) {
2823
2838
  return imageId;
2824
2839
  }
@@ -2981,7 +2996,10 @@ function calculateCentroid(imageIdIndexBufferIndex, multiframe, metadataProvider
2981
2996
  let worldYAcc = 0;
2982
2997
  let worldZAcc = 0;
2983
2998
  let count = 0;
2984
- for (const [imageIdIndex, bufferIndices] of Object.entries(imageIdIndexBufferIndex)) {
2999
+ for (const _ref3 of Object.entries(imageIdIndexBufferIndex)) {
3000
+ var _ref4 = (0,slicedToArray/* default */.A)(_ref3, 2);
3001
+ const imageIdIndex = _ref4[0];
3002
+ const bufferIndices = _ref4[1];
2985
3003
  const z = Number(imageIdIndex);
2986
3004
  if (!bufferIndices || bufferIndices.length === 0) {
2987
3005
  continue;
@@ -2994,13 +3012,11 @@ function calculateCentroid(imageIdIndexBufferIndex, multiframe, metadataProvider
2994
3012
  console.debug('Missing imagePlaneModule metadata for centroid calculation');
2995
3013
  continue;
2996
3014
  }
2997
- const {
2998
- imagePositionPatient,
2999
- rowCosines,
3000
- columnCosines,
3001
- rowPixelSpacing,
3002
- columnPixelSpacing
3003
- } = imagePlaneModule;
3015
+ const imagePositionPatient = imagePlaneModule.imagePositionPatient,
3016
+ rowCosines = imagePlaneModule.rowCosines,
3017
+ columnCosines = imagePlaneModule.columnCosines,
3018
+ rowPixelSpacing = imagePlaneModule.rowPixelSpacing,
3019
+ columnPixelSpacing = imagePlaneModule.columnPixelSpacing;
3004
3020
  for (const bufferIndex of bufferIndices) {
3005
3021
  const y = Math.floor(bufferIndex / multiframe.Rows);
3006
3022
  const x = bufferIndex % multiframe.Rows;
@@ -3123,13 +3139,9 @@ function Segmentation_fillSegmentation(segmentation, inputLabelmaps3D) {
3123
3139
 
3124
3140
 
3125
3141
 
3126
- const {
3127
- DicomMessage: ParametricMap_DicomMessage,
3128
- DicomMetaDictionary: ParametricMap_DicomMetaDictionary
3129
- } = dcmjs_es/* data */.p;
3130
- const {
3131
- Normalizer: ParametricMap_Normalizer
3132
- } = dcmjs_es/* normalizers */.z8;
3142
+ const ParametricMap_DicomMessage = dcmjs_es/* data */.p.DicomMessage,
3143
+ ParametricMap_DicomMetaDictionary = dcmjs_es/* data */.p.DicomMetaDictionary;
3144
+ const ParametricMap_Normalizer = dcmjs_es/* normalizers */.z8.Normalizer;
3133
3145
  async function ParametricMap_generateToolState(imageIds, arrayBuffer, metadataProvider) {
3134
3146
  let tolerance = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1e-3;
3135
3147
  const dicomData = ParametricMap_DicomMessage.readFile(arrayBuffer);
@@ -3145,9 +3157,8 @@ async function ParametricMap_generateToolState(imageIds, arrayBuffer, metadataPr
3145
3157
  const pixelData = getPixelData(multiframe);
3146
3158
  const orientation = checkOrientation(multiframe, validOrientations, [imagePlaneModule.rows, imagePlaneModule.columns, imageIds.length], tolerance);
3147
3159
  const sopUIDImageIdIndexMap = imageIds.reduce((acc, imageId) => {
3148
- const {
3149
- sopInstanceUID
3150
- } = metadataProvider.get('generalImageModule', imageId);
3160
+ const _metadataProvider$get = metadataProvider.get('generalImageModule', imageId),
3161
+ sopInstanceUID = _metadataProvider$get.sopInstanceUID;
3151
3162
  acc[sopInstanceUID] = imageId;
3152
3163
  return acc;
3153
3164
  }, {});
@@ -3173,11 +3184,9 @@ async function ParametricMap_generateToolState(imageIds, arrayBuffer, metadataPr
3173
3184
  }
3174
3185
  function ParametricMap_insertPixelDataPlanar(sourcePixelData, multiframe, imageIds, metadataProvider, tolerance, sopUIDImageIdIndexMap, imageIdMaps) {
3175
3186
  const targetPixelData = new sourcePixelData.constructor(sourcePixelData.length);
3176
- const {
3177
- PerFrameFunctionalGroupsSequence,
3178
- Rows,
3179
- Columns
3180
- } = multiframe;
3187
+ const PerFrameFunctionalGroupsSequence = multiframe.PerFrameFunctionalGroupsSequence,
3188
+ Rows = multiframe.Rows,
3189
+ Columns = multiframe.Columns;
3181
3190
  const sliceLength = Columns * Rows;
3182
3191
  const numSlices = PerFrameFunctionalGroupsSequence.length;
3183
3192
  for (let i = 0; i < numSlices; i++) {
@@ -3226,12 +3235,10 @@ function ParametricMap_findReferenceSourceImageId(multiframe, frameSegment, imag
3226
3235
  if (!multiframe) {
3227
3236
  return imageId;
3228
3237
  }
3229
- const {
3230
- FrameOfReferenceUID,
3231
- PerFrameFunctionalGroupsSequence,
3232
- SourceImageSequence,
3233
- ReferencedSeriesSequence
3234
- } = multiframe;
3238
+ const FrameOfReferenceUID = multiframe.FrameOfReferenceUID,
3239
+ PerFrameFunctionalGroupsSequence = multiframe.PerFrameFunctionalGroupsSequence,
3240
+ SourceImageSequence = multiframe.SourceImageSequence,
3241
+ ReferencedSeriesSequence = multiframe.ReferencedSeriesSequence;
3235
3242
  if (!PerFrameFunctionalGroupsSequence || PerFrameFunctionalGroupsSequence.length === 0) {
3236
3243
  return imageId;
3237
3244
  }
@@ -3274,10 +3281,8 @@ function ParametricMap_findReferenceSourceImageId(multiframe, frameSegment, imag
3274
3281
  return imageId;
3275
3282
  }
3276
3283
  function ParametricMap_getImageIdOfSourceImageBySourceImageSequence(SourceImageSequence, sopUIDImageIdIndexMap) {
3277
- const {
3278
- ReferencedSOPInstanceUID,
3279
- ReferencedFrameNumber
3280
- } = SourceImageSequence;
3284
+ const ReferencedSOPInstanceUID = SourceImageSequence.ReferencedSOPInstanceUID,
3285
+ ReferencedFrameNumber = SourceImageSequence.ReferencedFrameNumber;
3281
3286
  return ReferencedFrameNumber ? ParametricMap_getImageIdOfReferencedFrame(ReferencedSOPInstanceUID, ReferencedFrameNumber, sopUIDImageIdIndexMap) : sopUIDImageIdIndexMap[ReferencedSOPInstanceUID];
3282
3287
  }
3283
3288
  function ParametricMap_getImageIdOfSourceImagebyGeometry(ReferencedSeriesInstanceUID, FrameOfReferenceUID, PerFrameFunctionalGroup, imageIds, metadataProvider, tolerance) {
@@ -3385,49 +3390,13 @@ function copySeriesTags(src) {
3385
3390
 
3386
3391
 
3387
3392
 
3388
- ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/helpers/scoordToWorld.js
3389
-
3390
-
3391
- const {
3392
- imageToWorldCoords
3393
- } = esm.utilities;
3394
- function scoordToWorld(_ref, scoord) {
3395
- let {
3396
- is3DMeasurement,
3397
- referencedImageId
3398
- } = _ref;
3399
- const worldCoords = [];
3400
- if (is3DMeasurement) {
3401
- const {
3402
- GraphicData
3403
- } = scoord;
3404
- for (let i = 0; i < GraphicData.length; i += 3) {
3405
- const point = [GraphicData[i], GraphicData[i + 1], GraphicData[i + 2]];
3406
- worldCoords.push(point);
3407
- }
3408
- } else {
3409
- const {
3410
- GraphicData
3411
- } = scoord;
3412
- for (let i = 0; i < GraphicData.length; i += 2) {
3413
- const point = imageToWorldCoords(referencedImageId, [GraphicData[i], GraphicData[i + 1]]);
3414
- worldCoords.push(point);
3415
- }
3416
- }
3417
- return worldCoords;
3418
- }
3419
-
3420
-
3421
-
3422
3393
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/helpers/toPoint3.js
3423
3394
  function toPoint3(flatPoints) {
3424
3395
  const points = [];
3425
3396
  if (!(flatPoints !== null && flatPoints !== void 0 && flatPoints.length)) {
3426
3397
  return points;
3427
3398
  }
3428
- const {
3429
- length: n
3430
- } = flatPoints;
3399
+ const n = flatPoints.length;
3431
3400
  if (n % 3 !== 0) {
3432
3401
  throw new Error("Points array should be divisible by 3 for SCOORD3D, but contents are: ".concat(JSON.stringify(flatPoints), " of length ").concat(n));
3433
3402
  }
@@ -3518,56 +3487,17 @@ const metaRTSSContour = constants_objectSpread(constants_objectSpread({}, metaSR
3518
3487
 
3519
3488
 
3520
3489
 
3521
- ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/helpers/toScoordType.js
3522
-
3523
-
3524
- const {
3525
- worldToImageCoords: globalWorldToImageCoords
3526
- } = esm.utilities;
3527
- let useWorldToImageCoords = globalWorldToImageCoords;
3528
- function toScoord(_ref, point) {
3529
- let {
3530
- is3DMeasurement,
3531
- referencedImageId
3532
- } = _ref;
3533
- if (is3DMeasurement) {
3534
- return {
3535
- x: point[0],
3536
- y: point[1],
3537
- z: point[2]
3538
- };
3539
- }
3540
- const point2 = useWorldToImageCoords(referencedImageId, point);
3541
- return {
3542
- x: point2[0],
3543
- y: point2[1]
3544
- };
3545
- }
3546
- function toScoords(scoordArgs, points) {
3547
- return points.map(point => toScoord(scoordArgs, point));
3548
- }
3549
- function setWorldToImageCoords() {
3550
- let worldToImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : globalWorldToImageCoords;
3551
- useWorldToImageCoords = worldToImage;
3552
- }
3553
-
3554
-
3555
-
3556
3490
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/LabelData.js
3557
3491
 
3558
3492
 
3559
3493
 
3560
3494
 
3561
3495
 
3562
- const {
3563
- sr: {
3564
- valueTypes,
3565
- coding
3566
- },
3567
- adapters: {
3568
- Cornerstone3D
3569
- }
3570
- } = dcmjs_es/* default */.Ay;
3496
+
3497
+ const _dcmjs$sr = dcmjs_es/* default.sr */.Ay.sr,
3498
+ valueTypes = _dcmjs$sr.valueTypes,
3499
+ coding = _dcmjs$sr.coding,
3500
+ Cornerstone3D = dcmjs_es/* default.adapters */.Ay.adapters.Cornerstone3D;
3571
3501
  class LabelData {
3572
3502
  constructor(tid300Item, annotation) {
3573
3503
  this.tid300Item = tid300Item;
@@ -3578,10 +3508,9 @@ class LabelData {
3578
3508
  var _handles$textBox;
3579
3509
  const contentEntries = this.tid300Item.contentItem();
3580
3510
  this.fixScoordRelationships(contentEntries);
3581
- const {
3582
- label,
3583
- handles
3584
- } = this.annotation.data;
3511
+ const _this$annotation$data = this.annotation.data,
3512
+ label = _this$annotation$data.label,
3513
+ handles = _this$annotation$data.handles;
3585
3514
  if (label) {
3586
3515
  contentEntries.push(this.createQualitativeLabel(label));
3587
3516
  this.filterCornerstoneFreeText(contentEntries);
@@ -3610,9 +3539,7 @@ class LabelData {
3610
3539
  return [contentSeq];
3611
3540
  }
3612
3541
  filterCornerstoneFreeText(contentEntries) {
3613
- const {
3614
- codeValues
3615
- } = Cornerstone3D.CodeScheme;
3542
+ const codeValues = Cornerstone3D.CodeScheme.codeValues;
3616
3543
  const freeTextCodes = [codeValues.FREE_TEXT_CODE_VALUE, codeValues.CORNERSTONEFREETEXT];
3617
3544
  for (let i = 0; i < contentEntries.length; i++) {
3618
3545
  const group = contentEntries[i];
@@ -3638,22 +3565,18 @@ class LabelData {
3638
3565
  });
3639
3566
  }
3640
3567
  createQualitativeLabelPosition(annotation) {
3641
- const {
3642
- textBox
3643
- } = annotation.data.handles;
3644
- const {
3645
- referencedImageId,
3646
- FrameOfReferenceUID: frameOfReferenceUID
3647
- } = annotation.metadata;
3568
+ const textBox = annotation.data.handles.textBox;
3569
+ const _annotation$metadata = annotation.metadata,
3570
+ referencedImageId = _annotation$metadata.referencedImageId,
3571
+ frameOfReferenceUID = _annotation$metadata.FrameOfReferenceUID;
3648
3572
  const is3DMeasurement = !referencedImageId;
3649
- const {
3650
- x,
3651
- y,
3652
- z
3653
- } = toScoord({
3654
- is3DMeasurement,
3655
- referencedImageId
3656
- }, textBox.worldPosition);
3573
+ const _toScoord = toScoord({
3574
+ is3DMeasurement,
3575
+ referencedImageId
3576
+ }, textBox.worldPosition),
3577
+ x = _toScoord.x,
3578
+ y = _toScoord.y,
3579
+ z = _toScoord.z;
3657
3580
  const graphicType = valueTypes.GraphicTypes.POINT;
3658
3581
  const relationshipType = valueTypes.RelationshipTypes.CONTAINS;
3659
3582
  const name = new coding.CodedConcept(TEXT_ANNOTATION_POSITION);
@@ -3695,29 +3618,19 @@ class LabelData {
3695
3618
 
3696
3619
 
3697
3620
 
3621
+
3622
+
3698
3623
  var _MeasurementReport;
3699
3624
  function MeasurementReport_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3700
3625
  function MeasurementReport_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? MeasurementReport_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : MeasurementReport_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3701
- const {
3702
- MetadataModules
3703
- } = esm.Enums;
3704
- const {
3705
- TID1500: MeasurementReport_TID1500,
3706
- addAccessors: MeasurementReport_addAccessors
3707
- } = dcmjs_es/* utilities */.BF;
3708
- const {
3709
- StructuredReport: MeasurementReport_StructuredReport
3710
- } = dcmjs_es/* derivations */.h4;
3711
- const {
3712
- Normalizer: MeasurementReport_Normalizer
3713
- } = dcmjs_es/* normalizers */.z8;
3714
- const {
3715
- TID1500MeasurementReport: MeasurementReport_TID1500MeasurementReport,
3716
- TID1501MeasurementGroup: MeasurementReport_TID1501MeasurementGroup
3717
- } = MeasurementReport_TID1500;
3718
- const {
3719
- DicomMetaDictionary: MeasurementReport_DicomMetaDictionary
3720
- } = dcmjs_es/* data */.p;
3626
+ const MetadataModules = esm.Enums.MetadataModules;
3627
+ const MeasurementReport_TID1500 = dcmjs_es/* utilities */.BF.TID1500,
3628
+ MeasurementReport_addAccessors = dcmjs_es/* utilities */.BF.addAccessors;
3629
+ const MeasurementReport_StructuredReport = dcmjs_es/* derivations */.h4.StructuredReport;
3630
+ const MeasurementReport_Normalizer = dcmjs_es/* normalizers */.z8.Normalizer;
3631
+ const MeasurementReport_TID1500MeasurementReport = MeasurementReport_TID1500.TID1500MeasurementReport,
3632
+ MeasurementReport_TID1501MeasurementGroup = MeasurementReport_TID1500.TID1501MeasurementGroup;
3633
+ const MeasurementReport_DicomMetaDictionary = dcmjs_es/* data */.p.DicomMetaDictionary;
3721
3634
  const MeasurementReport_FINDING = {
3722
3635
  CodingSchemeDesignator: 'DCM',
3723
3636
  CodeValue: '121071'
@@ -3773,11 +3686,10 @@ class MeasurementReport_MeasurementReport {
3773
3686
  return new MeasurementReport_TID1501MeasurementGroup(Measurements);
3774
3687
  }
3775
3688
  static getCornerstoneLabelFromDefaultState(defaultState) {
3776
- const {
3777
- findingSites = [],
3778
- finding,
3779
- commentGroup
3780
- } = defaultState;
3689
+ const _defaultState$finding = defaultState.findingSites,
3690
+ findingSites = _defaultState$finding === void 0 ? [] : _defaultState$finding,
3691
+ finding = defaultState.finding,
3692
+ commentGroup = defaultState.commentGroup;
3781
3693
  if (commentGroup !== null && commentGroup !== void 0 && commentGroup.TextValue) {
3782
3694
  return commentGroup.TextValue;
3783
3695
  }
@@ -3794,19 +3706,14 @@ class MeasurementReport_MeasurementReport {
3794
3706
  return metaSRAnnotation;
3795
3707
  }
3796
3708
  static processSCOORDGroup(_ref) {
3797
- let {
3798
- SCOORDGroup,
3799
- toolType,
3800
- sopInstanceUIDToImageIdMap,
3801
- metadata
3802
- } = _ref;
3803
- const {
3804
- ReferencedSOPSequence
3805
- } = SCOORDGroup.ContentSequence;
3806
- const {
3807
- ReferencedSOPInstanceUID,
3808
- ReferencedFrameNumber = 1
3809
- } = ReferencedSOPSequence;
3709
+ let SCOORDGroup = _ref.SCOORDGroup,
3710
+ toolType = _ref.toolType,
3711
+ sopInstanceUIDToImageIdMap = _ref.sopInstanceUIDToImageIdMap,
3712
+ metadata = _ref.metadata;
3713
+ const ReferencedSOPSequence = SCOORDGroup.ContentSequence.ReferencedSOPSequence;
3714
+ const ReferencedSOPInstanceUID = ReferencedSOPSequence.ReferencedSOPInstanceUID,
3715
+ _ReferencedSOPSequenc = ReferencedSOPSequence.ReferencedFrameNumber,
3716
+ ReferencedFrameNumber = _ReferencedSOPSequenc === void 0 ? 1 : _ReferencedSOPSequenc;
3810
3717
  const referencedImageId = sopInstanceUIDToImageIdMap["".concat(ReferencedSOPInstanceUID, ":").concat(ReferencedFrameNumber)];
3811
3718
  const imagePlaneModule = metadata.get('imagePlaneModule', referencedImageId);
3812
3719
  const annotationUID = MeasurementReport_DicomMetaDictionary.uid();
@@ -3841,10 +3748,8 @@ class MeasurementReport_MeasurementReport {
3841
3748
  };
3842
3749
  }
3843
3750
  static processSCOORD3DGroup(_ref2) {
3844
- let {
3845
- SCOORD3DGroup,
3846
- toolType
3847
- } = _ref2;
3751
+ let SCOORD3DGroup = _ref2.SCOORD3DGroup,
3752
+ toolType = _ref2.toolType;
3848
3753
  const annotationUID = MeasurementReport_DicomMetaDictionary.uid();
3849
3754
  const toolData = {
3850
3755
  SCOORD3DGroup,
@@ -3875,12 +3780,10 @@ class MeasurementReport_MeasurementReport {
3875
3780
  }
3876
3781
  static getSpatialCoordinatesState(_ref3) {
3877
3782
  var _contentSequenceArr$f, _contentSequenceArr$f2;
3878
- let {
3879
- NUMGroup,
3880
- sopInstanceUIDToImageIdMap,
3881
- metadata,
3882
- toolType
3883
- } = _ref3;
3783
+ let NUMGroup = _ref3.NUMGroup,
3784
+ sopInstanceUIDToImageIdMap = _ref3.sopInstanceUIDToImageIdMap,
3785
+ metadata = _ref3.metadata,
3786
+ toolType = _ref3.toolType;
3884
3787
  const contentSequenceArr = toArray(NUMGroup.ContentSequence);
3885
3788
  const SCOORDGroup = (_contentSequenceArr$f = contentSequenceArr.find(group => group.ValueType === 'SCOORD' && !isSecondaryScoordGroup(group))) !== null && _contentSequenceArr$f !== void 0 ? _contentSequenceArr$f : contentSequenceArr.find(group => group.ValueType === 'SCOORD');
3886
3789
  const SCOORD3DGroup = (_contentSequenceArr$f2 = contentSequenceArr.find(group => group.ValueType === 'SCOORD3D' && !isSecondaryScoordGroup(group))) !== null && _contentSequenceArr$f2 !== void 0 ? _contentSequenceArr$f2 : contentSequenceArr.find(group => group.ValueType === 'SCOORD3D');
@@ -3899,33 +3802,30 @@ class MeasurementReport_MeasurementReport {
3899
3802
  return result;
3900
3803
  }
3901
3804
  static processSpatialCoordinatesGroup(_ref4) {
3902
- let {
3903
- NUMGroup,
3904
- sopInstanceUIDToImageIdMap,
3905
- metadata,
3906
- findingGroup,
3907
- findingSiteGroups,
3908
- commentGroup,
3909
- commentPositionGroup,
3910
- controlPointsGroup,
3911
- toolType
3912
- } = _ref4;
3913
- const {
3914
- state,
3915
- SCOORDGroup,
3916
- ReferencedSOPSequence,
3917
- ReferencedSOPInstanceUID,
3918
- ReferencedFrameNumber,
3919
- SCOORD3DGroup,
3920
- FrameOfReferenceUID,
3921
- referencedImageId,
3922
- textBoxPosition
3923
- } = this.getSpatialCoordinatesState({
3924
- NUMGroup,
3925
- sopInstanceUIDToImageIdMap,
3926
- metadata,
3927
- toolType
3928
- });
3805
+ let NUMGroup = _ref4.NUMGroup,
3806
+ sopInstanceUIDToImageIdMap = _ref4.sopInstanceUIDToImageIdMap,
3807
+ metadata = _ref4.metadata,
3808
+ findingGroup = _ref4.findingGroup,
3809
+ findingSiteGroups = _ref4.findingSiteGroups,
3810
+ commentGroup = _ref4.commentGroup,
3811
+ commentPositionGroup = _ref4.commentPositionGroup,
3812
+ controlPointsGroup = _ref4.controlPointsGroup,
3813
+ toolType = _ref4.toolType;
3814
+ const _this$getSpatialCoord = this.getSpatialCoordinatesState({
3815
+ NUMGroup,
3816
+ sopInstanceUIDToImageIdMap,
3817
+ metadata,
3818
+ toolType
3819
+ }),
3820
+ state = _this$getSpatialCoord.state,
3821
+ SCOORDGroup = _this$getSpatialCoord.SCOORDGroup,
3822
+ ReferencedSOPSequence = _this$getSpatialCoord.ReferencedSOPSequence,
3823
+ ReferencedSOPInstanceUID = _this$getSpatialCoord.ReferencedSOPInstanceUID,
3824
+ ReferencedFrameNumber = _this$getSpatialCoord.ReferencedFrameNumber,
3825
+ SCOORD3DGroup = _this$getSpatialCoord.SCOORD3DGroup,
3826
+ FrameOfReferenceUID = _this$getSpatialCoord.FrameOfReferenceUID,
3827
+ referencedImageId = _this$getSpatialCoord.referencedImageId,
3828
+ textBoxPosition = _this$getSpatialCoord.textBoxPosition;
3929
3829
  const finding = findingGroup ? MeasurementReport_addAccessors(findingGroup.ConceptCodeSequence) : undefined;
3930
3830
  const findingSites = findingSiteGroups.map(fsg => {
3931
3831
  return MeasurementReport_addAccessors(fsg.ConceptCodeSequence);
@@ -3972,9 +3872,7 @@ class MeasurementReport_MeasurementReport {
3972
3872
  };
3973
3873
  }
3974
3874
  static getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, toolType) {
3975
- const {
3976
- ContentSequence
3977
- } = MeasurementGroup;
3875
+ const ContentSequence = MeasurementGroup.ContentSequence;
3978
3876
  const contentSequenceArr = toArray(ContentSequence);
3979
3877
  const findingGroup = contentSequenceArr.find(group => this.codeValueMatch(group, MeasurementReport_FINDING));
3980
3878
  const commentGroup = contentSequenceArr.find(group => this.codeValueMatch(group, COMMENT));
@@ -3999,9 +3897,7 @@ class MeasurementReport_MeasurementReport {
3999
3897
  controlPointsGroup,
4000
3898
  toolType
4001
3899
  });
4002
- const {
4003
- referencedImageId
4004
- } = spatialGroup.state.annotation.metadata;
3900
+ const referencedImageId = spatialGroup.state.annotation.metadata.referencedImageId;
4005
3901
  const is3DMeasurement = !!spatialGroup.SCOORD3DGroup;
4006
3902
  const scoordArgs = {
4007
3903
  referencedImageId,
@@ -4017,27 +3913,21 @@ class MeasurementReport_MeasurementReport {
4017
3913
  });
4018
3914
  }
4019
3915
  static generateReferencedSOPSequence(_ref5) {
4020
- let {
4021
- toolData,
4022
- toolTypes,
4023
- metadataProvider,
4024
- imageId,
4025
- sopInstanceUIDsToSeriesInstanceUIDMap,
4026
- derivationSourceDatasets
4027
- } = _ref5;
3916
+ let toolData = _ref5.toolData,
3917
+ toolTypes = _ref5.toolTypes,
3918
+ metadataProvider = _ref5.metadataProvider,
3919
+ imageId = _ref5.imageId,
3920
+ sopInstanceUIDsToSeriesInstanceUIDMap = _ref5.sopInstanceUIDsToSeriesInstanceUIDMap,
3921
+ derivationSourceDatasets = _ref5.derivationSourceDatasets;
4028
3922
  const effectiveImageId = imageId === NO_IMAGE_ID ? this.getImageIdFromVolume({
4029
3923
  toolData,
4030
3924
  toolTypes
4031
3925
  }) : imageId;
4032
3926
  const sopCommonModule = metadataProvider.get('sopCommonModule', effectiveImageId);
4033
3927
  const instance = metadataProvider.get('instance', effectiveImageId);
4034
- const {
4035
- sopInstanceUID,
4036
- sopClassUID
4037
- } = sopCommonModule;
4038
- const {
4039
- SeriesInstanceUID: seriesInstanceUID
4040
- } = instance;
3928
+ const sopInstanceUID = sopCommonModule.sopInstanceUID,
3929
+ sopClassUID = sopCommonModule.sopClassUID;
3930
+ const seriesInstanceUID = instance.SeriesInstanceUID;
4041
3931
  sopInstanceUIDsToSeriesInstanceUIDMap[sopInstanceUID] = seriesInstanceUID;
4042
3932
  if (!derivationSourceDatasets.find(dsd => dsd.SeriesInstanceUID === seriesInstanceUID)) {
4043
3933
  const derivationSourceDataset = MeasurementReport_MeasurementReport.generateDerivationSourceDataset(instance);
@@ -4056,10 +3946,8 @@ class MeasurementReport_MeasurementReport {
4056
3946
  }
4057
3947
  static getImageIdFromVolume(_ref6) {
4058
3948
  var _toolData$toolTypes$, _referenceToolData$me;
4059
- let {
4060
- toolData,
4061
- toolTypes
4062
- } = _ref6;
3949
+ let toolData = _ref6.toolData,
3950
+ toolTypes = _ref6.toolTypes;
4063
3951
  const referenceToolData = toolData === null || toolData === void 0 || (_toolData$toolTypes$ = toolData[toolTypes === null || toolTypes === void 0 ? void 0 : toolTypes[0]]) === null || _toolData$toolTypes$ === void 0 || (_toolData$toolTypes$ = _toolData$toolTypes$.data) === null || _toolData$toolTypes$ === void 0 ? void 0 : _toolData$toolTypes$[0];
4064
3952
  const volumeId = referenceToolData === null || referenceToolData === void 0 || (_referenceToolData$me = referenceToolData.metadata) === null || _referenceToolData$me === void 0 ? void 0 : _referenceToolData$me.volumeId;
4065
3953
  const volume = esm.cache.getVolume(volumeId);
@@ -4130,9 +4018,7 @@ class MeasurementReport_MeasurementReport {
4130
4018
  const GROUP = 'Measurement Group';
4131
4019
  const TRACKING_IDENTIFIER = 'Tracking Identifier';
4132
4020
  const TRACKING_UNIQUE_IDENTIFIER = 'Tracking Unique Identifier';
4133
- const {
4134
- imageId: predecessorImageId
4135
- } = dataset;
4021
+ const predecessorImageId = dataset.imageId;
4136
4022
  const imagingMeasurementContent = toArray(dataset.ContentSequence).find(codeMeaningEquals(REPORT));
4137
4023
  const measurementGroups = toArray(imagingMeasurementContent.ContentSequence).filter(codeMeaningEquals(GROUP));
4138
4024
  const measurementData = {};
@@ -4141,9 +4027,7 @@ class MeasurementReport_MeasurementReport {
4141
4027
  var _hooks$getToolClass;
4142
4028
  const measurementGroupContentSequence = toArray(measurementGroup.ContentSequence);
4143
4029
  const trackingIdentifierGroup = measurementGroupContentSequence.find(contentItem => contentItem.ConceptNameCodeSequence.CodeMeaning === TRACKING_IDENTIFIER);
4144
- const {
4145
- TextValue: trackingIdentifierValue
4146
- } = trackingIdentifierGroup;
4030
+ const trackingIdentifierValue = trackingIdentifierGroup.TextValue;
4147
4031
  const trackingUniqueIdentifierGroup = measurementGroupContentSequence.find(contentItem => contentItem.ConceptNameCodeSequence.CodeMeaning === TRACKING_UNIQUE_IDENTIFIER);
4148
4032
  const trackingUniqueIdentifierValue = trackingUniqueIdentifierGroup === null || trackingUniqueIdentifierGroup === void 0 ? void 0 : trackingUniqueIdentifierGroup.UID;
4149
4033
  const toolAdapter = (hooks === null || hooks === void 0 || (_hooks$getToolClass = hooks.getToolClass) === null || _hooks$getToolClass === void 0 ? void 0 : _hooks$getToolClass.call(hooks, measurementGroup, dataset, this.measurementAdapterByToolType)) || this.getAdapterForTrackingIdentifier(trackingIdentifierValue) || this.getAdapterForCodeType(measurementGroup);
@@ -4233,9 +4117,7 @@ _MeasurementReport.measurementAdapterByToolType = new Map();
4233
4117
  _MeasurementReport.measurementAdaptersByType = new Map();
4234
4118
  _MeasurementReport.measurementAdapterByTrackingIdentifier = new Map();
4235
4119
  _MeasurementReport.codeValueMatch = (group, code, oldCode) => {
4236
- const {
4237
- ConceptNameCodeSequence
4238
- } = group;
4120
+ const ConceptNameCodeSequence = group.ConceptNameCodeSequence;
4239
4121
  if (!ConceptNameCodeSequence) {
4240
4122
  return;
4241
4123
  }
@@ -4243,10 +4125,8 @@ _MeasurementReport.codeValueMatch = (group, code, oldCode) => {
4243
4125
  if (!seq) {
4244
4126
  return;
4245
4127
  }
4246
- const {
4247
- CodingSchemeDesignator,
4248
- CodeValue
4249
- } = seq;
4128
+ const CodingSchemeDesignator = seq.CodingSchemeDesignator,
4129
+ CodeValue = seq.CodeValue;
4250
4130
  return CodingSchemeDesignator == code.CodingSchemeDesignator && CodeValue == code.CodeValue || oldCode && CodingSchemeDesignator == oldCode.CodingSchemeDesignator && CodeValue == oldCode.CodeValue;
4251
4131
  };
4252
4132
  _MeasurementReport.generateDerivationSourceDataset = instance => {
@@ -4300,13 +4180,9 @@ class BaseAdapter3D {
4300
4180
  return items[offset];
4301
4181
  }
4302
4182
  static getGraphicCode(graphicItem) {
4303
- const {
4304
- ConceptNameCodeSequence: conceptNameItem
4305
- } = graphicItem;
4306
- const {
4307
- CodeValue: graphicValue,
4308
- CodingSchemeDesignator: graphicDesignator
4309
- } = conceptNameItem;
4183
+ const conceptNameItem = graphicItem.ConceptNameCodeSequence;
4184
+ const graphicValue = conceptNameItem.CodeValue,
4185
+ graphicDesignator = conceptNameItem.CodingSchemeDesignator;
4310
4186
  return "".concat(graphicDesignator, ":").concat(graphicValue);
4311
4187
  }
4312
4188
  static getGraphicType(graphicItem) {
@@ -4354,10 +4230,9 @@ class BaseAdapter3D {
4354
4230
  return trackingIdentifier.startsWith(this.trackingIdentifierTextValue);
4355
4231
  }
4356
4232
  static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, trackingIdentifier) {
4357
- const {
4358
- defaultState: state,
4359
- ReferencedFrameNumber
4360
- } = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
4233
+ const _MeasurementReport$ge = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
4234
+ state = _MeasurementReport$ge.defaultState,
4235
+ ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
4361
4236
  state.annotation.data = {
4362
4237
  cachedStats: {},
4363
4238
  frameNumber: ReferencedFrameNumber,
@@ -4367,16 +4242,10 @@ class BaseAdapter3D {
4367
4242
  }
4368
4243
  static getTID300RepresentationArguments(tool) {
4369
4244
  let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4370
- const {
4371
- metadata
4372
- } = tool;
4373
- const {
4374
- finding,
4375
- findingSites
4376
- } = tool;
4377
- const {
4378
- referencedImageId
4379
- } = metadata;
4245
+ const metadata = tool.metadata;
4246
+ const finding = tool.finding,
4247
+ findingSites = tool.findingSites;
4248
+ const referencedImageId = metadata.referencedImageId;
4380
4249
  const scoordProps = {
4381
4250
  is3DMeasurement,
4382
4251
  referencedImageId
@@ -4403,40 +4272,33 @@ class BaseAdapter3D {
4403
4272
 
4404
4273
 
4405
4274
 
4275
+
4276
+
4406
4277
  var _ArrowAnnotate;
4407
4278
  function Cornerstone3D_ArrowAnnotate_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4408
4279
  function Cornerstone3D_ArrowAnnotate_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Cornerstone3D_ArrowAnnotate_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Cornerstone3D_ArrowAnnotate_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4409
- const {
4410
- ArrowAnnotate: TID300ArrowAnnotate
4411
- } = dcmjs_es/* utilities */.BF.TID300;
4412
- const {
4413
- imageToWorldCoords: ArrowAnnotate_imageToWorldCoords
4414
- } = esm.utilities;
4280
+ const TID300ArrowAnnotate = dcmjs_es/* utilities */.BF.TID300.ArrowAnnotate;
4281
+ const ArrowAnnotate_imageToWorldCoords = esm.utilities.imageToWorldCoords;
4415
4282
  class ArrowAnnotate_ArrowAnnotate extends BaseAdapter3D {
4416
4283
  static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, _trackingIdentifier) {
4417
- const {
4418
- state,
4419
- SCOORDGroup,
4420
- worldCoords,
4421
- referencedImageId,
4422
- ReferencedFrameNumber
4423
- } = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
4284
+ const _MeasurementReport$ge = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
4285
+ state = _MeasurementReport$ge.state,
4286
+ SCOORDGroup = _MeasurementReport$ge.SCOORDGroup,
4287
+ worldCoords = _MeasurementReport$ge.worldCoords,
4288
+ referencedImageId = _MeasurementReport$ge.referencedImageId,
4289
+ ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
4424
4290
  const text = state.annotation.data.label;
4425
4291
  if (worldCoords.length === 1 && SCOORDGroup) {
4426
4292
  const imagePixelModule = metadata.get('imagePixelModule', referencedImageId);
4427
4293
  let xOffset = 10;
4428
4294
  let yOffset = 10;
4429
4295
  if (imagePixelModule) {
4430
- const {
4431
- columns,
4432
- rows
4433
- } = imagePixelModule;
4296
+ const columns = imagePixelModule.columns,
4297
+ rows = imagePixelModule.rows;
4434
4298
  xOffset = columns / 10;
4435
4299
  yOffset = rows / 10;
4436
4300
  }
4437
- const {
4438
- GraphicData
4439
- } = SCOORDGroup;
4301
+ const GraphicData = SCOORDGroup.GraphicData;
4440
4302
  const secondPoint = ArrowAnnotate_imageToWorldCoords(referencedImageId, [GraphicData[0] + xOffset, GraphicData[1] + yOffset]);
4441
4303
  worldCoords.push(secondPoint);
4442
4304
  }
@@ -4452,25 +4314,18 @@ class ArrowAnnotate_ArrowAnnotate extends BaseAdapter3D {
4452
4314
  }
4453
4315
  static getTID300RepresentationArguments(tool) {
4454
4316
  let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4455
- const {
4456
- data,
4457
- metadata,
4458
- findingSites
4459
- } = tool;
4460
- const {
4461
- finding
4462
- } = tool;
4463
- const {
4464
- referencedImageId
4465
- } = metadata;
4317
+ const data = tool.data,
4318
+ metadata = tool.metadata,
4319
+ findingSites = tool.findingSites;
4320
+ const finding = tool.finding;
4321
+ const referencedImageId = metadata.referencedImageId;
4466
4322
  const scoordProps = {
4467
4323
  is3DMeasurement,
4468
4324
  referencedImageId
4469
4325
  };
4470
- const {
4471
- points,
4472
- arrowFirst
4473
- } = data.handles;
4326
+ const _data$handles = data.handles,
4327
+ points = _data$handles.points,
4328
+ arrowFirst = _data$handles.arrowFirst;
4474
4329
  const point = arrowFirst ? points[0] : points[1];
4475
4330
  const point2 = arrowFirst ? points[1] : points[0];
4476
4331
  const pointImage = toScoord(scoordProps, point);
@@ -4503,25 +4358,21 @@ _ArrowAnnotate = ArrowAnnotate_ArrowAnnotate;
4503
4358
 
4504
4359
 
4505
4360
 
4361
+
4506
4362
  var _Bidirectional;
4507
4363
  function Bidirectional_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4508
4364
  function Bidirectional_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Bidirectional_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Bidirectional_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4509
- const {
4510
- Bidirectional: Bidirectional_TID300Bidirectional
4511
- } = dcmjs_es/* utilities */.BF.TID300;
4365
+ const Bidirectional_TID300Bidirectional = dcmjs_es/* utilities */.BF.TID300.Bidirectional;
4512
4366
  const Bidirectional_LONG_AXIS = 'Long Axis';
4513
4367
  const Bidirectional_SHORT_AXIS = 'Short Axis';
4514
4368
  class Bidirectional_Bidirectional extends BaseAdapter3D {
4515
4369
  static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata) {
4516
- const {
4517
- state,
4518
- scoordArgs,
4519
- referencedImageId,
4520
- ReferencedFrameNumber
4521
- } = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
4522
- const {
4523
- ContentSequence
4524
- } = MeasurementGroup;
4370
+ const _MeasurementReport$ge = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
4371
+ state = _MeasurementReport$ge.state,
4372
+ scoordArgs = _MeasurementReport$ge.scoordArgs,
4373
+ referencedImageId = _MeasurementReport$ge.referencedImageId,
4374
+ ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
4375
+ const ContentSequence = MeasurementGroup.ContentSequence;
4525
4376
  const longAxisNUMGroup = toArray(ContentSequence).find(group => group.ConceptNameCodeSequence.CodeMeaning === Bidirectional_LONG_AXIS);
4526
4377
  const shortAxisNUMGroup = toArray(ContentSequence).find(group => group.ConceptNameCodeSequence.CodeMeaning === Bidirectional_SHORT_AXIS);
4527
4378
  const longAxisScoordGroup = toArray(longAxisNUMGroup.ContentSequence).find(group => group.ValueType === 'SCOORD3D' || group.ValueType === 'SCOORD');
@@ -4549,26 +4400,19 @@ class Bidirectional_Bidirectional extends BaseAdapter3D {
4549
4400
  }
4550
4401
  static getTID300RepresentationArguments(tool) {
4551
4402
  let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4552
- const {
4553
- data,
4554
- finding,
4555
- findingSites,
4556
- metadata
4557
- } = tool;
4558
- const {
4559
- cachedStats = {},
4560
- handles
4561
- } = data;
4562
- const {
4563
- referencedImageId
4564
- } = metadata;
4403
+ const data = tool.data,
4404
+ finding = tool.finding,
4405
+ findingSites = tool.findingSites,
4406
+ metadata = tool.metadata;
4407
+ const _data$cachedStats = data.cachedStats,
4408
+ cachedStats = _data$cachedStats === void 0 ? {} : _data$cachedStats,
4409
+ handles = data.handles;
4410
+ const referencedImageId = metadata.referencedImageId;
4565
4411
  const scoordProps = {
4566
4412
  is3DMeasurement,
4567
4413
  referencedImageId
4568
4414
  };
4569
- const {
4570
- points
4571
- } = handles;
4415
+ const points = handles.points;
4572
4416
  const firstPointPairs = [points[0], points[1]];
4573
4417
  const secondPointPairs = [points[2], points[3]];
4574
4418
  const firstPointPairsDistance = Math.sqrt(Math.pow(firstPointPairs[0][0] - firstPointPairs[1][0], 2) + Math.pow(firstPointPairs[0][1] - firstPointPairs[1][1], 2) + Math.pow(firstPointPairs[0][2] - firstPointPairs[1][2], 2));
@@ -4586,11 +4430,10 @@ class Bidirectional_Bidirectional extends BaseAdapter3D {
4586
4430
  const longAxisEndImage = toScoord(scoordProps, shortAxisPoints[1]);
4587
4431
  const shortAxisStartImage = toScoord(scoordProps, longAxisPoints[0]);
4588
4432
  const shortAxisEndImage = toScoord(scoordProps, longAxisPoints[1]);
4589
- const {
4590
- length,
4591
- width,
4592
- unit
4593
- } = cachedStats["imageId:".concat(referencedImageId)] || {};
4433
+ const _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
4434
+ length = _ref.length,
4435
+ width = _ref.width,
4436
+ unit = _ref.unit;
4594
4437
  return {
4595
4438
  longAxis: {
4596
4439
  point1: longAxisStartImage,
@@ -4627,21 +4470,19 @@ _Bidirectional = Bidirectional_Bidirectional;
4627
4470
 
4628
4471
 
4629
4472
 
4473
+
4630
4474
  var _Angle;
4631
4475
  function Cornerstone3D_Angle_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4632
4476
  function Cornerstone3D_Angle_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Cornerstone3D_Angle_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Cornerstone3D_Angle_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4633
- const {
4634
- CobbAngle: Angle_TID300CobbAngle
4635
- } = dcmjs_es/* utilities */.BF.TID300;
4477
+ const Angle_TID300CobbAngle = dcmjs_es/* utilities */.BF.TID300.CobbAngle;
4636
4478
  class Angle_Angle extends BaseAdapter3D {
4637
4479
  static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata) {
4638
- const {
4639
- state,
4640
- NUMGroup,
4641
- worldCoords,
4642
- referencedImageId,
4643
- ReferencedFrameNumber
4644
- } = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
4480
+ const _MeasurementReport$ge = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
4481
+ state = _MeasurementReport$ge.state,
4482
+ NUMGroup = _MeasurementReport$ge.NUMGroup,
4483
+ worldCoords = _MeasurementReport$ge.worldCoords,
4484
+ referencedImageId = _MeasurementReport$ge.referencedImageId,
4485
+ ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
4645
4486
  const cachedStats = referencedImageId ? {
4646
4487
  ["imageId:".concat(referencedImageId)]: {
4647
4488
  angle: NUMGroup ? NUMGroup.MeasuredValueSequence.NumericValue : null
@@ -4659,19 +4500,14 @@ class Angle_Angle extends BaseAdapter3D {
4659
4500
  static getTID300RepresentationArguments(tool) {
4660
4501
  var _cachedStats;
4661
4502
  let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4662
- const {
4663
- data,
4664
- finding,
4665
- findingSites,
4666
- metadata
4667
- } = tool;
4668
- const {
4669
- cachedStats = {},
4670
- handles
4671
- } = data;
4672
- const {
4673
- referencedImageId
4674
- } = metadata;
4503
+ const data = tool.data,
4504
+ finding = tool.finding,
4505
+ findingSites = tool.findingSites,
4506
+ metadata = tool.metadata;
4507
+ const _data$cachedStats = data.cachedStats,
4508
+ cachedStats = _data$cachedStats === void 0 ? {} : _data$cachedStats,
4509
+ handles = data.handles;
4510
+ const referencedImageId = metadata.referencedImageId;
4675
4511
  const scoordProps = {
4676
4512
  is3DMeasurement,
4677
4513
  referencedImageId
@@ -4711,21 +4547,20 @@ _Angle = Angle_Angle;
4711
4547
 
4712
4548
 
4713
4549
 
4550
+
4551
+
4714
4552
  var _CobbAngle;
4715
4553
  function Cornerstone3D_CobbAngle_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4716
4554
  function Cornerstone3D_CobbAngle_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Cornerstone3D_CobbAngle_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Cornerstone3D_CobbAngle_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4717
- const {
4718
- CobbAngle: CobbAngle_TID300CobbAngle
4719
- } = dcmjs_es/* utilities */.BF.TID300;
4555
+ const CobbAngle_TID300CobbAngle = dcmjs_es/* utilities */.BF.TID300.CobbAngle;
4720
4556
  class CobbAngle_CobbAngle extends BaseAdapter3D {
4721
4557
  static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata) {
4722
- const {
4723
- state,
4724
- NUMGroup,
4725
- referencedImageId,
4726
- worldCoords,
4727
- ReferencedFrameNumber
4728
- } = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, CobbAngle_CobbAngle.toolType);
4558
+ const _MeasurementReport$ge = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, CobbAngle_CobbAngle.toolType),
4559
+ state = _MeasurementReport$ge.state,
4560
+ NUMGroup = _MeasurementReport$ge.NUMGroup,
4561
+ referencedImageId = _MeasurementReport$ge.referencedImageId,
4562
+ worldCoords = _MeasurementReport$ge.worldCoords,
4563
+ ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
4729
4564
  state.annotation.data = Cornerstone3D_CobbAngle_objectSpread(Cornerstone3D_CobbAngle_objectSpread({}, state.annotation.data), {}, {
4730
4565
  handles: Cornerstone3D_CobbAngle_objectSpread(Cornerstone3D_CobbAngle_objectSpread({}, state.annotation.data.handles), {}, {
4731
4566
  points: [worldCoords[0], worldCoords[1], worldCoords[2], worldCoords[3]]
@@ -4743,28 +4578,26 @@ class CobbAngle_CobbAngle extends BaseAdapter3D {
4743
4578
  }
4744
4579
  static getTID300RepresentationArguments(tool) {
4745
4580
  let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4746
- const {
4747
- data,
4748
- finding,
4749
- findingSites,
4750
- metadata
4751
- } = tool;
4752
- const {
4753
- cachedStats = {},
4754
- handles
4755
- } = data;
4756
- const {
4757
- referencedImageId
4758
- } = metadata;
4581
+ const data = tool.data,
4582
+ finding = tool.finding,
4583
+ findingSites = tool.findingSites,
4584
+ metadata = tool.metadata;
4585
+ const _data$cachedStats = data.cachedStats,
4586
+ cachedStats = _data$cachedStats === void 0 ? {} : _data$cachedStats,
4587
+ handles = data.handles;
4588
+ const referencedImageId = metadata.referencedImageId;
4759
4589
  const scoordProps = {
4760
4590
  is3DMeasurement,
4761
4591
  referencedImageId
4762
4592
  };
4763
4593
  const points = toScoords(scoordProps, handles.points);
4764
- const [point1, point2, point3, point4] = points;
4765
- const {
4766
- angle
4767
- } = cachedStats["imageId:".concat(referencedImageId)] || {};
4594
+ const _points = (0,slicedToArray/* default */.A)(points, 4),
4595
+ point1 = _points[0],
4596
+ point2 = _points[1],
4597
+ point3 = _points[2],
4598
+ point4 = _points[3];
4599
+ const _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
4600
+ angle = _ref.angle;
4768
4601
  return {
4769
4602
  point1,
4770
4603
  point2,
@@ -4788,6 +4621,8 @@ _CobbAngle = CobbAngle_CobbAngle;
4788
4621
 
4789
4622
 
4790
4623
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/metricHandler.js
4624
+
4625
+
4791
4626
  function extractAllNUMGroups(MeasurementGroup, referencedSOPInstanceUID) {
4792
4627
  const numGroupsBySOPInstanceUID = {};
4793
4628
  if (MeasurementGroup.ContentSequence) {
@@ -4830,15 +4665,16 @@ function restoreAdditionalMetrics(numGroups) {
4830
4665
  radius: 'radiusUnit',
4831
4666
  width: 'widthUnit'
4832
4667
  };
4833
- for (const [codeMeaning, metricKey] of Object.entries(metricMapping)) {
4668
+ for (const _ref of Object.entries(metricMapping)) {
4669
+ var _ref2 = (0,slicedToArray/* default */.A)(_ref, 2);
4670
+ const codeMeaning = _ref2[0];
4671
+ const metricKey = _ref2[1];
4834
4672
  const group = numGroups[codeMeaning];
4835
4673
  if (!group) {
4836
4674
  continue;
4837
4675
  }
4838
- const {
4839
- value,
4840
- unit
4841
- } = group;
4676
+ const value = group.value,
4677
+ unit = group.unit;
4842
4678
  if (value == null) {
4843
4679
  continue;
4844
4680
  }
@@ -4873,21 +4709,19 @@ function restoreAdditionalMetrics(numGroups) {
4873
4709
 
4874
4710
 
4875
4711
 
4712
+
4876
4713
  var _CircleROI;
4877
4714
  function CircleROI_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4878
4715
  function CircleROI_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? CircleROI_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : CircleROI_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4879
- const {
4880
- Circle: CircleROI_TID300Circle
4881
- } = dcmjs_es/* utilities */.BF.TID300;
4716
+ const CircleROI_TID300Circle = dcmjs_es/* utilities */.BF.TID300.Circle;
4882
4717
  class CircleROI extends BaseAdapter3D {
4883
4718
  static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata) {
4884
- const {
4885
- state,
4886
- NUMGroup,
4887
- worldCoords,
4888
- referencedImageId,
4889
- ReferencedFrameNumber
4890
- } = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
4719
+ const _MeasurementReport$ge = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
4720
+ state = _MeasurementReport$ge.state,
4721
+ NUMGroup = _MeasurementReport$ge.NUMGroup,
4722
+ worldCoords = _MeasurementReport$ge.worldCoords,
4723
+ referencedImageId = _MeasurementReport$ge.referencedImageId,
4724
+ ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
4891
4725
  const referencedSOPInstanceUID = state.sopInstanceUid;
4892
4726
  const allNUMGroups = extractAllNUMGroups(MeasurementGroup, referencedSOPInstanceUID);
4893
4727
  const measurementNUMGroups = allNUMGroups[referencedSOPInstanceUID] || {};
@@ -4910,36 +4744,30 @@ class CircleROI extends BaseAdapter3D {
4910
4744
  }
4911
4745
  static getTID300RepresentationArguments(tool) {
4912
4746
  let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4913
- const {
4914
- data,
4915
- finding,
4916
- findingSites,
4917
- metadata
4918
- } = tool;
4919
- const {
4920
- cachedStats = {},
4921
- handles
4922
- } = data;
4923
- const {
4924
- referencedImageId
4925
- } = metadata;
4747
+ const data = tool.data,
4748
+ finding = tool.finding,
4749
+ findingSites = tool.findingSites,
4750
+ metadata = tool.metadata;
4751
+ const _data$cachedStats = data.cachedStats,
4752
+ cachedStats = _data$cachedStats === void 0 ? {} : _data$cachedStats,
4753
+ handles = data.handles;
4754
+ const referencedImageId = metadata.referencedImageId;
4926
4755
  const scoordProps = {
4927
4756
  is3DMeasurement,
4928
4757
  referencedImageId
4929
4758
  };
4930
4759
  const center = toScoord(scoordProps, handles.points[0]);
4931
4760
  const end = toScoord(scoordProps, handles.points[1]);
4932
- const {
4933
- area,
4934
- radius,
4935
- max,
4936
- min,
4937
- stdDev,
4938
- mean,
4939
- modalityUnit,
4940
- radiusUnit,
4941
- areaUnit
4942
- } = cachedStats["imageId:".concat(referencedImageId)] || {};
4761
+ const _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
4762
+ area = _ref.area,
4763
+ radius = _ref.radius,
4764
+ max = _ref.max,
4765
+ min = _ref.min,
4766
+ stdDev = _ref.stdDev,
4767
+ mean = _ref.mean,
4768
+ modalityUnit = _ref.modalityUnit,
4769
+ radiusUnit = _ref.radiusUnit,
4770
+ areaUnit = _ref.areaUnit;
4943
4771
  const perimeter = 2 * Math.PI * radius;
4944
4772
  return {
4945
4773
  area,
@@ -4978,21 +4806,19 @@ _CircleROI = CircleROI;
4978
4806
 
4979
4807
 
4980
4808
 
4809
+
4981
4810
  var _EllipticalROI;
4982
4811
  function EllipticalROI_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4983
4812
  function EllipticalROI_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? EllipticalROI_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : EllipticalROI_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4984
- const {
4985
- Ellipse: EllipticalROI_TID300Ellipse
4986
- } = dcmjs_es/* utilities */.BF.TID300;
4813
+ const EllipticalROI_TID300Ellipse = dcmjs_es/* utilities */.BF.TID300.Ellipse;
4987
4814
  class EllipticalROI extends BaseAdapter3D {
4988
4815
  static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata) {
4989
- const {
4990
- state,
4991
- NUMGroup,
4992
- worldCoords,
4993
- referencedImageId,
4994
- ReferencedFrameNumber
4995
- } = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, EllipticalROI.toolType);
4816
+ const _MeasurementReport$ge = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, EllipticalROI.toolType),
4817
+ state = _MeasurementReport$ge.state,
4818
+ NUMGroup = _MeasurementReport$ge.NUMGroup,
4819
+ worldCoords = _MeasurementReport$ge.worldCoords,
4820
+ referencedImageId = _MeasurementReport$ge.referencedImageId,
4821
+ ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
4996
4822
  const referencedSOPInstanceUID = state.sopInstanceUid;
4997
4823
  const allNUMGroups = extractAllNUMGroups(MeasurementGroup, referencedSOPInstanceUID);
4998
4824
  const measurementNUMGroups = allNUMGroups[referencedSOPInstanceUID] || {};
@@ -5011,20 +4837,15 @@ class EllipticalROI extends BaseAdapter3D {
5011
4837
  }
5012
4838
  static getTID300RepresentationArguments(tool) {
5013
4839
  let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
5014
- const {
5015
- data,
5016
- finding,
5017
- findingSites,
5018
- metadata
5019
- } = tool;
5020
- const {
5021
- cachedStats = {},
5022
- handles
5023
- } = data;
4840
+ const data = tool.data,
4841
+ finding = tool.finding,
4842
+ findingSites = tool.findingSites,
4843
+ metadata = tool.metadata;
4844
+ const _data$cachedStats = data.cachedStats,
4845
+ cachedStats = _data$cachedStats === void 0 ? {} : _data$cachedStats,
4846
+ handles = data.handles;
5024
4847
  const rotation = data.initialRotation || 0;
5025
- const {
5026
- referencedImageId
5027
- } = metadata;
4848
+ const referencedImageId = metadata.referencedImageId;
5028
4849
  const scoordProps = {
5029
4850
  is3DMeasurement,
5030
4851
  referencedImageId
@@ -5049,15 +4870,14 @@ class EllipticalROI extends BaseAdapter3D {
5049
4870
  } else {
5050
4871
  points.push(left, right, top, bottom);
5051
4872
  }
5052
- const {
5053
- area,
5054
- max,
5055
- min,
5056
- mean,
5057
- stdDev,
5058
- modalityUnit,
5059
- areaUnit
5060
- } = cachedStats["imageId:".concat(referencedImageId)] || {};
4873
+ const _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
4874
+ area = _ref.area,
4875
+ max = _ref.max,
4876
+ min = _ref.min,
4877
+ mean = _ref.mean,
4878
+ stdDev = _ref.stdDev,
4879
+ modalityUnit = _ref.modalityUnit,
4880
+ areaUnit = _ref.areaUnit;
5061
4881
  const convertedPoints = points.map(point => toScoord(scoordProps, point));
5062
4882
  return {
5063
4883
  area,
@@ -5090,12 +4910,11 @@ _EllipticalROI.init('EllipticalROI', EllipticalROI_TID300Ellipse);
5090
4910
 
5091
4911
 
5092
4912
 
4913
+
5093
4914
  var _RectangleROI;
5094
4915
  function RectangleROI_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5095
4916
  function RectangleROI_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? RectangleROI_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : RectangleROI_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5096
- const {
5097
- Polyline: RectangleROI_TID300Polyline
5098
- } = dcmjs_es/* utilities */.BF.TID300;
4917
+ const RectangleROI_TID300Polyline = dcmjs_es/* utilities */.BF.TID300.Polyline;
5099
4918
  class RectangleROI extends BaseAdapter3D {
5100
4919
  static isValidMeasurement(measurement) {
5101
4920
  const graphicItem = this.getGraphicItem(measurement);
@@ -5104,12 +4923,11 @@ class RectangleROI extends BaseAdapter3D {
5104
4923
  }
5105
4924
  static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata) {
5106
4925
  var _areaGroup$MeasuredVa, _areaGroup$MeasuredVa2;
5107
- const {
5108
- state,
5109
- worldCoords,
5110
- referencedImageId,
5111
- ReferencedFrameNumber
5112
- } = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
4926
+ const _MeasurementReport$ge = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
4927
+ state = _MeasurementReport$ge.state,
4928
+ worldCoords = _MeasurementReport$ge.worldCoords,
4929
+ referencedImageId = _MeasurementReport$ge.referencedImageId,
4930
+ ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
5113
4931
  const points = worldCoords.length === 5 ? worldCoords.slice(0, 4) : worldCoords;
5114
4932
  const areaGroup = MeasurementGroup.ContentSequence.find(g => g.ValueType === 'NUM' && g.ConceptNameCodeSequence.CodeMeaning === 'Area');
5115
4933
  const referencedSOPInstanceUID = state.sopInstanceUid;
@@ -5133,29 +4951,24 @@ class RectangleROI extends BaseAdapter3D {
5133
4951
  }
5134
4952
  static getTID300RepresentationArguments(tool) {
5135
4953
  let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
5136
- const {
5137
- data,
5138
- finding,
5139
- findingSites,
5140
- metadata
5141
- } = tool;
5142
- const {
5143
- referencedImageId
5144
- } = metadata;
4954
+ const data = tool.data,
4955
+ finding = tool.finding,
4956
+ findingSites = tool.findingSites,
4957
+ metadata = tool.metadata;
4958
+ const referencedImageId = metadata.referencedImageId;
5145
4959
  const scoordProps = {
5146
4960
  is3DMeasurement,
5147
4961
  referencedImageId
5148
4962
  };
5149
4963
  const corners = toScoords(scoordProps, data.handles.points);
5150
- const {
5151
- area,
5152
- perimeter,
5153
- max,
5154
- mean,
5155
- stdDev,
5156
- areaUnit,
5157
- modalityUnit
5158
- } = data.cachedStats["imageId:".concat(referencedImageId)] || {};
4964
+ const _ref = data.cachedStats["imageId:".concat(referencedImageId)] || {},
4965
+ area = _ref.area,
4966
+ perimeter = _ref.perimeter,
4967
+ max = _ref.max,
4968
+ mean = _ref.mean,
4969
+ stdDev = _ref.stdDev,
4970
+ areaUnit = _ref.areaUnit,
4971
+ modalityUnit = _ref.modalityUnit;
5159
4972
  return {
5160
4973
  points: [corners[0], corners[1], corners[3], corners[2], corners[0]],
5161
4974
  area,
@@ -5190,22 +5003,20 @@ _RectangleROI = RectangleROI;
5190
5003
 
5191
5004
 
5192
5005
 
5006
+
5193
5007
  var _Length;
5194
5008
  function Length_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5195
5009
  function Length_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Length_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Length_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5196
- const {
5197
- Length: Length_TID300Length
5198
- } = dcmjs_es/* utilities */.BF.TID300;
5010
+ const Length_TID300Length = dcmjs_es/* utilities */.BF.TID300.Length;
5199
5011
  const Length_LENGTH = 'Length';
5200
5012
  class Length_Length extends BaseAdapter3D {
5201
5013
  static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata) {
5202
- const {
5203
- state,
5204
- NUMGroup,
5205
- worldCoords,
5206
- referencedImageId,
5207
- ReferencedFrameNumber
5208
- } = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
5014
+ const _MeasurementReport$ge = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
5015
+ state = _MeasurementReport$ge.state,
5016
+ NUMGroup = _MeasurementReport$ge.NUMGroup,
5017
+ worldCoords = _MeasurementReport$ge.worldCoords,
5018
+ referencedImageId = _MeasurementReport$ge.referencedImageId,
5019
+ ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
5209
5020
  const cachedStats = referencedImageId ? {
5210
5021
  ["imageId:".concat(referencedImageId)]: {
5211
5022
  length: NUMGroup ? NUMGroup.MeasuredValueSequence.NumericValue : 0,
@@ -5224,28 +5035,22 @@ class Length_Length extends BaseAdapter3D {
5224
5035
  }
5225
5036
  static getTID300RepresentationArguments(tool) {
5226
5037
  let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
5227
- const {
5228
- data,
5229
- finding,
5230
- findingSites,
5231
- metadata
5232
- } = tool;
5233
- const {
5234
- cachedStats = {},
5235
- handles
5236
- } = data;
5237
- const {
5238
- referencedImageId
5239
- } = metadata;
5038
+ const data = tool.data,
5039
+ finding = tool.finding,
5040
+ findingSites = tool.findingSites,
5041
+ metadata = tool.metadata;
5042
+ const _data$cachedStats = data.cachedStats,
5043
+ cachedStats = _data$cachedStats === void 0 ? {} : _data$cachedStats,
5044
+ handles = data.handles;
5045
+ const referencedImageId = metadata.referencedImageId;
5240
5046
  const scoordProps = {
5241
5047
  is3DMeasurement,
5242
5048
  referencedImageId
5243
5049
  };
5244
5050
  const point1 = toScoord(scoordProps, handles.points[0]);
5245
5051
  const point2 = toScoord(scoordProps, handles.points[1]);
5246
- const {
5247
- length: distance
5248
- } = cachedStats["imageId:".concat(referencedImageId)] || {};
5052
+ const _ref = cachedStats["imageId:".concat(referencedImageId)] || {},
5053
+ distance = _ref.length;
5249
5054
  return {
5250
5055
  point1,
5251
5056
  point2,
@@ -5271,23 +5076,18 @@ var gl_matrix_esm = __webpack_require__(3823);
5271
5076
 
5272
5077
 
5273
5078
 
5274
- const {
5275
- valueTypes: ControlPointPolyline_valueTypes
5276
- } = dcmjs_es.sr;
5277
- const {
5278
- Polyline: ControlPointPolyline_TID300Polyline
5279
- } = dcmjs_es/* utilities */.BF.TID300;
5079
+ const ControlPointPolyline_valueTypes = dcmjs_es.sr.valueTypes;
5080
+ const ControlPointPolyline_TID300Polyline = dcmjs_es/* utilities */.BF.TID300.Polyline;
5280
5081
  class ControlPointPolyline extends ControlPointPolyline_TID300Polyline {
5281
5082
  contentItem() {
5282
5083
  const contentEntries = super.contentItem();
5283
5084
  const self = this;
5284
- const {
5285
- controlPoints,
5286
- use3DSpatialCoordinates,
5287
- ReferencedSOPSequence,
5288
- ReferencedFrameOfReferenceUID,
5289
- use3DSpatialCoordinates: is3DMeasurement
5290
- } = self.props;
5085
+ const _self$props = self.props,
5086
+ controlPoints = _self$props.controlPoints,
5087
+ use3DSpatialCoordinates = _self$props.use3DSpatialCoordinates,
5088
+ ReferencedSOPSequence = _self$props.ReferencedSOPSequence,
5089
+ ReferencedFrameOfReferenceUID = _self$props.ReferencedFrameOfReferenceUID,
5090
+ is3DMeasurement = _self$props.use3DSpatialCoordinates;
5291
5091
  if (!(controlPoints !== null && controlPoints !== void 0 && controlPoints.length)) {
5292
5092
  return contentEntries;
5293
5093
  }
@@ -5328,9 +5128,7 @@ class ControlPointPolyline extends ControlPointPolyline_TID300Polyline {
5328
5128
  ReferencedSOPSequence
5329
5129
  }]
5330
5130
  };
5331
- const {
5332
- splineType
5333
- } = self.props;
5131
+ const splineType = self.props.splineType;
5334
5132
  const entries = contentEntries;
5335
5133
  const numEntry = entries.find(e => e.ValueType === 'NUM');
5336
5134
  if (numEntry) {
@@ -5380,13 +5178,12 @@ function PlanarFreehandROI_objectSpread(e) { for (var r = 1; r < arguments.lengt
5380
5178
  class PlanarFreehandROI extends BaseAdapter3D {
5381
5179
  static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata) {
5382
5180
  var _state$annotation$dat, _state$annotation$dat2, _numSeq$find;
5383
- const {
5384
- state,
5385
- NUMGroup,
5386
- worldCoords,
5387
- referencedImageId,
5388
- ReferencedFrameNumber
5389
- } = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
5181
+ const _MeasurementReport$ge = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
5182
+ state = _MeasurementReport$ge.state,
5183
+ NUMGroup = _MeasurementReport$ge.NUMGroup,
5184
+ worldCoords = _MeasurementReport$ge.worldCoords,
5185
+ referencedImageId = _MeasurementReport$ge.referencedImageId,
5186
+ ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
5390
5187
  const distanceBetweenFirstAndLastPoint = gl_matrix_esm/* vec3.distance */.eR.distance(worldCoords[worldCoords.length - 1], worldCoords[0]);
5391
5188
  let isOpenContour = true;
5392
5189
  if (distanceBetweenFirstAndLastPoint < this.closedContourThreshold) {
@@ -5433,23 +5230,16 @@ class PlanarFreehandROI extends BaseAdapter3D {
5433
5230
  static getTID300RepresentationArguments(tool) {
5434
5231
  var _handles$points, _data$spline;
5435
5232
  let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
5436
- const {
5437
- data,
5438
- finding,
5439
- findingSites,
5440
- metadata
5441
- } = tool;
5442
- const {
5443
- handles
5444
- } = data;
5445
- const {
5446
- polyline,
5447
- closed
5448
- } = data.contour;
5233
+ const data = tool.data,
5234
+ finding = tool.finding,
5235
+ findingSites = tool.findingSites,
5236
+ metadata = tool.metadata;
5237
+ const handles = data.handles;
5238
+ const _data$contour = data.contour,
5239
+ polyline = _data$contour.polyline,
5240
+ closed = _data$contour.closed;
5449
5241
  const isOpenContour = closed !== true;
5450
- const {
5451
- referencedImageId
5452
- } = metadata;
5242
+ const referencedImageId = metadata.referencedImageId;
5453
5243
  const scoordProps = {
5454
5244
  is3DMeasurement,
5455
5245
  referencedImageId
@@ -5460,16 +5250,15 @@ class PlanarFreehandROI extends BaseAdapter3D {
5460
5250
  points.push(firstPoint);
5461
5251
  }
5462
5252
  const controlPoints = (handles === null || handles === void 0 || (_handles$points = handles.points) === null || _handles$points === void 0 ? void 0 : _handles$points.length) && toScoords(scoordProps, handles.points);
5463
- const {
5464
- area,
5465
- areaUnit,
5466
- modalityUnit,
5467
- perimeter,
5468
- mean,
5469
- max,
5470
- stdDev,
5471
- length
5472
- } = data.cachedStats["imageId:".concat(referencedImageId)] || {};
5253
+ const _ref = data.cachedStats["imageId:".concat(referencedImageId)] || {},
5254
+ area = _ref.area,
5255
+ areaUnit = _ref.areaUnit,
5256
+ modalityUnit = _ref.modalityUnit,
5257
+ perimeter = _ref.perimeter,
5258
+ mean = _ref.mean,
5259
+ max = _ref.max,
5260
+ stdDev = _ref.stdDev,
5261
+ length = _ref.length;
5473
5262
  return {
5474
5263
  points,
5475
5264
  controlPoints,
@@ -5507,12 +5296,11 @@ _PlanarFreehandROI.closedContourThreshold = 1e-5;
5507
5296
 
5508
5297
 
5509
5298
 
5299
+
5510
5300
  var _Probe;
5511
5301
  function Probe_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5512
5302
  function Probe_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Probe_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Probe_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5513
- const {
5514
- Point: Probe_TID300Point
5515
- } = dcmjs_es/* utilities */.BF.TID300;
5303
+ const Probe_TID300Point = dcmjs_es/* utilities */.BF.TID300.Point;
5516
5304
  class Probe extends BaseAdapter3D {
5517
5305
  static isValidMeasurement(measurement) {
5518
5306
  const graphicItem = this.getGraphicItem(measurement);
@@ -5520,13 +5308,12 @@ class Probe extends BaseAdapter3D {
5520
5308
  }
5521
5309
  static getMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, _trackingIdentifier) {
5522
5310
  var _NUMGroup$MeasuredVal, _NUMGroup$MeasuredVal2;
5523
- const {
5524
- state,
5525
- NUMGroup,
5526
- worldCoords,
5527
- referencedImageId,
5528
- ReferencedFrameNumber
5529
- } = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
5311
+ const _MeasurementReport$ge = MeasurementReport_MeasurementReport.getSetupMeasurementData(MeasurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
5312
+ state = _MeasurementReport$ge.state,
5313
+ NUMGroup = _MeasurementReport$ge.NUMGroup,
5314
+ worldCoords = _MeasurementReport$ge.worldCoords,
5315
+ referencedImageId = _MeasurementReport$ge.referencedImageId,
5316
+ ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
5530
5317
  const cachedStats = referencedImageId ? {
5531
5318
  ["imageId:".concat(referencedImageId)]: {
5532
5319
  value: (_NUMGroup$MeasuredVal = NUMGroup === null || NUMGroup === void 0 || (_NUMGroup$MeasuredVal2 = NUMGroup.MeasuredValueSequence) === null || _NUMGroup$MeasuredVal2 === void 0 ? void 0 : _NUMGroup$MeasuredVal2.NumericValue) !== null && _NUMGroup$MeasuredVal !== void 0 ? _NUMGroup$MeasuredVal : null
@@ -5544,26 +5331,17 @@ class Probe extends BaseAdapter3D {
5544
5331
  }
5545
5332
  static getTID300RepresentationArguments(tool) {
5546
5333
  let is3DMeasurement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
5547
- const {
5548
- data,
5549
- metadata
5550
- } = tool;
5551
- const {
5552
- finding,
5553
- findingSites
5554
- } = tool;
5555
- const {
5556
- referencedImageId
5557
- } = metadata;
5334
+ const data = tool.data,
5335
+ metadata = tool.metadata;
5336
+ const finding = tool.finding,
5337
+ findingSites = tool.findingSites;
5338
+ const referencedImageId = metadata.referencedImageId;
5558
5339
  const scoordProps = {
5559
5340
  is3DMeasurement,
5560
5341
  referencedImageId
5561
5342
  };
5562
- const {
5563
- handles: {
5564
- points = []
5565
- }
5566
- } = data;
5343
+ const _data$handles$points = data.handles.points,
5344
+ points = _data$handles$points === void 0 ? [] : _data$handles$points;
5567
5345
  const pointsImage = toScoords(scoordProps, points);
5568
5346
  return {
5569
5347
  points: pointsImage,
@@ -5595,19 +5373,14 @@ _Probe = Probe;
5595
5373
  var _UltrasoundDirectional;
5596
5374
  function UltrasoundDirectional_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5597
5375
  function UltrasoundDirectional_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? UltrasoundDirectional_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : UltrasoundDirectional_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5598
- const {
5599
- Length: UltrasoundDirectional_TID300Length
5600
- } = dcmjs_es/* utilities */.BF.TID300;
5601
- const {
5602
- worldToImageCoords
5603
- } = esm.utilities;
5376
+ const UltrasoundDirectional_TID300Length = dcmjs_es/* utilities */.BF.TID300.Length;
5377
+ const worldToImageCoords = esm.utilities.worldToImageCoords;
5604
5378
  class UltrasoundDirectional extends BaseAdapter3D {
5605
5379
  static getMeasurementData(measurementGroup, sopInstanceUIDToImageIdMap, metadata) {
5606
- const {
5607
- state,
5608
- worldCoords,
5609
- ReferencedFrameNumber
5610
- } = MeasurementReport_MeasurementReport.getSetupMeasurementData(measurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType);
5380
+ const _MeasurementReport$ge = MeasurementReport_MeasurementReport.getSetupMeasurementData(measurementGroup, sopInstanceUIDToImageIdMap, metadata, this.toolType),
5381
+ state = _MeasurementReport$ge.state,
5382
+ worldCoords = _MeasurementReport$ge.worldCoords,
5383
+ ReferencedFrameNumber = _MeasurementReport$ge.ReferencedFrameNumber;
5611
5384
  state.annotation.data = UltrasoundDirectional_objectSpread(UltrasoundDirectional_objectSpread({}, state.annotation.data), {}, {
5612
5385
  handles: UltrasoundDirectional_objectSpread(UltrasoundDirectional_objectSpread({}, state.annotation.data.handles), {}, {
5613
5386
  points: worldCoords
@@ -5617,18 +5390,12 @@ class UltrasoundDirectional extends BaseAdapter3D {
5617
5390
  return state;
5618
5391
  }
5619
5392
  static getTID300RepresentationArguments(tool, is3DMeasurement) {
5620
- const {
5621
- data,
5622
- finding,
5623
- findingSites,
5624
- metadata
5625
- } = tool;
5626
- const {
5627
- handles
5628
- } = data;
5629
- const {
5630
- referencedImageId
5631
- } = metadata;
5393
+ const data = tool.data,
5394
+ finding = tool.finding,
5395
+ findingSites = tool.findingSites,
5396
+ metadata = tool.metadata;
5397
+ const handles = data.handles;
5398
+ const referencedImageId = metadata.referencedImageId;
5632
5399
  if (!referencedImageId) {
5633
5400
  throw new Error('UltrasoundDirectionalTool.getTID300RepresentationArguments: referencedImageId is not defined');
5634
5401
  }
@@ -5664,15 +5431,9 @@ _UltrasoundDirectional.init('UltrasoundDirectionalTool', UltrasoundDirectional_T
5664
5431
 
5665
5432
  function generateSegmentation_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5666
5433
  function generateSegmentation_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? generateSegmentation_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : generateSegmentation_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5667
- const {
5668
- MetadataModules: generateSegmentation_MetadataModules
5669
- } = esm.Enums;
5670
- const {
5671
- SEGImageNormalizer
5672
- } = dcmjs_es/* normalizers */.z8;
5673
- const {
5674
- Segmentation: generateSegmentation_SegmentationDerivation
5675
- } = dcmjs_es/* derivations */.h4;
5434
+ const generateSegmentation_MetadataModules = esm.Enums.MetadataModules;
5435
+ const SEGImageNormalizer = dcmjs_es/* normalizers */.z8.SEGImageNormalizer;
5436
+ const generateSegmentation_SegmentationDerivation = dcmjs_es/* derivations */.h4.Segmentation;
5676
5437
  function generateSegmentation_generateSegmentation(images, labelmaps, metadata) {
5677
5438
  let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
5678
5439
  const segmentation = _createMultiframeSegmentationFromReferencedImages(images, metadata, options);
@@ -5688,9 +5449,7 @@ function _createMultiframeSegmentationFromReferencedImages(images, metadata, opt
5688
5449
  const studyImageId = (options === null || options === void 0 ? void 0 : options.predecessorImageId) || images[0].imageId;
5689
5450
  const studyData = metadata.get(generateSegmentation_MetadataModules.STUDY_DATA, studyImageId);
5690
5451
  const datasets = images.map(image => {
5691
- const {
5692
- imageId
5693
- } = image;
5452
+ const imageId = image.imageId;
5694
5453
  const seriesData = metadata.get(generateSegmentation_MetadataModules.SERIES_DATA, imageId);
5695
5454
  const imageData = metadata.get(generateSegmentation_MetadataModules.IMAGE_DATA, imageId);
5696
5455
  return generateSegmentation_objectSpread(generateSegmentation_objectSpread(generateSegmentation_objectSpread(generateSegmentation_objectSpread({}, studyData), seriesData), imageData), {}, {
@@ -5708,9 +5467,7 @@ function _createMultiframeSegmentationFromReferencedImages(images, metadata, opt
5708
5467
  }
5709
5468
  const normalizer = new SEGImageNormalizer(datasets);
5710
5469
  normalizer.normalize();
5711
- const {
5712
- dataset: multiframe
5713
- } = normalizer;
5470
+ const multiframe = normalizer.dataset;
5714
5471
  if (!multiframe) {
5715
5472
  throw new Error('Failed to normalize the multiframe dataset, the data is not multi-frame.');
5716
5473
  }
@@ -5735,10 +5492,8 @@ function _createMultiframeSegmentationFromReferencedImages(images, metadata, opt
5735
5492
 
5736
5493
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/Segmentation/generateLabelMaps2DFrom3D.js
5737
5494
  function generateLabelMaps2DFrom3D(labelmap3D) {
5738
- const {
5739
- scalarData,
5740
- dimensions
5741
- } = labelmap3D;
5495
+ const scalarData = labelmap3D.scalarData,
5496
+ dimensions = labelmap3D.dimensions;
5742
5497
  const labelmaps2D = [];
5743
5498
  const segmentsOnLabelmap3D = new Set();
5744
5499
  for (let z = 0; z < dimensions[2]; z++) {
@@ -5775,11 +5530,9 @@ function generateLabelMaps2DFrom3D(labelmap3D) {
5775
5530
  var dist_esm = __webpack_require__(4667);
5776
5531
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/Segmentation/compactMergeSegData.js
5777
5532
  const checkHasOverlapping = _ref => {
5778
- let {
5779
- largerArray,
5780
- currentTestedArray,
5781
- newArray
5782
- } = _ref;
5533
+ let largerArray = _ref.largerArray,
5534
+ currentTestedArray = _ref.currentTestedArray,
5535
+ newArray = _ref.newArray;
5783
5536
  return largerArray.some((_, currentImageIndex) => {
5784
5537
  const originalImagePixelData = currentTestedArray[currentImageIndex];
5785
5538
  const newImagePixelData = newArray[currentImageIndex];
@@ -5793,10 +5546,8 @@ const checkHasOverlapping = _ref => {
5793
5546
  });
5794
5547
  };
5795
5548
  const compactMergeSegmentDataWithoutInformationLoss = _ref2 => {
5796
- let {
5797
- arrayOfSegmentData,
5798
- newSegmentData
5799
- } = _ref2;
5549
+ let arrayOfSegmentData = _ref2.arrayOfSegmentData,
5550
+ newSegmentData = _ref2.newSegmentData;
5800
5551
  if (arrayOfSegmentData.length === 0) {
5801
5552
  arrayOfSegmentData.push(newSegmentData);
5802
5553
  return;
@@ -5846,34 +5597,24 @@ const compactMergeSegmentDataWithoutInformationLoss = _ref2 => {
5846
5597
 
5847
5598
 
5848
5599
 
5849
- const {
5850
- DicomMessage: labelmapImagesFromBuffer_DicomMessage,
5851
- DicomMetaDictionary: labelmapImagesFromBuffer_DicomMetaDictionary
5852
- } = dcmjs_es/* data */.p;
5853
- const {
5854
- Normalizer: labelmapImagesFromBuffer_Normalizer
5855
- } = dcmjs_es/* normalizers */.z8;
5856
- const {
5857
- decode: labelmapImagesFromBuffer_decode
5858
- } = dcmjs_es/* utilities */.BF.compression;
5600
+ const labelmapImagesFromBuffer_DicomMessage = dcmjs_es/* data */.p.DicomMessage,
5601
+ labelmapImagesFromBuffer_DicomMetaDictionary = dcmjs_es/* data */.p.DicomMetaDictionary;
5602
+ const labelmapImagesFromBuffer_Normalizer = dcmjs_es/* normalizers */.z8.Normalizer;
5603
+ const labelmapImagesFromBuffer_decode = dcmjs_es/* utilities */.BF.compression.decode;
5859
5604
  const updateSegmentsOnFrame = _ref => {
5860
- let {
5861
- segmentsOnFrame,
5862
- imageIdIndex,
5863
- segmentIndex
5864
- } = _ref;
5605
+ let segmentsOnFrame = _ref.segmentsOnFrame,
5606
+ imageIdIndex = _ref.imageIdIndex,
5607
+ segmentIndex = _ref.segmentIndex;
5865
5608
  if (!segmentsOnFrame[imageIdIndex]) {
5866
5609
  segmentsOnFrame[imageIdIndex] = [];
5867
5610
  }
5868
5611
  segmentsOnFrame[imageIdIndex].push(segmentIndex);
5869
5612
  };
5870
5613
  const updateSegmentsPixelIndices = _ref2 => {
5871
- let {
5872
- segmentsPixelIndices,
5873
- segmentIndex,
5874
- imageIdIndex,
5875
- indexCache
5876
- } = _ref2;
5614
+ let segmentsPixelIndices = _ref2.segmentsPixelIndices,
5615
+ segmentIndex = _ref2.segmentIndex,
5616
+ imageIdIndex = _ref2.imageIdIndex,
5617
+ indexCache = _ref2.indexCache;
5877
5618
  if (!segmentsPixelIndices.has(segmentIndex)) {
5878
5619
  segmentsPixelIndices.set(segmentIndex, {});
5879
5620
  }
@@ -5882,12 +5623,10 @@ const updateSegmentsPixelIndices = _ref2 => {
5882
5623
  segmentsPixelIndices.set(segmentIndex, segmentIndexObject);
5883
5624
  };
5884
5625
  const extractInfoFromPerFrameFunctionalGroups = _ref3 => {
5885
- let {
5886
- PerFrameFunctionalGroups,
5887
- sequenceIndex,
5888
- sopUIDImageIdIndexMap,
5889
- multiframe
5890
- } = _ref3;
5626
+ let PerFrameFunctionalGroups = _ref3.PerFrameFunctionalGroups,
5627
+ sequenceIndex = _ref3.sequenceIndex,
5628
+ sopUIDImageIdIndexMap = _ref3.sopUIDImageIdIndexMap,
5629
+ multiframe = _ref3.multiframe;
5891
5630
  const referencedSOPInstanceUid = PerFrameFunctionalGroups.DerivationImageSequence[0].SourceImageSequence[0].ReferencedSOPInstanceUID;
5892
5631
  const referencedImageId = sopUIDImageIdIndexMap[referencedSOPInstanceUid];
5893
5632
  const segmentIndex = getSegmentIndex(multiframe, sequenceIndex);
@@ -5898,11 +5637,12 @@ const extractInfoFromPerFrameFunctionalGroups = _ref3 => {
5898
5637
  };
5899
5638
  };
5900
5639
  async function createLabelmapsFromBufferInternal(referencedImageIds, arrayBuffer, metadataProvider, options) {
5901
- const {
5902
- tolerance = 1e-3,
5903
- TypedArrayConstructor = Uint8Array,
5904
- maxBytesPerChunk = 199000000
5905
- } = options;
5640
+ const _options$tolerance = options.tolerance,
5641
+ tolerance = _options$tolerance === void 0 ? 1e-3 : _options$tolerance,
5642
+ _options$TypedArrayCo = options.TypedArrayConstructor,
5643
+ TypedArrayConstructor = _options$TypedArrayCo === void 0 ? Uint8Array : _options$TypedArrayCo,
5644
+ _options$maxBytesPerC = options.maxBytesPerChunk,
5645
+ maxBytesPerChunk = _options$maxBytesPerC === void 0 ? 199000000 : _options$maxBytesPerC;
5906
5646
  const dicomData = labelmapImagesFromBuffer_DicomMessage.readFile(arrayBuffer);
5907
5647
  const dataset = labelmapImagesFromBuffer_DicomMetaDictionary.naturalizeDataset(dicomData.dict);
5908
5648
  dataset._meta = labelmapImagesFromBuffer_DicomMetaDictionary.namifyDataset(dicomData.meta);
@@ -5937,9 +5677,8 @@ async function createLabelmapsFromBufferInternal(referencedImageIds, arrayBuffer
5937
5677
  }
5938
5678
  const orientation = checkOrientation(multiframe, validOrientations, [imagePlaneModule.rows, imagePlaneModule.columns, referencedImageIds.length], tolerance);
5939
5679
  const sopUIDImageIdIndexMap = referencedImageIds.reduce((acc, imageId) => {
5940
- const {
5941
- sopInstanceUID
5942
- } = metadataProvider.get('generalImageModule', imageId);
5680
+ const _metadataProvider$get = metadataProvider.get('generalImageModule', imageId),
5681
+ sopInstanceUID = _metadataProvider$get.sopInstanceUID;
5943
5682
  acc[sopInstanceUID] = imageId;
5944
5683
  return acc;
5945
5684
  }, {});
@@ -5967,23 +5706,22 @@ async function createLabelmapsFromBufferInternal(referencedImageIds, arrayBuffer
5967
5706
  labelMapImages.push(labelMapImage);
5968
5707
  }
5969
5708
  const segmentsPixelIndices = new Map();
5970
- const {
5971
- hasOverlappingSegments,
5972
- arrayOfLabelMapImages
5973
- } = await insertFunction({
5974
- segmentsOnFrame,
5975
- labelMapImages,
5976
- pixelDataChunks,
5977
- multiframe,
5978
- referencedImageIds,
5979
- validOrientations,
5980
- metadataProvider,
5981
- tolerance,
5982
- segmentsPixelIndices,
5983
- sopUIDImageIdIndexMap,
5984
- imageIdMaps,
5985
- TypedArrayConstructor
5986
- });
5709
+ const _await$insertFunction = await insertFunction({
5710
+ segmentsOnFrame,
5711
+ labelMapImages,
5712
+ pixelDataChunks,
5713
+ multiframe,
5714
+ referencedImageIds,
5715
+ validOrientations,
5716
+ metadataProvider,
5717
+ tolerance,
5718
+ segmentsPixelIndices,
5719
+ sopUIDImageIdIndexMap,
5720
+ imageIdMaps,
5721
+ TypedArrayConstructor
5722
+ }),
5723
+ hasOverlappingSegments = _await$insertFunction.hasOverlappingSegments,
5724
+ arrayOfLabelMapImages = _await$insertFunction.arrayOfLabelMapImages;
5987
5725
  const centroidXYZ = new Map();
5988
5726
  segmentsPixelIndices.forEach((imageIdIndexBufferIndex, segmentIndex) => {
5989
5727
  const centroids = calculateCentroid(imageIdIndexBufferIndex, multiframe, metadataProvider, referencedImageIds);
@@ -6003,25 +5741,21 @@ const throttledTriggerLoadProgressEvent = dist_esm.utilities.throttle(percentCom
6003
5741
  });
6004
5742
  }, 200);
6005
5743
  function labelmapImagesFromBuffer_insertPixelDataPlanar(_ref4) {
6006
- let {
6007
- segmentsOnFrame,
6008
- labelMapImages,
6009
- pixelDataChunks,
6010
- multiframe,
6011
- referencedImageIds,
6012
- validOrientations,
6013
- metadataProvider,
6014
- tolerance,
6015
- segmentsPixelIndices,
6016
- sopUIDImageIdIndexMap,
6017
- imageIdMaps
6018
- } = _ref4;
6019
- const {
6020
- SharedFunctionalGroupsSequence,
6021
- PerFrameFunctionalGroupsSequence,
6022
- Rows,
6023
- Columns
6024
- } = multiframe;
5744
+ let segmentsOnFrame = _ref4.segmentsOnFrame,
5745
+ labelMapImages = _ref4.labelMapImages,
5746
+ pixelDataChunks = _ref4.pixelDataChunks,
5747
+ multiframe = _ref4.multiframe,
5748
+ referencedImageIds = _ref4.referencedImageIds,
5749
+ validOrientations = _ref4.validOrientations,
5750
+ metadataProvider = _ref4.metadataProvider,
5751
+ tolerance = _ref4.tolerance,
5752
+ segmentsPixelIndices = _ref4.segmentsPixelIndices,
5753
+ sopUIDImageIdIndexMap = _ref4.sopUIDImageIdIndexMap,
5754
+ imageIdMaps = _ref4.imageIdMaps;
5755
+ const SharedFunctionalGroupsSequence = multiframe.SharedFunctionalGroupsSequence,
5756
+ PerFrameFunctionalGroupsSequence = multiframe.PerFrameFunctionalGroupsSequence,
5757
+ Rows = multiframe.Rows,
5758
+ Columns = multiframe.Columns;
6025
5759
  const sharedImageOrientationPatient = SharedFunctionalGroupsSequence.PlaneOrientationSequence ? SharedFunctionalGroupsSequence.PlaneOrientationSequence.ImageOrientationPatient : undefined;
6026
5760
  const sliceLength = Columns * Rows;
6027
5761
  const groupsLen = PerFrameFunctionalGroupsSequence.length;
@@ -6181,17 +5915,15 @@ function labelmapImagesFromBuffer_insertPixelDataPlanar(_ref4) {
6181
5915
  });
6182
5916
  }
6183
5917
  const getAlignedPixelData = _ref5 => {
6184
- let {
6185
- sharedImageOrientationPatient,
6186
- PerFrameFunctionalGroups,
6187
- pixelDataChunks,
6188
- sequenceIndex,
6189
- sliceLength,
6190
- Rows,
6191
- Columns,
6192
- validOrientations,
6193
- tolerance
6194
- } = _ref5;
5918
+ let sharedImageOrientationPatient = _ref5.sharedImageOrientationPatient,
5919
+ PerFrameFunctionalGroups = _ref5.PerFrameFunctionalGroups,
5920
+ pixelDataChunks = _ref5.pixelDataChunks,
5921
+ sequenceIndex = _ref5.sequenceIndex,
5922
+ sliceLength = _ref5.sliceLength,
5923
+ Rows = _ref5.Rows,
5924
+ Columns = _ref5.Columns,
5925
+ validOrientations = _ref5.validOrientations,
5926
+ tolerance = _ref5.tolerance;
6195
5927
  const ImageOrientationPatientI = sharedImageOrientationPatient || PerFrameFunctionalGroups.PlaneOrientationSequence.ImageOrientationPatient;
6196
5928
  const view = readFromUnpackedChunks(pixelDataChunks, sequenceIndex * sliceLength, sliceLength);
6197
5929
  const pixelDataI2D = ndarray_default()(view, [Rows, Columns]);
@@ -6202,22 +5934,18 @@ const getAlignedPixelData = _ref5 => {
6202
5934
  return alignedPixelDataI;
6203
5935
  };
6204
5936
  const checkImageDimensions = _ref6 => {
6205
- let {
6206
- metadataProvider,
6207
- imageId,
6208
- Rows,
6209
- Columns
6210
- } = _ref6;
5937
+ let metadataProvider = _ref6.metadataProvider,
5938
+ imageId = _ref6.imageId,
5939
+ Rows = _ref6.Rows,
5940
+ Columns = _ref6.Columns;
6211
5941
  const sourceImageMetadata = metadataProvider.get('instance', imageId);
6212
5942
  if (Rows !== sourceImageMetadata.Rows || Columns !== sourceImageMetadata.Columns) {
6213
5943
  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. ');
6214
5944
  }
6215
5945
  };
6216
5946
  const getArrayOfLabelMapImagesWithSegmentData = _ref7 => {
6217
- let {
6218
- arrayOfSegmentData,
6219
- referencedImageIds
6220
- } = _ref7;
5947
+ let arrayOfSegmentData = _ref7.arrayOfSegmentData,
5948
+ referencedImageIds = _ref7.referencedImageIds;
6221
5949
  let largestArray = [];
6222
5950
  for (let i = 0; i < arrayOfSegmentData.length; i++) {
6223
5951
  const segmentData = arrayOfSegmentData[i];
@@ -6241,25 +5969,21 @@ const getArrayOfLabelMapImagesWithSegmentData = _ref7 => {
6241
5969
  });
6242
5970
  };
6243
5971
  function labelmapImagesFromBuffer_insertOverlappingPixelDataPlanar(_ref8) {
6244
- let {
6245
- segmentsOnFrame,
6246
- labelMapImages,
6247
- pixelDataChunks,
6248
- multiframe,
6249
- referencedImageIds,
6250
- validOrientations,
6251
- metadataProvider,
6252
- tolerance,
6253
- segmentsPixelIndices,
6254
- sopUIDImageIdIndexMap,
6255
- imageIdMaps
6256
- } = _ref8;
6257
- const {
6258
- SharedFunctionalGroupsSequence,
6259
- PerFrameFunctionalGroupsSequence,
6260
- Rows,
6261
- Columns
6262
- } = multiframe;
5972
+ let segmentsOnFrame = _ref8.segmentsOnFrame,
5973
+ labelMapImages = _ref8.labelMapImages,
5974
+ pixelDataChunks = _ref8.pixelDataChunks,
5975
+ multiframe = _ref8.multiframe,
5976
+ referencedImageIds = _ref8.referencedImageIds,
5977
+ validOrientations = _ref8.validOrientations,
5978
+ metadataProvider = _ref8.metadataProvider,
5979
+ tolerance = _ref8.tolerance,
5980
+ segmentsPixelIndices = _ref8.segmentsPixelIndices,
5981
+ sopUIDImageIdIndexMap = _ref8.sopUIDImageIdIndexMap,
5982
+ imageIdMaps = _ref8.imageIdMaps;
5983
+ const SharedFunctionalGroupsSequence = multiframe.SharedFunctionalGroupsSequence,
5984
+ PerFrameFunctionalGroupsSequence = multiframe.PerFrameFunctionalGroupsSequence,
5985
+ Rows = multiframe.Rows,
5986
+ Columns = multiframe.Columns;
6263
5987
  const sharedImageOrientationPatient = SharedFunctionalGroupsSequence.PlaneOrientationSequence ? SharedFunctionalGroupsSequence.PlaneOrientationSequence.ImageOrientationPatient : undefined;
6264
5988
  const sliceLength = Columns * Rows;
6265
5989
  const arrayOfSegmentData = getArrayOfSegmentData({
@@ -6289,23 +6013,21 @@ function labelmapImagesFromBuffer_insertOverlappingPixelDataPlanar(_ref8) {
6289
6013
  };
6290
6014
  }
6291
6015
  const getArrayOfSegmentData = _ref9 => {
6292
- let {
6293
- sliceLength,
6294
- Rows,
6295
- Columns,
6296
- validOrientations,
6297
- metadataProvider,
6298
- imageIdMaps,
6299
- segmentsOnFrame,
6300
- tolerance,
6301
- pixelDataChunks,
6302
- PerFrameFunctionalGroupsSequence,
6303
- labelMapImages,
6304
- sopUIDImageIdIndexMap,
6305
- multiframe,
6306
- sharedImageOrientationPatient,
6307
- segmentsPixelIndices
6308
- } = _ref9;
6016
+ let sliceLength = _ref9.sliceLength,
6017
+ Rows = _ref9.Rows,
6018
+ Columns = _ref9.Columns,
6019
+ validOrientations = _ref9.validOrientations,
6020
+ metadataProvider = _ref9.metadataProvider,
6021
+ imageIdMaps = _ref9.imageIdMaps,
6022
+ segmentsOnFrame = _ref9.segmentsOnFrame,
6023
+ tolerance = _ref9.tolerance,
6024
+ pixelDataChunks = _ref9.pixelDataChunks,
6025
+ PerFrameFunctionalGroupsSequence = _ref9.PerFrameFunctionalGroupsSequence,
6026
+ labelMapImages = _ref9.labelMapImages,
6027
+ sopUIDImageIdIndexMap = _ref9.sopUIDImageIdIndexMap,
6028
+ multiframe = _ref9.multiframe,
6029
+ sharedImageOrientationPatient = _ref9.sharedImageOrientationPatient,
6030
+ segmentsPixelIndices = _ref9.segmentsPixelIndices;
6309
6031
  const arrayOfSegmentData = [];
6310
6032
  const numberOfSegments = multiframe.SegmentSequence.length;
6311
6033
  for (let currentSegmentIndex = 1; currentSegmentIndex <= numberOfSegments; ++currentSegmentIndex) {
@@ -6335,38 +6057,35 @@ const getArrayOfSegmentData = _ref9 => {
6335
6057
  return arrayOfSegmentData;
6336
6058
  };
6337
6059
  const getSegmentData = _ref10 => {
6338
- let {
6339
- PerFrameFunctionalGroupsSequence,
6340
- labelMapImages,
6341
- sopUIDImageIdIndexMap,
6342
- multiframe,
6343
- segmentIndex,
6344
- sliceLength,
6345
- Rows,
6346
- Columns,
6347
- validOrientations,
6348
- tolerance,
6349
- pixelDataChunks,
6350
- sharedImageOrientationPatient,
6351
- metadataProvider,
6352
- imageIdMaps,
6353
- segmentsOnFrame,
6354
- segmentsPixelIndices
6355
- } = _ref10;
6060
+ let PerFrameFunctionalGroupsSequence = _ref10.PerFrameFunctionalGroupsSequence,
6061
+ labelMapImages = _ref10.labelMapImages,
6062
+ sopUIDImageIdIndexMap = _ref10.sopUIDImageIdIndexMap,
6063
+ multiframe = _ref10.multiframe,
6064
+ segmentIndex = _ref10.segmentIndex,
6065
+ sliceLength = _ref10.sliceLength,
6066
+ Rows = _ref10.Rows,
6067
+ Columns = _ref10.Columns,
6068
+ validOrientations = _ref10.validOrientations,
6069
+ tolerance = _ref10.tolerance,
6070
+ pixelDataChunks = _ref10.pixelDataChunks,
6071
+ sharedImageOrientationPatient = _ref10.sharedImageOrientationPatient,
6072
+ metadataProvider = _ref10.metadataProvider,
6073
+ imageIdMaps = _ref10.imageIdMaps,
6074
+ segmentsOnFrame = _ref10.segmentsOnFrame,
6075
+ segmentsPixelIndices = _ref10.segmentsPixelIndices;
6356
6076
  const segmentData = [];
6357
6077
  for (let currentLabelMapImageIndex = 0; currentLabelMapImageIndex < labelMapImages.length; currentLabelMapImageIndex++) {
6358
6078
  const currentLabelMapImage = labelMapImages[currentLabelMapImageIndex];
6359
6079
  const referencedImageId = currentLabelMapImage.referencedImageId;
6360
6080
  const PerFrameFunctionalGroupsIndex = PerFrameFunctionalGroupsSequence.findIndex((PerFrameFunctionalGroups, currentSequenceIndex) => {
6361
- const {
6362
- segmentIndex: groupsSegmentIndex,
6363
- referencedImageId: groupsReferenceImageId
6364
- } = extractInfoFromPerFrameFunctionalGroups({
6365
- PerFrameFunctionalGroups,
6366
- sequenceIndex: currentSequenceIndex,
6367
- sopUIDImageIdIndexMap,
6368
- multiframe
6369
- });
6081
+ const _extractInfoFromPerFr = extractInfoFromPerFrameFunctionalGroups({
6082
+ PerFrameFunctionalGroups,
6083
+ sequenceIndex: currentSequenceIndex,
6084
+ sopUIDImageIdIndexMap,
6085
+ multiframe
6086
+ }),
6087
+ groupsSegmentIndex = _extractInfoFromPerFr.segmentIndex,
6088
+ groupsReferenceImageId = _extractInfoFromPerFr.referencedImageId;
6370
6089
  const isCorrectPerFrameFunctionalGroup = groupsSegmentIndex === segmentIndex && groupsReferenceImageId === currentLabelMapImage.referencedImageId;
6371
6090
  return isCorrectPerFrameFunctionalGroup;
6372
6091
  });
@@ -6432,10 +6151,9 @@ function generateToolState_generateToolState(imageIds, arrayBuffer, metadataProv
6432
6151
  return Segmentation_generateToolState(imageIds, arrayBuffer, metadataProvider, skipOverlapping, tolerance, cs3dVersion);
6433
6152
  }
6434
6153
  function createFromDICOMSegBuffer(referencedImageIds, arrayBuffer, _ref) {
6435
- let {
6436
- metadataProvider,
6437
- tolerance = 1e-3
6438
- } = _ref;
6154
+ let metadataProvider = _ref.metadataProvider,
6155
+ _ref$tolerance = _ref.tolerance,
6156
+ tolerance = _ref$tolerance === void 0 ? 1e-3 : _ref$tolerance;
6439
6157
  return createLabelmapsFromBufferInternal(referencedImageIds, arrayBuffer, metadataProvider, {
6440
6158
  tolerance
6441
6159
  });
@@ -6451,12 +6169,8 @@ function createFromDICOMSegBuffer(referencedImageIds, arrayBuffer, _ref) {
6451
6169
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/ParametricMap/generateToolState.js
6452
6170
 
6453
6171
 
6454
- const {
6455
- ParametricMap
6456
- } = CornerstonePMAP;
6457
- const {
6458
- generateToolState: generateToolStateCornerstone
6459
- } = ParametricMap;
6172
+ const ParametricMap = CornerstonePMAP.ParametricMap;
6173
+ const generateToolStateCornerstone = ParametricMap.generateToolState;
6460
6174
  function ParametricMap_generateToolState_generateToolState(imageIds, arrayBuffer, metadataProvider) {
6461
6175
  let skipOverlapping = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
6462
6176
  let tolerance = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1e-3;
@@ -6470,9 +6184,7 @@ function ParametricMap_generateToolState_generateToolState(imageIds, arrayBuffer
6470
6184
 
6471
6185
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedFrameOfReferenceSequence.js
6472
6186
  function getReferencedFrameOfReferenceSequence(referencedFrameOfReferenceSequence, metadata, _options) {
6473
- const {
6474
- FrameOfReferenceUID
6475
- } = metadata;
6187
+ const FrameOfReferenceUID = metadata.FrameOfReferenceUID;
6476
6188
  referencedFrameOfReferenceSequence || (referencedFrameOfReferenceSequence = []);
6477
6189
  let referencedItem = referencedFrameOfReferenceSequence.find(it => it.FrameOfReferenceUID === FrameOfReferenceUID);
6478
6190
  if (!referencedItem) {
@@ -6489,23 +6201,17 @@ function getReferencedFrameOfReferenceSequence(referencedFrameOfReferenceSequenc
6489
6201
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedSeriesSequence.js
6490
6202
 
6491
6203
 
6492
- const {
6493
- MetadataModules: getReferencedSeriesSequence_MetadataModules
6494
- } = esm.Enums;
6204
+
6205
+ const getReferencedSeriesSequence_MetadataModules = esm.Enums.MetadataModules;
6495
6206
  function getReferencedSeriesSequence(referencedSeriesSequence, metadata, options) {
6496
6207
  const metadataProvider = (options === null || options === void 0 ? void 0 : options.metadataProvider) || esm.metaData;
6497
- const {
6498
- referencedImageId: imageId
6499
- } = metadata;
6208
+ const imageId = metadata.referencedImageId;
6500
6209
  const newReferenceSeq = metadataProvider.get(getReferencedSeriesSequence_MetadataModules.REFERENCED_SERIES_REFERENCE, imageId);
6501
6210
  referencedSeriesSequence || (referencedSeriesSequence = []);
6502
6211
  if (newReferenceSeq) {
6503
- const {
6504
- ReferencedSeriesInstanceUID: newSeriesUid,
6505
- ReferencedInstanceSequence: [{
6506
- ReferencedSOPInstanceUID: newSopUID
6507
- }]
6508
- } = newReferenceSeq;
6212
+ const newSeriesUid = newReferenceSeq.ReferencedSeriesInstanceUID,
6213
+ _newReferenceSeq$Refe = (0,slicedToArray/* default */.A)(newReferenceSeq.ReferencedInstanceSequence, 1),
6214
+ newSopUID = _newReferenceSeq$Refe[0].ReferencedSOPInstanceUID;
6509
6215
  const existingSeries = referencedSeriesSequence.find(it => it.ReferencedSeriesInstanceUID === newSeriesUid);
6510
6216
  if (!existingSeries) {
6511
6217
  referencedSeriesSequence.push(newReferenceSeq);
@@ -6537,9 +6243,7 @@ function getRTROIObservationsSequence(segment, index, options) {
6537
6243
 
6538
6244
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getStructureSetModule.js
6539
6245
  function getStructureSetModule(contour, segment) {
6540
- const {
6541
- FrameOfReferenceUID
6542
- } = contour.metadata;
6246
+ const FrameOfReferenceUID = contour.metadata.FrameOfReferenceUID;
6543
6247
  return {
6544
6248
  ROINumber: segment.segmentIndex,
6545
6249
  ROIName: segment.label,
@@ -6559,12 +6263,8 @@ function getStructureSetModule(contour, segment) {
6559
6263
 
6560
6264
  function referencedMetadataProvider_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6561
6265
  function referencedMetadataProvider_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? referencedMetadataProvider_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : referencedMetadataProvider_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6562
- const {
6563
- DicomMetaDictionary: referencedMetadataProvider_DicomMetaDictionary
6564
- } = dcmjs_es/* default.data */.Ay.data;
6565
- const {
6566
- MetadataModules: referencedMetadataProvider_MetadataModules
6567
- } = esm.Enums;
6266
+ const referencedMetadataProvider_DicomMetaDictionary = dcmjs_es/* default.data */.Ay.data.DicomMetaDictionary;
6267
+ const referencedMetadataProvider_MetadataModules = esm.Enums.MetadataModules;
6568
6268
  const STUDY_MODULES = [referencedMetadataProvider_MetadataModules.GENERAL_STUDY, referencedMetadataProvider_MetadataModules.PATIENT_STUDY, referencedMetadataProvider_MetadataModules.PATIENT];
6569
6269
  const SERIES_MODULES = [referencedMetadataProvider_MetadataModules.GENERAL_SERIES];
6570
6270
  const IMAGE_MODULES = [referencedMetadataProvider_MetadataModules.GENERAL_IMAGE, referencedMetadataProvider_MetadataModules.IMAGE_PLANE, referencedMetadataProvider_MetadataModules.CINE, referencedMetadataProvider_MetadataModules.VOI_LUT, referencedMetadataProvider_MetadataModules.MODALITY_LUT, referencedMetadataProvider_MetadataModules.SOP_COMMON];
@@ -6575,12 +6275,10 @@ const metadataProvider = {
6575
6275
  },
6576
6276
  [referencedMetadataProvider_MetadataModules.IMAGE_SOP_INSTANCE_REFERENCE]: function (imageId) {
6577
6277
  const frameModule = esm.metaData.get(referencedMetadataProvider_MetadataModules.FRAME_MODULE, imageId);
6578
- const {
6579
- sopClassUID,
6580
- sopInstanceUID,
6581
- frameNumber,
6582
- numberOfFrames
6583
- } = frameModule;
6278
+ const sopClassUID = frameModule.sopClassUID,
6279
+ sopInstanceUID = frameModule.sopInstanceUID,
6280
+ frameNumber = frameModule.frameNumber,
6281
+ numberOfFrames = frameModule.numberOfFrames;
6584
6282
  if (numberOfFrames > 1) {
6585
6283
  return {
6586
6284
  ReferencedSOPClassUID: sopClassUID,
@@ -6670,14 +6368,16 @@ esm.metaData.addProvider(metadataProvider.get, 9023);
6670
6368
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/utilities/createInstance.js
6671
6369
 
6672
6370
 
6673
- const {
6674
- MetadataModules: createInstance_MetadataModules
6675
- } = esm.Enums;
6371
+
6372
+ const createInstance_MetadataModules = esm.Enums.MetadataModules;
6676
6373
  function assignDefined(dest, source, options) {
6677
6374
  if (!source) {
6678
6375
  return;
6679
6376
  }
6680
- for (const [key, value] of Object.entries(source)) {
6377
+ for (const _ref of Object.entries(source)) {
6378
+ var _ref2 = (0,slicedToArray/* default */.A)(_ref, 2);
6379
+ const key = _ref2[0];
6380
+ const value = _ref2[1];
6681
6381
  if (value === undefined) {
6682
6382
  continue;
6683
6383
  }
@@ -6688,10 +6388,9 @@ function assignDefined(dest, source, options) {
6688
6388
  }
6689
6389
  }
6690
6390
  function createInstance(instanceKey, studyExemplarImageId, base, options) {
6691
- const {
6692
- metadataProvider = esm.metaData,
6693
- predecessorImageId
6694
- } = options;
6391
+ const _options$metadataProv = options.metadataProvider,
6392
+ metadataProvider = _options$metadataProv === void 0 ? esm.metaData : _options$metadataProv,
6393
+ predecessorImageId = options.predecessorImageId;
6695
6394
  const result = {};
6696
6395
  const instanceBase = metadataProvider.get(instanceKey, studyExemplarImageId);
6697
6396
  Object.assign(result, instanceBase);
@@ -6721,13 +6420,10 @@ function createInstance(instanceKey, studyExemplarImageId, base, options) {
6721
6420
 
6722
6421
  function RTSS_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6723
6422
  function RTSS_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? RTSS_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty/* default */.A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : RTSS_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6724
- const {
6725
- generateContourSetsFromLabelmap,
6726
- AnnotationToPointData
6727
- } = dist_esm.utilities.contours;
6728
- const {
6729
- MetadataModules: RTSS_MetadataModules
6730
- } = esm.Enums;
6423
+ const _utilities$contours = dist_esm.utilities.contours,
6424
+ generateContourSetsFromLabelmap = _utilities$contours.generateContourSetsFromLabelmap,
6425
+ AnnotationToPointData = _utilities$contours.AnnotationToPointData;
6426
+ const RTSS_MetadataModules = esm.Enums.MetadataModules;
6731
6427
  function generateRTSSFromSegmentations(segmentation, metadataProvider, _DicomMetadataStore) {
6732
6428
  return generateRTSSFromLabelmap(segmentation, {
6733
6429
  metadataProvider,
@@ -6736,9 +6432,8 @@ function generateRTSSFromSegmentations(segmentation, metadataProvider, _DicomMet
6736
6432
  }
6737
6433
  async function generateRTSSFromLabelmap(segmentations, options) {
6738
6434
  var _dataset$ReferencedFr;
6739
- const {
6740
- metadataProvider = esm.metaData
6741
- } = options;
6435
+ const _options$metadataProv = options.metadataProvider,
6436
+ metadataProvider = _options$metadataProv === void 0 ? esm.metaData : _options$metadataProv;
6742
6437
  const roiContours = [];
6743
6438
  const contourSets = await generateContourSetsFromLabelmap({
6744
6439
  segmentations
@@ -6748,9 +6443,7 @@ async function generateRTSSFromLabelmap(segmentations, options) {
6748
6443
  const contourSequence = [];
6749
6444
  contourSet.sliceContours.forEach(sliceContour => {
6750
6445
  const ContourImageSequence = metadataProvider.get('ImageSopInstanceReference', sliceContour.referencedImageId);
6751
- const {
6752
- points: polyDataPoints
6753
- } = sliceContour.polyData;
6446
+ const polyDataPoints = sliceContour.polyData.points;
6754
6447
  sliceContour.contours.forEach((contour, index) => {
6755
6448
  const ContourGeometricType = contour.type;
6756
6449
  const NumberOfContourPoints = contour.contourPoints.length;
@@ -6803,19 +6496,13 @@ function generateRTSSFromAnnotations(segmentations, annotations, options) {
6803
6496
  const dataset = _initializeDataset(segmentations, annotations[0].metadata, options);
6804
6497
  const segmentsContour = new Map();
6805
6498
  annotations.forEach((annotation, index) => {
6806
- const {
6807
- data: {
6808
- segmentation
6809
- }
6810
- } = annotation;
6499
+ const segmentation = annotation.data.segmentation;
6811
6500
  if (!segmentation) {
6812
6501
  console.warn('Annotation is not a segmentation:', annotation);
6813
6502
  return;
6814
6503
  }
6815
- const {
6816
- segmentationId,
6817
- segmentIndex
6818
- } = segmentation;
6504
+ const segmentationId = segmentation.segmentationId,
6505
+ segmentIndex = segmentation.segmentIndex;
6819
6506
  const key = "".concat(segmentationId, ":").concat(segmentIndex);
6820
6507
  let segmentAnnotation = segmentsContour.get(key);
6821
6508
  if (!segmentAnnotation) {
@@ -6847,9 +6534,7 @@ function generateRTSSFromAnnotations(segmentations, annotations, options) {
6847
6534
  return dataset;
6848
6535
  }
6849
6536
  function _initializeDataset(segmentation, imgMetadata, options) {
6850
- const {
6851
- referencedImageId: studyExemplarImageId
6852
- } = imgMetadata;
6537
+ const studyExemplarImageId = imgMetadata.referencedImageId;
6853
6538
  return createInstance(RTSS_MetadataModules.RTSS_INSTANCE_DATA, studyExemplarImageId, {
6854
6539
  StructureSetLabel: segmentation.label,
6855
6540
  StructureSetName: segmentation.label,
@@ -6858,9 +6543,7 @@ function _initializeDataset(segmentation, imgMetadata, options) {
6858
6543
  }, options);
6859
6544
  }
6860
6545
  function generateRTSSFromContour(segmentations, options) {
6861
- const {
6862
- annotationUIDsMap
6863
- } = segmentations.representationData.Contour;
6546
+ const annotationUIDsMap = segmentations.representationData.Contour.annotationUIDsMap;
6864
6547
  const annotations = [];
6865
6548
  for (const annotationSet of annotationUIDsMap.values()) {
6866
6549
  for (const annotationUID of annotationSet.values()) {
@@ -6891,9 +6574,7 @@ function generateRTSSFromRepresentation(segmentations) {
6891
6574
 
6892
6575
 
6893
6576
 
6894
- const {
6895
- generateContourSetsFromLabelmap: RTStruct_generateContourSetsFromLabelmap
6896
- } = dist_esm.utilities.contours;
6577
+ const RTStruct_generateContourSetsFromLabelmap = dist_esm.utilities.contours.generateContourSetsFromLabelmap;
6897
6578
 
6898
6579
 
6899
6580
 
@@ -6902,23 +6583,17 @@ const {
6902
6583
 
6903
6584
 
6904
6585
  var _KeyImage;
6905
- const {
6906
- Point: KeyImage_TID300Point
6907
- } = dcmjs_es/* utilities */.BF.TID300;
6586
+ const KeyImage_TID300Point = dcmjs_es/* utilities */.BF.TID300.Point;
6908
6587
  class KeyImage extends Probe {
6909
6588
  static getMeasurementData(measurementGroup, sopInstanceUIDToImageIdMap, metadata, trackingIdentifier) {
6910
6589
  const baseData = super.getMeasurementData(measurementGroup, sopInstanceUIDToImageIdMap, metadata, trackingIdentifier);
6911
- const {
6912
- data
6913
- } = baseData.annotation;
6590
+ const data = baseData.annotation.data;
6914
6591
  data.isPoint = trackingIdentifier.indexOf('Point') !== -1;
6915
6592
  return baseData;
6916
6593
  }
6917
6594
  static getTID300RepresentationArguments(tool) {
6918
6595
  const tid300Arguments = super.getTID300RepresentationArguments(tool);
6919
- const {
6920
- data
6921
- } = tool;
6596
+ const data = tool.data;
6922
6597
  if (data.isPoint) {
6923
6598
  if (data.seriesLevel) {
6924
6599
  tid300Arguments.trackingIdentifierTextValue = this.trackingSeriesPointIdentifier;
@@ -7006,10 +6681,8 @@ const Cornerstone3DRT = {
7006
6681
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/VTKjs/Segmentation.js
7007
6682
 
7008
6683
 
7009
- const {
7010
- Colors,
7011
- BitArray: Segmentation_BitArray
7012
- } = dcmjs_es/* data */.p;
6684
+ const Colors = dcmjs_es/* data */.p.Colors,
6685
+ Segmentation_BitArray = dcmjs_es/* data */.p.BitArray;
7013
6686
 
7014
6687
  // TODO: Is there a better name for this? RGBAInt?
7015
6688
  // Should we move it to Colors.js
@@ -7203,6 +6876,7 @@ const VTKjsSEG = {
7203
6876
 
7204
6877
 
7205
6878
 
6879
+
7206
6880
  const adaptersSR = {
7207
6881
  Cornerstone: CornerstoneSR,
7208
6882
  Cornerstone3D: Cornerstone3DSR
@@ -7238,32 +6912,6 @@ const graphicTypeEquals = graphicType => {
7238
6912
 
7239
6913
 
7240
6914
 
7241
- ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/helpers/downloadDICOMData.js
7242
-
7243
-
7244
- const {
7245
- datasetToBlob: downloadDICOMData_datasetToBlob
7246
- } = dcmjs_es/* data */.p;
7247
- function downloadDICOMData(bufferOrDataset, filename) {
7248
- let blob;
7249
- if (bufferOrDataset instanceof ArrayBuffer) {
7250
- blob = new Blob([bufferOrDataset], {
7251
- type: 'application/dicom'
7252
- });
7253
- } else {
7254
- if (!bufferOrDataset._meta) {
7255
- throw new Error('Dataset must have a _meta property');
7256
- }
7257
- blob = downloadDICOMData_datasetToBlob(bufferOrDataset);
7258
- }
7259
- const link = document.createElement('a');
7260
- link.href = window.URL.createObjectURL(blob);
7261
- link.download = filename;
7262
- link.click();
7263
- }
7264
-
7265
-
7266
-
7267
6915
  ;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/helpers/index.js
7268
6916
 
7269
6917