@ohif/app 3.0.0 → 3.5.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.
Files changed (125) hide show
  1. package/dist/151.bundle.07bac9172580a60fae7a.js +2579 -0
  2. package/dist/192.bundle.62be5f0ef9705a485071.js +894 -0
  3. package/dist/199.bundle.2286f24cf0a068e7f50c.js +480 -0
  4. package/dist/205.bundle.39e6c847d618ad2b1b7a.js +62 -0
  5. package/dist/208.bundle.23748a85dfdc79c05d3a.js +864 -0
  6. package/dist/270.bundle.abbdb5348274bae3e8bc.js +23906 -0
  7. package/dist/283.bundle.33f99a75a5e2d9333da2.js +2939 -0
  8. package/dist/295.bundle.5105ce962be15c92484d.js +48 -0
  9. package/dist/331.bundle.7ac7b142d249d14fd99e.js +73034 -0
  10. package/dist/351.bundle.c5d7279ef42e30f61e08.js +1471 -0
  11. package/dist/351.css +3 -0
  12. package/dist/36785fbd89b0e17f6099.wasm +0 -0
  13. package/dist/381.bundle.0905e683605fcbc0895f.js +1009 -0
  14. package/dist/404.bundle.0f7a500421f246153d89.js +706 -0
  15. package/dist/50.bundle.4cb103cd20f5ffccf927.js +324 -0
  16. package/dist/5004fdc02f329ce53b69.wasm +0 -0
  17. package/dist/531.bundle.1bc152c87c7e2e987d2b.js +5935 -0
  18. package/dist/55.bundle.a5a215e13a8511f7aee7.js +685 -0
  19. package/dist/55.css +3 -0
  20. package/dist/569.bundle.d147c0aa0604f8ea2094.js +514 -0
  21. package/dist/581.bundle.646c89c5c3e3ee096363.js +508 -0
  22. package/dist/606.bundle.5d876f5f3dd8287f0a28.js +4939 -0
  23. package/dist/610.min.worker.js +2 -0
  24. package/dist/610.min.worker.js.map +1 -0
  25. package/dist/616.bundle.bec4736d8c9513e62856.js +686 -0
  26. package/dist/62ab5d58a2bea7b5a1dc.wasm +0 -0
  27. package/dist/642.bundle.030d908e22c8ff5611f3.js +169 -0
  28. package/dist/65916ef3def695744bda.wasm +0 -0
  29. package/dist/664.bundle.4792c88ae0d6d4b5ed13.js +901 -0
  30. package/dist/707.bundle.0a74aa3e61ed002eb3c6.js +9049 -0
  31. package/dist/707.css +1 -0
  32. package/dist/728.bundle.d13856835357400fef82.js +26221 -0
  33. package/dist/744.bundle.53b07e48e07a11e920ac.js +2355 -0
  34. package/dist/75788f12450d4c5ed494.wasm +0 -0
  35. package/dist/75a0c2dfe07b824c7d21.wasm +0 -0
  36. package/dist/780.bundle.f60ac1906e0ae080dee8.js +4769 -0
  37. package/dist/790.bundle.b4df2c5d78a2a565b150.js +454 -0
  38. package/dist/799.bundle.3fff638815e355b0bdfd.js +271 -0
  39. package/dist/806.css +1 -0
  40. package/dist/82.bundle.a24015533196e05d190e.js +6104 -0
  41. package/dist/917.bundle.a094ae9e9de6df4119ae.js +196 -0
  42. package/dist/926.bundle.dbc9d0e591cb9217fda2.js +72552 -0
  43. package/dist/935.bundle.deeffff0e4f7b528e3c3.js +1849 -0
  44. package/dist/945.min.worker.js +2 -0
  45. package/dist/945.min.worker.js.map +1 -0
  46. package/dist/953.bundle.c14d9eb6400f697019ee.js +449 -0
  47. package/dist/973.bundle.4100cf103686b64938d1.js +261 -0
  48. package/dist/976.bundle.2720eb892514e1818018.js +2725 -0
  49. package/dist/984.bundle.157fc66ea5040e1364af.js +1842 -0
  50. package/dist/_headers +6 -0
  51. package/dist/_redirects +6 -0
  52. package/dist/app-config.js +215 -0
  53. package/dist/app.bundle.253eeb2a7ee986e89c50.js +154621 -0
  54. package/dist/app.bundle.css +21 -0
  55. package/dist/assets/android-chrome-144x144.png +0 -0
  56. package/dist/assets/android-chrome-192x192.png +0 -0
  57. package/dist/assets/android-chrome-256x256.png +0 -0
  58. package/dist/assets/android-chrome-36x36.png +0 -0
  59. package/dist/assets/android-chrome-384x384.png +0 -0
  60. package/dist/assets/android-chrome-48x48.png +0 -0
  61. package/dist/assets/android-chrome-512x512.png +0 -0
  62. package/dist/assets/android-chrome-72x72.png +0 -0
  63. package/dist/assets/android-chrome-96x96.png +0 -0
  64. package/dist/assets/apple-touch-icon-1024x1024.png +0 -0
  65. package/dist/assets/apple-touch-icon-114x114.png +0 -0
  66. package/dist/assets/apple-touch-icon-120x120.png +0 -0
  67. package/dist/assets/apple-touch-icon-144x144.png +0 -0
  68. package/dist/assets/apple-touch-icon-152x152.png +0 -0
  69. package/dist/assets/apple-touch-icon-167x167.png +0 -0
  70. package/dist/assets/apple-touch-icon-180x180.png +0 -0
  71. package/dist/assets/apple-touch-icon-57x57.png +0 -0
  72. package/dist/assets/apple-touch-icon-60x60.png +0 -0
  73. package/dist/assets/apple-touch-icon-72x72.png +0 -0
  74. package/dist/assets/apple-touch-icon-76x76.png +0 -0
  75. package/dist/assets/apple-touch-icon-precomposed.png +0 -0
  76. package/dist/assets/apple-touch-icon.png +0 -0
  77. package/dist/assets/apple-touch-startup-image-1182x2208.png +0 -0
  78. package/dist/assets/apple-touch-startup-image-1242x2148.png +0 -0
  79. package/dist/assets/apple-touch-startup-image-1496x2048.png +0 -0
  80. package/dist/assets/apple-touch-startup-image-1536x2008.png +0 -0
  81. package/dist/assets/apple-touch-startup-image-320x460.png +0 -0
  82. package/dist/assets/apple-touch-startup-image-640x1096.png +0 -0
  83. package/dist/assets/apple-touch-startup-image-640x920.png +0 -0
  84. package/dist/assets/apple-touch-startup-image-748x1024.png +0 -0
  85. package/dist/assets/apple-touch-startup-image-750x1294.png +0 -0
  86. package/dist/assets/apple-touch-startup-image-768x1004.png +0 -0
  87. package/dist/assets/browserconfig.xml +12 -0
  88. package/dist/assets/coast-228x228.png +0 -0
  89. package/dist/assets/favicon-16x16.png +0 -0
  90. package/dist/assets/favicon-32x32.png +0 -0
  91. package/dist/assets/favicon.ico +0 -0
  92. package/dist/assets/firefox_app_128x128.png +0 -0
  93. package/dist/assets/firefox_app_512x512.png +0 -0
  94. package/dist/assets/firefox_app_60x60.png +0 -0
  95. package/dist/assets/manifest.webapp +14 -0
  96. package/dist/assets/mstile-144x144.png +0 -0
  97. package/dist/assets/mstile-150x150.png +0 -0
  98. package/dist/assets/mstile-310x150.png +0 -0
  99. package/dist/assets/mstile-310x310.png +0 -0
  100. package/dist/assets/mstile-70x70.png +0 -0
  101. package/dist/assets/yandex-browser-50x50.png +0 -0
  102. package/dist/assets/yandex-browser-manifest.json +9 -0
  103. package/dist/b6b803111e2d06a825bd.wasm +0 -0
  104. package/dist/c22b37c3488e1d6c3aa4.wasm +0 -0
  105. package/dist/cornerstoneDICOMImageLoader.min.js +2 -0
  106. package/dist/cornerstoneDICOMImageLoader.min.js.map +1 -0
  107. package/dist/dicom-microscopy-viewer.bundle.aa60bdf008c32c39cfd7.js +12 -0
  108. package/dist/dicomMicroscopyViewer.min.js +3 -0
  109. package/dist/dicomMicroscopyViewer.min.js.LICENSE.txt +29 -0
  110. package/dist/es6-shim.min.js +12 -0
  111. package/dist/google.js +75 -0
  112. package/dist/index.html +1 -0
  113. package/dist/index.worker.ea71efba2ce63c499055.worker.js +2 -0
  114. package/dist/index.worker.ea71efba2ce63c499055.worker.js.map +1 -0
  115. package/dist/index.worker.min.worker.js +2 -0
  116. package/dist/index.worker.min.worker.js.map +1 -0
  117. package/dist/init-service-worker.js +59 -0
  118. package/dist/manifest.json +59 -0
  119. package/dist/ohif-logo-light.svg +15 -0
  120. package/dist/ohif-logo.svg +15 -0
  121. package/dist/oidc-client.min.js +46 -0
  122. package/dist/polyfill.min.js +1 -0
  123. package/dist/silent-refresh.html +16 -0
  124. package/dist/sw.js +56 -0
  125. package/package.json +24 -23
@@ -0,0 +1,480 @@
1
+ "use strict";
2
+ (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[199],{
3
+
4
+ /***/ 31199:
5
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6
+
7
+ // ESM COMPAT FLAG
8
+ __webpack_require__.r(__webpack_exports__);
9
+
10
+ // EXPORTS
11
+ __webpack_require__.d(__webpack_exports__, {
12
+ "default": () => (/* binding */ cornerstone_dicom_rt_src)
13
+ });
14
+
15
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-rt/package.json
16
+ const package_namespaceObject = JSON.parse('{"u2":"@ohif/extension-cornerstone-dicom-rt"}');
17
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-rt/src/id.js
18
+
19
+ const id = package_namespaceObject.u2;
20
+ const SOPClassHandlerName = 'dicom-rt';
21
+ const SOPClassHandlerId = `${id}.sopClassHandlerModule.${SOPClassHandlerName}`;
22
+
23
+ // EXTERNAL MODULE: ../../../node_modules/react/index.js
24
+ var react = __webpack_require__(32735);
25
+ // EXTERNAL MODULE: ../../core/src/index.ts + 101 modules
26
+ var src = __webpack_require__(48501);
27
+ // EXTERNAL MODULE: ../../../node_modules/dcmjs/build/dcmjs.es.js
28
+ var dcmjs_es = __webpack_require__(22737);
29
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-rt/src/loadRTStruct.js
30
+
31
+ const {
32
+ DicomMessage,
33
+ DicomMetaDictionary
34
+ } = dcmjs_es["default"].data;
35
+ const dicomlab2RGB = dcmjs_es["default"].data.Colors.dicomlab2RGB;
36
+ async function checkAndLoadContourData(instance, datasource) {
37
+ if (!instance || !instance.ROIContourSequence) {
38
+ return Promise.reject('Invalid instance object or ROIContourSequence');
39
+ }
40
+ const promisesMap = new Map();
41
+ for (const ROIContour of instance.ROIContourSequence) {
42
+ const referencedROINumber = ROIContour.ReferencedROINumber;
43
+ if (!ROIContour || !ROIContour.ContourSequence) {
44
+ promisesMap.set(referencedROINumber, [Promise.resolve([])]);
45
+ continue;
46
+ }
47
+ for (const Contour of ROIContour.ContourSequence) {
48
+ if (!Contour || !Contour.ContourData) {
49
+ return Promise.reject('Invalid Contour or ContourData');
50
+ }
51
+ const contourData = Contour.ContourData;
52
+ if (Array.isArray(contourData)) {
53
+ promisesMap.has(referencedROINumber) ? promisesMap.get(referencedROINumber).push(Promise.resolve(contourData)) : promisesMap.set(referencedROINumber, [Promise.resolve(contourData)]);
54
+ } else if (contourData && contourData.BulkDataURI) {
55
+ const bulkDataURI = contourData.BulkDataURI;
56
+ if (!datasource || !datasource.retrieve || !datasource.retrieve.bulkDataURI) {
57
+ return Promise.reject('Invalid datasource object or retrieve function');
58
+ }
59
+ const bulkDataPromise = datasource.retrieve.bulkDataURI({
60
+ BulkDataURI: bulkDataURI,
61
+ StudyInstanceUID: instance.StudyInstanceUID,
62
+ SeriesInstanceUID: instance.SeriesInstanceUID,
63
+ SOPInstanceUID: instance.SOPInstanceUID
64
+ });
65
+ promisesMap.has(referencedROINumber) ? promisesMap.get(referencedROINumber).push(bulkDataPromise) : promisesMap.set(referencedROINumber, [bulkDataPromise]);
66
+ } else {
67
+ return Promise.reject(`Invalid ContourData: ${contourData}`);
68
+ }
69
+ }
70
+ }
71
+ const resolvedPromisesMap = new Map();
72
+ for (const [key, promiseArray] of promisesMap.entries()) {
73
+ resolvedPromisesMap.set(key, await Promise.allSettled(promiseArray));
74
+ }
75
+ instance.ROIContourSequence.forEach(ROIContour => {
76
+ try {
77
+ const referencedROINumber = ROIContour.ReferencedROINumber;
78
+ const resolvedPromises = resolvedPromisesMap.get(referencedROINumber);
79
+ if (ROIContour.ContourSequence) {
80
+ ROIContour.ContourSequence.forEach((Contour, index) => {
81
+ const promise = resolvedPromises[index];
82
+ if (promise.status === 'fulfilled') {
83
+ if (Array.isArray(promise.value) && promise.value.every(Number.isFinite)) {
84
+ // If promise.value is already an array of numbers, use it directly
85
+ Contour.ContourData = promise.value;
86
+ } else {
87
+ // If the resolved promise value is a byte array (Blob), it needs to be decoded
88
+ const uint8Array = new Uint8Array(promise.value);
89
+ const textDecoder = new TextDecoder();
90
+ const dataUint8Array = textDecoder.decode(uint8Array);
91
+ if (typeof dataUint8Array === 'string' && dataUint8Array.includes('\\')) {
92
+ Contour.ContourData = dataUint8Array.split('\\').map(parseFloat);
93
+ } else {
94
+ Contour.ContourData = [];
95
+ }
96
+ }
97
+ } else {
98
+ console.error(promise.reason);
99
+ }
100
+ });
101
+ }
102
+ } catch (error) {
103
+ console.error(error);
104
+ }
105
+ });
106
+ }
107
+ async function loadRTStruct(extensionManager, rtStructDisplaySet, referencedDisplaySet, headers) {
108
+ const utilityModule = extensionManager.getModuleEntry('@ohif/extension-cornerstone.utilityModule.common');
109
+ const dataSource = extensionManager.getActiveDataSource()[0];
110
+ const {
111
+ bulkDataURI
112
+ } = dataSource.getConfig?.() || {};
113
+ const {
114
+ dicomLoaderService
115
+ } = utilityModule.exports;
116
+ const imageIdSopInstanceUidPairs = _getImageIdSopInstanceUidPairsForDisplaySet(referencedDisplaySet);
117
+
118
+ // Set here is loading is asynchronous.
119
+ // If this function throws its set back to false.
120
+ rtStructDisplaySet.isLoaded = true;
121
+ let instance = rtStructDisplaySet.instance;
122
+ if (!bulkDataURI || !bulkDataURI.enabled) {
123
+ const segArrayBuffer = await dicomLoaderService.findDicomDataPromise(rtStructDisplaySet, null, headers);
124
+ const dicomData = DicomMessage.readFile(segArrayBuffer);
125
+ const rtStructDataset = DicomMetaDictionary.naturalizeDataset(dicomData.dict);
126
+ rtStructDataset._meta = DicomMetaDictionary.namifyDataset(dicomData.meta);
127
+ instance = rtStructDataset;
128
+ } else {
129
+ await checkAndLoadContourData(instance, dataSource);
130
+ }
131
+ const {
132
+ StructureSetROISequence,
133
+ ROIContourSequence,
134
+ RTROIObservationsSequence
135
+ } = instance;
136
+
137
+ // Define our structure set entry and add it to the rtstruct module state.
138
+ const structureSet = {
139
+ StructureSetLabel: instance.StructureSetLabel,
140
+ SeriesInstanceUID: instance.SeriesInstanceUID,
141
+ ROIContours: [],
142
+ visible: true
143
+ };
144
+ for (let i = 0; i < ROIContourSequence.length; i++) {
145
+ const ROIContour = ROIContourSequence[i];
146
+ const {
147
+ ContourSequence
148
+ } = ROIContour;
149
+ if (!ContourSequence) {
150
+ continue;
151
+ }
152
+ const isSupported = false;
153
+ const ContourSequenceArray = _toArray(ContourSequence);
154
+ const contourPoints = [];
155
+ for (let c = 0; c < ContourSequenceArray.length; c++) {
156
+ const {
157
+ ContourImageSequence,
158
+ ContourData,
159
+ NumberOfContourPoints,
160
+ ContourGeometricType
161
+ } = ContourSequenceArray[c];
162
+ const sopInstanceUID = ContourImageSequence.ReferencedSOPInstanceUID;
163
+ const imageId = _getImageId(imageIdSopInstanceUidPairs, sopInstanceUID);
164
+ if (!imageId) {
165
+ continue;
166
+ }
167
+ let isSupported = false;
168
+ const points = [];
169
+ for (let p = 0; p < NumberOfContourPoints * 3; p += 3) {
170
+ points.push({
171
+ x: ContourData[p],
172
+ y: ContourData[p + 1],
173
+ z: ContourData[p + 2]
174
+ });
175
+ }
176
+ switch (ContourGeometricType) {
177
+ case 'CLOSED_PLANAR':
178
+ case 'OPEN_PLANAR':
179
+ case 'POINT':
180
+ isSupported = true;
181
+ break;
182
+ default:
183
+ continue;
184
+ }
185
+ contourPoints.push({
186
+ numberOfPoints: NumberOfContourPoints,
187
+ points,
188
+ type: ContourGeometricType,
189
+ isSupported
190
+ });
191
+ }
192
+ _setROIContourMetadata(structureSet, StructureSetROISequence, RTROIObservationsSequence, ROIContour, contourPoints, isSupported);
193
+ }
194
+ return structureSet;
195
+ }
196
+ const _getImageId = (imageIdSopInstanceUidPairs, sopInstanceUID) => {
197
+ const imageIdSopInstanceUidPairsEntry = imageIdSopInstanceUidPairs.find(imageIdSopInstanceUidPairsEntry => imageIdSopInstanceUidPairsEntry.sopInstanceUID === sopInstanceUID);
198
+ return imageIdSopInstanceUidPairsEntry ? imageIdSopInstanceUidPairsEntry.imageId : null;
199
+ };
200
+ function _getImageIdSopInstanceUidPairsForDisplaySet(referencedDisplaySet) {
201
+ return referencedDisplaySet.images.map(image => {
202
+ return {
203
+ imageId: image.imageId,
204
+ sopInstanceUID: image.SOPInstanceUID
205
+ };
206
+ });
207
+ }
208
+ function _setROIContourMetadata(structureSet, StructureSetROISequence, RTROIObservationsSequence, ROIContour, contourPoints, isSupported) {
209
+ const StructureSetROI = StructureSetROISequence.find(structureSetROI => structureSetROI.ROINumber === ROIContour.ReferencedROINumber);
210
+ const ROIContourData = {
211
+ ROINumber: StructureSetROI.ROINumber,
212
+ ROIName: StructureSetROI.ROIName,
213
+ ROIGenerationAlgorithm: StructureSetROI.ROIGenerationAlgorithm,
214
+ ROIDescription: StructureSetROI.ROIDescription,
215
+ isSupported,
216
+ contourPoints,
217
+ visible: true
218
+ };
219
+ _setROIContourDataColor(ROIContour, ROIContourData);
220
+ if (RTROIObservationsSequence) {
221
+ // If present, add additional RTROIObservations metadata.
222
+ _setROIContourRTROIObservations(ROIContourData, RTROIObservationsSequence, ROIContour.ReferencedROINumber);
223
+ }
224
+ structureSet.ROIContours.push(ROIContourData);
225
+ }
226
+ function _setROIContourDataColor(ROIContour, ROIContourData) {
227
+ let {
228
+ ROIDisplayColor,
229
+ RecommendedDisplayCIELabValue
230
+ } = ROIContour;
231
+ if (!ROIDisplayColor && RecommendedDisplayCIELabValue) {
232
+ // If ROIDisplayColor is absent, try using the RecommendedDisplayCIELabValue color.
233
+ ROIDisplayColor = dicomlab2RGB(RecommendedDisplayCIELabValue);
234
+ }
235
+ if (ROIDisplayColor) {
236
+ ROIContourData.colorArray = [...ROIDisplayColor];
237
+ }
238
+ }
239
+ function _setROIContourRTROIObservations(ROIContourData, RTROIObservationsSequence, ROINumber) {
240
+ const RTROIObservations = RTROIObservationsSequence.find(RTROIObservations => RTROIObservations.ReferencedROINumber === ROINumber);
241
+ if (RTROIObservations) {
242
+ // Deep copy so we don't keep the reference to the dcmjs dataset entry.
243
+ const {
244
+ ObservationNumber,
245
+ ROIObservationDescription,
246
+ RTROIInterpretedType,
247
+ ROIInterpreter
248
+ } = RTROIObservations;
249
+ ROIContourData.RTROIObservations = {
250
+ ObservationNumber,
251
+ ROIObservationDescription,
252
+ RTROIInterpretedType,
253
+ ROIInterpreter
254
+ };
255
+ }
256
+ }
257
+ function _toArray(objOrArray) {
258
+ return Array.isArray(objOrArray) ? objOrArray : [objOrArray];
259
+ }
260
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-rt/src/getSopClassHandlerModule.js
261
+
262
+
263
+
264
+ const sopClassUids = ['1.2.840.10008.5.1.4.1.1.481.3'];
265
+ let loadPromises = {};
266
+ function _getDisplaySetsFromSeries(instances, servicesManager, extensionManager) {
267
+ const instance = instances[0];
268
+ const {
269
+ StudyInstanceUID,
270
+ SeriesInstanceUID,
271
+ SOPInstanceUID,
272
+ SeriesDescription,
273
+ SeriesNumber,
274
+ SeriesDate,
275
+ SOPClassUID,
276
+ wadoRoot,
277
+ wadoUri,
278
+ wadoUriRoot
279
+ } = instance;
280
+ const displaySet = {
281
+ Modality: 'RTSTRUCT',
282
+ loading: false,
283
+ isReconstructable: false,
284
+ // by default for now since it is a volumetric SEG currently
285
+ displaySetInstanceUID: src.utils.guid(),
286
+ SeriesDescription,
287
+ SeriesNumber,
288
+ SeriesDate,
289
+ SOPInstanceUID,
290
+ SeriesInstanceUID,
291
+ StudyInstanceUID,
292
+ SOPClassHandlerId: SOPClassHandlerId,
293
+ SOPClassUID,
294
+ referencedImages: null,
295
+ referencedSeriesInstanceUID: null,
296
+ referencedDisplaySetInstanceUID: null,
297
+ isDerivedDisplaySet: true,
298
+ isLoaded: false,
299
+ isHydrated: false,
300
+ structureSet: null,
301
+ sopClassUids,
302
+ instance,
303
+ wadoRoot,
304
+ wadoUriRoot,
305
+ wadoUri,
306
+ isOverlayDisplaySet: true
307
+ };
308
+ let referencedSeriesSequence = instance.ReferencedSeriesSequence;
309
+ if (instance.ReferencedFrameOfReferenceSequence && !instance.ReferencedSeriesSequence) {
310
+ instance.ReferencedSeriesSequence = _deriveReferencedSeriesSequenceFromFrameOfReferenceSequence(instance.ReferencedFrameOfReferenceSequence);
311
+ referencedSeriesSequence = instance.ReferencedSeriesSequence;
312
+ }
313
+ if (!referencedSeriesSequence) {
314
+ throw new Error('ReferencedSeriesSequence is missing for the RTSTRUCT');
315
+ }
316
+ const referencedSeries = referencedSeriesSequence[0];
317
+ displaySet.referencedImages = instance.ReferencedSeriesSequence.ReferencedInstanceSequence;
318
+ displaySet.referencedSeriesInstanceUID = referencedSeries.SeriesInstanceUID;
319
+ displaySet.getReferenceDisplaySet = () => {
320
+ const {
321
+ DisplaySetService
322
+ } = servicesManager.services;
323
+ const referencedDisplaySets = DisplaySetService.getDisplaySetsForSeries(displaySet.referencedSeriesInstanceUID);
324
+ if (!referencedDisplaySets || referencedDisplaySets.length === 0) {
325
+ throw new Error('Referenced DisplaySet is missing for the RT');
326
+ }
327
+ const referencedDisplaySet = referencedDisplaySets[0];
328
+ displaySet.referencedDisplaySetInstanceUID = referencedDisplaySet.displaySetInstanceUID;
329
+ return referencedDisplaySet;
330
+ };
331
+ displaySet.load = _ref => {
332
+ let {
333
+ headers
334
+ } = _ref;
335
+ return _load(displaySet, servicesManager, extensionManager, headers);
336
+ };
337
+ return [displaySet];
338
+ }
339
+ function _load(rtDisplaySet, servicesManager, extensionManager, headers) {
340
+ const {
341
+ SOPInstanceUID
342
+ } = rtDisplaySet;
343
+ const {
344
+ segmentationService
345
+ } = servicesManager.services;
346
+ if ((rtDisplaySet.loading || rtDisplaySet.isLoaded) && loadPromises[SOPInstanceUID] && _segmentationExistsInCache(rtDisplaySet, segmentationService)) {
347
+ return loadPromises[SOPInstanceUID];
348
+ }
349
+ rtDisplaySet.loading = true;
350
+
351
+ // We don't want to fire multiple loads, so we'll wait for the first to finish
352
+ // and also return the same promise to any other callers.
353
+ loadPromises[SOPInstanceUID] = new Promise(async (resolve, reject) => {
354
+ if (!rtDisplaySet.structureSet) {
355
+ const structureSet = await loadRTStruct(extensionManager, rtDisplaySet, rtDisplaySet.getReferenceDisplaySet(), headers);
356
+ rtDisplaySet.structureSet = structureSet;
357
+ }
358
+ const suppressEvents = true;
359
+ segmentationService.createSegmentationForRTDisplaySet(rtDisplaySet, null, suppressEvents).then(() => {
360
+ rtDisplaySet.loading = false;
361
+ resolve();
362
+ }).catch(error => {
363
+ rtDisplaySet.loading = false;
364
+ reject(error);
365
+ });
366
+ });
367
+ return loadPromises[SOPInstanceUID];
368
+ }
369
+ function _deriveReferencedSeriesSequenceFromFrameOfReferenceSequence(ReferencedFrameOfReferenceSequence) {
370
+ const ReferencedSeriesSequence = [];
371
+ ReferencedFrameOfReferenceSequence.forEach(referencedFrameOfReference => {
372
+ const {
373
+ RTReferencedStudySequence
374
+ } = referencedFrameOfReference;
375
+ RTReferencedStudySequence.forEach(rtReferencedStudy => {
376
+ const {
377
+ RTReferencedSeriesSequence
378
+ } = rtReferencedStudy;
379
+ RTReferencedSeriesSequence.forEach(rtReferencedSeries => {
380
+ const ReferencedInstanceSequence = [];
381
+ const {
382
+ ContourImageSequence,
383
+ SeriesInstanceUID
384
+ } = rtReferencedSeries;
385
+ ContourImageSequence.forEach(contourImage => {
386
+ ReferencedInstanceSequence.push({
387
+ ReferencedSOPInstanceUID: contourImage.ReferencedSOPInstanceUID,
388
+ ReferencedSOPClassUID: contourImage.ReferencedSOPClassUID
389
+ });
390
+ });
391
+ const referencedSeries = {
392
+ SeriesInstanceUID,
393
+ ReferencedInstanceSequence
394
+ };
395
+ ReferencedSeriesSequence.push(referencedSeries);
396
+ });
397
+ });
398
+ });
399
+ return ReferencedSeriesSequence;
400
+ }
401
+ function _segmentationExistsInCache(rtDisplaySet, segmentationService) {
402
+ // Todo: fix this
403
+ return false;
404
+ // This should be abstracted with the CornerstoneCacheService
405
+ const rtContourId = rtDisplaySet.displaySetInstanceUID;
406
+ const contour = segmentationService.getContour(rtContourId);
407
+ return contour !== undefined;
408
+ }
409
+ function getSopClassHandlerModule(_ref2) {
410
+ let {
411
+ servicesManager,
412
+ extensionManager
413
+ } = _ref2;
414
+ return [{
415
+ name: 'dicom-rt',
416
+ sopClassUids,
417
+ getDisplaySetsFromSeries: instances => {
418
+ return _getDisplaySetsFromSeries(instances, servicesManager, extensionManager);
419
+ }
420
+ }];
421
+ }
422
+ /* harmony default export */ const src_getSopClassHandlerModule = (getSopClassHandlerModule);
423
+ ;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-rt/src/index.tsx
424
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
425
+
426
+
427
+
428
+ const Component = /*#__PURE__*/react.lazy(() => {
429
+ return __webpack_require__.e(/* import() */ 581).then(__webpack_require__.bind(__webpack_require__, 72581));
430
+ });
431
+ const OHIFCornerstoneRTViewport = props => {
432
+ return /*#__PURE__*/react.createElement(react.Suspense, {
433
+ fallback: /*#__PURE__*/react.createElement("div", null, "Loading...")
434
+ }, /*#__PURE__*/react.createElement(Component, props));
435
+ };
436
+
437
+ /**
438
+ * You can remove any of the following modules if you don't need them.
439
+ */
440
+ const extension = {
441
+ /**
442
+ * Only required property. Should be a unique value across all extensions.
443
+ * You ID can be anything you want, but it should be unique.
444
+ */
445
+ id: id,
446
+ /**
447
+ * PanelModule should provide a list of panels that will be available in OHIF
448
+ * for Modes to consume and render. Each panel is defined by a {name,
449
+ * iconName, iconLabel, label, component} object. Example of a panel module
450
+ * is the StudyBrowserPanel that is provided by the default extension in OHIF.
451
+ */
452
+ getViewportModule(_ref) {
453
+ let {
454
+ servicesManager,
455
+ extensionManager
456
+ } = _ref;
457
+ const ExtendedOHIFCornerstoneRTViewport = props => {
458
+ return /*#__PURE__*/react.createElement(OHIFCornerstoneRTViewport, _extends({
459
+ servicesManager: servicesManager,
460
+ extensionManager: extensionManager
461
+ }, props));
462
+ };
463
+ return [{
464
+ name: 'dicom-rt',
465
+ component: ExtendedOHIFCornerstoneRTViewport
466
+ }];
467
+ },
468
+ /**
469
+ * SopClassHandlerModule should provide a list of sop class handlers that will be
470
+ * available in OHIF for Modes to consume and use to create displaySets from Series.
471
+ * Each sop class handler is defined by a { name, sopClassUids, getDisplaySetsFromSeries}.
472
+ * Examples include the default sop class handler provided by the default extension
473
+ */
474
+ getSopClassHandlerModule: src_getSopClassHandlerModule
475
+ };
476
+ /* harmony default export */ const cornerstone_dicom_rt_src = (extension);
477
+
478
+ /***/ })
479
+
480
+ }]);
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[205],{
3
+
4
+ /***/ 36205:
5
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6
+
7
+ __webpack_require__.r(__webpack_exports__);
8
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
10
+ /* harmony export */ });
11
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32735);
12
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60216);
13
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
14
+
15
+
16
+ function OHIFCornerstoneVideoViewport(_ref) {
17
+ let {
18
+ displaySets
19
+ } = _ref;
20
+ if (displaySets && displaySets.length > 1) {
21
+ throw new Error('OHIFCornerstoneVideoViewport: only one display set is supported for dicom video right now');
22
+ }
23
+ const {
24
+ videoUrl
25
+ } = displaySets[0];
26
+ const mimeType = 'video/mp4';
27
+ const [url, setUrl] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
28
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
29
+ const load = async () => {
30
+ setUrl(await videoUrl);
31
+ };
32
+ load();
33
+ }, [videoUrl]);
34
+
35
+ // Need to copies of the source to fix a firefox bug
36
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
37
+ className: "bg-primary-black w-full h-full"
38
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("video", {
39
+ src: url,
40
+ controls: true,
41
+ controlsList: "nodownload",
42
+ preload: "auto",
43
+ className: "w-full h-full",
44
+ crossOrigin: "anonymous"
45
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("source", {
46
+ src: url,
47
+ type: mimeType
48
+ }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("source", {
49
+ src: url,
50
+ type: mimeType
51
+ }), "Video src/type not supported:", ' ', /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("a", {
52
+ href: url
53
+ }, url, " of type ", mimeType)));
54
+ }
55
+ OHIFCornerstoneVideoViewport.propTypes = {
56
+ displaySets: prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_1___default().object)).isRequired
57
+ };
58
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OHIFCornerstoneVideoViewport);
59
+
60
+ /***/ })
61
+
62
+ }]);