dwv 0.31.0-beta.15 → 0.31.0-beta.16
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/dwv.js +135 -67
- package/dist/dwv.min.js +2 -2
- package/package.json +2 -2
package/dist/dwv.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! dwv 0.31.0-beta.
|
|
1
|
+
/*! dwv 0.31.0-beta.16 2022-11-08 14:56:16 */
|
|
2
2
|
// Inspired from umdjs
|
|
3
3
|
// See https://github.com/umdjs/umd/blob/master/templates/returnExports.js
|
|
4
4
|
(function (root, factory) {
|
|
@@ -322,6 +322,17 @@ dwv.App = function () {
|
|
|
322
322
|
return stage.getLayerGroup(groupId);
|
|
323
323
|
};
|
|
324
324
|
|
|
325
|
+
/**
|
|
326
|
+
* Get a layer group by div id.
|
|
327
|
+
* The layer is available after the first loaded item.
|
|
328
|
+
*
|
|
329
|
+
* @param {string} divId The div id.
|
|
330
|
+
* @returns {dwv.gui.LayerGroup} The layer group.
|
|
331
|
+
*/
|
|
332
|
+
this.getLayerGroupByDivId = function (divId) {
|
|
333
|
+
return stage.getLayerGroupByDivId(divId);
|
|
334
|
+
};
|
|
335
|
+
|
|
325
336
|
/**
|
|
326
337
|
* Get the number of layer groups.
|
|
327
338
|
*
|
|
@@ -743,7 +754,7 @@ dwv.App = function () {
|
|
|
743
754
|
for (var i = 0; i < viewConfigs.length; ++i) {
|
|
744
755
|
var config = viewConfigs[i];
|
|
745
756
|
var layerGroup =
|
|
746
|
-
stage.
|
|
757
|
+
stage.getLayerGroupByDivId(config.divId);
|
|
747
758
|
// layer group must exist
|
|
748
759
|
if (!layerGroup) {
|
|
749
760
|
throw new Error('No layer group for ' + config.divId);
|
|
@@ -1325,7 +1336,7 @@ dwv.App = function () {
|
|
|
1325
1336
|
if (!data) {
|
|
1326
1337
|
throw new Error('Cannot initialise layer with data id: ' + dataIndex);
|
|
1327
1338
|
}
|
|
1328
|
-
var layerGroup = stage.
|
|
1339
|
+
var layerGroup = stage.getLayerGroupByDivId(dataViewConfig.divId);
|
|
1329
1340
|
if (!layerGroup) {
|
|
1330
1341
|
throw new Error('Cannot initialise layer with group id: ' +
|
|
1331
1342
|
dataViewConfig.divId);
|
|
@@ -4591,7 +4602,7 @@ dwv.dicom = dwv.dicom || {};
|
|
|
4591
4602
|
* @returns {string} The version of the library.
|
|
4592
4603
|
*/
|
|
4593
4604
|
dwv.getVersion = function () {
|
|
4594
|
-
return '0.31.0-beta.
|
|
4605
|
+
return '0.31.0-beta.16';
|
|
4595
4606
|
};
|
|
4596
4607
|
|
|
4597
4608
|
/**
|
|
@@ -6083,16 +6094,18 @@ dwv.dicom.isPixelDataTag = function (tag) {
|
|
|
6083
6094
|
* Get a tag from the dictionary using a tag string name.
|
|
6084
6095
|
*
|
|
6085
6096
|
* @param {string} tagName The tag string name.
|
|
6086
|
-
* @returns {object} The tag object.
|
|
6097
|
+
* @returns {object|null} The tag object or null if not found.
|
|
6087
6098
|
*/
|
|
6088
6099
|
dwv.dicom.getTagFromDictionary = function (tagName) {
|
|
6100
|
+
if (typeof tagName === 'undefined' || tagName === null) {
|
|
6101
|
+
return null;
|
|
6102
|
+
}
|
|
6089
6103
|
var group = null;
|
|
6090
6104
|
var element = null;
|
|
6091
6105
|
var dict = dwv.dicom.dictionary;
|
|
6092
6106
|
var keys0 = Object.keys(dict);
|
|
6093
6107
|
var keys1 = null;
|
|
6094
|
-
|
|
6095
|
-
outLabel:
|
|
6108
|
+
var foundTag = false;
|
|
6096
6109
|
// search through dictionary
|
|
6097
6110
|
for (var k0 = 0, lenK0 = keys0.length; k0 < lenK0; ++k0) {
|
|
6098
6111
|
group = keys0[k0];
|
|
@@ -6100,12 +6113,16 @@ dwv.dicom.getTagFromDictionary = function (tagName) {
|
|
|
6100
6113
|
for (var k1 = 0, lenK1 = keys1.length; k1 < lenK1; ++k1) {
|
|
6101
6114
|
element = keys1[k1];
|
|
6102
6115
|
if (dict[group][element][2] === tagName) {
|
|
6103
|
-
|
|
6116
|
+
foundTag = true;
|
|
6117
|
+
break;
|
|
6104
6118
|
}
|
|
6105
6119
|
}
|
|
6120
|
+
if (foundTag) {
|
|
6121
|
+
break;
|
|
6122
|
+
}
|
|
6106
6123
|
}
|
|
6107
6124
|
var tag = null;
|
|
6108
|
-
if (
|
|
6125
|
+
if (foundTag) {
|
|
6109
6126
|
tag = new dwv.dicom.Tag(group, element);
|
|
6110
6127
|
}
|
|
6111
6128
|
return tag;
|
|
@@ -6808,7 +6825,10 @@ dwv.dicom.DicomWriter.prototype.getBuffer = function (dicomElements) {
|
|
|
6808
6825
|
var element;
|
|
6809
6826
|
var groupName;
|
|
6810
6827
|
var metaLength = 0;
|
|
6828
|
+
// FileMetaInformationGroupLength
|
|
6811
6829
|
var fmiglTag = dwv.dicom.getFileMetaInformationGroupLengthTag();
|
|
6830
|
+
// FileMetaInformationVersion
|
|
6831
|
+
var fmivTag = new dwv.dicom.Tag('0x0002', '0x0001');
|
|
6812
6832
|
// ImplementationClassUID
|
|
6813
6833
|
var icUIDTag = new dwv.dicom.Tag('0x0002', '0x0012');
|
|
6814
6834
|
// ImplementationVersionName
|
|
@@ -6820,6 +6840,7 @@ dwv.dicom.DicomWriter.prototype.getBuffer = function (dicomElements) {
|
|
|
6820
6840
|
element = this.getElementToWrite(dicomElements[keys[i]]);
|
|
6821
6841
|
if (element !== null &&
|
|
6822
6842
|
!fmiglTag.equals(element.tag) &&
|
|
6843
|
+
!fmivTag.equals(element.tag) &&
|
|
6823
6844
|
!icUIDTag.equals(element.tag) &&
|
|
6824
6845
|
!ivnTag.equals(element.tag)) {
|
|
6825
6846
|
localSize = 0;
|
|
@@ -6862,9 +6883,16 @@ dwv.dicom.DicomWriter.prototype.getBuffer = function (dicomElements) {
|
|
|
6862
6883
|
}
|
|
6863
6884
|
}
|
|
6864
6885
|
|
|
6886
|
+
// FileMetaInformationVersion
|
|
6887
|
+
var fmiv = dwv.dicom.getDicomElement('FileMetaInformationVersion');
|
|
6888
|
+
var fmivSize = dwv.dicom.getDataElementPrefixByteSize(fmiv.vr, false);
|
|
6889
|
+
fmivSize += this.setElementValue(fmiv, [0, 1], false);
|
|
6890
|
+
metaElements.push(fmiv);
|
|
6891
|
+
metaLength += fmivSize;
|
|
6892
|
+
totalSize += fmivSize;
|
|
6865
6893
|
// ImplementationClassUID
|
|
6866
6894
|
var icUID = dwv.dicom.getDicomElement('ImplementationClassUID');
|
|
6867
|
-
var icUIDSize = dwv.dicom.getDataElementPrefixByteSize(icUID.vr,
|
|
6895
|
+
var icUIDSize = dwv.dicom.getDataElementPrefixByteSize(icUID.vr, false);
|
|
6868
6896
|
icUIDSize += this.setElementValue(
|
|
6869
6897
|
icUID, [dwv.dicom.getUID('ImplementationClassUID')], false);
|
|
6870
6898
|
metaElements.push(icUID);
|
|
@@ -6872,7 +6900,7 @@ dwv.dicom.DicomWriter.prototype.getBuffer = function (dicomElements) {
|
|
|
6872
6900
|
totalSize += icUIDSize;
|
|
6873
6901
|
// ImplementationVersionName
|
|
6874
6902
|
var ivn = dwv.dicom.getDicomElement('ImplementationVersionName');
|
|
6875
|
-
var ivnSize = dwv.dicom.getDataElementPrefixByteSize(ivn.vr,
|
|
6903
|
+
var ivnSize = dwv.dicom.getDataElementPrefixByteSize(ivn.vr, false);
|
|
6876
6904
|
var ivnValue = 'DWV_' + dwv.getVersion();
|
|
6877
6905
|
ivnSize += this.setElementValue(ivn, [ivnValue], false);
|
|
6878
6906
|
metaElements.push(ivn);
|
|
@@ -6888,7 +6916,7 @@ dwv.dicom.DicomWriter.prototype.getBuffer = function (dicomElements) {
|
|
|
6888
6916
|
|
|
6889
6917
|
// create the FileMetaInformationGroupLength element
|
|
6890
6918
|
var fmigl = dwv.dicom.getDicomElement('FileMetaInformationGroupLength');
|
|
6891
|
-
var fmiglSize = dwv.dicom.getDataElementPrefixByteSize(fmigl.vr,
|
|
6919
|
+
var fmiglSize = dwv.dicom.getDataElementPrefixByteSize(fmigl.vr, false);
|
|
6892
6920
|
fmiglSize += this.setElementValue(
|
|
6893
6921
|
fmigl, new Uint32Array([metaLength]), false);
|
|
6894
6922
|
totalSize += fmiglSize;
|
|
@@ -7189,6 +7217,9 @@ dwv.dicom.getElementsFromJSONTags = function (jsonTags) {
|
|
|
7189
7217
|
for (var k = 0, len = keys.length; k < len; ++k) {
|
|
7190
7218
|
// get the DICOM element definition from its name
|
|
7191
7219
|
var tag = dwv.dicom.getTagFromDictionary(keys[k]);
|
|
7220
|
+
if (!tag) {
|
|
7221
|
+
continue;
|
|
7222
|
+
}
|
|
7192
7223
|
var vr = tag.getVrFromDictionary();
|
|
7193
7224
|
// tag value
|
|
7194
7225
|
var value;
|
|
@@ -13495,7 +13526,7 @@ dwv.gui.LayerGroup = function (containerDiv, groupId) {
|
|
|
13495
13526
|
*
|
|
13496
13527
|
* @returns {string} The id of the div.
|
|
13497
13528
|
*/
|
|
13498
|
-
this.
|
|
13529
|
+
this.getDivId = function () {
|
|
13499
13530
|
return containerDiv.id;
|
|
13500
13531
|
};
|
|
13501
13532
|
|
|
@@ -14287,9 +14318,9 @@ dwv.gui.Stage = function () {
|
|
|
14287
14318
|
* @param {string} id The element id to find.
|
|
14288
14319
|
* @returns {dwv.gui.LayerGroup} The layer group.
|
|
14289
14320
|
*/
|
|
14290
|
-
this.
|
|
14321
|
+
this.getLayerGroupByDivId = function (id) {
|
|
14291
14322
|
return layerGroups.find(function (item) {
|
|
14292
|
-
return item.
|
|
14323
|
+
return item.getDivId() === id;
|
|
14293
14324
|
});
|
|
14294
14325
|
};
|
|
14295
14326
|
|
|
@@ -19675,21 +19706,21 @@ dwv.dicom.checkTag = function (rootElement, tagDefinition) {
|
|
|
19675
19706
|
/**
|
|
19676
19707
|
* List of DICOM Seg required tags.
|
|
19677
19708
|
*/
|
|
19678
|
-
dwv.dicom.
|
|
19709
|
+
dwv.dicom.requiredDicomSegTags = [
|
|
19679
19710
|
{
|
|
19680
|
-
name: '
|
|
19711
|
+
name: 'TransferSyntaxUID',
|
|
19681
19712
|
tag: 'x00020010',
|
|
19682
19713
|
type: '1',
|
|
19683
19714
|
enum: ['1.2.840.10008.1.2.1']
|
|
19684
19715
|
},
|
|
19685
19716
|
{
|
|
19686
|
-
name: '
|
|
19717
|
+
name: 'MediaStorageSOPClassUID',
|
|
19687
19718
|
tag: 'x00020002',
|
|
19688
19719
|
type: '1',
|
|
19689
19720
|
enum: ['1.2.840.10008.5.1.4.1.1.66.4']
|
|
19690
19721
|
},
|
|
19691
19722
|
{
|
|
19692
|
-
name: '
|
|
19723
|
+
name: 'SOPClassUID',
|
|
19693
19724
|
tag: 'x00020002',
|
|
19694
19725
|
type: '1',
|
|
19695
19726
|
enum: ['1.2.840.10008.5.1.4.1.1.66.4']
|
|
@@ -19701,61 +19732,75 @@ dwv.dicom.requiredSegDicomTags = [
|
|
|
19701
19732
|
enum: ['SEG']
|
|
19702
19733
|
},
|
|
19703
19734
|
{
|
|
19704
|
-
name: '
|
|
19735
|
+
name: 'SegmentationType',
|
|
19705
19736
|
tag: 'x00620001',
|
|
19706
19737
|
type: '1',
|
|
19707
19738
|
enum: ['BINARY']
|
|
19708
19739
|
},
|
|
19709
19740
|
{
|
|
19710
|
-
name: '
|
|
19741
|
+
name: 'DimensionOrganizationType',
|
|
19711
19742
|
tag: 'x00209311',
|
|
19712
19743
|
type: '3',
|
|
19713
19744
|
enum: ['3D']
|
|
19714
19745
|
},
|
|
19715
19746
|
{
|
|
19716
|
-
name: '
|
|
19747
|
+
name: 'ImageType',
|
|
19717
19748
|
tag: 'x00080008',
|
|
19718
19749
|
type: '1',
|
|
19719
19750
|
enum: [['DERIVED', 'PRIMARY']]
|
|
19720
19751
|
},
|
|
19721
19752
|
{
|
|
19722
|
-
name: '
|
|
19753
|
+
name: 'SamplesPerPixel',
|
|
19723
19754
|
tag: 'x00280002',
|
|
19724
19755
|
type: '1',
|
|
19725
19756
|
enum: [1]
|
|
19726
19757
|
},
|
|
19727
19758
|
{
|
|
19728
|
-
name: '
|
|
19759
|
+
name: 'PhotometricInterpretation',
|
|
19729
19760
|
tag: 'x00280004',
|
|
19730
19761
|
type: '1',
|
|
19731
19762
|
enum: ['MONOCHROME2']
|
|
19732
19763
|
},
|
|
19733
19764
|
{
|
|
19734
|
-
name: '
|
|
19765
|
+
name: 'PixelRepresentation',
|
|
19735
19766
|
tag: 'x00280103',
|
|
19736
19767
|
type: '1',
|
|
19737
19768
|
enum: [0]
|
|
19738
19769
|
},
|
|
19739
19770
|
{
|
|
19740
|
-
name: '
|
|
19771
|
+
name: 'BitsAllocated',
|
|
19741
19772
|
tag: 'x00280100',
|
|
19742
19773
|
type: '1',
|
|
19743
19774
|
enum: [1]
|
|
19744
19775
|
},
|
|
19745
19776
|
{
|
|
19746
|
-
name: '
|
|
19777
|
+
name: 'BitsStored',
|
|
19747
19778
|
tag: 'x00280101',
|
|
19748
19779
|
type: '1',
|
|
19749
19780
|
enum: [1]
|
|
19750
19781
|
},
|
|
19751
19782
|
{
|
|
19752
|
-
name: '
|
|
19783
|
+
name: 'HighBit',
|
|
19753
19784
|
tag: 'x00280102',
|
|
19754
19785
|
type: '1',
|
|
19755
19786
|
enum: [0]
|
|
19756
19787
|
},
|
|
19757
19788
|
];
|
|
19758
19789
|
|
|
19790
|
+
/**
|
|
19791
|
+
* Get the default DICOM seg tags as an object.
|
|
19792
|
+
*
|
|
19793
|
+
* @returns {object} The default tags.
|
|
19794
|
+
*/
|
|
19795
|
+
dwv.dicom.getDefaultDicomSegJson = function () {
|
|
19796
|
+
var tags = {};
|
|
19797
|
+
for (var i = 0; i < dwv.dicom.requiredDicomSegTags.length; ++i) {
|
|
19798
|
+
var reqTag = dwv.dicom.requiredDicomSegTags[i];
|
|
19799
|
+
tags[reqTag.name] = reqTag.enum[0];
|
|
19800
|
+
}
|
|
19801
|
+
return tags;
|
|
19802
|
+
};
|
|
19803
|
+
|
|
19759
19804
|
/**
|
|
19760
19805
|
* Check the dimension organization from a dicom element.
|
|
19761
19806
|
*
|
|
@@ -19769,7 +19814,7 @@ dwv.dicom.getDimensionOrganization = function (rootElement) {
|
|
|
19769
19814
|
throw new Error('Unsupported dimension organization sequence length');
|
|
19770
19815
|
}
|
|
19771
19816
|
// Dimension Organization UID
|
|
19772
|
-
var
|
|
19817
|
+
var orgUID = dwv.dicom.cleanString(orgSq[0].x00209164.value[0]);
|
|
19773
19818
|
|
|
19774
19819
|
// Dimension Index Sequence (conditionally required)
|
|
19775
19820
|
var indices = [];
|
|
@@ -19779,38 +19824,46 @@ dwv.dicom.getDimensionOrganization = function (rootElement) {
|
|
|
19779
19824
|
if (indexSq.length !== 2) {
|
|
19780
19825
|
throw new Error('Unsupported dimension index sequence length');
|
|
19781
19826
|
}
|
|
19827
|
+
var indexPointer;
|
|
19782
19828
|
for (var i = 0; i < indexSq.length; ++i) {
|
|
19783
19829
|
// Dimension Organization UID (required)
|
|
19784
19830
|
var indexOrg = dwv.dicom.cleanString(indexSq[i].x00209164.value[0]);
|
|
19785
|
-
if (indexOrg !==
|
|
19831
|
+
if (indexOrg !== orgUID) {
|
|
19786
19832
|
throw new Error(
|
|
19787
19833
|
'Dimension Index Sequence contains a unknown Dimension Organization');
|
|
19788
19834
|
}
|
|
19789
19835
|
// Dimension Index Pointer (required)
|
|
19790
|
-
|
|
19791
|
-
dwv.dicom.cleanString(indexSq[i].x00209165.value[0]);
|
|
19836
|
+
indexPointer = dwv.dicom.cleanString(indexSq[i].x00209165.value[0]);
|
|
19792
19837
|
|
|
19793
19838
|
var index = {
|
|
19794
|
-
|
|
19795
|
-
|
|
19839
|
+
DimensionOrganizationUID: indexOrg,
|
|
19840
|
+
DimensionIndexPointer: indexPointer
|
|
19796
19841
|
};
|
|
19797
19842
|
// Dimension Description Label (optional)
|
|
19798
19843
|
if (typeof indexSq[i].x00209421 !== 'undefined') {
|
|
19799
|
-
index.
|
|
19844
|
+
index.DimensionDescriptionLabel =
|
|
19800
19845
|
dwv.dicom.cleanString(indexSq[i].x00209421.value[0]);
|
|
19801
19846
|
}
|
|
19802
19847
|
// store
|
|
19803
19848
|
indices.push(index);
|
|
19804
19849
|
}
|
|
19805
19850
|
// expecting Image Position at last position
|
|
19806
|
-
if (
|
|
19851
|
+
if (indexPointer !== '(0020,0032)') {
|
|
19807
19852
|
throw new Error('Unsupported non image position as last index');
|
|
19808
19853
|
}
|
|
19809
19854
|
}
|
|
19810
19855
|
|
|
19811
19856
|
return {
|
|
19812
|
-
organizations:
|
|
19813
|
-
|
|
19857
|
+
organizations: {
|
|
19858
|
+
value: [
|
|
19859
|
+
{
|
|
19860
|
+
DimensionOrganizationUID: orgUID
|
|
19861
|
+
}
|
|
19862
|
+
]
|
|
19863
|
+
},
|
|
19864
|
+
indices: {
|
|
19865
|
+
value: indices
|
|
19866
|
+
}
|
|
19814
19867
|
};
|
|
19815
19868
|
};
|
|
19816
19869
|
|
|
@@ -20116,8 +20169,8 @@ dwv.image.MaskFactory = function () {};
|
|
|
20116
20169
|
dwv.image.MaskFactory.prototype.create = function (
|
|
20117
20170
|
dicomElements, pixelBuffer) {
|
|
20118
20171
|
// check required and supported tags
|
|
20119
|
-
for (var d = 0; d < dwv.dicom.
|
|
20120
|
-
dwv.dicom.checkTag(dicomElements, dwv.dicom.
|
|
20172
|
+
for (var d = 0; d < dwv.dicom.requiredDicomSegTags.length; ++d) {
|
|
20173
|
+
dwv.dicom.checkTag(dicomElements, dwv.dicom.requiredDicomSegTags[d]);
|
|
20121
20174
|
}
|
|
20122
20175
|
|
|
20123
20176
|
// columns
|
|
@@ -20183,12 +20236,7 @@ dwv.image.MaskFactory.prototype.create = function (
|
|
|
20183
20236
|
var planeOrientationSeq = funcGroup0.x00209116;
|
|
20184
20237
|
if (planeOrientationSeq.value.length !== 0) {
|
|
20185
20238
|
// should be only one
|
|
20186
|
-
|
|
20187
|
-
imageOrientationPatient = orientArray.map(
|
|
20188
|
-
function (x) {
|
|
20189
|
-
return parseFloat(x);
|
|
20190
|
-
}
|
|
20191
|
-
);
|
|
20239
|
+
imageOrientationPatient = planeOrientationSeq.value[0].x00200037.value;
|
|
20192
20240
|
} else {
|
|
20193
20241
|
dwv.logger.warn(
|
|
20194
20242
|
'No shared functional group plane orientation sequence items.');
|
|
@@ -20375,32 +20423,52 @@ dwv.image.MaskFactory.prototype.create = function (
|
|
|
20375
20423
|
image.setPhotometricInterpretation('RGB');
|
|
20376
20424
|
}
|
|
20377
20425
|
// meta information
|
|
20378
|
-
var meta =
|
|
20379
|
-
|
|
20380
|
-
|
|
20381
|
-
|
|
20382
|
-
|
|
20383
|
-
|
|
20384
|
-
|
|
20385
|
-
|
|
20386
|
-
|
|
20387
|
-
|
|
20388
|
-
|
|
20389
|
-
|
|
20390
|
-
|
|
20391
|
-
|
|
20392
|
-
|
|
20393
|
-
|
|
20394
|
-
|
|
20395
|
-
|
|
20396
|
-
|
|
20397
|
-
|
|
20398
|
-
|
|
20426
|
+
var meta = dwv.dicom.getDefaultDicomSegJson();
|
|
20427
|
+
// Study
|
|
20428
|
+
meta.StudyDate = dicomElements.getFromKey('x00080020');
|
|
20429
|
+
meta.StudyTime = dicomElements.getFromKey('x00080030');
|
|
20430
|
+
meta.StudyInstanceUID = dicomElements.getFromKey('x0020000D');
|
|
20431
|
+
meta.StudyID = dicomElements.getFromKey('x00200010');
|
|
20432
|
+
// Series
|
|
20433
|
+
meta.SeriesInstanceUID = dicomElements.getFromKey('x0020000E');
|
|
20434
|
+
meta.SeriesNumber = dicomElements.getFromKey('x00200011');
|
|
20435
|
+
// ReferringPhysicianName
|
|
20436
|
+
meta.ReferringPhysicianName = dicomElements.getFromKey('x00080090');
|
|
20437
|
+
// patient info
|
|
20438
|
+
meta.PatientName =
|
|
20439
|
+
dwv.dicom.cleanString(dicomElements.getFromKey('x00100010'));
|
|
20440
|
+
meta.PatientID = dwv.dicom.cleanString(dicomElements.getFromKey('x00100020'));
|
|
20441
|
+
meta.PatientBirthDate = dicomElements.getFromKey('x00100030');
|
|
20442
|
+
meta.PatientSex =
|
|
20443
|
+
dwv.dicom.cleanString(dicomElements.getFromKey('x00100040'));
|
|
20444
|
+
// Enhanced General Equipment Module
|
|
20445
|
+
meta.Manufacturer = dicomElements.getFromKey('x00080070');
|
|
20446
|
+
meta.ManufacturerModelName = dicomElements.getFromKey('x00081090');
|
|
20447
|
+
meta.DeviceSerialNumber = dicomElements.getFromKey('x00181000');
|
|
20448
|
+
meta.SoftwareVersions = dicomElements.getFromKey('x00181020');
|
|
20449
|
+
// dicom seg dimension
|
|
20450
|
+
meta.DimensionOrganizationSequence = dimension.organizations;
|
|
20451
|
+
meta.DimensionIndexSequence = dimension.indices;
|
|
20452
|
+
// custom
|
|
20453
|
+
meta.custom = {
|
|
20454
|
+
segments: segments,
|
|
20455
|
+
frameInfos: frameInfos,
|
|
20456
|
+
SOPInstanceUID: dicomElements.getFromKey('x00080018')
|
|
20457
|
+
};
|
|
20458
|
+
|
|
20459
|
+
// number of files: in this case equal to number slices,
|
|
20460
|
+
// used to calculate buffer size
|
|
20461
|
+
meta.numberOfFiles = numberOfSlices;
|
|
20399
20462
|
// FrameOfReferenceUID (optional)
|
|
20400
20463
|
var frameOfReferenceUID = dicomElements.getFromKey('x00200052');
|
|
20401
20464
|
if (frameOfReferenceUID) {
|
|
20402
20465
|
meta.FrameOfReferenceUID = frameOfReferenceUID;
|
|
20403
20466
|
}
|
|
20467
|
+
// LossyImageCompression (optional)
|
|
20468
|
+
var lossyImageCompression = dicomElements.getFromKey('x00282110');
|
|
20469
|
+
if (lossyImageCompression) {
|
|
20470
|
+
meta.LossyImageCompression = lossyImageCompression;
|
|
20471
|
+
}
|
|
20404
20472
|
|
|
20405
20473
|
image.setMeta(meta);
|
|
20406
20474
|
|