@dcmjs-org/dcmjs 1.0.0-beta.19 → 1.0.0-beta.21
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 +200 -62
- 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-DnjtTwFB.js → dcmjs.shared-CMo1hh3U.js} +127 -53
- package/build/dcmjs.shared-CMo1hh3U.js.map +1 -0
- package/build/{dcmjs.shared-L4OH_Ab_.cjs → dcmjs.shared-C_SwQ4fu.cjs} +126 -52
- package/build/dcmjs.shared-C_SwQ4fu.cjs.map +1 -0
- package/build/eventStream.cjs +1 -1
- package/build/eventStream.es.js +1 -1
- package/package.json +7 -7
- package/build/dcmjs.shared-DnjtTwFB.js.map +0 -1
- package/build/dcmjs.shared-L4OH_Ab_.cjs.map +0 -1
|
@@ -1608,7 +1608,9 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
1608
1608
|
_classCallCheck(this, AsyncDicomReader);
|
|
1609
1609
|
_defineProperty(this, "syntax", core.EXPLICIT_LITTLE_ENDIAN);
|
|
1610
1610
|
this.isLittleEndian = options === null || options === void 0 ? void 0 : options.isLittleEndian;
|
|
1611
|
-
//
|
|
1611
|
+
// Number of sequence items being read, 0 at the top level
|
|
1612
|
+
this.sequenceDepth = 0;
|
|
1613
|
+
// Default maxFragmentSize is 128 MB; a Big Endian fragment is at least one word, so it can be larger
|
|
1612
1614
|
this.maxFragmentSize = (_options$maxFragmentS = options === null || options === void 0 ? void 0 : options.maxFragmentSize) !== null && _options$maxFragmentS !== void 0 ? _options$maxFragmentS : 128 * 1024 * 1024;
|
|
1613
1615
|
this.stream = new core.ReadBufferStream(null, _objectSpread2(_objectSpread2({
|
|
1614
1616
|
clearBuffers: true
|
|
@@ -2069,16 +2071,24 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2069
2071
|
* item boundary and returns control here for the next item. Without that
|
|
2070
2072
|
* offset, read() skips the later Item tags as instructions, and all items
|
|
2071
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.
|
|
2072
2078
|
*/
|
|
2073
2079
|
}, {
|
|
2074
2080
|
key: "readSequence",
|
|
2075
2081
|
value: (function () {
|
|
2076
2082
|
var _readSequence = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(listener, sqTagInfo, options) {
|
|
2077
2083
|
var _ref, _sqTagInfo$sequenceRe;
|
|
2078
|
-
var length, stream, readSyntax, endOffset, tagInfo, tag, itemLength, itemUntilOffset, decoder, _t;
|
|
2084
|
+
var itemOptions, length, stream, readSyntax, endOffset, tagInfo, tag, itemLength, itemUntilOffset, decoder, _t;
|
|
2079
2085
|
return _regeneratorRuntime().wrap(function (_context6) {
|
|
2080
2086
|
while (1) switch (_context6.prev = _context6.next) {
|
|
2081
2087
|
case 0:
|
|
2088
|
+
itemOptions = _objectSpread2(_objectSpread2({}, options), {}, {
|
|
2089
|
+
untilTag: null,
|
|
2090
|
+
includeUntilTagValue: false
|
|
2091
|
+
});
|
|
2082
2092
|
length = sqTagInfo.length;
|
|
2083
2093
|
stream = this.stream;
|
|
2084
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;
|
|
@@ -2095,16 +2105,16 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2095
2105
|
_t = _context6.sent;
|
|
2096
2106
|
case 3:
|
|
2097
2107
|
if (!_t) {
|
|
2098
|
-
_context6.next =
|
|
2108
|
+
_context6.next = 10;
|
|
2099
2109
|
break;
|
|
2100
2110
|
}
|
|
2101
2111
|
readLog.debug("readSequence loop", stream.offset, endOffset);
|
|
2102
|
-
tagInfo = this.readTagHeader(_objectSpread2(_objectSpread2({},
|
|
2112
|
+
tagInfo = this.readTagHeader(_objectSpread2(_objectSpread2({}, itemOptions), {}, {
|
|
2103
2113
|
readSyntax: readSyntax
|
|
2104
2114
|
}));
|
|
2105
2115
|
tag = tagInfo.tag;
|
|
2106
2116
|
if (!(tag === core.TagHex.Item)) {
|
|
2107
|
-
_context6.next =
|
|
2117
|
+
_context6.next = 7;
|
|
2108
2118
|
break;
|
|
2109
2119
|
}
|
|
2110
2120
|
listener.startObject();
|
|
@@ -2114,38 +2124,59 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2114
2124
|
// item (PS3.5 7.5.3), but the item is read on this stream:
|
|
2115
2125
|
// put back the decoder the item started with.
|
|
2116
2126
|
decoder = stream.decoder;
|
|
2117
|
-
|
|
2118
|
-
|
|
2127
|
+
this.sequenceDepth++;
|
|
2128
|
+
_context6.prev = 4;
|
|
2129
|
+
_context6.next = 5;
|
|
2130
|
+
return this.read(listener, _objectSpread2(_objectSpread2({}, itemOptions), {}, {
|
|
2119
2131
|
untilOffset: itemUntilOffset,
|
|
2120
2132
|
readSyntax: readSyntax
|
|
2121
2133
|
}));
|
|
2122
|
-
case
|
|
2134
|
+
case 5:
|
|
2135
|
+
_context6.prev = 5;
|
|
2136
|
+
this.sequenceDepth--;
|
|
2137
|
+
return _context6.finish(5);
|
|
2138
|
+
case 6:
|
|
2123
2139
|
stream.setDecoder(decoder);
|
|
2124
|
-
_context6.next =
|
|
2140
|
+
_context6.next = 9;
|
|
2125
2141
|
break;
|
|
2126
|
-
case
|
|
2142
|
+
case 7:
|
|
2127
2143
|
if (!(tag === core.TagHex.SequenceDelimitationEnd)) {
|
|
2128
|
-
_context6.next =
|
|
2144
|
+
_context6.next = 8;
|
|
2129
2145
|
break;
|
|
2130
2146
|
}
|
|
2131
2147
|
return _context6.abrupt("return");
|
|
2132
|
-
case
|
|
2148
|
+
case 8:
|
|
2133
2149
|
console.warn("Unknown tag info", length, tagInfo);
|
|
2134
|
-
throw new Error();
|
|
2135
|
-
case
|
|
2150
|
+
throw new Error("Expected an item or a sequence delimitation item in a sequence, found tag ".concat(tag));
|
|
2151
|
+
case 9:
|
|
2136
2152
|
_context6.next = 1;
|
|
2137
2153
|
break;
|
|
2138
|
-
case
|
|
2154
|
+
case 10:
|
|
2139
2155
|
case "end":
|
|
2140
2156
|
return _context6.stop();
|
|
2141
2157
|
}
|
|
2142
|
-
}, _callee6, this);
|
|
2158
|
+
}, _callee6, this, [[4,, 5, 6]]);
|
|
2143
2159
|
}));
|
|
2144
2160
|
function readSequence(_x3, _x4, _x5) {
|
|
2145
2161
|
return _readSequence.apply(this, arguments);
|
|
2146
2162
|
}
|
|
2147
2163
|
return readSequence;
|
|
2148
|
-
}()
|
|
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
|
+
}
|
|
2149
2180
|
}, {
|
|
2150
2181
|
key: "readPixelData",
|
|
2151
2182
|
value: function readPixelData(tagInfo) {
|
|
@@ -2158,16 +2189,28 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2158
2189
|
/**
|
|
2159
2190
|
* Emits one or more listener.value() calls for a fragment, splitting if needed.
|
|
2160
2191
|
* This does NOT start/pop any array contexts; callers control the surrounding structure.
|
|
2192
|
+
* In Explicit VR Big Endian, each fragment holds whole words of wordWidth
|
|
2193
|
+
* bytes, swapped to little endian.
|
|
2161
2194
|
*/
|
|
2162
2195
|
}, {
|
|
2163
2196
|
key: "_emitSplitValues",
|
|
2164
2197
|
value: (function () {
|
|
2165
2198
|
var _emitSplitValues2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(length) {
|
|
2166
2199
|
var _listener$awaitDrain;
|
|
2167
|
-
var
|
|
2200
|
+
var wordWidth,
|
|
2201
|
+
stream,
|
|
2202
|
+
listener,
|
|
2203
|
+
maxFragmentSize,
|
|
2204
|
+
swap,
|
|
2205
|
+
fragmentSize,
|
|
2206
|
+
offset,
|
|
2207
|
+
chunkSize,
|
|
2208
|
+
buffer,
|
|
2209
|
+
_args7 = arguments;
|
|
2168
2210
|
return _regeneratorRuntime().wrap(function (_context7) {
|
|
2169
2211
|
while (1) switch (_context7.prev = _context7.next) {
|
|
2170
2212
|
case 0:
|
|
2213
|
+
wordWidth = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : 1;
|
|
2171
2214
|
stream = this.stream, listener = this.listener;
|
|
2172
2215
|
_context7.next = 1;
|
|
2173
2216
|
return (_listener$awaitDrain = listener.awaitDrain) === null || _listener$awaitDrain === void 0 ? void 0 : _listener$awaitDrain.call(listener);
|
|
@@ -2179,6 +2222,8 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2179
2222
|
}
|
|
2180
2223
|
throw new Error("maxFragmentSize must be a positive number, got ".concat(maxFragmentSize));
|
|
2181
2224
|
case 2:
|
|
2225
|
+
swap = this.syntax === core.EXPLICIT_BIG_ENDIAN && wordWidth > 1;
|
|
2226
|
+
fragmentSize = swap ? Math.max(wordWidth, maxFragmentSize - maxFragmentSize % wordWidth) : maxFragmentSize;
|
|
2182
2227
|
offset = 0;
|
|
2183
2228
|
case 3:
|
|
2184
2229
|
if (!(offset < length)) {
|
|
@@ -2186,11 +2231,14 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2186
2231
|
break;
|
|
2187
2232
|
}
|
|
2188
2233
|
readLog.trace("_emitSplitValues loop", offset, length);
|
|
2189
|
-
chunkSize = Math.min(
|
|
2234
|
+
chunkSize = Math.min(fragmentSize, length - offset);
|
|
2190
2235
|
_context7.next = 4;
|
|
2191
2236
|
return stream.ensureAvailable(chunkSize);
|
|
2192
2237
|
case 4:
|
|
2193
2238
|
buffer = stream.readArrayBuffer(chunkSize);
|
|
2239
|
+
if (swap) {
|
|
2240
|
+
core.swapBytes(buffer, wordWidth);
|
|
2241
|
+
}
|
|
2194
2242
|
listener.value(buffer);
|
|
2195
2243
|
offset += chunkSize;
|
|
2196
2244
|
stream.consume();
|
|
@@ -2215,8 +2263,7 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2215
2263
|
key: "readCompressed",
|
|
2216
2264
|
value: (function () {
|
|
2217
2265
|
var _readCompressed = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_tagInfo) {
|
|
2218
|
-
var
|
|
2219
|
-
var stream, listener, transferSyntaxUid, isVideo, numberOfFrames, isSingleFrame, offsets, singleArray, startOffset, frameNumber, lastFrame, frameTag, length;
|
|
2266
|
+
var stream, listener, transferSyntaxUid, isVideo, isSingleFrame, offsets, singleArray, startOffset, frameNumber, lastFrame, frameTag, length;
|
|
2220
2267
|
return _regeneratorRuntime().wrap(function (_context8) {
|
|
2221
2268
|
while (1) switch (_context8.prev = _context8.next) {
|
|
2222
2269
|
case 0:
|
|
@@ -2227,8 +2274,7 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2227
2274
|
case 1:
|
|
2228
2275
|
// Check if this is a video transfer syntax
|
|
2229
2276
|
isVideo = core.isVideoTransferSyntax(transferSyntaxUid); // Check number of frames - only use video logic for single frame (or undefined)
|
|
2230
|
-
|
|
2231
|
-
isSingleFrame = !numberOfFrames || parseInt(numberOfFrames) <= 1;
|
|
2277
|
+
isSingleFrame = this.getNumberOfFrames() <= 1;
|
|
2232
2278
|
_context8.next = 2;
|
|
2233
2279
|
return this.readOffsets();
|
|
2234
2280
|
case 2:
|
|
@@ -2342,23 +2388,23 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2342
2388
|
key: "readUncompressed",
|
|
2343
2389
|
value: (function () {
|
|
2344
2390
|
var _readUncompressed = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee0(tagInfo) {
|
|
2345
|
-
var _listener$information2;
|
|
2346
|
-
var length, listener, numberOfFrames, frameLength, _listener$information3, _listener$information4, _listener$information5, _listener$information6, rows, cols, samplesPerPixel, bitsAllocated, bitsPerFrame, frameNumber;
|
|
2391
|
+
var length, listener, wordWidth, numberOfFrames, frameLength, _listener$information, _listener$information2, _listener$information3, _listener$information4, rows, cols, samplesPerPixel, bitsAllocated, bitsPerFrame, allPixelData, offset, frameNumber;
|
|
2347
2392
|
return _regeneratorRuntime().wrap(function (_context0) {
|
|
2348
2393
|
while (1) switch (_context0.prev = _context0.next) {
|
|
2349
2394
|
case 0:
|
|
2350
2395
|
length = tagInfo.length;
|
|
2351
2396
|
listener = this.listener;
|
|
2352
|
-
|
|
2397
|
+
wordWidth = this.wordWidth(tagInfo);
|
|
2398
|
+
numberOfFrames = this.getNumberOfFrames();
|
|
2353
2399
|
frameLength = Math.floor(length / numberOfFrames);
|
|
2354
2400
|
if (!(numberOfFrames > 1)) {
|
|
2355
2401
|
_context0.next = 4;
|
|
2356
2402
|
break;
|
|
2357
2403
|
}
|
|
2358
|
-
rows = (_listener$
|
|
2359
|
-
cols = (_listener$
|
|
2360
|
-
samplesPerPixel = (_listener$
|
|
2361
|
-
bitsAllocated = (_listener$
|
|
2404
|
+
rows = (_listener$information = listener.information) === null || _listener$information === void 0 ? void 0 : _listener$information.rows;
|
|
2405
|
+
cols = (_listener$information2 = listener.information) === null || _listener$information2 === void 0 ? void 0 : _listener$information2.columns;
|
|
2406
|
+
samplesPerPixel = (_listener$information3 = listener.information) === null || _listener$information3 === void 0 ? void 0 : _listener$information3.samplesPerPixel;
|
|
2407
|
+
bitsAllocated = (_listener$information4 = listener.information) === null || _listener$information4 === void 0 ? void 0 : _listener$information4.bitsAllocated;
|
|
2362
2408
|
bitsPerFrame = rows * cols * samplesPerPixel * bitsAllocated;
|
|
2363
2409
|
if (!(bitsPerFrame % 8 !== 0)) {
|
|
2364
2410
|
_context0.next = 3;
|
|
@@ -2381,24 +2427,41 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2381
2427
|
}
|
|
2382
2428
|
throw new Error("Invalid frame length: ".concat(length, " for ").concat(numberOfFrames, " frames"));
|
|
2383
2429
|
case 4:
|
|
2384
|
-
|
|
2430
|
+
if (!(this.syntax === core.EXPLICIT_BIG_ENDIAN && frameLength % wordWidth !== 0)) {
|
|
2431
|
+
_context0.next = 6;
|
|
2432
|
+
break;
|
|
2433
|
+
}
|
|
2434
|
+
_context0.next = 5;
|
|
2435
|
+
return this.stream.ensureAvailable(length);
|
|
2385
2436
|
case 5:
|
|
2437
|
+
allPixelData = this.stream.readArrayBuffer(length);
|
|
2438
|
+
this.stream.consume();
|
|
2439
|
+
core.swapBytes(allPixelData, wordWidth);
|
|
2440
|
+
for (offset = 0; offset < length; offset += frameLength) {
|
|
2441
|
+
listener.startObject([]);
|
|
2442
|
+
listener.value(allPixelData.slice(offset, offset + frameLength));
|
|
2443
|
+
listener.pop();
|
|
2444
|
+
}
|
|
2445
|
+
return _context0.abrupt("return");
|
|
2446
|
+
case 6:
|
|
2447
|
+
frameNumber = 0;
|
|
2448
|
+
case 7:
|
|
2386
2449
|
if (!(frameNumber < numberOfFrames)) {
|
|
2387
|
-
_context0.next =
|
|
2450
|
+
_context0.next = 10;
|
|
2388
2451
|
break;
|
|
2389
2452
|
}
|
|
2390
2453
|
readLog.trace("readUncompressed loop", frameNumber, numberOfFrames);
|
|
2391
2454
|
listener.startObject([]);
|
|
2392
|
-
_context0.next =
|
|
2393
|
-
return this._emitSplitValues(frameLength);
|
|
2394
|
-
case
|
|
2455
|
+
_context0.next = 8;
|
|
2456
|
+
return this._emitSplitValues(frameLength, wordWidth);
|
|
2457
|
+
case 8:
|
|
2395
2458
|
listener.pop();
|
|
2396
2459
|
// console.log(stream.getBufferMemoryInfo());
|
|
2397
|
-
case
|
|
2460
|
+
case 9:
|
|
2398
2461
|
frameNumber++;
|
|
2399
|
-
_context0.next =
|
|
2462
|
+
_context0.next = 7;
|
|
2400
2463
|
break;
|
|
2401
|
-
case
|
|
2464
|
+
case 10:
|
|
2402
2465
|
case "end":
|
|
2403
2466
|
return _context0.stop();
|
|
2404
2467
|
}
|
|
@@ -2427,18 +2490,18 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2427
2490
|
key: "readUncompressedBitFrame",
|
|
2428
2491
|
value: (function () {
|
|
2429
2492
|
var _readUncompressedBitFrame = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee1(tagInfo) {
|
|
2430
|
-
var _listener$
|
|
2493
|
+
var _listener$information5, _listener$information6, _listener$information7, _listener$information8;
|
|
2431
2494
|
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;
|
|
2432
2495
|
return _regeneratorRuntime().wrap(function (_context1) {
|
|
2433
2496
|
while (1) switch (_context1.prev = _context1.next) {
|
|
2434
2497
|
case 0:
|
|
2435
2498
|
length = tagInfo.length;
|
|
2436
2499
|
listener = this.listener, stream = this.stream;
|
|
2437
|
-
numberOfFrames =
|
|
2438
|
-
rows = (_listener$
|
|
2439
|
-
cols = (_listener$
|
|
2440
|
-
samplesPerPixel = ((_listener$
|
|
2441
|
-
bitsAllocated = (_listener$
|
|
2500
|
+
numberOfFrames = this.getNumberOfFrames();
|
|
2501
|
+
rows = (_listener$information5 = listener.information) === null || _listener$information5 === void 0 ? void 0 : _listener$information5.rows;
|
|
2502
|
+
cols = (_listener$information6 = listener.information) === null || _listener$information6 === void 0 ? void 0 : _listener$information6.columns;
|
|
2503
|
+
samplesPerPixel = ((_listener$information7 = listener.information) === null || _listener$information7 === void 0 ? void 0 : _listener$information7.samplesPerPixel) || 1;
|
|
2504
|
+
bitsAllocated = (_listener$information8 = listener.information) === null || _listener$information8 === void 0 ? void 0 : _listener$information8.bitsAllocated;
|
|
2442
2505
|
if (!(!rows || !cols || !bitsAllocated)) {
|
|
2443
2506
|
_context1.next = 1;
|
|
2444
2507
|
break;
|
|
@@ -2466,6 +2529,10 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2466
2529
|
case 4:
|
|
2467
2530
|
allPixelData = stream.readArrayBuffer(totalBytes);
|
|
2468
2531
|
stream.consume();
|
|
2532
|
+
if (this.syntax === core.EXPLICIT_BIG_ENDIAN) {
|
|
2533
|
+
// the bits of OW data are packed in big endian words
|
|
2534
|
+
core.swapBytes(allPixelData, this.wordWidth(tagInfo));
|
|
2535
|
+
}
|
|
2469
2536
|
|
|
2470
2537
|
// Extract each frame, unpacking bits so each frame starts at byte 0
|
|
2471
2538
|
for (frameNumber = 0; frameNumber < numberOfFrames; frameNumber++) {
|
|
@@ -2507,7 +2574,8 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2507
2574
|
}()
|
|
2508
2575
|
/**
|
|
2509
2576
|
* Reads raw binary data in chunks and delivers it to the listener.
|
|
2510
|
-
*
|
|
2577
|
+
* Reads the value in fragments of `maxFragmentSize` bytes.
|
|
2578
|
+
* OW/OF/OL/OD/OV words come as little endian, as on the other read paths.
|
|
2511
2579
|
*/
|
|
2512
2580
|
)
|
|
2513
2581
|
}, {
|
|
@@ -2520,7 +2588,7 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2520
2588
|
case 0:
|
|
2521
2589
|
length = tagInfo.length;
|
|
2522
2590
|
_context10.next = 1;
|
|
2523
|
-
return this._emitSplitValues(length);
|
|
2591
|
+
return this._emitSplitValues(length, this.wordWidth(tagInfo));
|
|
2524
2592
|
case 1:
|
|
2525
2593
|
case "end":
|
|
2526
2594
|
return _context10.stop();
|
|
@@ -2531,7 +2599,13 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2531
2599
|
return _readRawBinary.apply(this, arguments);
|
|
2532
2600
|
}
|
|
2533
2601
|
return readRawBinary;
|
|
2534
|
-
}())
|
|
2602
|
+
}() /** Bytes per word of the value field; "ox" (a UN pixel data) is OW. */)
|
|
2603
|
+
}, {
|
|
2604
|
+
key: "wordWidth",
|
|
2605
|
+
value: function wordWidth(tagInfo) {
|
|
2606
|
+
var _ValueRepresentation$;
|
|
2607
|
+
return (_ValueRepresentation$ = core.ValueRepresentation.createByTypeString(tagInfo.vr).wordWidth) !== null && _ValueRepresentation$ !== void 0 ? _ValueRepresentation$ : 1;
|
|
2608
|
+
}
|
|
2535
2609
|
}, {
|
|
2536
2610
|
key: "isSequence",
|
|
2537
2611
|
value: function isSequence(tagInfo) {
|
|
@@ -2585,13 +2659,13 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2585
2659
|
if (elementData) {
|
|
2586
2660
|
vrType = elementData.vr;
|
|
2587
2661
|
if (vrType === "xs") {
|
|
2588
|
-
var _this$
|
|
2662
|
+
var _this$listener2;
|
|
2589
2663
|
// The dictionary meta-VR "xs" ("US or SS") resolves via
|
|
2590
2664
|
// PixelRepresentation (PS3.5), exactly like the sync
|
|
2591
2665
|
// reader (DicomMessage._readTag). The listener's
|
|
2592
2666
|
// information filter tracks (0028,0103), which precedes
|
|
2593
2667
|
// every xs tag in tag order.
|
|
2594
|
-
vrType = DicomMessage.resolveXsVrType((_this$
|
|
2668
|
+
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);
|
|
2595
2669
|
}
|
|
2596
2670
|
} else {
|
|
2597
2671
|
//unknown tag
|
|
@@ -2613,10 +2687,10 @@ var AsyncDicomReader = /*#__PURE__*/function () {
|
|
|
2613
2687
|
if (vrType === "UN" && (_DicomMessage$lookupT = DicomMessage.lookupTag(tagObj)) !== null && _DicomMessage$lookupT !== void 0 && _DicomMessage$lookupT.vr) {
|
|
2614
2688
|
vrType = DicomMessage.lookupTag(tagObj).vr;
|
|
2615
2689
|
if (vrType === "xs") {
|
|
2616
|
-
var _this$
|
|
2690
|
+
var _this$listener3;
|
|
2617
2691
|
// Same PixelRepresentation-driven US/SS resolution for
|
|
2618
2692
|
// explicit-VR UN elements whose dictionary VR is "xs".
|
|
2619
|
-
vrType = DicomMessage.resolveXsVrType((_this$
|
|
2693
|
+
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);
|
|
2620
2694
|
}
|
|
2621
2695
|
vr = core.ValueRepresentation.parseUnknownVr(vrType);
|
|
2622
2696
|
} else {
|
|
@@ -15993,4 +16067,4 @@ exports.derivations = derivations;
|
|
|
15993
16067
|
exports.normalizers = normalizers;
|
|
15994
16068
|
exports.sr = sr;
|
|
15995
16069
|
exports.utilities = utilities;
|
|
15996
|
-
//# sourceMappingURL=dcmjs.shared-
|
|
16070
|
+
//# sourceMappingURL=dcmjs.shared-C_SwQ4fu.cjs.map
|