@exini/dicom-streams-js 3.0.9 → 3.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exini/dicom-streams-js",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
4
4
  "description": "Streaming parsing and processing of DICOM data",
5
5
  "main": "node/index.js",
6
6
  "browser": "web/index.js",
package/web/index.js CHANGED
@@ -20272,8 +20272,8 @@ function collectFlow(tagCondition, stopCondition, label, maxBufferSize = 1000000
20272
20272
  if (maxBufferSize > 0 && this.currentBufferSize > maxBufferSize) {
20273
20273
  throw Error('Error collecting elements: max buffer size exceeded');
20274
20274
  }
20275
- if (part !== dicom_flow_1.valueChunkMarker &&
20276
- part !== dicom_flow_1.sequenceDelimitationPartMarker &&
20275
+ if (!(part instanceof dicom_flow_1.ValueChunkMarker) &&
20276
+ !(part instanceof dicom_flow_1.SequenceDelimitationPartMarker) &&
20277
20277
  !(part instanceof dicom_flow_1.ItemDelimitationPartMarker)) {
20278
20278
  this.buffer.push(part);
20279
20279
  this.currentBufferSize += part.bytes.length;
@@ -20324,7 +20324,7 @@ function collectFlow(tagCondition, stopCondition, label, maxBufferSize = 1000000
20324
20324
  this.maybeAdd(new dicom_elements_1.ItemDelimitationElement(part.bigEndian));
20325
20325
  return [];
20326
20326
  }
20327
- if (part === dicom_flow_1.sequenceDelimitationPartMarker) {
20327
+ if (part instanceof dicom_flow_1.SequenceDelimitationPartMarker) {
20328
20328
  return [];
20329
20329
  }
20330
20330
  if (part instanceof dicom_parts_1.SequenceDelimitationPart) {
@@ -20825,7 +20825,7 @@ exports.Fragments = Fragments;
20825
20825
  "use strict";
20826
20826
 
20827
20827
  Object.defineProperty(exports, "__esModule", ({ value: true }));
20828
- exports.GroupLengthWarnings = exports.TagPathTracking = exports.InSequence = exports.GuaranteedDelimitationEvents = exports.itemDelimitationPartMarker = exports.ItemDelimitationPartMarker = exports.sequenceDelimitationPartMarker = exports.GuaranteedValueEvent = exports.valueChunkMarker = exports.InFragments = exports.EndEvent = exports.dicomEndMarker = exports.StartEvent = exports.dicomStartMarker = exports.DeferToPartFlow = exports.IdentityFlow = exports.DicomFlow = exports.createFlow = void 0;
20828
+ exports.GroupLengthWarnings = exports.TagPathTracking = exports.InSequence = exports.GuaranteedDelimitationEvents = exports.ItemDelimitationPartMarker = exports.SequenceDelimitationPartMarker = exports.GuaranteedValueEvent = exports.ValueChunkMarker = exports.InFragments = exports.EndEvent = exports.dicomEndMarker = exports.StartEvent = exports.dicomStartMarker = exports.DeferToPartFlow = exports.IdentityFlow = exports.DicomFlow = exports.createFlow = void 0;
20829
20829
  const base_1 = __webpack_require__(/*! ./base */ "./src/base.ts");
20830
20830
  const flows_1 = __webpack_require__(/*! ./flows */ "./src/flows.ts");
20831
20831
  const dicom_parts_1 = __webpack_require__(/*! ./dicom-parts */ "./src/dicom-parts.ts");
@@ -21001,49 +21001,48 @@ const InFragments = (Super) => class extends Super {
21001
21001
  };
21002
21002
  exports.InFragments = InFragments;
21003
21003
  class ValueChunkMarker extends dicom_parts_1.ValueChunk {
21004
- constructor() {
21005
- super(false, base_1.emptyBuffer, true);
21004
+ constructor(bigEndian) {
21005
+ super(bigEndian, base_1.emptyBuffer, true);
21006
21006
  }
21007
21007
  toString() {
21008
- return 'Value Chunk Marker []';
21008
+ return `Value Chunk Marker [bigEndian=${this.bigEndian}]`;
21009
21009
  }
21010
21010
  }
21011
- exports.valueChunkMarker = new ValueChunkMarker();
21011
+ exports.ValueChunkMarker = ValueChunkMarker;
21012
21012
  const GuaranteedValueEvent = (Super) => class extends Super {
21013
21013
  onHeader(part) {
21014
21014
  return part.length === 0
21015
- ? super.onHeader(part).concat(this.onValueChunk(exports.valueChunkMarker))
21015
+ ? super.onHeader(part).concat(this.onValueChunk(new ValueChunkMarker(part.bigEndian)))
21016
21016
  : super.onHeader(part);
21017
21017
  }
21018
21018
  onItem(part) {
21019
21019
  return this.inFragments && part.length === 0
21020
- ? super.onItem(part).concat(this.onValueChunk(exports.valueChunkMarker))
21020
+ ? super.onItem(part).concat(this.onValueChunk(new ValueChunkMarker(part.bigEndian)))
21021
21021
  : super.onItem(part);
21022
21022
  }
21023
21023
  onValueChunk(part) {
21024
- return super.onValueChunk(part).filter((c) => c !== exports.valueChunkMarker);
21024
+ return super.onValueChunk(part).filter((c) => !(c instanceof ValueChunkMarker));
21025
21025
  }
21026
21026
  };
21027
21027
  exports.GuaranteedValueEvent = GuaranteedValueEvent;
21028
21028
  class SequenceDelimitationPartMarker extends dicom_parts_1.SequenceDelimitationPart {
21029
- constructor() {
21030
- super(false, base_1.emptyBuffer);
21029
+ constructor(bigEndian) {
21030
+ super(bigEndian, base_1.emptyBuffer);
21031
21031
  }
21032
21032
  toString() {
21033
- return 'SequenceDelimitationMarker []';
21033
+ return `SequenceDelimitationMarker [bigEndian=${this.bigEndian}]`;
21034
21034
  }
21035
21035
  }
21036
- exports.sequenceDelimitationPartMarker = new SequenceDelimitationPartMarker();
21036
+ exports.SequenceDelimitationPartMarker = SequenceDelimitationPartMarker;
21037
21037
  class ItemDelimitationPartMarker extends dicom_parts_1.ItemDelimitationPart {
21038
- constructor() {
21039
- super(false, base_1.emptyBuffer);
21038
+ constructor(bigEndian) {
21039
+ super(bigEndian, base_1.emptyBuffer);
21040
21040
  }
21041
21041
  toString() {
21042
- return 'ItemDelimitationMarker []';
21042
+ return `ItemDelimitationMarker [bigEndian=${this.bigEndian}]`;
21043
21043
  }
21044
21044
  }
21045
21045
  exports.ItemDelimitationPartMarker = ItemDelimitationPartMarker;
21046
- exports.itemDelimitationPartMarker = new ItemDelimitationPartMarker();
21047
21046
  /**
21048
21047
  * Depends on InFragments
21049
21048
  */
@@ -21065,10 +21064,10 @@ const GuaranteedDelimitationEvents = (Super) => class extends Super {
21065
21064
  return super.onItem(part).concat(this.maybeDelimit());
21066
21065
  }
21067
21066
  onSequenceDelimitation(part) {
21068
- if (this.partStack.length > 0 && part != exports.sequenceDelimitationPartMarker && !this.inFragments) {
21067
+ if (this.partStack.length > 0 && !(part instanceof SequenceDelimitationPartMarker) && !this.inFragments) {
21069
21068
  this.partStack.shift();
21070
21069
  }
21071
- return this.subtractAndEmit(part, (p) => super.onSequenceDelimitation(p).filter((d) => d !== exports.sequenceDelimitationPartMarker));
21070
+ return this.subtractAndEmit(part, (p) => super.onSequenceDelimitation(p).filter((d) => !(d instanceof SequenceDelimitationPartMarker)));
21072
21071
  }
21073
21072
  onItemDelimitation(part) {
21074
21073
  if (this.partStack.length > 0 && !(part instanceof ItemDelimitationPartMarker)) {
@@ -21102,8 +21101,8 @@ const GuaranteedDelimitationEvents = (Super) => class extends Super {
21102
21101
  const inactive = this.partStack.slice(0, splitIndex);
21103
21102
  this.partStack = this.partStack.slice(splitIndex);
21104
21103
  const out = inactive.map((i) => i.part instanceof dicom_parts_1.ItemPart
21105
- ? this.onItemDelimitation(exports.itemDelimitationPartMarker)
21106
- : this.onSequenceDelimitation(exports.sequenceDelimitationPartMarker));
21104
+ ? this.onItemDelimitation(new ItemDelimitationPartMarker(i.part.bigEndian))
21105
+ : this.onSequenceDelimitation(new SequenceDelimitationPartMarker(i.part.bigEndian)));
21107
21106
  return [].concat(...out);
21108
21107
  }
21109
21108
  subtractAndEmit(part, handle) {