dcmjs 0.36.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/dcmjs.es.js CHANGED
@@ -8405,6 +8405,10 @@ var DicomMetaDictionary = /*#__PURE__*/function () {
8405
8405
  // when the vr is data-dependent, keep track of the original type
8406
8406
  naturalDataset._vrMap[naturalName] = data.vr;
8407
8407
  }
8408
+ if (data.vr !== entry.vr) {
8409
+ // save origin vr if it different that in dictionary
8410
+ naturalDataset._vrMap[naturalName] = data.vr;
8411
+ }
8408
8412
  }
8409
8413
  if (data.Value === undefined) {
8410
8414
  // In the case of type 2, add this tag but explictly set it null to indicate its empty.
@@ -8478,8 +8482,9 @@ var DicomMetaDictionary = /*#__PURE__*/function () {
8478
8482
  return;
8479
8483
  }
8480
8484
  // process this one entry
8485
+ var vr = dataset._vrMap && dataset._vrMap[naturalName] ? dataset._vrMap[naturalName] : entry.vr;
8481
8486
  var dataItem = ValueRepresentation.addTagAccessors({
8482
- vr: entry.vr
8487
+ vr: vr
8483
8488
  });
8484
8489
  dataItem.Value = dataset[naturalName];
8485
8490
  if (dataValue !== null) {
@@ -8490,7 +8495,7 @@ var DicomMetaDictionary = /*#__PURE__*/function () {
8490
8495
  log.error("No value representation given for", naturalName);
8491
8496
  }
8492
8497
  }
8493
- var vr = ValueRepresentation.createByTypeString(dataItem.vr);
8498
+ var _vr = ValueRepresentation.createByTypeString(dataItem.vr);
8494
8499
  dataItem.Value = DicomMetaDictionary.denaturalizeValue(dataItem.Value);
8495
8500
  if (entry.vr == "SQ") {
8496
8501
  var unnaturalValues = [];
@@ -8500,11 +8505,11 @@ var DicomMetaDictionary = /*#__PURE__*/function () {
8500
8505
  }
8501
8506
  dataItem.Value = unnaturalValues;
8502
8507
  }
8503
- if (!vr.isBinary() && vr.maxLength) {
8508
+ if (!_vr.isBinary() && _vr.maxLength) {
8504
8509
  dataItem.Value = dataItem.Value.map(function (value) {
8505
- if (value.length > vr.maxLength) {
8506
- log.warn("Truncating value ".concat(value, " of ").concat(naturalName, " because it is longer than ").concat(vr.maxLength));
8507
- return value.slice(0, vr.maxLength);
8510
+ if (value.length > _vr.maxLength) {
8511
+ log.warn("Truncating value ".concat(value, " of ").concat(naturalName, " because it is longer than ").concat(_vr.maxLength));
8512
+ return value.slice(0, _vr.maxLength);
8508
8513
  } else {
8509
8514
  return value;
8510
8515
  }