dcmjs 0.35.0 → 0.37.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/build/dcmjs.es.js +29 -8
- package/build/dcmjs.es.js.map +1 -1
- package/build/dcmjs.js +29 -8
- package/build/dcmjs.js.map +1 -1
- package/package.json +1 -1
- package/test/data.test.js +130 -0
- package/test/normalizers.test.js +22 -3
package/build/dcmjs.js
CHANGED
|
@@ -8411,6 +8411,10 @@
|
|
|
8411
8411
|
// when the vr is data-dependent, keep track of the original type
|
|
8412
8412
|
naturalDataset._vrMap[naturalName] = data.vr;
|
|
8413
8413
|
}
|
|
8414
|
+
if (data.vr !== entry.vr) {
|
|
8415
|
+
// save origin vr if it different that in dictionary
|
|
8416
|
+
naturalDataset._vrMap[naturalName] = data.vr;
|
|
8417
|
+
}
|
|
8414
8418
|
}
|
|
8415
8419
|
if (data.Value === undefined) {
|
|
8416
8420
|
// In the case of type 2, add this tag but explictly set it null to indicate its empty.
|
|
@@ -8484,8 +8488,9 @@
|
|
|
8484
8488
|
return;
|
|
8485
8489
|
}
|
|
8486
8490
|
// process this one entry
|
|
8491
|
+
var vr = dataset._vrMap && dataset._vrMap[naturalName] ? dataset._vrMap[naturalName] : entry.vr;
|
|
8487
8492
|
var dataItem = ValueRepresentation.addTagAccessors({
|
|
8488
|
-
vr:
|
|
8493
|
+
vr: vr
|
|
8489
8494
|
});
|
|
8490
8495
|
dataItem.Value = dataset[naturalName];
|
|
8491
8496
|
if (dataValue !== null) {
|
|
@@ -8496,7 +8501,7 @@
|
|
|
8496
8501
|
log.error("No value representation given for", naturalName);
|
|
8497
8502
|
}
|
|
8498
8503
|
}
|
|
8499
|
-
var
|
|
8504
|
+
var _vr = ValueRepresentation.createByTypeString(dataItem.vr);
|
|
8500
8505
|
dataItem.Value = DicomMetaDictionary.denaturalizeValue(dataItem.Value);
|
|
8501
8506
|
if (entry.vr == "SQ") {
|
|
8502
8507
|
var unnaturalValues = [];
|
|
@@ -8506,11 +8511,11 @@
|
|
|
8506
8511
|
}
|
|
8507
8512
|
dataItem.Value = unnaturalValues;
|
|
8508
8513
|
}
|
|
8509
|
-
if (!
|
|
8514
|
+
if (!_vr.isBinary() && _vr.maxLength) {
|
|
8510
8515
|
dataItem.Value = dataItem.Value.map(function (value) {
|
|
8511
|
-
if (value.length >
|
|
8512
|
-
log.warn("Truncating value ".concat(value, " of ").concat(naturalName, " because it is longer than ").concat(
|
|
8513
|
-
return value.slice(0,
|
|
8516
|
+
if (value.length > _vr.maxLength) {
|
|
8517
|
+
log.warn("Truncating value ".concat(value, " of ").concat(naturalName, " because it is longer than ").concat(_vr.maxLength));
|
|
8518
|
+
return value.slice(0, _vr.maxLength);
|
|
8514
8519
|
} else {
|
|
8515
8520
|
return value;
|
|
8516
8521
|
}
|
|
@@ -8621,7 +8626,8 @@
|
|
|
8621
8626
|
"1.2.840.10008.5.1.4.1.1.128": "PETImage",
|
|
8622
8627
|
"1.2.840.10008.5.1.4.1.1.130": "EnhancedPETImage",
|
|
8623
8628
|
"1.2.840.10008.5.1.4.1.1.128.1": "LegacyConvertedEnhancedPETImage",
|
|
8624
|
-
"1.2.840.10008.5.1.4.1.1.77.1.5.1": "OphthalmicPhotography8BitImage"
|
|
8629
|
+
"1.2.840.10008.5.1.4.1.1.77.1.5.1": "OphthalmicPhotography8BitImage",
|
|
8630
|
+
"1.2.840.10008.5.1.4.1.1.77.1.5.4": "OphthalmicTomographyImage"
|
|
8625
8631
|
};
|
|
8626
8632
|
DicomMetaDictionary.dictionary = dictionary;
|
|
8627
8633
|
DicomMetaDictionary._generateNameMap();
|
|
@@ -11256,13 +11262,14 @@
|
|
|
11256
11262
|
sopClassUIDMap[toUID.Segmentation] = SEGImageNormalizer;
|
|
11257
11263
|
sopClassUIDMap[toUID.DeformableSpatialRegistration] = DSRNormalizer;
|
|
11258
11264
|
sopClassUIDMap[toUID.OphthalmicPhotography8BitImage] = OPImageNormalizer;
|
|
11265
|
+
sopClassUIDMap[toUID.OphthalmicTomographyImage] = OCTImageNormalizer;
|
|
11259
11266
|
return sopClassUIDMap[sopClassUID];
|
|
11260
11267
|
}
|
|
11261
11268
|
}, {
|
|
11262
11269
|
key: "isMultiframeSOPClassUID",
|
|
11263
11270
|
value: function isMultiframeSOPClassUID(sopClassUID) {
|
|
11264
11271
|
var toUID = DicomMetaDictionary.sopClassUIDsByName;
|
|
11265
|
-
var multiframeSOPClasses = [toUID.NMImage, toUID.EnhancedMRImage, toUID.LegacyConvertedEnhancedMRImage, toUID.EnhancedCTImage, toUID.LegacyConvertedEnhancedCTImage, toUID.EnhancedUSVolume, toUID.EnhancedPETImage, toUID.LegacyConvertedEnhancedPETImage, toUID.Segmentation, toUID.ParametricMapStorage];
|
|
11272
|
+
var multiframeSOPClasses = [toUID.NMImage, toUID.EnhancedMRImage, toUID.LegacyConvertedEnhancedMRImage, toUID.EnhancedCTImage, toUID.LegacyConvertedEnhancedCTImage, toUID.EnhancedUSVolume, toUID.EnhancedPETImage, toUID.LegacyConvertedEnhancedPETImage, toUID.Segmentation, toUID.ParametricMapStorage, toUID.OphthalmicTomographyImage];
|
|
11266
11273
|
return multiframeSOPClasses.indexOf(sopClassUID) !== -1;
|
|
11267
11274
|
}
|
|
11268
11275
|
}, {
|
|
@@ -11783,6 +11790,20 @@
|
|
|
11783
11790
|
}]);
|
|
11784
11791
|
return OPImageNormalizer;
|
|
11785
11792
|
}(Normalizer);
|
|
11793
|
+
var OCTImageNormalizer = /*#__PURE__*/function (_ImageNormalizer10) {
|
|
11794
|
+
_inherits(OCTImageNormalizer, _ImageNormalizer10);
|
|
11795
|
+
function OCTImageNormalizer() {
|
|
11796
|
+
_classCallCheck(this, OCTImageNormalizer);
|
|
11797
|
+
return _callSuper(this, OCTImageNormalizer, arguments);
|
|
11798
|
+
}
|
|
11799
|
+
_createClass(OCTImageNormalizer, [{
|
|
11800
|
+
key: "normalize",
|
|
11801
|
+
value: function normalize() {
|
|
11802
|
+
_get(_getPrototypeOf(OCTImageNormalizer.prototype), "normalize", this).call(this);
|
|
11803
|
+
}
|
|
11804
|
+
}]);
|
|
11805
|
+
return OCTImageNormalizer;
|
|
11806
|
+
}(ImageNormalizer);
|
|
11786
11807
|
|
|
11787
11808
|
var Segmentation$4 = /*#__PURE__*/function (_DerivedPixels) {
|
|
11788
11809
|
_inherits(Segmentation, _DerivedPixels);
|