@dcmjs-org/dcmjs 1.0.0-beta.18 → 1.0.0-beta.20
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.cjs +1 -1
- package/build/dcmjs.es.js +1 -1
- package/build/dcmjs.js +395 -185
- package/build/dcmjs.js.map +1 -1
- package/build/dcmjs.min.js +1 -1
- package/build/dcmjs.min.js.map +1 -1
- package/build/{dcmjs.shared-CKG7Js9d.cjs → dcmjs.shared-Cmkm67T1.cjs} +111 -49
- package/build/dcmjs.shared-Cmkm67T1.cjs.map +1 -0
- package/build/{dcmjs.shared-BLrcKS2A.js → dcmjs.shared-RH-AbhO5.js} +112 -50
- package/build/dcmjs.shared-RH-AbhO5.js.map +1 -0
- package/build/eventStream.cjs +6 -1
- package/build/eventStream.cjs.map +1 -1
- package/build/eventStream.es.js +6 -1
- package/build/eventStream.es.js.map +1 -1
- package/package.json +7 -7
- package/build/dcmjs.shared-BLrcKS2A.js.map +0 -1
- package/build/dcmjs.shared-CKG7Js9d.cjs.map +0 -1
|
@@ -1077,7 +1077,8 @@ var DicomMessage = /*#__PURE__*/function () {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
var length = null,
|
|
1079
1079
|
vr = null,
|
|
1080
|
-
vrType
|
|
1080
|
+
vrType,
|
|
1081
|
+
wireVrType = null;
|
|
1081
1082
|
if (implicit) {
|
|
1082
1083
|
length = stream.readUint32();
|
|
1083
1084
|
var elementData = DicomMessage.lookupTag(tag);
|
|
@@ -1105,6 +1106,7 @@ var DicomMessage = /*#__PURE__*/function () {
|
|
|
1105
1106
|
vr = core.ValueRepresentation.createByTypeString(vrType);
|
|
1106
1107
|
} else {
|
|
1107
1108
|
vrType = stream.readVR();
|
|
1109
|
+
wireVrType = vrType;
|
|
1108
1110
|
if (vrType === "UN" && DicomMessage.lookupTag(tag) && DicomMessage.lookupTag(tag).vr) {
|
|
1109
1111
|
vrType = DicomMessage.lookupTag(tag).vr;
|
|
1110
1112
|
if (vrType === "xs") {
|
|
@@ -1123,13 +1125,19 @@ var DicomMessage = /*#__PURE__*/function () {
|
|
|
1123
1125
|
length = stream.readUint16();
|
|
1124
1126
|
}
|
|
1125
1127
|
}
|
|
1128
|
+
var readSyntax = syntax;
|
|
1129
|
+
if (!implicit && wireVrType === "UN" && core.isUnSequenceValue(stream.view, stream.offset, length, vr.type)) {
|
|
1130
|
+
vr = core.ValueRepresentation.createByTypeString("SQ");
|
|
1131
|
+
readSyntax = core.IMPLICIT_LITTLE_ENDIAN;
|
|
1132
|
+
stream.setEndian(true); // the items are LE in a BE body too
|
|
1133
|
+
}
|
|
1126
1134
|
var values = [];
|
|
1127
1135
|
var rawValues = [];
|
|
1128
1136
|
if (vr.isBinary() && length > vr.maxLength && !vr.noMultiple) {
|
|
1129
1137
|
var times = length / vr.maxLength,
|
|
1130
1138
|
i = 0;
|
|
1131
1139
|
while (i++ < times) {
|
|
1132
|
-
var _vr$read = vr.read(stream, vr.maxLength,
|
|
1140
|
+
var _vr$read = vr.read(stream, vr.maxLength, readSyntax, options),
|
|
1133
1141
|
rawValue = _vr$read.rawValue,
|
|
1134
1142
|
value = _vr$read.value;
|
|
1135
1143
|
rawValues.push(rawValue);
|
|
@@ -1140,7 +1148,7 @@ var DicomMessage = /*#__PURE__*/function () {
|
|
|
1140
1148
|
var readOptions = vr.type === "SQ" ? _objectSpread2(_objectSpread2({}, options), {}, {
|
|
1141
1149
|
readItem: readItem
|
|
1142
1150
|
}) : options;
|
|
1143
|
-
var _ref = vr.read(stream, length,
|
|
1151
|
+
var _ref = vr.read(stream, length, readSyntax, readOptions) || {},
|
|
1144
1152
|
_rawValue = _ref.rawValue,
|
|
1145
1153
|
_value = _ref.value;
|
|
1146
1154
|
if (!vr.isBinary() && core.singleVRs.indexOf(vr.type) == -1) {
|
|
@@ -1600,6 +1608,8 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
1600
1608
|
_classCallCheck(this, AsyncDicomReader);
|
|
1601
1609
|
_defineProperty(this, "syntax", core.EXPLICIT_LITTLE_ENDIAN);
|
|
1602
1610
|
this.isLittleEndian = options === null || options === void 0 ? void 0 : options.isLittleEndian;
|
|
1611
|
+
// Number of sequence items being read, 0 at the top level
|
|
1612
|
+
this.sequenceDepth = 0;
|
|
1603
1613
|
// Default maxFragmentSize is 128 MB (128 * 1024 * 1024 bytes)
|
|
1604
1614
|
this.maxFragmentSize = (_options$maxFragmentS = options === null || options === void 0 ? void 0 : options.maxFragmentSize) !== null && _options$maxFragmentS !== void 0 ? _options$maxFragmentS : 128 * 1024 * 1024;
|
|
1605
1615
|
this.stream = new core.ReadBufferStream(null, _objectSpread2(_objectSpread2({
|
|
@@ -2061,17 +2071,27 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2061
2071
|
* item boundary and returns control here for the next item. Without that
|
|
2062
2072
|
* offset, read() skips the later Item tags as instructions, and all items
|
|
2063
2073
|
* of a defined-length sequence merge into the first item.
|
|
2074
|
+
*
|
|
2075
|
+
* untilTag and includeUntilTagValue apply to the top-level data set only,
|
|
2076
|
+
* so the items are read without them: an Icon Image Sequence item has its
|
|
2077
|
+
* own Pixel Data, which must not stop a read with untilTag 7FE00010.
|
|
2064
2078
|
*/
|
|
2065
2079
|
}, {
|
|
2066
2080
|
key: "readSequence",
|
|
2067
2081
|
value: (function () {
|
|
2068
2082
|
var _readSequence = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(listener, sqTagInfo, options) {
|
|
2069
|
-
var
|
|
2083
|
+
var _ref, _sqTagInfo$sequenceRe;
|
|
2084
|
+
var itemOptions, length, stream, readSyntax, endOffset, tagInfo, tag, itemLength, itemUntilOffset, decoder, _t;
|
|
2070
2085
|
return _regeneratorRuntime().wrap(function (_context6) {
|
|
2071
2086
|
while (1) switch (_context6.prev = _context6.next) {
|
|
2072
2087
|
case 0:
|
|
2088
|
+
itemOptions = _objectSpread2(_objectSpread2({}, options), {}, {
|
|
2089
|
+
untilTag: null,
|
|
2090
|
+
includeUntilTagValue: false
|
|
2091
|
+
});
|
|
2073
2092
|
length = sqTagInfo.length;
|
|
2074
|
-
stream = this.stream
|
|
2093
|
+
stream = this.stream;
|
|
2094
|
+
readSyntax = (_ref = (_sqTagInfo$sequenceRe = sqTagInfo.sequenceReadSyntax) !== null && _sqTagInfo$sequenceRe !== void 0 ? _sqTagInfo$sequenceRe : options === null || options === void 0 ? void 0 : options.readSyntax) !== null && _ref !== void 0 ? _ref : this.syntax;
|
|
2075
2095
|
endOffset = length === core.UNDEFINED_LENGTH_FIX ? Number.MAX_SAFE_INTEGER : stream.offset + length;
|
|
2076
2096
|
case 1:
|
|
2077
2097
|
_t = stream.offset < endOffset;
|
|
@@ -2085,50 +2105,78 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2085
2105
|
_t = _context6.sent;
|
|
2086
2106
|
case 3:
|
|
2087
2107
|
if (!_t) {
|
|
2088
|
-
_context6.next =
|
|
2108
|
+
_context6.next = 10;
|
|
2089
2109
|
break;
|
|
2090
2110
|
}
|
|
2091
2111
|
readLog.debug("readSequence loop", stream.offset, endOffset);
|
|
2092
|
-
tagInfo = this.readTagHeader(
|
|
2112
|
+
tagInfo = this.readTagHeader(_objectSpread2(_objectSpread2({}, itemOptions), {}, {
|
|
2113
|
+
readSyntax: readSyntax
|
|
2114
|
+
}));
|
|
2093
2115
|
tag = tagInfo.tag;
|
|
2094
2116
|
if (!(tag === core.TagHex.Item)) {
|
|
2095
|
-
_context6.next =
|
|
2117
|
+
_context6.next = 7;
|
|
2096
2118
|
break;
|
|
2097
2119
|
}
|
|
2098
2120
|
listener.startObject();
|
|
2099
2121
|
// defined-length item: stop at its own end (see doc comment)
|
|
2100
2122
|
itemLength = tagInfo.length;
|
|
2101
|
-
itemUntilOffset = itemLength === core.UNDEFINED_LENGTH_FIX ? endOffset : Math.min(stream.offset + itemLength, endOffset);
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2123
|
+
itemUntilOffset = itemLength === core.UNDEFINED_LENGTH_FIX ? endOffset : Math.min(stream.offset + itemLength, endOffset); // A SpecificCharacterSet in the item applies only to that
|
|
2124
|
+
// item (PS3.5 7.5.3), but the item is read on this stream:
|
|
2125
|
+
// put back the decoder the item started with.
|
|
2126
|
+
decoder = stream.decoder;
|
|
2127
|
+
this.sequenceDepth++;
|
|
2128
|
+
_context6.prev = 4;
|
|
2129
|
+
_context6.next = 5;
|
|
2130
|
+
return this.read(listener, _objectSpread2(_objectSpread2({}, itemOptions), {}, {
|
|
2131
|
+
untilOffset: itemUntilOffset,
|
|
2132
|
+
readSyntax: readSyntax
|
|
2105
2133
|
}));
|
|
2106
|
-
case 4:
|
|
2107
|
-
_context6.next = 7;
|
|
2108
|
-
break;
|
|
2109
2134
|
case 5:
|
|
2135
|
+
_context6.prev = 5;
|
|
2136
|
+
this.sequenceDepth--;
|
|
2137
|
+
return _context6.finish(5);
|
|
2138
|
+
case 6:
|
|
2139
|
+
stream.setDecoder(decoder);
|
|
2140
|
+
_context6.next = 9;
|
|
2141
|
+
break;
|
|
2142
|
+
case 7:
|
|
2110
2143
|
if (!(tag === core.TagHex.SequenceDelimitationEnd)) {
|
|
2111
|
-
_context6.next =
|
|
2144
|
+
_context6.next = 8;
|
|
2112
2145
|
break;
|
|
2113
2146
|
}
|
|
2114
2147
|
return _context6.abrupt("return");
|
|
2115
|
-
case
|
|
2148
|
+
case 8:
|
|
2116
2149
|
console.warn("Unknown tag info", length, tagInfo);
|
|
2117
|
-
throw new Error();
|
|
2118
|
-
case
|
|
2150
|
+
throw new Error("Expected an item or a sequence delimitation item in a sequence, found tag ".concat(tag));
|
|
2151
|
+
case 9:
|
|
2119
2152
|
_context6.next = 1;
|
|
2120
2153
|
break;
|
|
2121
|
-
case
|
|
2154
|
+
case 10:
|
|
2122
2155
|
case "end":
|
|
2123
2156
|
return _context6.stop();
|
|
2124
2157
|
}
|
|
2125
|
-
}, _callee6, this);
|
|
2158
|
+
}, _callee6, this, [[4,, 5, 6]]);
|
|
2126
2159
|
}));
|
|
2127
2160
|
function readSequence(_x3, _x4, _x5) {
|
|
2128
2161
|
return _readSequence.apply(this, arguments);
|
|
2129
2162
|
}
|
|
2130
2163
|
return readSequence;
|
|
2131
|
-
}()
|
|
2164
|
+
}()
|
|
2165
|
+
/**
|
|
2166
|
+
* The number of frames of the Pixel Data being read. NumberOfFrames is
|
|
2167
|
+
* tracked for the top-level data set only, so Pixel Data inside a sequence
|
|
2168
|
+
* item (an Icon Image Sequence item, for example) is a single frame.
|
|
2169
|
+
*/
|
|
2170
|
+
)
|
|
2171
|
+
}, {
|
|
2172
|
+
key: "getNumberOfFrames",
|
|
2173
|
+
value: function getNumberOfFrames() {
|
|
2174
|
+
var _this$listener;
|
|
2175
|
+
if (this.sequenceDepth > 0) {
|
|
2176
|
+
return 1;
|
|
2177
|
+
}
|
|
2178
|
+
return parseInt(((_this$listener = this.listener) === null || _this$listener === void 0 || (_this$listener = _this$listener.information) === null || _this$listener === void 0 ? void 0 : _this$listener.numberOfFrames) || 1);
|
|
2179
|
+
}
|
|
2132
2180
|
}, {
|
|
2133
2181
|
key: "readPixelData",
|
|
2134
2182
|
value: function readPixelData(tagInfo) {
|
|
@@ -2198,8 +2246,7 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2198
2246
|
key: "readCompressed",
|
|
2199
2247
|
value: (function () {
|
|
2200
2248
|
var _readCompressed = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_tagInfo) {
|
|
2201
|
-
var
|
|
2202
|
-
var stream, listener, transferSyntaxUid, isVideo, numberOfFrames, isSingleFrame, offsets, singleArray, startOffset, frameNumber, lastFrame, frameTag, length;
|
|
2249
|
+
var stream, listener, transferSyntaxUid, isVideo, isSingleFrame, offsets, singleArray, startOffset, frameNumber, lastFrame, frameTag, length;
|
|
2203
2250
|
return _regeneratorRuntime().wrap(function (_context8) {
|
|
2204
2251
|
while (1) switch (_context8.prev = _context8.next) {
|
|
2205
2252
|
case 0:
|
|
@@ -2210,8 +2257,7 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2210
2257
|
case 1:
|
|
2211
2258
|
// Check if this is a video transfer syntax
|
|
2212
2259
|
isVideo = core.isVideoTransferSyntax(transferSyntaxUid); // Check number of frames - only use video logic for single frame (or undefined)
|
|
2213
|
-
|
|
2214
|
-
isSingleFrame = !numberOfFrames || parseInt(numberOfFrames) <= 1;
|
|
2260
|
+
isSingleFrame = this.getNumberOfFrames() <= 1;
|
|
2215
2261
|
_context8.next = 2;
|
|
2216
2262
|
return this.readOffsets();
|
|
2217
2263
|
case 2:
|
|
@@ -2325,23 +2371,22 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2325
2371
|
key: "readUncompressed",
|
|
2326
2372
|
value: (function () {
|
|
2327
2373
|
var _readUncompressed = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee0(tagInfo) {
|
|
2328
|
-
var _listener$information2;
|
|
2329
|
-
var length, listener, numberOfFrames, frameLength, _listener$information3, _listener$information4, _listener$information5, _listener$information6, rows, cols, samplesPerPixel, bitsAllocated, bitsPerFrame, frameNumber;
|
|
2374
|
+
var length, listener, numberOfFrames, frameLength, _listener$information, _listener$information2, _listener$information3, _listener$information4, rows, cols, samplesPerPixel, bitsAllocated, bitsPerFrame, frameNumber;
|
|
2330
2375
|
return _regeneratorRuntime().wrap(function (_context0) {
|
|
2331
2376
|
while (1) switch (_context0.prev = _context0.next) {
|
|
2332
2377
|
case 0:
|
|
2333
2378
|
length = tagInfo.length;
|
|
2334
2379
|
listener = this.listener;
|
|
2335
|
-
numberOfFrames =
|
|
2380
|
+
numberOfFrames = this.getNumberOfFrames();
|
|
2336
2381
|
frameLength = Math.floor(length / numberOfFrames);
|
|
2337
2382
|
if (!(numberOfFrames > 1)) {
|
|
2338
2383
|
_context0.next = 4;
|
|
2339
2384
|
break;
|
|
2340
2385
|
}
|
|
2341
|
-
rows = (_listener$
|
|
2342
|
-
cols = (_listener$
|
|
2343
|
-
samplesPerPixel = (_listener$
|
|
2344
|
-
bitsAllocated = (_listener$
|
|
2386
|
+
rows = (_listener$information = listener.information) === null || _listener$information === void 0 ? void 0 : _listener$information.rows;
|
|
2387
|
+
cols = (_listener$information2 = listener.information) === null || _listener$information2 === void 0 ? void 0 : _listener$information2.columns;
|
|
2388
|
+
samplesPerPixel = (_listener$information3 = listener.information) === null || _listener$information3 === void 0 ? void 0 : _listener$information3.samplesPerPixel;
|
|
2389
|
+
bitsAllocated = (_listener$information4 = listener.information) === null || _listener$information4 === void 0 ? void 0 : _listener$information4.bitsAllocated;
|
|
2345
2390
|
bitsPerFrame = rows * cols * samplesPerPixel * bitsAllocated;
|
|
2346
2391
|
if (!(bitsPerFrame % 8 !== 0)) {
|
|
2347
2392
|
_context0.next = 3;
|
|
@@ -2410,18 +2455,18 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2410
2455
|
key: "readUncompressedBitFrame",
|
|
2411
2456
|
value: (function () {
|
|
2412
2457
|
var _readUncompressedBitFrame = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee1(tagInfo) {
|
|
2413
|
-
var _listener$
|
|
2458
|
+
var _listener$information5, _listener$information6, _listener$information7, _listener$information8;
|
|
2414
2459
|
var length, listener, stream, numberOfFrames, rows, cols, samplesPerPixel, bitsAllocated, bitsPerFrame, bytesPerFrame, totalBits, totalBytes, allPixelData, frameNumber, bitOffset, frameBuffer, frameView, sourceView, bitIndex, globalBitIndex, sourceByteIndex, sourceBitIndex, targetByteIndex, targetBitIndex, sourceByte, bitValue;
|
|
2415
2460
|
return _regeneratorRuntime().wrap(function (_context1) {
|
|
2416
2461
|
while (1) switch (_context1.prev = _context1.next) {
|
|
2417
2462
|
case 0:
|
|
2418
2463
|
length = tagInfo.length;
|
|
2419
2464
|
listener = this.listener, stream = this.stream;
|
|
2420
|
-
numberOfFrames =
|
|
2421
|
-
rows = (_listener$
|
|
2422
|
-
cols = (_listener$
|
|
2423
|
-
samplesPerPixel = ((_listener$
|
|
2424
|
-
bitsAllocated = (_listener$
|
|
2465
|
+
numberOfFrames = this.getNumberOfFrames();
|
|
2466
|
+
rows = (_listener$information5 = listener.information) === null || _listener$information5 === void 0 ? void 0 : _listener$information5.rows;
|
|
2467
|
+
cols = (_listener$information6 = listener.information) === null || _listener$information6 === void 0 ? void 0 : _listener$information6.columns;
|
|
2468
|
+
samplesPerPixel = ((_listener$information7 = listener.information) === null || _listener$information7 === void 0 ? void 0 : _listener$information7.samplesPerPixel) || 1;
|
|
2469
|
+
bitsAllocated = (_listener$information8 = listener.information) === null || _listener$information8 === void 0 ? void 0 : _listener$information8.bitsAllocated;
|
|
2425
2470
|
if (!(!rows || !cols || !bitsAllocated)) {
|
|
2426
2471
|
_context1.next = 1;
|
|
2427
2472
|
break;
|
|
@@ -2529,14 +2574,15 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2529
2574
|
}, {
|
|
2530
2575
|
key: "readTagHeader",
|
|
2531
2576
|
value: function readTagHeader() {
|
|
2577
|
+
var _options$readSyntax;
|
|
2532
2578
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
2533
2579
|
untilTag: null,
|
|
2534
2580
|
includeUntilTagValue: false
|
|
2535
2581
|
};
|
|
2536
|
-
var stream = this.stream
|
|
2537
|
-
syntax = this.syntax;
|
|
2582
|
+
var stream = this.stream;
|
|
2538
2583
|
var untilTag = options.untilTag,
|
|
2539
2584
|
includeUntilTagValue = options.includeUntilTagValue;
|
|
2585
|
+
var syntax = (_options$readSyntax = options.readSyntax) !== null && _options$readSyntax !== void 0 ? _options$readSyntax : this.syntax;
|
|
2540
2586
|
var implicit = syntax == core.IMPLICIT_LITTLE_ENDIAN;
|
|
2541
2587
|
var isLittleEndian = syntax !== core.EXPLICIT_BIG_ENDIAN;
|
|
2542
2588
|
stream.setEndian(isLittleEndian);
|
|
@@ -2556,6 +2602,7 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2556
2602
|
var length = null;
|
|
2557
2603
|
var vr = null;
|
|
2558
2604
|
var vrType;
|
|
2605
|
+
var wireVrType = null;
|
|
2559
2606
|
var isCommand = tagObj.group() === 0;
|
|
2560
2607
|
if (tagObj.isInstruction()) {
|
|
2561
2608
|
length = stream.readUint32();
|
|
@@ -2566,13 +2613,13 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2566
2613
|
if (elementData) {
|
|
2567
2614
|
vrType = elementData.vr;
|
|
2568
2615
|
if (vrType === "xs") {
|
|
2569
|
-
var _this$
|
|
2616
|
+
var _this$listener2;
|
|
2570
2617
|
// The dictionary meta-VR "xs" ("US or SS") resolves via
|
|
2571
2618
|
// PixelRepresentation (PS3.5), exactly like the sync
|
|
2572
2619
|
// reader (DicomMessage._readTag). The listener's
|
|
2573
2620
|
// information filter tracks (0028,0103), which precedes
|
|
2574
2621
|
// every xs tag in tag order.
|
|
2575
|
-
vrType = DicomMessage.resolveXsVrType((_this$
|
|
2622
|
+
vrType = DicomMessage.resolveXsVrType((_this$listener2 = this.listener) === null || _this$listener2 === void 0 || (_this$listener2 = _this$listener2.information) === null || _this$listener2 === void 0 ? void 0 : _this$listener2.pixelRepresentation);
|
|
2576
2623
|
}
|
|
2577
2624
|
} else {
|
|
2578
2625
|
//unknown tag
|
|
@@ -2590,13 +2637,14 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2590
2637
|
} else {
|
|
2591
2638
|
var _DicomMessage$lookupT;
|
|
2592
2639
|
vrType = stream.readVR();
|
|
2640
|
+
wireVrType = vrType;
|
|
2593
2641
|
if (vrType === "UN" && (_DicomMessage$lookupT = DicomMessage.lookupTag(tagObj)) !== null && _DicomMessage$lookupT !== void 0 && _DicomMessage$lookupT.vr) {
|
|
2594
2642
|
vrType = DicomMessage.lookupTag(tagObj).vr;
|
|
2595
2643
|
if (vrType === "xs") {
|
|
2596
|
-
var _this$
|
|
2644
|
+
var _this$listener3;
|
|
2597
2645
|
// Same PixelRepresentation-driven US/SS resolution for
|
|
2598
2646
|
// explicit-VR UN elements whose dictionary VR is "xs".
|
|
2599
|
-
vrType = DicomMessage.resolveXsVrType((_this$
|
|
2647
|
+
vrType = DicomMessage.resolveXsVrType((_this$listener3 = this.listener) === null || _this$listener3 === void 0 || (_this$listener3 = _this$listener3.information) === null || _this$listener3 === void 0 ? void 0 : _this$listener3.pixelRepresentation);
|
|
2600
2648
|
}
|
|
2601
2649
|
vr = core.ValueRepresentation.parseUnknownVr(vrType);
|
|
2602
2650
|
} else {
|
|
@@ -2609,11 +2657,16 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2609
2657
|
length = stream.readUint16();
|
|
2610
2658
|
}
|
|
2611
2659
|
}
|
|
2660
|
+
var sequenceReadSyntax;
|
|
2661
|
+
if (!implicit && wireVrType === "UN" && core.isUnSequenceValue(stream.view, stream.offset, length, vr.type)) {
|
|
2662
|
+
vr = core.ValueRepresentation.createByTypeString("SQ");
|
|
2663
|
+
sequenceReadSyntax = core.IMPLICIT_LITTLE_ENDIAN;
|
|
2664
|
+
}
|
|
2612
2665
|
var punctuatedTag = core.DicomMetaDictionary.punctuateTag(tag);
|
|
2613
2666
|
var entry = core.DicomMetaDictionary.dictionary[punctuatedTag];
|
|
2614
2667
|
|
|
2615
2668
|
// Include both the string and object values for vr and tag
|
|
2616
|
-
var header = {
|
|
2669
|
+
var header = _objectSpread2({
|
|
2617
2670
|
vrObj: vr,
|
|
2618
2671
|
vr: vr.type,
|
|
2619
2672
|
tag: tag,
|
|
@@ -2621,7 +2674,9 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2621
2674
|
vm: entry === null || entry === void 0 ? void 0 : entry.vm,
|
|
2622
2675
|
name: entry === null || entry === void 0 ? void 0 : entry.name,
|
|
2623
2676
|
length: length === core.UNDEFINED_LENGTH ? -1 : length
|
|
2624
|
-
}
|
|
2677
|
+
}, sequenceReadSyntax && {
|
|
2678
|
+
sequenceReadSyntax: sequenceReadSyntax
|
|
2679
|
+
});
|
|
2625
2680
|
return header;
|
|
2626
2681
|
}
|
|
2627
2682
|
|
|
@@ -2635,12 +2690,14 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2635
2690
|
key: "readSingle",
|
|
2636
2691
|
value: (function () {
|
|
2637
2692
|
var _readSingle = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(tagInfo, listener, options) {
|
|
2693
|
+
var _options$readSyntax2;
|
|
2638
2694
|
var length, stream, syntax, vr, values, times, i, _vr$read, value, _vr$read2, _value, delimiterChar, decoder, valuesForListener;
|
|
2639
2695
|
return _regeneratorRuntime().wrap(function (_context11) {
|
|
2640
2696
|
while (1) switch (_context11.prev = _context11.next) {
|
|
2641
2697
|
case 0:
|
|
2642
2698
|
length = tagInfo.length;
|
|
2643
|
-
stream = this.stream
|
|
2699
|
+
stream = this.stream;
|
|
2700
|
+
syntax = (_options$readSyntax2 = options === null || options === void 0 ? void 0 : options.readSyntax) !== null && _options$readSyntax2 !== void 0 ? _options$readSyntax2 : this.syntax;
|
|
2644
2701
|
_context11.next = 1;
|
|
2645
2702
|
return this.stream.ensureAvailable(length);
|
|
2646
2703
|
case 1:
|
|
@@ -12758,6 +12815,11 @@ var DICOMMicroscopyViewer = {
|
|
|
12758
12815
|
MeasurementReport: MeasurementReport$1
|
|
12759
12816
|
};
|
|
12760
12817
|
|
|
12818
|
+
/**
|
|
12819
|
+
* @deprecated The adapters moved to `@cornerstonejs/adapters`. Import them
|
|
12820
|
+
* from that package. `@dcmjs-org/dcmjs` keeps this export only for
|
|
12821
|
+
* compatibility with 0.x, and a later major release removes it.
|
|
12822
|
+
*/
|
|
12761
12823
|
var adapters = {
|
|
12762
12824
|
Cornerstone: Cornerstone,
|
|
12763
12825
|
Cornerstone3D: Cornerstone3D,
|
|
@@ -15959,4 +16021,4 @@ exports.derivations = derivations;
|
|
|
15959
16021
|
exports.normalizers = normalizers;
|
|
15960
16022
|
exports.sr = sr;
|
|
15961
16023
|
exports.utilities = utilities;
|
|
15962
|
-
//# sourceMappingURL=dcmjs.shared-
|
|
16024
|
+
//# sourceMappingURL=dcmjs.shared-Cmkm67T1.cjs.map
|