dcmjs 0.38.0 → 0.38.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/README.md CHANGED
@@ -41,6 +41,7 @@ _Parts of DICOM that dcmjs *will not* focus on:_
41
41
  - DIMSE (legacy networking like C-STORE, C-FIND, C-MOVE, etc). See the [dcmjs-dimse](https://github.com/PantelisGeorgiadis/dcmjs-dimse) project for that.
42
42
  - Physical Media (optical disks). See [this FAQ](https://www.dclunie.com/medical-image-faq/html/index.html) if you need to work with those.
43
43
  - Image rendering. See [dcmjs-imaging](https://github.com/PantelisGeorgiadis/dcmjs-imaging) for this.
44
+ - Encapsulated transfer syntax transcoding. See [dcmjs-codecs](https://github.com/PantelisGeorgiadis/dcmjs-codecs) for this.
44
45
  - 3D rendering. See [vtk.js](https://kitware.github.io/vtk-js/index.html).
45
46
  - Radiology review application - see [OHIF](https://ohif.org).
46
47
 
package/build/dcmjs.es.js CHANGED
@@ -8768,7 +8768,10 @@ var ValueRepresentation = /*#__PURE__*/function () {
8768
8768
  forceStoreRaw: false
8769
8769
  };
8770
8770
  if (this.fixed && this.maxLength) {
8771
- if (!length) return this.defaultValue;
8771
+ if (!length) return {
8772
+ rawValue: this.defaultValue,
8773
+ value: this.defaultValue
8774
+ };
8772
8775
  if (this.maxLength != length) log.error("Invalid length for fixed length tag, vr " + this.type + ", length " + this.maxLength + " != " + length);
8773
8776
  }
8774
8777
  var rawValue = this.readBytes(stream, length, syntax);
@@ -9628,13 +9631,13 @@ var PersonName = /*#__PURE__*/function (_EncodedStringReprese3) {
9628
9631
  }, {
9629
9632
  key: "readBytes",
9630
9633
  value: function readBytes(stream, length) {
9631
- return this.readPaddedEncodedString(stream, length).split(String.fromCharCode(VM_DELIMITER));
9634
+ return this.readPaddedEncodedString(stream, length);
9632
9635
  }
9633
9636
  }, {
9634
9637
  key: "applyFormatting",
9635
9638
  value: function applyFormatting(value) {
9636
9639
  var parsePersonName = function parsePersonName(valueStr) {
9637
- return dicomJson.pnConvertToJsonObject(valueStr, false);
9640
+ return dicomJson.pnConvertToJsonObject(valueStr);
9638
9641
  };
9639
9642
  if (Array.isArray(value)) {
9640
9643
  return value.map(function (valueStr) {
@@ -10635,9 +10638,14 @@ var DicomMessage = /*#__PURE__*/function () {
10635
10638
 
10636
10639
  // apply VR specific formatting to the original _rawValue and compare to the Value
10637
10640
  var vr = ValueRepresentation.createByTypeString(vrType);
10638
- var originalValue = tagObject._rawValue.map(function (val) {
10639
- return vr.applyFormatting(val);
10640
- });
10641
+ var originalValue;
10642
+ if (Array.isArray(tagObject._rawValue)) {
10643
+ originalValue = tagObject._rawValue.map(function (val) {
10644
+ return vr.applyFormatting(val);
10645
+ });
10646
+ } else {
10647
+ originalValue = vr.applyFormatting(tagObject._rawValue);
10648
+ }
10641
10649
 
10642
10650
  // if Value has not changed, write _rawValue unformatted back into the file
10643
10651
  if (deepEqual(tagObject.Value, originalValue)) {