@dcmjs-org/dcmjs 1.0.0-beta.11 → 1.0.0-beta.13

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.
@@ -720,6 +720,34 @@ var DicomDict = /*#__PURE__*/function () {
720
720
  this.dict[tag].Value = core.ValueRepresentation.addValueAccessorsFor(this.dict[tag].vr, values);
721
721
  }
722
722
 
723
+ /**
724
+ * Reserves a private block for a creator, and writes its creator element
725
+ * when the creator has no block yet; pass `{ create: false }` to only look
726
+ * it up. The block is found by creator, never assumed (NAT-U-PRIV-11).
727
+ *
728
+ * dicomDict.privateBlock("4D43:ACME 1.0").set("x01", "CS", ["HYBRID"]);
729
+ *
730
+ * @param {number|string} groupOrKey odd group number, or block key "gggg:creator"
731
+ * @param {string} [creator] creator string, with a group number
732
+ * @param {{create?: boolean}} [options] create defaults to true; false
733
+ * returns null when the creator is absent
734
+ * @returns {Object|null} accessor with key, group, creator, reservedBlock,
735
+ * tag, has, get and set
736
+ */
737
+ }, {
738
+ key: "privateBlock",
739
+ value: function privateBlock(groupOrKey, creator) {
740
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
741
+ if (typeof groupOrKey === "string" && _typeof(creator) === "object") {
742
+ options = creator;
743
+ creator = undefined;
744
+ }
745
+ var _ref = options || {},
746
+ _ref$create = _ref.create,
747
+ create = _ref$create === void 0 ? true : _ref$create;
748
+ return create ? core.reservePrivateBlock(this.dict, groupOrKey, creator) : core.findPrivateBlock(this.dict, groupOrKey, creator);
749
+ }
750
+
723
751
  // The Part 10 envelope (preamble/DICM, computed meta group length,
724
752
  // deflate branch, default transfer syntax) moved verbatim to
725
753
  // @dcmjs-org/core as writePart10 (core/writeCore.js); this delegation
@@ -1881,7 +1909,7 @@ var AsyncDicomReader = /*#__PURE__*/function () {
1881
1909
  break;
1882
1910
  }
1883
1911
  // Group length
1884
- stream.increment(tagObj.length);
1912
+ stream.increment(length);
1885
1913
  return _context5.abrupt("continue", 1);
1886
1914
  case 5:
1887
1915
  addTagResult = listener.addTag(tag, tagInfo);
@@ -15752,7 +15780,11 @@ var data = {
15752
15780
  setAttribute: core.setAttribute,
15753
15781
  setPersonName: core.setPersonName,
15754
15782
  definePrivateAliases: core.definePrivateAliases,
15755
- frameDataset: core.frameDataset
15783
+ frameDataset: core.frameDataset,
15784
+ // private blocks of a DICOM JSON dict (NAT-U-PRIV-11)
15785
+ findPrivateBlock: core.findPrivateBlock,
15786
+ reservePrivateBlock: core.reservePrivateBlock,
15787
+ privateBlockKey: core.privateBlockKey
15756
15788
  };
15757
15789
  var async = {
15758
15790
  AsyncDicomReader: AsyncDicomReader
@@ -15820,4 +15852,4 @@ exports.derivations = derivations;
15820
15852
  exports.normalizers = normalizers;
15821
15853
  exports.sr = sr;
15822
15854
  exports.utilities = utilities;
15823
- //# sourceMappingURL=dcmjs.shared-CvR7StGL.cjs.map
15855
+ //# sourceMappingURL=dcmjs.shared-DI53lI_H.cjs.map