dcmjs 0.50.0 → 0.50.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/dcmjs.js CHANGED
@@ -14264,7 +14264,7 @@
14264
14264
  key: "readSequence",
14265
14265
  value: function () {
14266
14266
  var _readSequence = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(listener, sqTagInfo, options) {
14267
- var length, stream, syntax, endOffset, tagInfo, tag;
14267
+ var length, stream, syntax, endOffset, tagInfo, tag, itemLength, itemUntilOffset;
14268
14268
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
14269
14269
  while (1) switch (_context6.prev = _context6.next) {
14270
14270
  case 0:
@@ -14283,37 +14283,45 @@
14283
14283
  _context6.t0 = _context6.sent;
14284
14284
  case 8:
14285
14285
  if (!_context6.t0) {
14286
- _context6.next = 26;
14286
+ _context6.next = 28;
14287
14287
  break;
14288
14288
  }
14289
14289
  readLog.debug("readSequence loop", stream.offset, endOffset);
14290
14290
  tagInfo = this.readTagHeader(syntax, options);
14291
14291
  tag = tagInfo.tag;
14292
14292
  if (!(tag === TagHex.Item)) {
14293
- _context6.next = 18;
14293
+ _context6.next = 20;
14294
14294
  break;
14295
14295
  }
14296
14296
  listener.startObject();
14297
- _context6.next = 16;
14297
+ // For defined-length items, use the item's own end offset
14298
+ // so read() stops at the item boundary and returns control
14299
+ // to readSequence for the next item. Without this, all
14300
+ // items in a defined-length sequence get merged into the
14301
+ // first item because read() treats subsequent Item tags
14302
+ // as instructions and skips them.
14303
+ itemLength = tagInfo.length;
14304
+ itemUntilOffset = itemLength === UNDEFINED_LENGTH_FIX ? endOffset : Math.min(stream.offset + itemLength, endOffset);
14305
+ _context6.next = 18;
14298
14306
  return this.read(listener, _objectSpread2(_objectSpread2({}, options), {}, {
14299
- untilOffset: endOffset
14307
+ untilOffset: itemUntilOffset
14300
14308
  }));
14301
- case 16:
14302
- _context6.next = 24;
14303
- break;
14304
14309
  case 18:
14310
+ _context6.next = 26;
14311
+ break;
14312
+ case 20:
14305
14313
  if (!(tag === TagHex.SequenceDelimitationEnd)) {
14306
- _context6.next = 22;
14314
+ _context6.next = 24;
14307
14315
  break;
14308
14316
  }
14309
14317
  return _context6.abrupt("return");
14310
- case 22:
14318
+ case 24:
14311
14319
  console.warn("Unknown tag info", length, tagInfo);
14312
14320
  throw new Error();
14313
- case 24:
14321
+ case 26:
14314
14322
  _context6.next = 3;
14315
14323
  break;
14316
- case 26:
14324
+ case 28:
14317
14325
  case "end":
14318
14326
  return _context6.stop();
14319
14327
  }
@@ -26654,7 +26662,7 @@ b"+i+"*=d\
26654
26662
  function NormalRangeProperties(options) {
26655
26663
  var _this6;
26656
26664
  _classCallCheck(this, NormalRangeProperties);
26657
- _this6 = _callSuper(this, NormalRangeProperties, [options]);
26665
+ _this6 = _callSuper(this, NormalRangeProperties);
26658
26666
  if (options.values === undefined) {
26659
26667
  throw new Error("Option 'values' is required for NormalRangeProperties.");
26660
26668
  }
@@ -27080,7 +27088,7 @@ b"+i+"*=d\
27080
27088
  function SubjectContextDevice(options) {
27081
27089
  var _this17;
27082
27090
  _classCallCheck(this, SubjectContextDevice);
27083
- _this17 = _callSuper(this, SubjectContextDevice, [options]);
27091
+ _this17 = _callSuper(this, SubjectContextDevice);
27084
27092
  if (options.name === undefined) {
27085
27093
  throw new Error("Option 'name' is required for SubjectContextDevice.");
27086
27094
  }
@@ -27380,7 +27388,7 @@ b"+i+"*=d\
27380
27388
  function MeasurementsDerivedFromMultipleROIMeasurements(options) {
27381
27389
  var _this21;
27382
27390
  _classCallCheck(this, MeasurementsDerivedFromMultipleROIMeasurements);
27383
- _this21 = _callSuper(this, MeasurementsDerivedFromMultipleROIMeasurements, [options]);
27391
+ _this21 = _callSuper(this, MeasurementsDerivedFromMultipleROIMeasurements);
27384
27392
  if (options.derivation === undefined) {
27385
27393
  throw new Error("Option 'derivation' is required for " + "MeasurementsDerivedFromMultipleROIMeasurements.");
27386
27394
  }
@@ -27580,7 +27588,7 @@ b"+i+"*=d\
27580
27588
  function TimePointContext(options) {
27581
27589
  var _this24;
27582
27590
  _classCallCheck(this, TimePointContext);
27583
- _this24 = _callSuper(this, TimePointContext, [options]);
27591
+ _this24 = _callSuper(this, TimePointContext);
27584
27592
  if (options.timePoint === undefined) {
27585
27593
  throw new Error("Option 'timePoint' is required for TimePointContext.");
27586
27594
  }
@@ -27736,7 +27744,7 @@ b"+i+"*=d\
27736
27744
  function TrackingIdentifier(options) {
27737
27745
  var _this27;
27738
27746
  _classCallCheck(this, TrackingIdentifier);
27739
- _this27 = _callSuper(this, TrackingIdentifier, [options]);
27747
+ _this27 = _callSuper(this, TrackingIdentifier);
27740
27748
  if (options.uid === undefined) {
27741
27749
  throw new Error("Option 'uid' is required for TrackingIdentifier.");
27742
27750
  }