@ohif/app 3.12.0-beta.90 → 3.12.0-beta.92
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/{1037.bundle.87a5adb8c92bd5bf53f5.js → 1037.bundle.dd9098a9a640f0d0ef0f.js} +129 -96
- package/dist/{1608.bundle.3d904bc76f5d5f78ff21.js → 1608.bundle.f855c4bdb7f00eb66fca.js} +1 -1
- package/dist/{1903.bundle.f0505c6e927d0bef5589.js → 1903.bundle.9a291597f23ebaa3371c.js} +49 -47
- package/dist/{1604.bundle.4f01a6b0b8d5b1cbc294.js → 1933.bundle.a5d41c04da5425d06694.js} +13 -26
- package/dist/{2018.bundle.59c7c4cb3f79f63bab68.js → 2018.bundle.4527f2b0c1c8ff75f568.js} +18 -43
- package/dist/{306.bundle.f9faa2b3cdd7e86b5869.js → 306.bundle.a0af0889477845729c6a.js} +23 -1
- package/dist/{3461.bundle.458597198f24359ec78f.js → 3461.bundle.3cac685ef19f883a0f9d.js} +27 -8
- package/dist/{4019.bundle.1be1cdd0805ad2c59d65.js → 4019.bundle.03029c488a02493cb7f3.js} +17 -1
- package/dist/{2518.bundle.644302643ac0790e7374.js → 4033.bundle.1609f8751de2a6aff280.js} +457 -303
- package/dist/{4819.bundle.f187a4c0517c85e37ab0.js → 4819.bundle.14344bf9acf5c5f6d123.js} +3 -3
- package/dist/{5028.bundle.6003ab9178779929462f.js → 5028.bundle.c61b7cd88172e2d589d5.js} +2 -2
- package/dist/{5400.bundle.c3a3fe8867efa2edfa94.js → 5400.bundle.428fdd2dc347a7fda9e6.js} +96 -92
- package/dist/5457.bundle.af893cd38fdaeafd5c2a.js +89 -0
- package/dist/{5485.bundle.2ee096f57ff7e51d4c23.js → 5485.bundle.929d9add8bdf90a4f3c7.js} +8 -0
- package/dist/{5802.bundle.8922caf16c088b10cdb0.js → 5802.bundle.756d2ed511c06ee8b461.js} +2 -2
- package/dist/{6991.bundle.46bc04720d99fbb06785.js → 6991.bundle.7d091de815571097b96e.js} +8 -10
- package/dist/{7412.bundle.34fe5e72833e857edc0a.js → 7412.bundle.dfe01ae3e53107abe53d.js} +80 -57
- package/dist/{8305.bundle.8ea926425cdffaf84fe3.js → 8305.bundle.08ba73235df90e099838.js} +75 -55
- package/dist/{8558.bundle.c9ffb4f942dbbbff1849.js → 8558.bundle.705446f4883e84021bf4.js} +29 -11
- package/dist/{8583.bundle.7715397a42e8f00a9e3e.js → 8583.bundle.0288cadf5cf8401446b1.js} +12 -13
- package/dist/{874.bundle.92ddc54408fef9debee7.js → 874.bundle.7e543ec9343c9a718e3d.js} +35 -42
- package/dist/{3613.bundle.6157004e0592003c0800.js → 8802.bundle.4958d8ba1d0d521a002a.js} +131 -76
- package/dist/{9548.bundle.7be4f24aeadd0ad4f16c.js → 9195.bundle.70afccd0f802b78c279a.js} +75 -104
- package/dist/{9845.bundle.7e4db5e31b28d73fdac2.js → 9845.bundle.0d22f2210c1d5ac18882.js} +1 -1
- package/dist/{app.bundle.bdd8a45996ed4ca28560.js → app.bundle.2b7e40349f89ffdfd96c.js} +1055 -219
- package/dist/{compute.bundle.f3ca9fb0e7ce9e885b9c.js → compute.bundle.4c0ef8b919cbe5eef44d.js} +3 -3
- package/dist/index.html +1 -1
- package/dist/{polySeg.bundle.7b8d1bb21d442a48da1d.js → polySeg.bundle.75f37f2780c5375e161e.js} +3 -3
- package/dist/sw.js +1 -1
- package/package.json +22 -22
- package/dist/5457.bundle.535bae0c872c1ca0c2cb.js +0 -1358
- /package/dist/{1459.bundle.0481573ae1bde12b24ee.js → 1459.bundle.c4acfc6df383fc187e9e.js} +0 -0
- /package/dist/{147.bundle.6fc65a239d1ae1c6a918.js → 147.bundle.c191ca0b67633f707aff.js} +0 -0
- /package/dist/{1515.bundle.73d415797a677ae5261e.js → 1515.bundle.3f81b326242dd945ecdb.js} +0 -0
- /package/dist/{1604.css → 1933.css} +0 -0
- /package/dist/{213.bundle.9b152cd4d202cae43af2.js → 213.bundle.33092c23ffe1d81ae242.js} +0 -0
- /package/dist/{2243.bundle.25ca9faa6d0776355adf.js → 2243.bundle.e37c80996a222167dc14.js} +0 -0
- /package/dist/{2424.bundle.57b7484a3b1b1e5a1722.js → 2424.bundle.45583fc64208a2821aa3.js} +0 -0
- /package/dist/{319.bundle.4ea0dbcfeb553c900206.js → 319.bundle.febb2a63634488c11db6.js} +0 -0
- /package/dist/{6027.bundle.06ab1f1cd27f93f826e5.js → 6027.bundle.b2942a0dd2c583374d7b.js} +0 -0
- /package/dist/{7431.bundle.55dd86000e66bee467e2.js → 7431.bundle.b80819b8eb28d2ee897d.js} +0 -0
- /package/dist/{7639.bundle.a89f4a8c6e8b2593d7a4.js → 7639.bundle.2ad4b6cd132d87439fa6.js} +0 -0
- /package/dist/{85.bundle.f3a9149485e3fcf652f0.js → 85.bundle.a772983604a0f9514e33.js} +0 -0
- /package/dist/{9862.bundle.0456a2d473895bf2916e.js → 9862.bundle.eca4ea8821bb040a44c1.js} +0 -0
- /package/dist/{9927.bundle.d7051dac659d827d62d3.js → 9927.bundle.775cb41458de4c28a9ba.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[
|
|
1
|
+
(globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[4033],{
|
|
2
2
|
|
|
3
|
-
/***/
|
|
3
|
+
/***/ 14041:
|
|
4
4
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
@@ -16,6 +16,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
16
16
|
_$: () => (/* reexport */ helpers_namespaceObject)
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
+
// UNUSED EXPORTS: utilities
|
|
20
|
+
|
|
19
21
|
// NAMESPACE OBJECT: ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone/Segmentation.js
|
|
20
22
|
var Segmentation_namespaceObject = {};
|
|
21
23
|
__webpack_require__.r(Segmentation_namespaceObject);
|
|
@@ -48,6 +50,9 @@ __webpack_require__.r(RTStruct_namespaceObject);
|
|
|
48
50
|
__webpack_require__.d(RTStruct_namespaceObject, {
|
|
49
51
|
generateContourSetsFromLabelmap: () => (RTStruct_generateContourSetsFromLabelmap),
|
|
50
52
|
generateRTSSFromAnnotations: () => (generateRTSSFromAnnotations),
|
|
53
|
+
generateRTSSFromContour: () => (generateRTSSFromContour),
|
|
54
|
+
generateRTSSFromLabelmap: () => (generateRTSSFromLabelmap),
|
|
55
|
+
generateRTSSFromRepresentation: () => (generateRTSSFromRepresentation),
|
|
51
56
|
generateRTSSFromSegmentations: () => (generateRTSSFromSegmentations)
|
|
52
57
|
});
|
|
53
58
|
|
|
@@ -81,8 +86,6 @@ const codeMeaningEquals = codeMeaningName => {
|
|
|
81
86
|
|
|
82
87
|
|
|
83
88
|
|
|
84
|
-
// EXTERNAL MODULE: ../../../node_modules/buffer/index.js
|
|
85
|
-
var node_modules_buffer = __webpack_require__(81429);
|
|
86
89
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 1 modules
|
|
87
90
|
var esm = __webpack_require__(15327);
|
|
88
91
|
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone/MeasurementReport.js
|
|
@@ -91,7 +94,6 @@ var esm = __webpack_require__(15327);
|
|
|
91
94
|
|
|
92
95
|
|
|
93
96
|
|
|
94
|
-
|
|
95
97
|
const {
|
|
96
98
|
TID1500,
|
|
97
99
|
addAccessors
|
|
@@ -535,7 +537,6 @@ MeasurementReport.registerTool(FreehandRoi);
|
|
|
535
537
|
|
|
536
538
|
|
|
537
539
|
|
|
538
|
-
|
|
539
540
|
const {
|
|
540
541
|
Bidirectional: TID300Bidirectional
|
|
541
542
|
} = dcmjs_es/* utilities */.BF.TID300;
|
|
@@ -3337,8 +3338,8 @@ var CORNERSTONE_3D_TAG = "Cornerstone3DTools@^0.1.0";
|
|
|
3337
3338
|
|
|
3338
3339
|
|
|
3339
3340
|
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/helpers/copyStudyTags.js
|
|
3340
|
-
const patientTags = [
|
|
3341
|
-
const studyTags = [
|
|
3341
|
+
const patientTags = ['PatientName', 'PatientID', 'PatientBirthDate', 'PatientBirthTime', 'IssuerOfPatientID', 'OtherPatientIDs', 'OtherPatientIDsSequence', 'PatientSex', 'PatientIdentityRemoved', 'DeidentificationMethodCodeSequence'];
|
|
3342
|
+
const studyTags = ['StudyDate', 'StudyTime', 'StudyStatusID', 'StudyPriorityID', 'StudyInstanceUID', 'StudyDescription', 'AccessionNumber', 'StudyID', 'ReferringPhysicianName', 'TimezoneOffsetFromUTC'];
|
|
3342
3343
|
const patientStudyTags = [...patientTags, ...studyTags];
|
|
3343
3344
|
function copyStudyTags(src) {
|
|
3344
3345
|
const study = {
|
|
@@ -3358,20 +3359,17 @@ function copyStudyTags(src) {
|
|
|
3358
3359
|
|
|
3359
3360
|
|
|
3360
3361
|
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/helpers/copySeriesTags.js
|
|
3361
|
-
const seriesTags = [
|
|
3362
|
+
const seriesTags = ['SeriesInstanceUID', 'SeriesNumber', 'SeriesDescription', 'Modality', 'SeriesDate', 'SeriesTime', '_meta', '_vrMap'];
|
|
3362
3363
|
function copySeriesTags(src) {
|
|
3363
|
-
const
|
|
3364
|
-
_meta: src._meta,
|
|
3365
|
-
_vrMap: src._vrMap
|
|
3366
|
-
};
|
|
3364
|
+
const result = {};
|
|
3367
3365
|
for (const tagKey of seriesTags) {
|
|
3368
3366
|
const value = src[tagKey];
|
|
3369
3367
|
if (value === undefined) {
|
|
3370
3368
|
continue;
|
|
3371
3369
|
}
|
|
3372
|
-
|
|
3370
|
+
result[tagKey] = value;
|
|
3373
3371
|
}
|
|
3374
|
-
return
|
|
3372
|
+
return result;
|
|
3375
3373
|
}
|
|
3376
3374
|
|
|
3377
3375
|
|
|
@@ -3448,17 +3446,50 @@ const CodingScheme = {
|
|
|
3448
3446
|
|
|
3449
3447
|
|
|
3450
3448
|
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/constants/index.js
|
|
3451
|
-
const NO_IMAGE_ID =
|
|
3452
|
-
const CS3D_DESIGNATOR =
|
|
3449
|
+
const NO_IMAGE_ID = 'none';
|
|
3450
|
+
const CS3D_DESIGNATOR = '99CS3D';
|
|
3453
3451
|
const TEXT_ANNOTATION_POSITION = {
|
|
3454
3452
|
schemeDesignator: CS3D_DESIGNATOR,
|
|
3455
|
-
meaning:
|
|
3456
|
-
value:
|
|
3453
|
+
meaning: 'Text Annotation Position',
|
|
3454
|
+
value: 'TextPosition'
|
|
3457
3455
|
};
|
|
3458
3456
|
const COMMENT_CODE = {
|
|
3459
|
-
schemeDesignator:
|
|
3460
|
-
meaning:
|
|
3461
|
-
value:
|
|
3457
|
+
schemeDesignator: 'DCM',
|
|
3458
|
+
meaning: 'Comment',
|
|
3459
|
+
value: '121106'
|
|
3460
|
+
};
|
|
3461
|
+
const fileMetaInformationVersionArray1 = new Uint8Array(2);
|
|
3462
|
+
fileMetaInformationVersionArray1[1] = 1;
|
|
3463
|
+
const fileMetaInformationVersionArray2 = new Uint8Array(2);
|
|
3464
|
+
fileMetaInformationVersionArray2[1] = 2;
|
|
3465
|
+
const ImplementationClassUidSRAnnotation = '2.25.2470123695996825859949881583571202391.1.0.1';
|
|
3466
|
+
const ImplementationClassRtssContours = '2.25.2470123695996825859949881583571202391.2.0.1';
|
|
3467
|
+
const fileMetaInformationVersionArray = new Uint8Array(2);
|
|
3468
|
+
fileMetaInformationVersionArray[1] = 1;
|
|
3469
|
+
const metaSRAnnotation = {
|
|
3470
|
+
FileMetaInformationVersion: {
|
|
3471
|
+
Value: [fileMetaInformationVersionArray2.buffer],
|
|
3472
|
+
vr: 'OB'
|
|
3473
|
+
},
|
|
3474
|
+
TransferSyntaxUID: {
|
|
3475
|
+
Value: ['1.2.840.10008.1.2'],
|
|
3476
|
+
vr: 'UI'
|
|
3477
|
+
},
|
|
3478
|
+
ImplementationClassUID: {
|
|
3479
|
+
Value: [ImplementationClassUidSRAnnotation],
|
|
3480
|
+
vr: 'UI'
|
|
3481
|
+
},
|
|
3482
|
+
ImplementationVersionName: {
|
|
3483
|
+
Value: ['cs3d-4.8.4'],
|
|
3484
|
+
vr: 'SH'
|
|
3485
|
+
}
|
|
3486
|
+
};
|
|
3487
|
+
const metaRTSSContour = {
|
|
3488
|
+
...metaSRAnnotation,
|
|
3489
|
+
ImplementationClassUID: {
|
|
3490
|
+
Value: [ImplementationClassRtssContours],
|
|
3491
|
+
vr: 'UI'
|
|
3492
|
+
}
|
|
3462
3493
|
};
|
|
3463
3494
|
|
|
3464
3495
|
|
|
@@ -3504,7 +3535,6 @@ function setWorldToImageCoords() {
|
|
|
3504
3535
|
|
|
3505
3536
|
|
|
3506
3537
|
|
|
3507
|
-
|
|
3508
3538
|
const {
|
|
3509
3539
|
sr: {
|
|
3510
3540
|
valueTypes,
|
|
@@ -3616,8 +3646,10 @@ class LabelData {
|
|
|
3616
3646
|
|
|
3617
3647
|
|
|
3618
3648
|
|
|
3619
|
-
|
|
3620
3649
|
var _MeasurementReport;
|
|
3650
|
+
const {
|
|
3651
|
+
MetadataModules
|
|
3652
|
+
} = esm.Enums;
|
|
3621
3653
|
const {
|
|
3622
3654
|
TID1500: MeasurementReport_TID1500,
|
|
3623
3655
|
addAccessors: MeasurementReport_addAccessors
|
|
@@ -3636,8 +3668,8 @@ const {
|
|
|
3636
3668
|
DicomMetaDictionary: MeasurementReport_DicomMetaDictionary
|
|
3637
3669
|
} = dcmjs_es/* data */.p;
|
|
3638
3670
|
const MeasurementReport_FINDING = {
|
|
3639
|
-
CodingSchemeDesignator:
|
|
3640
|
-
CodeValue:
|
|
3671
|
+
CodingSchemeDesignator: 'DCM',
|
|
3672
|
+
CodeValue: '121071'
|
|
3641
3673
|
};
|
|
3642
3674
|
const COMMENT = {
|
|
3643
3675
|
CodingSchemeDesignator: COMMENT_CODE.schemeDesignator,
|
|
@@ -3648,12 +3680,12 @@ const COMMENT_POSITION = {
|
|
|
3648
3680
|
CodeValue: TEXT_ANNOTATION_POSITION.value
|
|
3649
3681
|
};
|
|
3650
3682
|
const MeasurementReport_FINDING_SITE = {
|
|
3651
|
-
CodingSchemeDesignator:
|
|
3652
|
-
CodeValue:
|
|
3683
|
+
CodingSchemeDesignator: 'SCT',
|
|
3684
|
+
CodeValue: '363698007'
|
|
3653
3685
|
};
|
|
3654
3686
|
const MeasurementReport_FINDING_SITE_OLD = {
|
|
3655
|
-
CodingSchemeDesignator:
|
|
3656
|
-
CodeValue:
|
|
3687
|
+
CodingSchemeDesignator: 'SRT',
|
|
3688
|
+
CodeValue: 'G-C0E3'
|
|
3657
3689
|
};
|
|
3658
3690
|
class MeasurementReport_MeasurementReport {
|
|
3659
3691
|
static getTID300ContentItem(tool, ReferencedSOPSequence, toolClass, is3DMeasurement) {
|
|
@@ -3696,27 +3728,7 @@ class MeasurementReport_MeasurementReport {
|
|
|
3696
3728
|
}
|
|
3697
3729
|
}
|
|
3698
3730
|
static generateDatasetMeta() {
|
|
3699
|
-
|
|
3700
|
-
fileMetaInformationVersionArray[1] = 1;
|
|
3701
|
-
const _meta = {
|
|
3702
|
-
FileMetaInformationVersion: {
|
|
3703
|
-
Value: [fileMetaInformationVersionArray.buffer],
|
|
3704
|
-
vr: "OB"
|
|
3705
|
-
},
|
|
3706
|
-
TransferSyntaxUID: {
|
|
3707
|
-
Value: ["1.2.840.10008.1.2.1"],
|
|
3708
|
-
vr: "UI"
|
|
3709
|
-
},
|
|
3710
|
-
ImplementationClassUID: {
|
|
3711
|
-
Value: [MeasurementReport_DicomMetaDictionary.uid()],
|
|
3712
|
-
vr: "UI"
|
|
3713
|
-
},
|
|
3714
|
-
ImplementationVersionName: {
|
|
3715
|
-
Value: ["dcmjs"],
|
|
3716
|
-
vr: "SH"
|
|
3717
|
-
}
|
|
3718
|
-
};
|
|
3719
|
-
return _meta;
|
|
3731
|
+
return metaSRAnnotation;
|
|
3720
3732
|
}
|
|
3721
3733
|
static processSCOORDGroup(_ref) {
|
|
3722
3734
|
let {
|
|
@@ -3733,7 +3745,7 @@ class MeasurementReport_MeasurementReport {
|
|
|
3733
3745
|
ReferencedFrameNumber = 1
|
|
3734
3746
|
} = ReferencedSOPSequence;
|
|
3735
3747
|
const referencedImageId = sopInstanceUIDToImageIdMap[`${ReferencedSOPInstanceUID}:${ReferencedFrameNumber}`];
|
|
3736
|
-
const imagePlaneModule = metadata.get(
|
|
3748
|
+
const imagePlaneModule = metadata.get('imagePlaneModule', referencedImageId);
|
|
3737
3749
|
const annotationUID = MeasurementReport_DicomMetaDictionary.uid();
|
|
3738
3750
|
return {
|
|
3739
3751
|
SCOORDGroup,
|
|
@@ -3806,8 +3818,8 @@ class MeasurementReport_MeasurementReport {
|
|
|
3806
3818
|
toolType
|
|
3807
3819
|
} = _ref3;
|
|
3808
3820
|
const contentSequenceArr = toArray(NUMGroup.ContentSequence);
|
|
3809
|
-
const SCOORDGroup = contentSequenceArr.find(group => group.ValueType ===
|
|
3810
|
-
const SCOORD3DGroup = contentSequenceArr.find(group => group.ValueType ===
|
|
3821
|
+
const SCOORDGroup = contentSequenceArr.find(group => group.ValueType === 'SCOORD');
|
|
3822
|
+
const SCOORD3DGroup = contentSequenceArr.find(group => group.ValueType === 'SCOORD3D');
|
|
3811
3823
|
const result = SCOORD3DGroup && this.processSCOORD3DGroup({
|
|
3812
3824
|
SCOORD3DGroup,
|
|
3813
3825
|
toolType
|
|
@@ -3818,7 +3830,7 @@ class MeasurementReport_MeasurementReport {
|
|
|
3818
3830
|
sopInstanceUIDToImageIdMap
|
|
3819
3831
|
});
|
|
3820
3832
|
if (!result) {
|
|
3821
|
-
throw new Error(
|
|
3833
|
+
throw new Error('No spatial coordinates group found.');
|
|
3822
3834
|
}
|
|
3823
3835
|
return result;
|
|
3824
3836
|
}
|
|
@@ -3896,8 +3908,8 @@ class MeasurementReport_MeasurementReport {
|
|
|
3896
3908
|
const commentGroup = contentSequenceArr.find(group => this.codeValueMatch(group, COMMENT));
|
|
3897
3909
|
const commentPositionGroup = contentSequenceArr.find(group => this.codeValueMatch(group, COMMENT_POSITION));
|
|
3898
3910
|
const findingSiteGroups = contentSequenceArr.filter(group => this.codeValueMatch(group, MeasurementReport_FINDING_SITE, MeasurementReport_FINDING_SITE_OLD)) || [];
|
|
3899
|
-
const NUMGroup = contentSequenceArr.find(group => group.ValueType ===
|
|
3900
|
-
ContentSequence: contentSequenceArr.filter(group => group.ValueType ===
|
|
3911
|
+
const NUMGroup = contentSequenceArr.find(group => group.ValueType === 'NUM') || {
|
|
3912
|
+
ContentSequence: contentSequenceArr.filter(group => group.ValueType === 'SCOORD' || group.ValueType === 'SCOORD3D')
|
|
3901
3913
|
};
|
|
3902
3914
|
const spatialGroup = this.processSpatialCoordinatesGroup({
|
|
3903
3915
|
NUMGroup,
|
|
@@ -3940,8 +3952,8 @@ class MeasurementReport_MeasurementReport {
|
|
|
3940
3952
|
toolData,
|
|
3941
3953
|
toolTypes
|
|
3942
3954
|
}) : imageId;
|
|
3943
|
-
const sopCommonModule = metadataProvider.get(
|
|
3944
|
-
const instance = metadataProvider.get(
|
|
3955
|
+
const sopCommonModule = metadataProvider.get('sopCommonModule', effectiveImageId);
|
|
3956
|
+
const instance = metadataProvider.get('instance', effectiveImageId);
|
|
3945
3957
|
const {
|
|
3946
3958
|
sopInstanceUID,
|
|
3947
3959
|
sopClassUID
|
|
@@ -3954,7 +3966,7 @@ class MeasurementReport_MeasurementReport {
|
|
|
3954
3966
|
const derivationSourceDataset = MeasurementReport_MeasurementReport.generateDerivationSourceDataset(instance);
|
|
3955
3967
|
derivationSourceDatasets.push(derivationSourceDataset);
|
|
3956
3968
|
}
|
|
3957
|
-
const frameNumber = metadataProvider.get(
|
|
3969
|
+
const frameNumber = metadataProvider.get('frameNumber', effectiveImageId);
|
|
3958
3970
|
const ReferencedSOPSequence = {
|
|
3959
3971
|
ReferencedSOPClassUID: sopClassUID,
|
|
3960
3972
|
ReferencedSOPInstanceUID: sopInstanceUID,
|
|
@@ -4019,7 +4031,11 @@ class MeasurementReport_MeasurementReport {
|
|
|
4019
4031
|
});
|
|
4020
4032
|
report.dataset = Object.assign(report.dataset, contentItem);
|
|
4021
4033
|
report.dataset._meta = _meta;
|
|
4022
|
-
report.SpecificCharacterSet =
|
|
4034
|
+
report.SpecificCharacterSet = 'ISO_IR 192';
|
|
4035
|
+
report.dataset.InstanceNumber ||= options.InstanceNumber || 1;
|
|
4036
|
+
if (options.predecessorImageId) {
|
|
4037
|
+
Object.assign(report.dataset, metadataProvider.get(MetadataModules.PREDECESSOR_SEQUENCE, options.predecessorImageId));
|
|
4038
|
+
}
|
|
4023
4039
|
if (is3DSR) {
|
|
4024
4040
|
report.dataset.SOPClassUID = MeasurementReport_DicomMetaDictionary.sopClassUIDsByName.Comprehensive3DSR;
|
|
4025
4041
|
if (!report.dataset.SOPClassUID) {
|
|
@@ -4029,13 +4045,16 @@ class MeasurementReport_MeasurementReport {
|
|
|
4029
4045
|
return report;
|
|
4030
4046
|
}
|
|
4031
4047
|
static generateToolState(dataset, sopInstanceUIDToImageIdMap, metadata, hooks) {
|
|
4032
|
-
if (dataset.ContentTemplateSequence.TemplateIdentifier !==
|
|
4033
|
-
throw new Error(
|
|
4048
|
+
if (dataset.ContentTemplateSequence.TemplateIdentifier !== '1500') {
|
|
4049
|
+
throw new Error('This package can currently only interpret DICOM SR TID 1500');
|
|
4034
4050
|
}
|
|
4035
|
-
const REPORT =
|
|
4036
|
-
const GROUP =
|
|
4037
|
-
const TRACKING_IDENTIFIER =
|
|
4038
|
-
const TRACKING_UNIQUE_IDENTIFIER =
|
|
4051
|
+
const REPORT = 'Imaging Measurements';
|
|
4052
|
+
const GROUP = 'Measurement Group';
|
|
4053
|
+
const TRACKING_IDENTIFIER = 'Tracking Identifier';
|
|
4054
|
+
const TRACKING_UNIQUE_IDENTIFIER = 'Tracking Unique Identifier';
|
|
4055
|
+
const {
|
|
4056
|
+
imageId: predecessorImageId
|
|
4057
|
+
} = dataset;
|
|
4039
4058
|
const imagingMeasurementContent = toArray(dataset.ContentSequence).find(codeMeaningEquals(REPORT));
|
|
4040
4059
|
const measurementGroups = toArray(imagingMeasurementContent.ContentSequence).filter(codeMeaningEquals(GROUP));
|
|
4041
4060
|
const measurementData = {};
|
|
@@ -4052,13 +4071,14 @@ class MeasurementReport_MeasurementReport {
|
|
|
4052
4071
|
if (toolAdapter) {
|
|
4053
4072
|
const measurement = toolAdapter.getMeasurementData(measurementGroup, sopInstanceUIDToImageIdMap, metadata, trackingIdentifierValue);
|
|
4054
4073
|
measurement.TrackingUniqueIdentifier = trackingUniqueIdentifierValue;
|
|
4074
|
+
measurement.predecessorImageId = predecessorImageId;
|
|
4055
4075
|
console.log(`=== ${toolAdapter.toolType} ===`);
|
|
4056
4076
|
console.log(measurement);
|
|
4057
4077
|
measurementData[toolAdapter.toolType] ||= [];
|
|
4058
4078
|
measurementData[toolAdapter.toolType].push(measurement);
|
|
4059
4079
|
}
|
|
4060
4080
|
} catch (e) {
|
|
4061
|
-
console.warn(
|
|
4081
|
+
console.warn('Unable to generate tool state for', measurementGroup, e);
|
|
4062
4082
|
}
|
|
4063
4083
|
});
|
|
4064
4084
|
return measurementData;
|
|
@@ -4070,7 +4090,7 @@ class MeasurementReport_MeasurementReport {
|
|
|
4070
4090
|
if (!replace) {
|
|
4071
4091
|
throw new Error(`The registered tool name ${registerName} already exists in adapters, use a different toolType or use replace`);
|
|
4072
4092
|
}
|
|
4073
|
-
if (typeof replace ===
|
|
4093
|
+
if (typeof replace === 'function') {
|
|
4074
4094
|
replace(this.measurementAdapterByToolType.get(registerName));
|
|
4075
4095
|
}
|
|
4076
4096
|
}
|
|
@@ -4169,7 +4189,6 @@ function appendList(list, appendList) {
|
|
|
4169
4189
|
|
|
4170
4190
|
|
|
4171
4191
|
|
|
4172
|
-
|
|
4173
4192
|
class BaseAdapter3D {
|
|
4174
4193
|
static registerType() {
|
|
4175
4194
|
let code = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
@@ -4302,7 +4321,6 @@ class BaseAdapter3D {
|
|
|
4302
4321
|
|
|
4303
4322
|
|
|
4304
4323
|
|
|
4305
|
-
|
|
4306
4324
|
var _ArrowAnnotate;
|
|
4307
4325
|
const {
|
|
4308
4326
|
Point: ArrowAnnotate_TID300Point
|
|
@@ -4402,7 +4420,6 @@ _ArrowAnnotate = ArrowAnnotate_ArrowAnnotate;
|
|
|
4402
4420
|
|
|
4403
4421
|
|
|
4404
4422
|
|
|
4405
|
-
|
|
4406
4423
|
var _Bidirectional;
|
|
4407
4424
|
const {
|
|
4408
4425
|
Bidirectional: Bidirectional_TID300Bidirectional
|
|
@@ -4522,7 +4539,6 @@ _Bidirectional = Bidirectional_Bidirectional;
|
|
|
4522
4539
|
|
|
4523
4540
|
|
|
4524
4541
|
|
|
4525
|
-
|
|
4526
4542
|
var _Angle;
|
|
4527
4543
|
const {
|
|
4528
4544
|
CobbAngle: Angle_TID300CobbAngle
|
|
@@ -4605,7 +4621,6 @@ _Angle = Angle_Angle;
|
|
|
4605
4621
|
|
|
4606
4622
|
|
|
4607
4623
|
|
|
4608
|
-
|
|
4609
4624
|
var _CobbAngle;
|
|
4610
4625
|
const {
|
|
4611
4626
|
CobbAngle: CobbAngle_TID300CobbAngle
|
|
@@ -4689,7 +4704,6 @@ _CobbAngle = CobbAngle_CobbAngle;
|
|
|
4689
4704
|
|
|
4690
4705
|
|
|
4691
4706
|
|
|
4692
|
-
|
|
4693
4707
|
var _CircleROI;
|
|
4694
4708
|
const {
|
|
4695
4709
|
Circle: CircleROI_TID300Circle
|
|
@@ -4776,7 +4790,6 @@ _CircleROI = CircleROI;
|
|
|
4776
4790
|
|
|
4777
4791
|
|
|
4778
4792
|
|
|
4779
|
-
|
|
4780
4793
|
var _EllipticalROI;
|
|
4781
4794
|
const {
|
|
4782
4795
|
Ellipse: EllipticalROI_TID300Ellipse
|
|
@@ -4872,7 +4885,6 @@ _EllipticalROI.init("EllipticalROI", EllipticalROI_TID300Ellipse);
|
|
|
4872
4885
|
|
|
4873
4886
|
|
|
4874
4887
|
|
|
4875
|
-
|
|
4876
4888
|
var _RectangleROI;
|
|
4877
4889
|
const {
|
|
4878
4890
|
Polyline: RectangleROI_TID300Polyline
|
|
@@ -4957,7 +4969,6 @@ _RectangleROI = RectangleROI;
|
|
|
4957
4969
|
|
|
4958
4970
|
|
|
4959
4971
|
|
|
4960
|
-
|
|
4961
4972
|
var _Length;
|
|
4962
4973
|
const {
|
|
4963
4974
|
Length: Length_TID300Length
|
|
@@ -5042,7 +5053,6 @@ var gl_matrix_esm = __webpack_require__(3823);
|
|
|
5042
5053
|
|
|
5043
5054
|
|
|
5044
5055
|
|
|
5045
|
-
|
|
5046
5056
|
var _PlanarFreehandROI;
|
|
5047
5057
|
const {
|
|
5048
5058
|
Polyline: PlanarFreehandROI_TID300Polyline
|
|
@@ -5151,7 +5161,6 @@ _PlanarFreehandROI.init("PlanarFreehandROI", PlanarFreehandROI_TID300Polyline);
|
|
|
5151
5161
|
|
|
5152
5162
|
|
|
5153
5163
|
|
|
5154
|
-
|
|
5155
5164
|
var _Probe;
|
|
5156
5165
|
const {
|
|
5157
5166
|
Point: Probe_TID300Point
|
|
@@ -5303,8 +5312,12 @@ _UltrasoundDirectional.init("UltrasoundDirectionalTool", UltrasoundDirectional_T
|
|
|
5303
5312
|
|
|
5304
5313
|
|
|
5305
5314
|
|
|
5315
|
+
|
|
5316
|
+
const {
|
|
5317
|
+
MetadataModules: generateSegmentation_MetadataModules
|
|
5318
|
+
} = esm.Enums;
|
|
5306
5319
|
const {
|
|
5307
|
-
|
|
5320
|
+
SEGImageNormalizer
|
|
5308
5321
|
} = dcmjs_es/* normalizers */.z8;
|
|
5309
5322
|
const {
|
|
5310
5323
|
Segmentation: generateSegmentation_SegmentationDerivation
|
|
@@ -5312,26 +5325,59 @@ const {
|
|
|
5312
5325
|
function generateSegmentation_generateSegmentation(images, labelmaps, metadata) {
|
|
5313
5326
|
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
5314
5327
|
const segmentation = _createMultiframeSegmentationFromReferencedImages(images, metadata, options);
|
|
5315
|
-
|
|
5328
|
+
const segmentationResult = fillSegmentation(segmentation, labelmaps, options);
|
|
5329
|
+
const predecessorImageId = options?.predecessorImageId;
|
|
5330
|
+
if (predecessorImageId) {
|
|
5331
|
+
const predecessor = metadata.get(generateSegmentation_MetadataModules.PREDECESSOR_SEQUENCE, predecessorImageId);
|
|
5332
|
+
Object.assign(segmentationResult, predecessor);
|
|
5333
|
+
}
|
|
5334
|
+
return segmentationResult;
|
|
5316
5335
|
}
|
|
5317
5336
|
function _createMultiframeSegmentationFromReferencedImages(images, metadata, options) {
|
|
5337
|
+
const studyImageId = options?.predecessorImageId || images[0].imageId;
|
|
5338
|
+
const studyData = metadata.get(generateSegmentation_MetadataModules.STUDY_DATA, studyImageId);
|
|
5318
5339
|
const datasets = images.map(image => {
|
|
5319
|
-
const
|
|
5340
|
+
const {
|
|
5341
|
+
imageId
|
|
5342
|
+
} = image;
|
|
5343
|
+
const seriesData = metadata.get(generateSegmentation_MetadataModules.SERIES_DATA, imageId);
|
|
5344
|
+
const imageData = metadata.get(generateSegmentation_MetadataModules.IMAGE_DATA, imageId);
|
|
5320
5345
|
return {
|
|
5321
|
-
...
|
|
5322
|
-
...
|
|
5323
|
-
|
|
5324
|
-
SOPInstanceUID: instance.SopInstanceUID || instance.SOPInstanceUID,
|
|
5346
|
+
...studyData,
|
|
5347
|
+
...seriesData,
|
|
5348
|
+
...imageData,
|
|
5325
5349
|
PixelData: image.voxelManager.getScalarData(),
|
|
5350
|
+
BitsAllocated: 16,
|
|
5326
5351
|
_vrMap: {
|
|
5327
|
-
PixelData:
|
|
5352
|
+
PixelData: 'OW'
|
|
5328
5353
|
},
|
|
5329
5354
|
_meta: {}
|
|
5330
5355
|
};
|
|
5331
5356
|
});
|
|
5332
|
-
const
|
|
5357
|
+
const isSingleNonMultiFrame = datasets.length === 1 && !(datasets[0].NumberOfFrames > 1);
|
|
5358
|
+
if (isSingleNonMultiFrame) {
|
|
5359
|
+
datasets.push(datasets[0]);
|
|
5360
|
+
}
|
|
5361
|
+
const normalizer = new SEGImageNormalizer(datasets);
|
|
5362
|
+
normalizer.normalize();
|
|
5363
|
+
const {
|
|
5364
|
+
dataset: multiframe
|
|
5365
|
+
} = normalizer;
|
|
5333
5366
|
if (!multiframe) {
|
|
5334
|
-
throw new Error(
|
|
5367
|
+
throw new Error('Failed to normalize the multiframe dataset, the data is not multi-frame.');
|
|
5368
|
+
}
|
|
5369
|
+
multiframe.SharedFunctionalGroupsSequence ||= {};
|
|
5370
|
+
multiframe.SharedFunctionalGroupsSequence.PixelMeasuresSequence = {};
|
|
5371
|
+
multiframe.PerFrameFunctionalGroupsSequence ||= [];
|
|
5372
|
+
for (let index = 0; index < images.length; index++) {
|
|
5373
|
+
multiframe.PerFrameFunctionalGroupsSequence[index] ||= {
|
|
5374
|
+
PlanePositionSequence: {},
|
|
5375
|
+
PlaneOrientationSequence: {}
|
|
5376
|
+
};
|
|
5377
|
+
}
|
|
5378
|
+
if (isSingleNonMultiFrame) {
|
|
5379
|
+
multiframe.PerFrameFunctionalGroupsSequence = [multiframe.PerFrameFunctionalGroupsSequence[0]];
|
|
5380
|
+
multiframe.NumberOfFrames = 1;
|
|
5335
5381
|
}
|
|
5336
5382
|
return new generateSegmentation_SegmentationDerivation([multiframe], options);
|
|
5337
5383
|
}
|
|
@@ -6072,132 +6118,245 @@ function ParametricMap_generateToolState_generateToolState(imageIds, arrayBuffer
|
|
|
6072
6118
|
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/ParametricMap/index.js
|
|
6073
6119
|
|
|
6074
6120
|
|
|
6075
|
-
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getPatientModule.js
|
|
6076
|
-
function getPatientModule(imageId, metadataProvider) {
|
|
6077
|
-
const generalSeriesModule = metadataProvider.get("generalSeriesModule", imageId);
|
|
6078
|
-
const generalStudyModule = metadataProvider.get("generalStudyModule", imageId);
|
|
6079
|
-
const patientStudyModule = metadataProvider.get("patientStudyModule", imageId);
|
|
6080
|
-
const patientModule = metadataProvider.get("patientModule", imageId);
|
|
6081
|
-
const patientDemographicModule = metadataProvider.get("patientDemographicModule", imageId);
|
|
6082
|
-
return {
|
|
6083
|
-
Modality: generalSeriesModule.modality,
|
|
6084
|
-
PatientID: patientModule.patientId,
|
|
6085
|
-
PatientName: patientModule.patientName,
|
|
6086
|
-
PatientBirthDate: "",
|
|
6087
|
-
PatientAge: patientStudyModule.patientAge,
|
|
6088
|
-
PatientSex: patientDemographicModule.patientSex,
|
|
6089
|
-
PatientWeight: patientStudyModule.patientWeight,
|
|
6090
|
-
StudyDate: generalStudyModule.studyDate,
|
|
6091
|
-
StudyTime: generalStudyModule.studyTime,
|
|
6092
|
-
StudyID: "ToDo",
|
|
6093
|
-
AccessionNumber: generalStudyModule.accessionNumber
|
|
6094
|
-
};
|
|
6095
|
-
}
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
6121
|
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedFrameOfReferenceSequence.js
|
|
6100
|
-
function getReferencedFrameOfReferenceSequence(
|
|
6122
|
+
function getReferencedFrameOfReferenceSequence(referencedFrameOfReferenceSequence, metadata, _options) {
|
|
6101
6123
|
const {
|
|
6102
|
-
referencedImageId: imageId,
|
|
6103
6124
|
FrameOfReferenceUID
|
|
6104
6125
|
} = metadata;
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
RTReferencedStudySequence: [{
|
|
6115
|
-
ReferencedSOPClassUID: dataset.SOPClassUID,
|
|
6116
|
-
ReferencedSOPInstanceUID: dataset.SOPInstanceUID,
|
|
6117
|
-
RTReferencedSeriesSequence: [{
|
|
6118
|
-
SeriesInstanceUID,
|
|
6119
|
-
ContourImageSequence: [...ReferencedSeriesSequence[0].ReferencedInstanceSequence]
|
|
6120
|
-
}]
|
|
6121
|
-
}]
|
|
6122
|
-
}];
|
|
6126
|
+
referencedFrameOfReferenceSequence ||= [];
|
|
6127
|
+
let referencedItem = referencedFrameOfReferenceSequence.find(it => it.FrameOfReferenceUID === FrameOfReferenceUID);
|
|
6128
|
+
if (!referencedItem) {
|
|
6129
|
+
referencedItem = {
|
|
6130
|
+
FrameOfReferenceUID
|
|
6131
|
+
};
|
|
6132
|
+
referencedFrameOfReferenceSequence.push(referencedItem);
|
|
6133
|
+
}
|
|
6134
|
+
return referencedFrameOfReferenceSequence;
|
|
6123
6135
|
}
|
|
6124
6136
|
|
|
6125
6137
|
|
|
6126
6138
|
|
|
6127
6139
|
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getReferencedSeriesSequence.js
|
|
6128
|
-
|
|
6129
|
-
|
|
6140
|
+
|
|
6141
|
+
|
|
6142
|
+
const {
|
|
6143
|
+
MetadataModules: getReferencedSeriesSequence_MetadataModules
|
|
6144
|
+
} = esm.Enums;
|
|
6145
|
+
function getReferencedSeriesSequence(referencedSeriesSequence, metadata, options) {
|
|
6146
|
+
const metadataProvider = options?.metadataProvider || esm.metaData;
|
|
6130
6147
|
const {
|
|
6131
6148
|
referencedImageId: imageId
|
|
6132
6149
|
} = metadata;
|
|
6133
|
-
const
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
ReferencedSOPInstanceUID: SOPInstanceUID
|
|
6153
|
-
});
|
|
6154
|
-
});
|
|
6155
|
-
ReferencedSeriesSequence.push(ReferencedSeries);
|
|
6150
|
+
const newReferenceSeq = metadataProvider.get(getReferencedSeriesSequence_MetadataModules.REFERENCED_SERIES_REFERENCE, imageId);
|
|
6151
|
+
referencedSeriesSequence ||= [];
|
|
6152
|
+
if (newReferenceSeq) {
|
|
6153
|
+
const {
|
|
6154
|
+
ReferencedSeriesInstanceUID: newSeriesUid,
|
|
6155
|
+
ReferencedInstanceSequence: [{
|
|
6156
|
+
ReferencedSOPInstanceUID: newSopUID
|
|
6157
|
+
}]
|
|
6158
|
+
} = newReferenceSeq;
|
|
6159
|
+
const existingSeries = referencedSeriesSequence.find(it => it.ReferencedSeriesInstanceUID === newSeriesUid);
|
|
6160
|
+
if (!existingSeries) {
|
|
6161
|
+
referencedSeriesSequence.push(newReferenceSeq);
|
|
6162
|
+
return referencedSeriesSequence;
|
|
6163
|
+
}
|
|
6164
|
+
if (existingSeries.ReferencedInstanceSequence.find(it => it.ReferencedSOPInstanceUID === newSopUID)) {
|
|
6165
|
+
return referencedSeriesSequence;
|
|
6166
|
+
}
|
|
6167
|
+
const referencedInstanceSeq = newReferenceSeq.ReferencedInstanceSequence;
|
|
6168
|
+
existingSeries.ReferencedInstanceSequence.push(Array.isArray(referencedInstanceSeq) ? referencedInstanceSeq[0] : referencedInstanceSeq);
|
|
6156
6169
|
}
|
|
6157
|
-
return
|
|
6170
|
+
return referencedSeriesSequence;
|
|
6158
6171
|
}
|
|
6159
6172
|
|
|
6160
6173
|
|
|
6161
6174
|
|
|
6162
6175
|
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTROIObservationsSequence.js
|
|
6163
|
-
function getRTROIObservationsSequence(
|
|
6176
|
+
function getRTROIObservationsSequence(segment, index, options) {
|
|
6164
6177
|
return {
|
|
6165
6178
|
ObservationNumber: index + 1,
|
|
6166
|
-
ReferencedROINumber: index + 1,
|
|
6167
|
-
RTROIInterpretedType:
|
|
6168
|
-
ROIInterpreter:
|
|
6169
|
-
};
|
|
6170
|
-
}
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getRTSeriesModule.js
|
|
6175
|
-
function getRTSeriesModule(DicomMetaDictionary) {
|
|
6176
|
-
return {
|
|
6177
|
-
SeriesInstanceUID: DicomMetaDictionary.uid(),
|
|
6178
|
-
// generate a new series instance uid
|
|
6179
|
-
SeriesNumber: "99" // Todo:: what should be the series number?
|
|
6179
|
+
ReferencedROINumber: segment.segmentIndex ?? index + 1,
|
|
6180
|
+
RTROIInterpretedType: options?.interpretedType || 'ORGAN',
|
|
6181
|
+
ROIInterpreter: options?.observerName || ''
|
|
6180
6182
|
};
|
|
6181
6183
|
}
|
|
6182
6184
|
|
|
6183
6185
|
|
|
6184
6186
|
|
|
6185
6187
|
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/RTStruct/utilities/getStructureSetModule.js
|
|
6186
|
-
function getStructureSetModule(contour,
|
|
6188
|
+
function getStructureSetModule(contour, segment) {
|
|
6187
6189
|
const {
|
|
6188
6190
|
FrameOfReferenceUID
|
|
6189
6191
|
} = contour.metadata;
|
|
6190
6192
|
return {
|
|
6191
|
-
ROINumber:
|
|
6192
|
-
ROIName:
|
|
6193
|
-
ROIDescription:
|
|
6194
|
-
ROIGenerationAlgorithm:
|
|
6193
|
+
ROINumber: segment.segmentIndex,
|
|
6194
|
+
ROIName: segment.label,
|
|
6195
|
+
ROIDescription: segment.label,
|
|
6196
|
+
ROIGenerationAlgorithm: 'MANUAL',
|
|
6195
6197
|
ReferencedFrameOfReferenceUID: FrameOfReferenceUID
|
|
6196
6198
|
};
|
|
6197
6199
|
}
|
|
6198
6200
|
|
|
6199
6201
|
|
|
6200
6202
|
|
|
6203
|
+
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/utilities/referencedMetadataProvider.js
|
|
6204
|
+
|
|
6205
|
+
|
|
6206
|
+
|
|
6207
|
+
|
|
6208
|
+
const {
|
|
6209
|
+
DicomMetaDictionary: referencedMetadataProvider_DicomMetaDictionary
|
|
6210
|
+
} = dcmjs_es/* default.data */.Ay.data;
|
|
6211
|
+
const {
|
|
6212
|
+
MetadataModules: referencedMetadataProvider_MetadataModules
|
|
6213
|
+
} = esm.Enums;
|
|
6214
|
+
const STUDY_MODULES = [referencedMetadataProvider_MetadataModules.GENERAL_STUDY, referencedMetadataProvider_MetadataModules.PATIENT_STUDY, referencedMetadataProvider_MetadataModules.PATIENT];
|
|
6215
|
+
const SERIES_MODULES = [referencedMetadataProvider_MetadataModules.GENERAL_SERIES];
|
|
6216
|
+
const IMAGE_MODULES = [referencedMetadataProvider_MetadataModules.GENERAL_IMAGE, referencedMetadataProvider_MetadataModules.IMAGE_PLANE, referencedMetadataProvider_MetadataModules.CINE, referencedMetadataProvider_MetadataModules.VOI_LUT, referencedMetadataProvider_MetadataModules.MODALITY_LUT, referencedMetadataProvider_MetadataModules.SOP_COMMON];
|
|
6217
|
+
const metadataProvider = {
|
|
6218
|
+
get: function (type, imageId, options) {
|
|
6219
|
+
return metadataProvider[type]?.(imageId, options);
|
|
6220
|
+
},
|
|
6221
|
+
[referencedMetadataProvider_MetadataModules.IMAGE_SOP_INSTANCE_REFERENCE]: function (imageId) {
|
|
6222
|
+
const frameModule = esm.metaData.get(referencedMetadataProvider_MetadataModules.FRAME_MODULE, imageId);
|
|
6223
|
+
const {
|
|
6224
|
+
sopClassUID,
|
|
6225
|
+
sopInstanceUID,
|
|
6226
|
+
frameNumber,
|
|
6227
|
+
numberOfFrames
|
|
6228
|
+
} = frameModule;
|
|
6229
|
+
if (numberOfFrames > 1) {
|
|
6230
|
+
return {
|
|
6231
|
+
ReferencedSOPClassUID: sopClassUID,
|
|
6232
|
+
ReferencedSOPInstanceUID: sopInstanceUID,
|
|
6233
|
+
ReferencedFrameNumber: frameNumber
|
|
6234
|
+
};
|
|
6235
|
+
}
|
|
6236
|
+
return {
|
|
6237
|
+
ReferencedSOPClassUID: frameModule.sopClassUID,
|
|
6238
|
+
ReferencedSOPInstanceUID: frameModule.sopInstanceUID
|
|
6239
|
+
};
|
|
6240
|
+
},
|
|
6241
|
+
[referencedMetadataProvider_MetadataModules.REFERENCED_SERIES_REFERENCE]: imageId => {
|
|
6242
|
+
const sopModule = esm.metaData.get(referencedMetadataProvider_MetadataModules.SOP_COMMON, imageId);
|
|
6243
|
+
const seriesModule = esm.metaData.get(referencedMetadataProvider_MetadataModules.GENERAL_SERIES, imageId);
|
|
6244
|
+
return {
|
|
6245
|
+
SeriesInstanceUID: seriesModule.seriesInstanceUID,
|
|
6246
|
+
ReferencedInstanceSequence: [{
|
|
6247
|
+
ReferencedSOPClassUID: sopModule.sopClassUID,
|
|
6248
|
+
ReferencedSOPInstanceUID: sopModule.sopInstanceUID
|
|
6249
|
+
}]
|
|
6250
|
+
};
|
|
6251
|
+
},
|
|
6252
|
+
[referencedMetadataProvider_MetadataModules.PREDECESSOR_SEQUENCE]: imageId => {
|
|
6253
|
+
const result = {
|
|
6254
|
+
...esm.metaData.get(referencedMetadataProvider_MetadataModules.SERIES_DATA, imageId)
|
|
6255
|
+
};
|
|
6256
|
+
const generalImage = esm.metaData.get(referencedMetadataProvider_MetadataModules.GENERAL_IMAGE, imageId);
|
|
6257
|
+
const study = esm.metaData.get(referencedMetadataProvider_MetadataModules.GENERAL_STUDY, imageId);
|
|
6258
|
+
result.InstanceNumber = 1 + Number(generalImage.instanceNumber);
|
|
6259
|
+
result.PredecessorDocumentsSequence = {
|
|
6260
|
+
StudyInstanceUID: study.studyInstanceUID,
|
|
6261
|
+
ReferencedSeriesSequence: {
|
|
6262
|
+
SeriesInstanceUID: result.SeriesInstanceUID,
|
|
6263
|
+
ReferencedSOPSequence: {
|
|
6264
|
+
ReferencedSOPClassUID: generalImage.sopClassUID,
|
|
6265
|
+
ReferencedSOPInstanceUID: generalImage.sopInstanceUID
|
|
6266
|
+
}
|
|
6267
|
+
}
|
|
6268
|
+
};
|
|
6269
|
+
return result;
|
|
6270
|
+
},
|
|
6271
|
+
[referencedMetadataProvider_MetadataModules.STUDY_DATA]: imageId => {
|
|
6272
|
+
return esm.metaData.getNormalized(imageId, STUDY_MODULES);
|
|
6273
|
+
},
|
|
6274
|
+
[referencedMetadataProvider_MetadataModules.SERIES_DATA]: imageId => {
|
|
6275
|
+
return esm.metaData.getNormalized(imageId, SERIES_MODULES);
|
|
6276
|
+
},
|
|
6277
|
+
[referencedMetadataProvider_MetadataModules.IMAGE_DATA]: imageId => {
|
|
6278
|
+
return esm.metaData.getNormalized(imageId, IMAGE_MODULES);
|
|
6279
|
+
},
|
|
6280
|
+
[referencedMetadataProvider_MetadataModules.RTSS_INSTANCE_DATA]: imageId => {
|
|
6281
|
+
const newInstanceData = esm.metaData.get(referencedMetadataProvider_MetadataModules.NEW_INSTANCE_DATA, imageId);
|
|
6282
|
+
return {
|
|
6283
|
+
...newInstanceData,
|
|
6284
|
+
SeriesNumber: '3201',
|
|
6285
|
+
StructureSetROISequence: [],
|
|
6286
|
+
ROIContourSequence: [],
|
|
6287
|
+
RTROIObservationsSequence: [],
|
|
6288
|
+
ReferencedFrameOfReferenceSequence: [],
|
|
6289
|
+
Modality: 'RTSTRUCT',
|
|
6290
|
+
SOPClassUID: '1.2.840.10008.5.1.4.1.1.481.3',
|
|
6291
|
+
PositionReferenceIndicator: '',
|
|
6292
|
+
StructureSetLabel: '',
|
|
6293
|
+
StructureSetName: '',
|
|
6294
|
+
StructureSetDate: referencedMetadataProvider_DicomMetaDictionary.date(),
|
|
6295
|
+
StructureSetTime: referencedMetadataProvider_DicomMetaDictionary.time()
|
|
6296
|
+
};
|
|
6297
|
+
},
|
|
6298
|
+
[referencedMetadataProvider_MetadataModules.NEW_INSTANCE_DATA]: imageId => {
|
|
6299
|
+
const studyData = esm.metaData.get(referencedMetadataProvider_MetadataModules.STUDY_DATA, imageId);
|
|
6300
|
+
return {
|
|
6301
|
+
...studyData,
|
|
6302
|
+
SeriesNumber: '50000',
|
|
6303
|
+
InstanceNumber: '1',
|
|
6304
|
+
OperatorsName: '',
|
|
6305
|
+
ReferringPhysicianName: '',
|
|
6306
|
+
SpecificCharacterSet: 'ISO_IR 192',
|
|
6307
|
+
Manufacturer: 'cs3d',
|
|
6308
|
+
SOPInstanceUID: referencedMetadataProvider_DicomMetaDictionary.uid(),
|
|
6309
|
+
SeriesInstanceUID: referencedMetadataProvider_DicomMetaDictionary.uid()
|
|
6310
|
+
};
|
|
6311
|
+
},
|
|
6312
|
+
[referencedMetadataProvider_MetadataModules.RTSS_CONTOUR]: () => metaRTSSContour,
|
|
6313
|
+
[referencedMetadataProvider_MetadataModules.SR_ANNOTATION]: () => metaSRAnnotation
|
|
6314
|
+
};
|
|
6315
|
+
esm.metaData.addProvider(metadataProvider.get, 9023);
|
|
6316
|
+
|
|
6317
|
+
|
|
6318
|
+
|
|
6319
|
+
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/utilities/createInstance.js
|
|
6320
|
+
|
|
6321
|
+
|
|
6322
|
+
const {
|
|
6323
|
+
MetadataModules: createInstance_MetadataModules
|
|
6324
|
+
} = esm.Enums;
|
|
6325
|
+
function assignDefined(dest, source, options) {
|
|
6326
|
+
if (!source) {
|
|
6327
|
+
return;
|
|
6328
|
+
}
|
|
6329
|
+
for (const [key, value] of Object.entries(source)) {
|
|
6330
|
+
if (value === undefined) {
|
|
6331
|
+
continue;
|
|
6332
|
+
}
|
|
6333
|
+
if (dest[key] === undefined && options?.requireDestinationKey) {
|
|
6334
|
+
continue;
|
|
6335
|
+
}
|
|
6336
|
+
dest[key] = value;
|
|
6337
|
+
}
|
|
6338
|
+
}
|
|
6339
|
+
function createInstance(instanceKey, studyExemplarImageId, base, options) {
|
|
6340
|
+
const {
|
|
6341
|
+
metadataProvider = esm.metaData,
|
|
6342
|
+
predecessorImageId
|
|
6343
|
+
} = options;
|
|
6344
|
+
const result = {};
|
|
6345
|
+
const instanceBase = metadataProvider.get(instanceKey, studyExemplarImageId);
|
|
6346
|
+
Object.assign(result, instanceBase);
|
|
6347
|
+
assignDefined(result, base);
|
|
6348
|
+
assignDefined(result, options, {
|
|
6349
|
+
requireDestinationKey: true
|
|
6350
|
+
});
|
|
6351
|
+
if (predecessorImageId) {
|
|
6352
|
+
const predecessor = metadataProvider.get(createInstance_MetadataModules.PREDECESSOR_SEQUENCE, predecessorImageId);
|
|
6353
|
+
Object.assign(result, predecessor);
|
|
6354
|
+
}
|
|
6355
|
+
return result;
|
|
6356
|
+
}
|
|
6357
|
+
|
|
6358
|
+
|
|
6359
|
+
|
|
6201
6360
|
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/Cornerstone3D/RTStruct/RTSS.js
|
|
6202
6361
|
|
|
6203
6362
|
|
|
@@ -6213,9 +6372,18 @@ const {
|
|
|
6213
6372
|
AnnotationToPointData
|
|
6214
6373
|
} = dist_esm.utilities.contours;
|
|
6215
6374
|
const {
|
|
6216
|
-
|
|
6217
|
-
} =
|
|
6218
|
-
|
|
6375
|
+
MetadataModules: RTSS_MetadataModules
|
|
6376
|
+
} = esm.Enums;
|
|
6377
|
+
function generateRTSSFromSegmentations(segmentation, metadataProvider, _DicomMetadataStore) {
|
|
6378
|
+
return generateRTSSFromLabelmap(segmentation, {
|
|
6379
|
+
metadataProvider,
|
|
6380
|
+
_DicomMetadataStore
|
|
6381
|
+
});
|
|
6382
|
+
}
|
|
6383
|
+
async function generateRTSSFromLabelmap(segmentations, options) {
|
|
6384
|
+
const {
|
|
6385
|
+
metadataProvider = esm.metaData
|
|
6386
|
+
} = options;
|
|
6219
6387
|
const roiContours = [];
|
|
6220
6388
|
const contourSets = await generateContourSetsFromLabelmap({
|
|
6221
6389
|
segmentations
|
|
@@ -6224,26 +6392,17 @@ async function generateRTSSFromSegmentations(segmentations, metadataProvider, Di
|
|
|
6224
6392
|
if (contourSet) {
|
|
6225
6393
|
const contourSequence = [];
|
|
6226
6394
|
contourSet.sliceContours.forEach(sliceContour => {
|
|
6227
|
-
const
|
|
6228
|
-
const
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
ReferencedSOPClassUID,
|
|
6232
|
-
ReferencedSOPInstanceUID
|
|
6233
|
-
}];
|
|
6234
|
-
const sliceContourPolyData = sliceContour.polyData;
|
|
6395
|
+
const ContourImageSequence = metadataProvider.get('ImageSopInstanceReference', sliceContour.referencedImageId);
|
|
6396
|
+
const {
|
|
6397
|
+
points: polyDataPoints
|
|
6398
|
+
} = sliceContour.polyData;
|
|
6235
6399
|
sliceContour.contours.forEach((contour, index) => {
|
|
6236
6400
|
const ContourGeometricType = contour.type;
|
|
6237
6401
|
const NumberOfContourPoints = contour.contourPoints.length;
|
|
6238
6402
|
const ContourData = [];
|
|
6239
6403
|
contour.contourPoints.forEach(point => {
|
|
6240
|
-
const pointData =
|
|
6241
|
-
pointData
|
|
6242
|
-
pointData[1] = +pointData[1].toFixed(2);
|
|
6243
|
-
pointData[2] = +pointData[2].toFixed(2);
|
|
6244
|
-
ContourData.push(pointData[0]);
|
|
6245
|
-
ContourData.push(pointData[1]);
|
|
6246
|
-
ContourData.push(pointData[2]);
|
|
6404
|
+
const pointData = polyDataPoints[point];
|
|
6405
|
+
ContourData.push(...pointData.map(v => v.toFixed(2)));
|
|
6247
6406
|
});
|
|
6248
6407
|
contourSequence.push({
|
|
6249
6408
|
ContourImageSequence,
|
|
@@ -6259,124 +6418,116 @@ async function generateRTSSFromSegmentations(segmentations, metadataProvider, Di
|
|
|
6259
6418
|
name: segLabel,
|
|
6260
6419
|
description: segLabel,
|
|
6261
6420
|
contourSequence,
|
|
6262
|
-
color: contourSet.color,
|
|
6421
|
+
color: contourSet.color.slice(0, 3),
|
|
6263
6422
|
metadata: contourSet.metadata
|
|
6264
6423
|
};
|
|
6265
6424
|
roiContours.push(ROIContour);
|
|
6266
6425
|
}
|
|
6267
6426
|
});
|
|
6268
|
-
const
|
|
6269
|
-
name: segmentations.label,
|
|
6270
|
-
label: segmentations.label
|
|
6271
|
-
};
|
|
6272
|
-
const dataset = _initializeDataset(rtMetadata, roiContours[0].metadata, metadataProvider);
|
|
6427
|
+
const dataset = _initializeDataset(segmentations, roiContours[0].metadata, options);
|
|
6273
6428
|
roiContours.forEach((contour, index) => {
|
|
6274
6429
|
const roiContour = {
|
|
6275
6430
|
ROIDisplayColor: contour.color || [255, 0, 0],
|
|
6276
6431
|
ContourSequence: contour.contourSequence,
|
|
6277
6432
|
ReferencedROINumber: index + 1
|
|
6278
6433
|
};
|
|
6279
|
-
|
|
6434
|
+
const segment = segmentations.segments[index + 1];
|
|
6435
|
+
dataset.StructureSetROISequence.push(getStructureSetModule(contour, segment));
|
|
6436
|
+
dataset.RTROIObservationsSequence.push(getRTROIObservationsSequence(segment, index, options));
|
|
6280
6437
|
dataset.ROIContourSequence.push(roiContour);
|
|
6281
|
-
dataset.ReferencedSeriesSequence = getReferencedSeriesSequence(contour.metadata,
|
|
6282
|
-
dataset.ReferencedFrameOfReferenceSequence = getReferencedFrameOfReferenceSequence(contour.metadata
|
|
6438
|
+
dataset.ReferencedSeriesSequence = getReferencedSeriesSequence(dataset.ReferencedSeriesSequence, contour.metadata, options);
|
|
6439
|
+
dataset.ReferencedFrameOfReferenceSequence = getReferencedFrameOfReferenceSequence(dataset.ReferencedFrameOfReferenceSequence, contour.metadata);
|
|
6283
6440
|
});
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
FileMetaInformationVersion: {
|
|
6288
|
-
Value: [fileMetaInformationVersionArray.buffer],
|
|
6289
|
-
vr: "OB"
|
|
6290
|
-
},
|
|
6291
|
-
TransferSyntaxUID: {
|
|
6292
|
-
Value: ["1.2.840.10008.1.2.1"],
|
|
6293
|
-
vr: "UI"
|
|
6294
|
-
},
|
|
6295
|
-
ImplementationClassUID: {
|
|
6296
|
-
Value: [RTSS_DicomMetaDictionary.uid()],
|
|
6297
|
-
vr: "UI"
|
|
6298
|
-
},
|
|
6299
|
-
ImplementationVersionName: {
|
|
6300
|
-
Value: ["dcmjs"],
|
|
6301
|
-
vr: "SH"
|
|
6302
|
-
}
|
|
6303
|
-
};
|
|
6304
|
-
dataset._meta = _meta;
|
|
6305
|
-
dataset.SpecificCharacterSet = "ISO_IR 192";
|
|
6441
|
+
if (dataset.ReferencedFrameOfReferenceSequence?.length === 1) {
|
|
6442
|
+
dataset.FrameOfReferenceUID = dataset.ReferencedFrameOfReferenceSequence[0].FrameOfReferenceUID;
|
|
6443
|
+
}
|
|
6306
6444
|
return dataset;
|
|
6307
6445
|
}
|
|
6308
|
-
function generateRTSSFromAnnotations(
|
|
6309
|
-
const
|
|
6310
|
-
|
|
6311
|
-
label: "RTSS from Annotations"
|
|
6312
|
-
};
|
|
6313
|
-
const dataset = _initializeDataset(rtMetadata, annotations[0].metadata, metadataProvider);
|
|
6446
|
+
function generateRTSSFromAnnotations(segmentations, annotations, options) {
|
|
6447
|
+
const dataset = _initializeDataset(segmentations, annotations[0].metadata, options);
|
|
6448
|
+
const segmentsContour = new Map();
|
|
6314
6449
|
annotations.forEach((annotation, index) => {
|
|
6315
|
-
const
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
fileMetaInformationVersionArray[1] = 1;
|
|
6324
|
-
const _meta = {
|
|
6325
|
-
FileMetaInformationVersion: {
|
|
6326
|
-
Value: [fileMetaInformationVersionArray.buffer],
|
|
6327
|
-
vr: "OB"
|
|
6328
|
-
},
|
|
6329
|
-
TransferSyntaxUID: {
|
|
6330
|
-
Value: ["1.2.840.10008.1.2.1"],
|
|
6331
|
-
vr: "UI"
|
|
6332
|
-
},
|
|
6333
|
-
ImplementationClassUID: {
|
|
6334
|
-
Value: [RTSS_DicomMetaDictionary.uid()],
|
|
6335
|
-
vr: "UI"
|
|
6336
|
-
},
|
|
6337
|
-
ImplementationVersionName: {
|
|
6338
|
-
Value: ["dcmjs"],
|
|
6339
|
-
vr: "SH"
|
|
6450
|
+
const {
|
|
6451
|
+
data: {
|
|
6452
|
+
segmentation
|
|
6453
|
+
}
|
|
6454
|
+
} = annotation;
|
|
6455
|
+
if (!segmentation) {
|
|
6456
|
+
console.warn('Annotation is not a segmentation:', annotation);
|
|
6457
|
+
return;
|
|
6340
6458
|
}
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6459
|
+
const {
|
|
6460
|
+
segmentationId,
|
|
6461
|
+
segmentIndex
|
|
6462
|
+
} = segmentation;
|
|
6463
|
+
const key = `${segmentationId}:${segmentIndex}`;
|
|
6464
|
+
let segmentAnnotation = segmentsContour.get(key);
|
|
6465
|
+
if (!segmentAnnotation) {
|
|
6466
|
+
const segment = segmentations.segments[segmentIndex];
|
|
6467
|
+
const structureSetModule = getStructureSetModule(annotation, segment);
|
|
6468
|
+
dataset.StructureSetROISequence.push(structureSetModule);
|
|
6469
|
+
dataset.RTROIObservationsSequence.push(getRTROIObservationsSequence(segment, index, options));
|
|
6470
|
+
segmentAnnotation = {
|
|
6471
|
+
...segmentation,
|
|
6472
|
+
annotations: [],
|
|
6473
|
+
structureSetModule,
|
|
6474
|
+
segment,
|
|
6475
|
+
roiContourSequence: null
|
|
6476
|
+
};
|
|
6477
|
+
segmentsContour.set(key, segmentAnnotation);
|
|
6478
|
+
}
|
|
6479
|
+
const roiContourSequence = AnnotationToPointData.convert(annotation, segmentAnnotation.segment, esm.metaData);
|
|
6480
|
+
if (segmentAnnotation.roiContourSequence) {
|
|
6481
|
+
segmentAnnotation.roiContourSequence.ContourSequence.push(...roiContourSequence.ContourSequence);
|
|
6482
|
+
} else {
|
|
6483
|
+
dataset.ROIContourSequence.push(roiContourSequence);
|
|
6484
|
+
segmentAnnotation.roiContourSequence = roiContourSequence;
|
|
6485
|
+
}
|
|
6486
|
+
dataset.ReferencedSeriesSequence = getReferencedSeriesSequence(dataset.ReferencedSeriesSequence, annotation.metadata, options);
|
|
6487
|
+
dataset.ReferencedFrameOfReferenceSequence = getReferencedFrameOfReferenceSequence(dataset.ReferencedFrameOfReferenceSequence, annotation.metadata);
|
|
6488
|
+
});
|
|
6489
|
+
if (dataset.ReferencedFrameOfReferenceSequence?.length === 1) {
|
|
6490
|
+
dataset.FrameOfReferenceUID = dataset.ReferencedFrameOfReferenceSequence[0].FrameOfReferenceUID;
|
|
6491
|
+
}
|
|
6344
6492
|
return dataset;
|
|
6345
6493
|
}
|
|
6346
|
-
function _initializeDataset(
|
|
6347
|
-
const rtSOPInstanceUID = RTSS_DicomMetaDictionary.uid();
|
|
6494
|
+
function _initializeDataset(segmentation, imgMetadata, options) {
|
|
6348
6495
|
const {
|
|
6349
|
-
referencedImageId:
|
|
6350
|
-
FrameOfReferenceUID
|
|
6496
|
+
referencedImageId: studyExemplarImageId
|
|
6351
6497
|
} = imgMetadata;
|
|
6498
|
+
return createInstance(RTSS_MetadataModules.RTSS_INSTANCE_DATA, studyExemplarImageId, {
|
|
6499
|
+
StructureSetLabel: segmentation.label,
|
|
6500
|
+
StructureSetName: segmentation.label,
|
|
6501
|
+
SeriesDescription: segmentation.label,
|
|
6502
|
+
_meta: esm.metaData.get(RTSS_MetadataModules.RTSS_CONTOUR, studyExemplarImageId)
|
|
6503
|
+
}, options);
|
|
6504
|
+
}
|
|
6505
|
+
function generateRTSSFromContour(segmentations, options) {
|
|
6352
6506
|
const {
|
|
6353
|
-
|
|
6354
|
-
} =
|
|
6355
|
-
const
|
|
6356
|
-
const
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
StructureSetTime: RTSS_DicomMetaDictionary.time(),
|
|
6378
|
-
_meta: null
|
|
6379
|
-
};
|
|
6507
|
+
annotationUIDsMap
|
|
6508
|
+
} = segmentations.representationData.Contour;
|
|
6509
|
+
const annotations = [];
|
|
6510
|
+
for (const annotationSet of annotationUIDsMap.values()) {
|
|
6511
|
+
for (const annotationUID of annotationSet.values()) {
|
|
6512
|
+
const annotation$1 = dist_esm.annotation.state.getAnnotation(annotationUID);
|
|
6513
|
+
if (!annotation$1) {
|
|
6514
|
+
console.error('Unable to find an annotation for UID', annotationUID);
|
|
6515
|
+
continue;
|
|
6516
|
+
}
|
|
6517
|
+
annotations.push(annotation$1);
|
|
6518
|
+
}
|
|
6519
|
+
}
|
|
6520
|
+
return generateRTSSFromAnnotations(segmentations, annotations, options);
|
|
6521
|
+
}
|
|
6522
|
+
function generateRTSSFromRepresentation(segmentations) {
|
|
6523
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6524
|
+
if (segmentations.representationData.Labelmap) {
|
|
6525
|
+
return generateRTSSFromLabelmap(segmentations, options);
|
|
6526
|
+
}
|
|
6527
|
+
if (segmentations.representationData.Contour) {
|
|
6528
|
+
return generateRTSSFromContour(segmentations, options);
|
|
6529
|
+
}
|
|
6530
|
+
throw new Error(`No representation available to save to RTSS: ${Object.keys(segmentations.representationData)}`);
|
|
6380
6531
|
}
|
|
6381
6532
|
|
|
6382
6533
|
|
|
@@ -6716,6 +6867,10 @@ const adaptersRT = {
|
|
|
6716
6867
|
|
|
6717
6868
|
|
|
6718
6869
|
|
|
6870
|
+
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/utilities/index.js
|
|
6871
|
+
|
|
6872
|
+
|
|
6873
|
+
|
|
6719
6874
|
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/enums/index.js
|
|
6720
6875
|
|
|
6721
6876
|
|
|
@@ -6731,29 +6886,26 @@ const graphicTypeEquals = graphicType => {
|
|
|
6731
6886
|
;// ../../../node_modules/@cornerstonejs/adapters/dist/esm/adapters/helpers/downloadDICOMData.js
|
|
6732
6887
|
|
|
6733
6888
|
|
|
6734
|
-
|
|
6735
6889
|
const {
|
|
6736
|
-
|
|
6890
|
+
datasetToBlob: downloadDICOMData_datasetToBlob
|
|
6737
6891
|
} = dcmjs_es/* data */.p;
|
|
6738
6892
|
function downloadDICOMData(bufferOrDataset, filename) {
|
|
6739
6893
|
let blob;
|
|
6740
6894
|
if (bufferOrDataset instanceof ArrayBuffer) {
|
|
6741
6895
|
blob = new Blob([bufferOrDataset], {
|
|
6742
|
-
type:
|
|
6896
|
+
type: 'application/dicom'
|
|
6743
6897
|
});
|
|
6744
6898
|
} else {
|
|
6745
6899
|
if (!bufferOrDataset._meta) {
|
|
6746
|
-
throw new Error(
|
|
6900
|
+
throw new Error('Dataset must have a _meta property');
|
|
6747
6901
|
}
|
|
6748
|
-
|
|
6749
|
-
blob = new Blob([buffer], {
|
|
6750
|
-
type: "application/dicom"
|
|
6751
|
-
});
|
|
6902
|
+
blob = downloadDICOMData_datasetToBlob(bufferOrDataset);
|
|
6752
6903
|
}
|
|
6753
|
-
const link = document.createElement(
|
|
6904
|
+
const link = document.createElement('a');
|
|
6754
6905
|
link.href = window.URL.createObjectURL(blob);
|
|
6755
6906
|
link.download = filename;
|
|
6756
6907
|
link.click();
|
|
6908
|
+
URL.revokeObjectURL(link.href);
|
|
6757
6909
|
}
|
|
6758
6910
|
|
|
6759
6911
|
|
|
@@ -6778,6 +6930,8 @@ function downloadDICOMData(bufferOrDataset, filename) {
|
|
|
6778
6930
|
|
|
6779
6931
|
|
|
6780
6932
|
|
|
6933
|
+
|
|
6934
|
+
|
|
6781
6935
|
/***/ }),
|
|
6782
6936
|
|
|
6783
6937
|
/***/ 75183:
|