dicom-curate 0.16.0 → 0.20.0
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/dist/esm/applyMappingsWorker.js +69 -64
- package/dist/esm/collectMappings.js +52 -51
- package/dist/esm/curateDict.js +65 -59
- package/dist/esm/curateOne.js +69 -64
- package/dist/esm/getParser.js +143 -142
- package/dist/esm/index.js +69 -64
- package/dist/types/types.d.ts +1 -1
- package/dist/umd/dicom-curate.umd.js +60 -36
- package/dist/umd/dicom-curate.umd.js.map +1 -1
- package/dist/umd/dicom-curate.umd.min.js +4 -4
- package/dist/umd/dicom-curate.umd.min.js.map +1 -1
- package/package.json +12 -5
|
@@ -564,11 +564,11 @@ var require_dcmjs = __commonJS({
|
|
|
564
564
|
}
|
|
565
565
|
return object;
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function _get4() {
|
|
568
568
|
if (typeof Reflect !== "undefined" && Reflect.get) {
|
|
569
|
-
|
|
569
|
+
_get4 = Reflect.get.bind();
|
|
570
570
|
} else {
|
|
571
|
-
|
|
571
|
+
_get4 = function _get5(target, property, receiver) {
|
|
572
572
|
var base = _superPropBase(target, property);
|
|
573
573
|
if (!base)
|
|
574
574
|
return;
|
|
@@ -579,7 +579,7 @@ var require_dcmjs = __commonJS({
|
|
|
579
579
|
return desc.value;
|
|
580
580
|
};
|
|
581
581
|
}
|
|
582
|
-
return
|
|
582
|
+
return _get4.apply(this, arguments);
|
|
583
583
|
}
|
|
584
584
|
function _slicedToArray(arr, i4) {
|
|
585
585
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i4) || _unsupportedIterableToArray(arr, i4) || _nonIterableRest();
|
|
@@ -6095,8 +6095,8 @@ var require_dcmjs = __commonJS({
|
|
|
6095
6095
|
}, {
|
|
6096
6096
|
key: "writeBytes",
|
|
6097
6097
|
value: function writeBytes(stream, value, writeOptions) {
|
|
6098
|
-
var written =
|
|
6099
|
-
return
|
|
6098
|
+
var written = _get4(_getPrototypeOf(AsciiStringRepresentation2.prototype), "write", this).call(this, stream, "AsciiString", value);
|
|
6099
|
+
return _get4(_getPrototypeOf(AsciiStringRepresentation2.prototype), "writeBytes", this).call(this, stream, value, written, writeOptions);
|
|
6100
6100
|
}
|
|
6101
6101
|
}]);
|
|
6102
6102
|
return AsciiStringRepresentation2;
|
|
@@ -6115,8 +6115,8 @@ var require_dcmjs = __commonJS({
|
|
|
6115
6115
|
}, {
|
|
6116
6116
|
key: "writeBytes",
|
|
6117
6117
|
value: function writeBytes(stream, value, writeOptions) {
|
|
6118
|
-
var written =
|
|
6119
|
-
return
|
|
6118
|
+
var written = _get4(_getPrototypeOf(EncodedStringRepresentation2.prototype), "write", this).call(this, stream, "UTF8String", value);
|
|
6119
|
+
return _get4(_getPrototypeOf(EncodedStringRepresentation2.prototype), "writeBytes", this).call(this, stream, value, written, writeOptions);
|
|
6120
6120
|
}
|
|
6121
6121
|
}]);
|
|
6122
6122
|
return EncodedStringRepresentation2;
|
|
@@ -6195,7 +6195,7 @@ var require_dcmjs = __commonJS({
|
|
|
6195
6195
|
var binaryData = value[0];
|
|
6196
6196
|
binaryStream = new ReadBufferStream(binaryData);
|
|
6197
6197
|
stream.concat(binaryStream);
|
|
6198
|
-
return
|
|
6198
|
+
return _get4(_getPrototypeOf(BinaryRepresentation2.prototype), "writeBytes", this).call(this, stream, binaryData, [binaryStream.size], writeOptions);
|
|
6199
6199
|
}
|
|
6200
6200
|
}
|
|
6201
6201
|
}, {
|
|
@@ -6381,7 +6381,7 @@ var require_dcmjs = __commonJS({
|
|
|
6381
6381
|
}, {
|
|
6382
6382
|
key: "writeBytes",
|
|
6383
6383
|
value: function writeBytes(stream, value, writeOptions) {
|
|
6384
|
-
return
|
|
6384
|
+
return _get4(_getPrototypeOf(AttributeTag2.prototype), "writeBytes", this).call(this, stream, value, _get4(_getPrototypeOf(AttributeTag2.prototype), "write", this).call(this, stream, "TwoUint16s", value), writeOptions);
|
|
6385
6385
|
}
|
|
6386
6386
|
}]);
|
|
6387
6387
|
return AttributeTag2;
|
|
@@ -6406,7 +6406,7 @@ var require_dcmjs = __commonJS({
|
|
|
6406
6406
|
if (isRangeQuery) {
|
|
6407
6407
|
this.maxLength = 18;
|
|
6408
6408
|
}
|
|
6409
|
-
var result =
|
|
6409
|
+
var result = _get4(_getPrototypeOf(DateValue2.prototype), "writeBytes", this).call(this, stream, value, writeOptions);
|
|
6410
6410
|
this.maxLength = originalMaxLength;
|
|
6411
6411
|
return result;
|
|
6412
6412
|
}
|
|
@@ -6484,7 +6484,7 @@ var require_dcmjs = __commonJS({
|
|
|
6484
6484
|
var val = Array.isArray(value) ? value.map(function(ds) {
|
|
6485
6485
|
return _this8.convertToString(ds);
|
|
6486
6486
|
}) : [this.convertToString(value)];
|
|
6487
|
-
return
|
|
6487
|
+
return _get4(_getPrototypeOf(DecimalString2.prototype), "writeBytes", this).call(this, stream, val, writeOptions);
|
|
6488
6488
|
}
|
|
6489
6489
|
}]);
|
|
6490
6490
|
return DecimalString2;
|
|
@@ -6508,7 +6508,7 @@ var require_dcmjs = __commonJS({
|
|
|
6508
6508
|
if (isRangeQuery) {
|
|
6509
6509
|
this.maxLength = 54;
|
|
6510
6510
|
}
|
|
6511
|
-
var result =
|
|
6511
|
+
var result = _get4(_getPrototypeOf(DateTime2.prototype), "writeBytes", this).call(this, stream, value, writeOptions);
|
|
6512
6512
|
this.maxLength = originalMaxLength;
|
|
6513
6513
|
return result;
|
|
6514
6514
|
}
|
|
@@ -6540,7 +6540,7 @@ var require_dcmjs = __commonJS({
|
|
|
6540
6540
|
}, {
|
|
6541
6541
|
key: "writeBytes",
|
|
6542
6542
|
value: function writeBytes(stream, value, writeOptions) {
|
|
6543
|
-
return
|
|
6543
|
+
return _get4(_getPrototypeOf(FloatingPointSingle2.prototype), "writeBytes", this).call(this, stream, value, _get4(_getPrototypeOf(FloatingPointSingle2.prototype), "write", this).call(this, stream, "Float", value), writeOptions);
|
|
6544
6544
|
}
|
|
6545
6545
|
}]);
|
|
6546
6546
|
return FloatingPointSingle2;
|
|
@@ -6570,7 +6570,7 @@ var require_dcmjs = __commonJS({
|
|
|
6570
6570
|
}, {
|
|
6571
6571
|
key: "writeBytes",
|
|
6572
6572
|
value: function writeBytes(stream, value, writeOptions) {
|
|
6573
|
-
return
|
|
6573
|
+
return _get4(_getPrototypeOf(FloatingPointDouble2.prototype), "writeBytes", this).call(this, stream, value, _get4(_getPrototypeOf(FloatingPointDouble2.prototype), "write", this).call(this, stream, "Double", value), writeOptions);
|
|
6574
6574
|
}
|
|
6575
6575
|
}]);
|
|
6576
6576
|
return FloatingPointDouble2;
|
|
@@ -6611,7 +6611,7 @@ var require_dcmjs = __commonJS({
|
|
|
6611
6611
|
var val = Array.isArray(value) ? value.map(function(is) {
|
|
6612
6612
|
return _this13.convertToString(is);
|
|
6613
6613
|
}) : [this.convertToString(value)];
|
|
6614
|
-
return
|
|
6614
|
+
return _get4(_getPrototypeOf(IntegerString2.prototype), "writeBytes", this).call(this, stream, val, writeOptions);
|
|
6615
6615
|
}
|
|
6616
6616
|
}]);
|
|
6617
6617
|
return IntegerString2;
|
|
@@ -6751,7 +6751,7 @@ var require_dcmjs = __commonJS({
|
|
|
6751
6751
|
}, {
|
|
6752
6752
|
key: "writeBytes",
|
|
6753
6753
|
value: function writeBytes(stream, value, writeOptions) {
|
|
6754
|
-
return
|
|
6754
|
+
return _get4(_getPrototypeOf(PersonName2.prototype), "writeBytes", this).call(this, stream, dicomJson.pnObjectToString(value), writeOptions);
|
|
6755
6755
|
}
|
|
6756
6756
|
}], [{
|
|
6757
6757
|
key: "checkComponentLengths",
|
|
@@ -6809,7 +6809,7 @@ var require_dcmjs = __commonJS({
|
|
|
6809
6809
|
}, {
|
|
6810
6810
|
key: "writeBytes",
|
|
6811
6811
|
value: function writeBytes(stream, value, writeOptions) {
|
|
6812
|
-
return
|
|
6812
|
+
return _get4(_getPrototypeOf(SignedLong2.prototype), "writeBytes", this).call(this, stream, value, _get4(_getPrototypeOf(SignedLong2.prototype), "write", this).call(this, stream, "Int32", value), writeOptions);
|
|
6813
6813
|
}
|
|
6814
6814
|
}]);
|
|
6815
6815
|
return SignedLong2;
|
|
@@ -6906,21 +6906,21 @@ var require_dcmjs = __commonJS({
|
|
|
6906
6906
|
if (value) {
|
|
6907
6907
|
for (var i4 = 0; i4 < value.length; i4++) {
|
|
6908
6908
|
var item = value[i4];
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6909
|
+
_get4(_getPrototypeOf(SequenceOfItems2.prototype), "write", this).call(this, stream, "Uint16", 65534);
|
|
6910
|
+
_get4(_getPrototypeOf(SequenceOfItems2.prototype), "write", this).call(this, stream, "Uint16", 57344);
|
|
6911
|
+
_get4(_getPrototypeOf(SequenceOfItems2.prototype), "write", this).call(this, stream, "Uint32", 4294967295);
|
|
6912
6912
|
written += DicomMessage$3.write(item, stream, syntax, writeOptions);
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6913
|
+
_get4(_getPrototypeOf(SequenceOfItems2.prototype), "write", this).call(this, stream, "Uint16", 65534);
|
|
6914
|
+
_get4(_getPrototypeOf(SequenceOfItems2.prototype), "write", this).call(this, stream, "Uint16", 57357);
|
|
6915
|
+
_get4(_getPrototypeOf(SequenceOfItems2.prototype), "write", this).call(this, stream, "Uint32", 0);
|
|
6916
6916
|
written += 16;
|
|
6917
6917
|
}
|
|
6918
6918
|
}
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6919
|
+
_get4(_getPrototypeOf(SequenceOfItems2.prototype), "write", this).call(this, stream, "Uint16", 65534);
|
|
6920
|
+
_get4(_getPrototypeOf(SequenceOfItems2.prototype), "write", this).call(this, stream, "Uint16", 57565);
|
|
6921
|
+
_get4(_getPrototypeOf(SequenceOfItems2.prototype), "write", this).call(this, stream, "Uint32", 0);
|
|
6922
6922
|
written += 8;
|
|
6923
|
-
return
|
|
6923
|
+
return _get4(_getPrototypeOf(SequenceOfItems2.prototype), "writeBytes", this).call(this, stream, value, [written], writeOptions);
|
|
6924
6924
|
}
|
|
6925
6925
|
}]);
|
|
6926
6926
|
return SequenceOfItems2;
|
|
@@ -6946,7 +6946,7 @@ var require_dcmjs = __commonJS({
|
|
|
6946
6946
|
}, {
|
|
6947
6947
|
key: "writeBytes",
|
|
6948
6948
|
value: function writeBytes(stream, value, writeOptions) {
|
|
6949
|
-
return
|
|
6949
|
+
return _get4(_getPrototypeOf(SignedShort2.prototype), "writeBytes", this).call(this, stream, value, _get4(_getPrototypeOf(SignedShort2.prototype), "write", this).call(this, stream, "Int16", value), writeOptions);
|
|
6950
6950
|
}
|
|
6951
6951
|
}]);
|
|
6952
6952
|
return SignedShort2;
|
|
@@ -7003,7 +7003,7 @@ var require_dcmjs = __commonJS({
|
|
|
7003
7003
|
if (isRangeQuery) {
|
|
7004
7004
|
this.maxLength = 28;
|
|
7005
7005
|
}
|
|
7006
|
-
var result =
|
|
7006
|
+
var result = _get4(_getPrototypeOf(TimeValue2.prototype), "writeBytes", this).call(this, stream, value, writeOptions);
|
|
7007
7007
|
this.maxLength = originalMaxLength;
|
|
7008
7008
|
return result;
|
|
7009
7009
|
}
|
|
@@ -7077,7 +7077,7 @@ var require_dcmjs = __commonJS({
|
|
|
7077
7077
|
}, {
|
|
7078
7078
|
key: "writeBytes",
|
|
7079
7079
|
value: function writeBytes(stream, value, writeOptions) {
|
|
7080
|
-
return
|
|
7080
|
+
return _get4(_getPrototypeOf(UnsignedShort2.prototype), "writeBytes", this).call(this, stream, value, _get4(_getPrototypeOf(UnsignedShort2.prototype), "write", this).call(this, stream, "Uint16", value), writeOptions);
|
|
7081
7081
|
}
|
|
7082
7082
|
}]);
|
|
7083
7083
|
return UnsignedShort2;
|
|
@@ -7102,7 +7102,7 @@ var require_dcmjs = __commonJS({
|
|
|
7102
7102
|
}, {
|
|
7103
7103
|
key: "writeBytes",
|
|
7104
7104
|
value: function writeBytes(stream, value, writeOptions) {
|
|
7105
|
-
return
|
|
7105
|
+
return _get4(_getPrototypeOf(UnsignedLong2.prototype), "writeBytes", this).call(this, stream, value, _get4(_getPrototypeOf(UnsignedLong2.prototype), "write", this).call(this, stream, "Uint32", value), writeOptions);
|
|
7106
7106
|
}
|
|
7107
7107
|
}]);
|
|
7108
7108
|
return UnsignedLong2;
|
|
@@ -8168,7 +8168,7 @@ var require_dcmjs = __commonJS({
|
|
|
8168
8168
|
_createClass(DerivedPixels2, [{
|
|
8169
8169
|
key: "derive",
|
|
8170
8170
|
value: function derive() {
|
|
8171
|
-
|
|
8171
|
+
_get4(_getPrototypeOf(DerivedPixels2.prototype), "derive", this).call(this);
|
|
8172
8172
|
this.assignToDataset({
|
|
8173
8173
|
ImageType: ["DERIVED", "PRIMARY"],
|
|
8174
8174
|
LossyImageCompression: "00",
|
|
@@ -8197,7 +8197,7 @@ var require_dcmjs = __commonJS({
|
|
|
8197
8197
|
_createClass(DerivedImage2, [{
|
|
8198
8198
|
key: "derive",
|
|
8199
8199
|
value: function derive() {
|
|
8200
|
-
|
|
8200
|
+
_get4(_getPrototypeOf(DerivedImage2.prototype), "derive", this).call(this);
|
|
8201
8201
|
this.assignFromReference(["WindowCenter", "WindowWidth", "BitsAllocated", "PixelRepresentation", "BodyPartExamined", "Laterality", "PatientPosition", "RescaleSlope", "RescaleIntercept", "PixelPresentation", "VolumetricProperties", "VolumeBasedCalculationTechnique", "PresentationLUTShape"]);
|
|
8202
8202
|
}
|
|
8203
8203
|
}]);
|
|
@@ -8552,13 +8552,13 @@ var require_dcmjs = __commonJS({
|
|
|
8552
8552
|
_createClass(MRImageNormalizer2, [{
|
|
8553
8553
|
key: "normalize",
|
|
8554
8554
|
value: function normalize2() {
|
|
8555
|
-
|
|
8555
|
+
_get4(_getPrototypeOf(MRImageNormalizer2.prototype), "normalize", this).call(this);
|
|
8556
8556
|
this.dataset.SOPClassUID = "LegacyConvertedEnhancedMRImage";
|
|
8557
8557
|
}
|
|
8558
8558
|
}, {
|
|
8559
8559
|
key: "normalizeMultiframe",
|
|
8560
8560
|
value: function normalizeMultiframe() {
|
|
8561
|
-
|
|
8561
|
+
_get4(_getPrototypeOf(MRImageNormalizer2.prototype), "normalizeMultiframe", this).call(this);
|
|
8562
8562
|
var ds = this.dataset;
|
|
8563
8563
|
if (!ds.ImageType || !ds.ImageType.constructor || ds.ImageType.constructor.name != "Array" || ds.ImageType.length != 4) {
|
|
8564
8564
|
ds.ImageType = ["ORIGINAL", "PRIMARY", "OTHER", "NONE"];
|
|
@@ -8584,7 +8584,7 @@ var require_dcmjs = __commonJS({
|
|
|
8584
8584
|
_createClass(EnhancedCTImageNormalizer2, [{
|
|
8585
8585
|
key: "normalize",
|
|
8586
8586
|
value: function normalize2() {
|
|
8587
|
-
|
|
8587
|
+
_get4(_getPrototypeOf(EnhancedCTImageNormalizer2.prototype), "normalize", this).call(this);
|
|
8588
8588
|
}
|
|
8589
8589
|
}]);
|
|
8590
8590
|
return EnhancedCTImageNormalizer2;
|
|
@@ -8598,7 +8598,7 @@ var require_dcmjs = __commonJS({
|
|
|
8598
8598
|
_createClass(EnhancedMRImageNormalizer2, [{
|
|
8599
8599
|
key: "normalize",
|
|
8600
8600
|
value: function normalize2() {
|
|
8601
|
-
|
|
8601
|
+
_get4(_getPrototypeOf(EnhancedMRImageNormalizer2.prototype), "normalize", this).call(this);
|
|
8602
8602
|
}
|
|
8603
8603
|
}]);
|
|
8604
8604
|
return EnhancedMRImageNormalizer2;
|
|
@@ -8612,7 +8612,7 @@ var require_dcmjs = __commonJS({
|
|
|
8612
8612
|
_createClass(EnhancedUSVolumeNormalizer2, [{
|
|
8613
8613
|
key: "normalize",
|
|
8614
8614
|
value: function normalize2() {
|
|
8615
|
-
|
|
8615
|
+
_get4(_getPrototypeOf(EnhancedUSVolumeNormalizer2.prototype), "normalize", this).call(this);
|
|
8616
8616
|
}
|
|
8617
8617
|
}]);
|
|
8618
8618
|
return EnhancedUSVolumeNormalizer2;
|
|
@@ -8626,7 +8626,7 @@ var require_dcmjs = __commonJS({
|
|
|
8626
8626
|
_createClass(NMImageNormalizer2, [{
|
|
8627
8627
|
key: "normalize",
|
|
8628
8628
|
value: function normalize2() {
|
|
8629
|
-
|
|
8629
|
+
_get4(_getPrototypeOf(NMImageNormalizer2.prototype), "normalize", this).call(this);
|
|
8630
8630
|
var toUID = DicomMetaDictionary.sopClassUIDsByName;
|
|
8631
8631
|
this.dataset.SOPClassUID = toUID.NMImage;
|
|
8632
8632
|
}
|
|
@@ -8642,7 +8642,7 @@ var require_dcmjs = __commonJS({
|
|
|
8642
8642
|
_createClass(CTImageNormalizer2, [{
|
|
8643
8643
|
key: "normalize",
|
|
8644
8644
|
value: function normalize2() {
|
|
8645
|
-
|
|
8645
|
+
_get4(_getPrototypeOf(CTImageNormalizer2.prototype), "normalize", this).call(this);
|
|
8646
8646
|
var toUID = DicomMetaDictionary.sopClassUIDsByName;
|
|
8647
8647
|
this.dataset.SOPClassUID = toUID.EnhancedCTImage;
|
|
8648
8648
|
}
|
|
@@ -8658,7 +8658,7 @@ var require_dcmjs = __commonJS({
|
|
|
8658
8658
|
_createClass(PETImageNormalizer2, [{
|
|
8659
8659
|
key: "normalize",
|
|
8660
8660
|
value: function normalize2() {
|
|
8661
|
-
|
|
8661
|
+
_get4(_getPrototypeOf(PETImageNormalizer2.prototype), "normalize", this).call(this);
|
|
8662
8662
|
var toUID = DicomMetaDictionary.sopClassUIDsByName;
|
|
8663
8663
|
this.dataset.SOPClassUID = toUID.EnhancedPETImage;
|
|
8664
8664
|
}
|
|
@@ -8674,7 +8674,7 @@ var require_dcmjs = __commonJS({
|
|
|
8674
8674
|
_createClass(SEGImageNormalizer2, [{
|
|
8675
8675
|
key: "normalize",
|
|
8676
8676
|
value: function normalize2() {
|
|
8677
|
-
|
|
8677
|
+
_get4(_getPrototypeOf(SEGImageNormalizer2.prototype), "normalize", this).call(this);
|
|
8678
8678
|
}
|
|
8679
8679
|
}]);
|
|
8680
8680
|
return SEGImageNormalizer2;
|
|
@@ -8688,7 +8688,7 @@ var require_dcmjs = __commonJS({
|
|
|
8688
8688
|
_createClass(PMImageNormalizer2, [{
|
|
8689
8689
|
key: "normalize",
|
|
8690
8690
|
value: function normalize2() {
|
|
8691
|
-
|
|
8691
|
+
_get4(_getPrototypeOf(PMImageNormalizer2.prototype), "normalize", this).call(this);
|
|
8692
8692
|
var ds = this.datasets[0];
|
|
8693
8693
|
if (ds.BitsAllocated !== 32) {
|
|
8694
8694
|
log2.error("Only works with 32 bit data, not " + String(ds.BitsAllocated));
|
|
@@ -8734,7 +8734,7 @@ var require_dcmjs = __commonJS({
|
|
|
8734
8734
|
_createClass(OCTImageNormalizer2, [{
|
|
8735
8735
|
key: "normalize",
|
|
8736
8736
|
value: function normalize2() {
|
|
8737
|
-
|
|
8737
|
+
_get4(_getPrototypeOf(OCTImageNormalizer2.prototype), "normalize", this).call(this);
|
|
8738
8738
|
}
|
|
8739
8739
|
}]);
|
|
8740
8740
|
return OCTImageNormalizer2;
|
|
@@ -8751,7 +8751,7 @@ var require_dcmjs = __commonJS({
|
|
|
8751
8751
|
_createClass(Segmentation2, [{
|
|
8752
8752
|
key: "derive",
|
|
8753
8753
|
value: function derive() {
|
|
8754
|
-
|
|
8754
|
+
_get4(_getPrototypeOf(Segmentation2.prototype), "derive", this).call(this);
|
|
8755
8755
|
this.assignToDataset({
|
|
8756
8756
|
SOPClassUID: DicomMetaDictionary.sopClassUIDsByName.Segmentation,
|
|
8757
8757
|
Modality: "SEG",
|
|
@@ -9044,7 +9044,7 @@ var require_dcmjs = __commonJS({
|
|
|
9044
9044
|
_createClass(ParametricMap2, [{
|
|
9045
9045
|
key: "derive",
|
|
9046
9046
|
value: function derive() {
|
|
9047
|
-
|
|
9047
|
+
_get4(_getPrototypeOf(ParametricMap2.prototype), "derive", this).call(this);
|
|
9048
9048
|
this.assignToDataset({
|
|
9049
9049
|
// TODO: ???
|
|
9050
9050
|
});
|
|
@@ -9063,7 +9063,7 @@ var require_dcmjs = __commonJS({
|
|
|
9063
9063
|
_createClass(StructuredReport2, [{
|
|
9064
9064
|
key: "derive",
|
|
9065
9065
|
value: function derive() {
|
|
9066
|
-
|
|
9066
|
+
_get4(_getPrototypeOf(StructuredReport2.prototype), "derive", this).call(this);
|
|
9067
9067
|
this.assignToDataset({
|
|
9068
9068
|
SOPClassUID: DicomMetaDictionary.sopClassUIDsByName.EnhancedSR,
|
|
9069
9069
|
Modality: "SR",
|
|
@@ -79357,6 +79357,7 @@ function composeSpecs(specOrComposedSpec) {
|
|
|
79357
79357
|
|
|
79358
79358
|
// src/getParser.ts
|
|
79359
79359
|
var dcmjs3 = __toESM(require_dcmjs(), 1);
|
|
79360
|
+
var import_lodash2 = __toESM(require_lodash(), 1);
|
|
79360
79361
|
|
|
79361
79362
|
// src/csvMapping.ts
|
|
79362
79363
|
function getCsvMapping(columnMappings, mapping, mappingKey, value) {
|
|
@@ -79383,7 +79384,7 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
|
|
|
79383
79384
|
if (attrName in dcmjs3.data.DicomMetaDictionary.dictionary) {
|
|
79384
79385
|
attrName = dcmjs3.data.DicomMetaDictionary.dictionary[attrName].name;
|
|
79385
79386
|
}
|
|
79386
|
-
return naturalData
|
|
79387
|
+
return (0, import_lodash2.get)(naturalData, attrName);
|
|
79387
79388
|
}
|
|
79388
79389
|
function getFilePathComp(component) {
|
|
79389
79390
|
const patternParts = inputPathPattern.split("/");
|
|
@@ -79450,7 +79451,7 @@ function getParser(inputPathPattern, inputFilePath, naturalData, dicomPS315EOpti
|
|
|
79450
79451
|
}
|
|
79451
79452
|
|
|
79452
79453
|
// src/collectMappings.ts
|
|
79453
|
-
var
|
|
79454
|
+
var import_lodash3 = __toESM(require_lodash(), 1);
|
|
79454
79455
|
function collectMappings(inputFilePath, inputFileIndex, dicomData, mappingOptions) {
|
|
79455
79456
|
const mapResults = {
|
|
79456
79457
|
// original UID for this dicomData
|
|
@@ -79512,7 +79513,7 @@ function collectMappings(inputFilePath, inputFileIndex, dicomData, mappingOption
|
|
|
79512
79513
|
const dicomMap = finalSpec.modifyDicomHeader(parser);
|
|
79513
79514
|
for (let attrPath in dicomMap) {
|
|
79514
79515
|
mapResults.mappings[attrPath] = [
|
|
79515
|
-
(0,
|
|
79516
|
+
(0, import_lodash3.get)(naturalData, attrPath),
|
|
79516
79517
|
"replace",
|
|
79517
79518
|
"mappingFunction",
|
|
79518
79519
|
dicomMap[attrPath]
|
|
@@ -79552,7 +79553,7 @@ function mapMetaheader(metaHeader, newInstanceUid) {
|
|
|
79552
79553
|
}
|
|
79553
79554
|
|
|
79554
79555
|
// src/curateDict.ts
|
|
79555
|
-
var
|
|
79556
|
+
var import_lodash4 = __toESM(require_lodash(), 1);
|
|
79556
79557
|
function curateDict(inputFilePath, inputFileIndex, dicomData, mappingOptions) {
|
|
79557
79558
|
const [naturalData, mapResults] = collectMappings(
|
|
79558
79559
|
inputFilePath,
|
|
@@ -79564,10 +79565,10 @@ function curateDict(inputFilePath, inputFileIndex, dicomData, mappingOptions) {
|
|
|
79564
79565
|
const [, operation2, , mappedValue] = mapResults.mappings[tagPath];
|
|
79565
79566
|
switch (operation2) {
|
|
79566
79567
|
case "delete":
|
|
79567
|
-
(0,
|
|
79568
|
+
(0, import_lodash4.unset)(naturalData, tagPath);
|
|
79568
79569
|
break;
|
|
79569
79570
|
case "replace":
|
|
79570
|
-
(0,
|
|
79571
|
+
(0, import_lodash4.set)(naturalData, tagPath, mappedValue);
|
|
79571
79572
|
break;
|
|
79572
79573
|
default:
|
|
79573
79574
|
console.error(`Bad operation ${operation2} in mappings`);
|
|
@@ -79592,7 +79593,9 @@ function curateDict(inputFilePath, inputFileIndex, dicomData, mappingOptions) {
|
|
|
79592
79593
|
const [, sequenceTagId, index] = arrayMatch;
|
|
79593
79594
|
let sequence = mappedDicomData.dict[sequenceTagId];
|
|
79594
79595
|
if (!sequence) {
|
|
79595
|
-
const sequenceItemWithPrivateTag = {
|
|
79596
|
+
const sequenceItemWithPrivateTag = {
|
|
79597
|
+
[privateTagId]: quarantinedElement
|
|
79598
|
+
};
|
|
79596
79599
|
sequence = {
|
|
79597
79600
|
vr: "SQ",
|
|
79598
79601
|
Value: [sequenceItemWithPrivateTag]
|
|
@@ -79608,24 +79611,27 @@ function curateDict(inputFilePath, inputFileIndex, dicomData, mappingOptions) {
|
|
|
79608
79611
|
if (sequence && sequence.Value && sequence.Value[parseInt(index)]) {
|
|
79609
79612
|
const sequenceItem = sequence.Value[parseInt(index)];
|
|
79610
79613
|
if (typeof sequenceItem === "object" && sequenceItem !== null) {
|
|
79611
|
-
const newSequenceItem = {
|
|
79614
|
+
const newSequenceItem = {
|
|
79615
|
+
...sequenceItem,
|
|
79616
|
+
[privateTagId]: quarantinedElement
|
|
79617
|
+
};
|
|
79612
79618
|
sequence.Value[parseInt(index)] = newSequenceItem;
|
|
79613
79619
|
}
|
|
79614
79620
|
}
|
|
79615
79621
|
}
|
|
79616
79622
|
}
|
|
79617
79623
|
} else {
|
|
79618
|
-
(0,
|
|
79624
|
+
(0, import_lodash4.set)(mappedDicomData.dict, tagIdPath, quarantinedElement);
|
|
79619
79625
|
}
|
|
79620
79626
|
} else {
|
|
79621
|
-
(0,
|
|
79627
|
+
(0, import_lodash4.set)(mappedDicomData.dict, tagIdPath, {
|
|
79622
79628
|
vr: "UN",
|
|
79623
79629
|
// Unknown VR for private tags
|
|
79624
79630
|
Value: Array.isArray(quarantinedElement) ? quarantinedElement : [quarantinedElement]
|
|
79625
79631
|
});
|
|
79626
79632
|
}
|
|
79627
79633
|
}
|
|
79628
|
-
return { dicomData: mappedDicomData, mapResults: (0,
|
|
79634
|
+
return { dicomData: mappedDicomData, mapResults: (0, import_lodash4.cloneDeep)(mapResults) };
|
|
79629
79635
|
}
|
|
79630
79636
|
|
|
79631
79637
|
// src/hash.ts
|
|
@@ -79841,10 +79847,9 @@ async function curateOne({
|
|
|
79841
79847
|
canSkip = previousSourceFileInfo.size === fileInfo.size && previousSourceFileInfo.mtime === mtime;
|
|
79842
79848
|
}
|
|
79843
79849
|
}
|
|
79844
|
-
const noMapResult = () => {
|
|
79850
|
+
const noMapResult = (outputFilePath) => {
|
|
79845
79851
|
const retval = {
|
|
79846
79852
|
sourceInstanceUID: `unchanged_${fileInfo.name.replace(/[^a-zA-Z0-9]/g, "_")}`,
|
|
79847
|
-
outputFilePath: `${fileInfo.path}/${fileInfo.name}`,
|
|
79848
79853
|
mappings: {},
|
|
79849
79854
|
anomalies: [],
|
|
79850
79855
|
errors: [],
|
|
@@ -79858,7 +79863,8 @@ async function curateOne({
|
|
|
79858
79863
|
preMappedHash
|
|
79859
79864
|
},
|
|
79860
79865
|
// include curationTime even when skipped to measure hashing/check time
|
|
79861
|
-
curationTime: performance.now() - startTime
|
|
79866
|
+
curationTime: performance.now() - startTime,
|
|
79867
|
+
outputFilePath
|
|
79862
79868
|
};
|
|
79863
79869
|
return retval;
|
|
79864
79870
|
};
|
|
@@ -79883,7 +79889,6 @@ async function curateOne({
|
|
|
79883
79889
|
`File ${fileInfo.name} is not a valid DICOM file or is corrupted`
|
|
79884
79890
|
],
|
|
79885
79891
|
sourceInstanceUID: `invalid_${fileInfo.name.replace(/[^a-zA-Z0-9]/g, "_")}`,
|
|
79886
|
-
outputFilePath: `${fileInfo.path}/${fileInfo.name}`,
|
|
79887
79892
|
fileInfo: {
|
|
79888
79893
|
name: fileInfo.name,
|
|
79889
79894
|
size: fileInfo.size,
|
|
@@ -79919,7 +79924,7 @@ async function curateOne({
|
|
|
79919
79924
|
postMappedHash = await hash(modifiedArrayBuffer, hashMethod || "crc64");
|
|
79920
79925
|
const previousPostMappedHash = previousMappedFileInfo ? previousMappedFileInfo(clonedMapResults.outputFilePath)?.postMappedHash : void 0;
|
|
79921
79926
|
if (previousPostMappedHash !== void 0 && previousPostMappedHash === postMappedHash) {
|
|
79922
|
-
return noMapResult();
|
|
79927
|
+
return noMapResult(clonedMapResults.outputFilePath);
|
|
79923
79928
|
}
|
|
79924
79929
|
if (typeof outputTarget?.directory === "object" && "getFileHandle" in outputTarget.directory) {
|
|
79925
79930
|
const subDirectoryHandle = await createNestedDirectories(
|