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.es.js
CHANGED
|
@@ -8405,6 +8405,10 @@ var DicomMetaDictionary = /*#__PURE__*/function () {
|
|
|
8405
8405
|
// when the vr is data-dependent, keep track of the original type
|
|
8406
8406
|
naturalDataset._vrMap[naturalName] = data.vr;
|
|
8407
8407
|
}
|
|
8408
|
+
if (data.vr !== entry.vr) {
|
|
8409
|
+
// save origin vr if it different that in dictionary
|
|
8410
|
+
naturalDataset._vrMap[naturalName] = data.vr;
|
|
8411
|
+
}
|
|
8408
8412
|
}
|
|
8409
8413
|
if (data.Value === undefined) {
|
|
8410
8414
|
// In the case of type 2, add this tag but explictly set it null to indicate its empty.
|
|
@@ -8478,8 +8482,9 @@ var DicomMetaDictionary = /*#__PURE__*/function () {
|
|
|
8478
8482
|
return;
|
|
8479
8483
|
}
|
|
8480
8484
|
// process this one entry
|
|
8485
|
+
var vr = dataset._vrMap && dataset._vrMap[naturalName] ? dataset._vrMap[naturalName] : entry.vr;
|
|
8481
8486
|
var dataItem = ValueRepresentation.addTagAccessors({
|
|
8482
|
-
vr:
|
|
8487
|
+
vr: vr
|
|
8483
8488
|
});
|
|
8484
8489
|
dataItem.Value = dataset[naturalName];
|
|
8485
8490
|
if (dataValue !== null) {
|
|
@@ -8490,7 +8495,7 @@ var DicomMetaDictionary = /*#__PURE__*/function () {
|
|
|
8490
8495
|
log.error("No value representation given for", naturalName);
|
|
8491
8496
|
}
|
|
8492
8497
|
}
|
|
8493
|
-
var
|
|
8498
|
+
var _vr = ValueRepresentation.createByTypeString(dataItem.vr);
|
|
8494
8499
|
dataItem.Value = DicomMetaDictionary.denaturalizeValue(dataItem.Value);
|
|
8495
8500
|
if (entry.vr == "SQ") {
|
|
8496
8501
|
var unnaturalValues = [];
|
|
@@ -8500,11 +8505,11 @@ var DicomMetaDictionary = /*#__PURE__*/function () {
|
|
|
8500
8505
|
}
|
|
8501
8506
|
dataItem.Value = unnaturalValues;
|
|
8502
8507
|
}
|
|
8503
|
-
if (!
|
|
8508
|
+
if (!_vr.isBinary() && _vr.maxLength) {
|
|
8504
8509
|
dataItem.Value = dataItem.Value.map(function (value) {
|
|
8505
|
-
if (value.length >
|
|
8506
|
-
log.warn("Truncating value ".concat(value, " of ").concat(naturalName, " because it is longer than ").concat(
|
|
8507
|
-
return value.slice(0,
|
|
8510
|
+
if (value.length > _vr.maxLength) {
|
|
8511
|
+
log.warn("Truncating value ".concat(value, " of ").concat(naturalName, " because it is longer than ").concat(_vr.maxLength));
|
|
8512
|
+
return value.slice(0, _vr.maxLength);
|
|
8508
8513
|
} else {
|
|
8509
8514
|
return value;
|
|
8510
8515
|
}
|
|
@@ -8615,7 +8620,8 @@ DicomMetaDictionary.sopClassNamesByUID = {
|
|
|
8615
8620
|
"1.2.840.10008.5.1.4.1.1.128": "PETImage",
|
|
8616
8621
|
"1.2.840.10008.5.1.4.1.1.130": "EnhancedPETImage",
|
|
8617
8622
|
"1.2.840.10008.5.1.4.1.1.128.1": "LegacyConvertedEnhancedPETImage",
|
|
8618
|
-
"1.2.840.10008.5.1.4.1.1.77.1.5.1": "OphthalmicPhotography8BitImage"
|
|
8623
|
+
"1.2.840.10008.5.1.4.1.1.77.1.5.1": "OphthalmicPhotography8BitImage",
|
|
8624
|
+
"1.2.840.10008.5.1.4.1.1.77.1.5.4": "OphthalmicTomographyImage"
|
|
8619
8625
|
};
|
|
8620
8626
|
DicomMetaDictionary.dictionary = dictionary;
|
|
8621
8627
|
DicomMetaDictionary._generateNameMap();
|
|
@@ -11250,13 +11256,14 @@ var Normalizer = /*#__PURE__*/function () {
|
|
|
11250
11256
|
sopClassUIDMap[toUID.Segmentation] = SEGImageNormalizer;
|
|
11251
11257
|
sopClassUIDMap[toUID.DeformableSpatialRegistration] = DSRNormalizer;
|
|
11252
11258
|
sopClassUIDMap[toUID.OphthalmicPhotography8BitImage] = OPImageNormalizer;
|
|
11259
|
+
sopClassUIDMap[toUID.OphthalmicTomographyImage] = OCTImageNormalizer;
|
|
11253
11260
|
return sopClassUIDMap[sopClassUID];
|
|
11254
11261
|
}
|
|
11255
11262
|
}, {
|
|
11256
11263
|
key: "isMultiframeSOPClassUID",
|
|
11257
11264
|
value: function isMultiframeSOPClassUID(sopClassUID) {
|
|
11258
11265
|
var toUID = DicomMetaDictionary.sopClassUIDsByName;
|
|
11259
|
-
var multiframeSOPClasses = [toUID.NMImage, toUID.EnhancedMRImage, toUID.LegacyConvertedEnhancedMRImage, toUID.EnhancedCTImage, toUID.LegacyConvertedEnhancedCTImage, toUID.EnhancedUSVolume, toUID.EnhancedPETImage, toUID.LegacyConvertedEnhancedPETImage, toUID.Segmentation, toUID.ParametricMapStorage];
|
|
11266
|
+
var multiframeSOPClasses = [toUID.NMImage, toUID.EnhancedMRImage, toUID.LegacyConvertedEnhancedMRImage, toUID.EnhancedCTImage, toUID.LegacyConvertedEnhancedCTImage, toUID.EnhancedUSVolume, toUID.EnhancedPETImage, toUID.LegacyConvertedEnhancedPETImage, toUID.Segmentation, toUID.ParametricMapStorage, toUID.OphthalmicTomographyImage];
|
|
11260
11267
|
return multiframeSOPClasses.indexOf(sopClassUID) !== -1;
|
|
11261
11268
|
}
|
|
11262
11269
|
}, {
|
|
@@ -11777,6 +11784,20 @@ var OPImageNormalizer = /*#__PURE__*/function (_Normalizer3) {
|
|
|
11777
11784
|
}]);
|
|
11778
11785
|
return OPImageNormalizer;
|
|
11779
11786
|
}(Normalizer);
|
|
11787
|
+
var OCTImageNormalizer = /*#__PURE__*/function (_ImageNormalizer10) {
|
|
11788
|
+
_inherits(OCTImageNormalizer, _ImageNormalizer10);
|
|
11789
|
+
function OCTImageNormalizer() {
|
|
11790
|
+
_classCallCheck(this, OCTImageNormalizer);
|
|
11791
|
+
return _callSuper(this, OCTImageNormalizer, arguments);
|
|
11792
|
+
}
|
|
11793
|
+
_createClass(OCTImageNormalizer, [{
|
|
11794
|
+
key: "normalize",
|
|
11795
|
+
value: function normalize() {
|
|
11796
|
+
_get(_getPrototypeOf(OCTImageNormalizer.prototype), "normalize", this).call(this);
|
|
11797
|
+
}
|
|
11798
|
+
}]);
|
|
11799
|
+
return OCTImageNormalizer;
|
|
11800
|
+
}(ImageNormalizer);
|
|
11780
11801
|
|
|
11781
11802
|
var Segmentation$4 = /*#__PURE__*/function (_DerivedPixels) {
|
|
11782
11803
|
_inherits(Segmentation, _DerivedPixels);
|