dcmjs 0.29.4 → 0.29.6

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
@@ -9,6 +9,8 @@
9
9
 
10
10
  **Note: this code is a work-in-progress and should not be used for production or clinical purposes**
11
11
 
12
+ This is a community effort so please help improve support for a wide range of DICOM data and use cases.
13
+
12
14
  See [live examples here](https://dcmjs.netlify.com/)
13
15
 
14
16
  # Goals
package/build/dcmjs.es.js CHANGED
@@ -9064,30 +9064,34 @@ var SequenceOfItems = /*#__PURE__*/function (_ValueRepresentation8) {
9064
9064
  if (g == 0xfffe) {
9065
9065
  // some control tag is about to be read
9066
9066
  var ge = stream.readUint16();
9067
+ var itemLength = stream.readUint32();
9068
+ stream.increment(-4);
9067
9069
 
9068
9070
  if (ge == 0xe00d) {
9069
- // item delimitation tag has been read
9070
- stack--;
9071
-
9072
- if (stack < 0) {
9073
- // if we are outside every stack, then we are finished reading the sequence of items
9074
- stream.increment(4);
9075
- read += 8;
9076
- break;
9071
+ if (itemLength === 0) {
9072
+ // item delimitation tag (0xfffee00d) + item length (0x00000000) has been read
9073
+ stack--;
9074
+
9075
+ if (stack < 0) {
9076
+ // if we are outside every stack, then we are finished reading the sequence of items
9077
+ stream.increment(4);
9078
+ read += 8;
9079
+ break;
9080
+ } else {
9081
+ // otherwise, we were in a nested sequence of items
9082
+ toRead += 4;
9083
+ }
9077
9084
  } else {
9078
- // otherwise, we were in a nested sequence of items
9079
- toRead += 4;
9085
+ // anything else has been read
9086
+ toRead += 2;
9080
9087
  }
9081
9088
  } else if (ge == 0xe000) {
9082
9089
  // a new item has been found
9083
- stack++;
9084
9090
  toRead += 4;
9085
- var itemLength = stream.readUint32();
9086
- stream.increment(-4);
9087
9091
 
9088
- if (itemLength === 0) {
9089
- // in some odd cases, DICOMs rely on the length being zero to denote that the item has closed
9090
- stack--;
9092
+ if (itemLength == 0xffffffff) {
9093
+ // a new item with undefined length has been found
9094
+ stack++;
9091
9095
  }
9092
9096
  } else {
9093
9097
  // some control tag that does not concern sequence of items has been read
@@ -9801,6 +9805,23 @@ var DicomMetaDictionary = /*#__PURE__*/function () {
9801
9805
  }
9802
9806
 
9803
9807
  return tag.substring(1, 10).replace(",", "");
9808
+ }
9809
+ }, {
9810
+ key: "parseIntFromTag",
9811
+ value: function parseIntFromTag(tag) {
9812
+ var integerValue = parseInt("0x" + DicomMetaDictionary.unpunctuateTag(tag));
9813
+ return integerValue;
9814
+ }
9815
+ }, {
9816
+ key: "tagAsIntegerFromName",
9817
+ value: function tagAsIntegerFromName(name) {
9818
+ var item = DicomMetaDictionary.nameMap[name];
9819
+
9820
+ if (item != undefined) {
9821
+ return this.parseIntFromTag(item.tag);
9822
+ } else {
9823
+ return undefined;
9824
+ }
9804
9825
  } // fixes some common errors in VRs
9805
9826
  // TODO: if this gets longer it could go in ValueRepresentation.js
9806
9827
  // or in a dedicated class
@@ -23571,7 +23592,9 @@ var TID300 = {
23571
23592
  CobbAngle: CobbAngle,
23572
23593
  Bidirectional: Bidirectional,
23573
23594
  Polyline: Polyline,
23574
- Ellipse: Ellipse
23595
+ Polygon: Polygon,
23596
+ Ellipse: Ellipse,
23597
+ Circle: Circle
23575
23598
  };
23576
23599
 
23577
23600
  /**