@ohif/app 3.9.0-beta.46 → 3.9.0-beta.48

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 (89) hide show
  1. package/dist/031089e563a18ada8441.wasm +0 -0
  2. package/dist/{445.bundle.38c6d2af64e41cd7c614.js → 10.bundle.c626810bd199ab63f3a2.js} +3 -3
  3. package/dist/{501.bundle.2f703ca4598a3be0d748.js → 129.bundle.3102eccbd5c78524c3dd.js} +6036 -11592
  4. package/dist/{140.bundle.57e0e190f83d686c7d84.js → 153.bundle.c5c3111fa78764c5960d.js} +7 -4
  5. package/dist/{139.bundle.09e5af0a9ae8a285af77.js → 169.bundle.eeb9614e7b06f896c70f.js} +65 -535
  6. package/dist/{139.css → 169.css} +0 -1
  7. package/dist/{164.bundle.2b23bfbcb23497d7c87a.js → 196.bundle.cf8c2311aafb5312bbf7.js} +15562 -8539
  8. package/dist/{342.bundle.fcb2038060a062129d34.js → 202.bundle.bb0e8196739bb896dc9e.js} +238 -276
  9. package/dist/{129.bundle.ef2824b9d3145e620069.js → 210.bundle.8d89ad148ee420ac573f.js} +46 -46
  10. package/dist/{363.bundle.b09eeacf1db06eac578f.js → 217.bundle.2e3eceda916aa4ec4039.js} +2099 -195
  11. package/dist/{363.css → 217.css} +1 -0
  12. package/dist/{14.bundle.afc14c0e2e6bdb9c03fb.js → 246.bundle.1069b026e904b03943f0.js} +11 -11
  13. package/dist/250.bundle.4743b359797751102600.js +663 -0
  14. package/dist/{851.bundle.1d974a1affa602a3db35.js → 281.bundle.34009e8337141e4b8f26.js} +211 -243
  15. package/dist/{727.bundle.7b7f3962207601643615.js → 286.bundle.985c5ebbb2158c7e59ab.js} +4 -4
  16. package/dist/29.bundle.976319462f33868497c2.js +12347 -0
  17. package/dist/{675.bundle.c9720f40fd7c7e9b7e54.js → 315.bundle.92d7aefc4dc9cfd951bd.js} +18 -18
  18. package/dist/{218.bundle.0d88a96c091e70b87ada.js → 353.bundle.ed24422ba6b77b3a1e6d.js} +8 -8
  19. package/dist/{799.bundle.b0278dd5010f2cbdbac5.js → 360.bundle.8500a439cff45926abf1.js} +62 -62
  20. package/dist/{555.bundle.d731e79ced564bce2167.js → 372.bundle.c9a475b03f1490357165.js} +50 -50
  21. package/dist/{211.bundle.c99f8ae0fb317d76eb84.js → 376.bundle.9ce6f93540d667c57ef7.js} +8 -8
  22. package/dist/{612.bundle.297a033523539e0b47f9.js → 412.bundle.836f106f6e2896dc42a5.js} +4 -4
  23. package/dist/{931.bundle.058f8de4606f27b31f4f.js → 417.bundle.abf8bcee0f246002acb9.js} +25 -25
  24. package/dist/{370.bundle.bd9884c274c26a54dfae.js → 428.bundle.744fc5865b2d747de88a.js} +829 -1511
  25. package/dist/{483.bundle.0f1848f6a2cf34829fef.js → 497.bundle.ee102d6243f984113f08.js} +141 -141
  26. package/dist/{323.bundle.955cc8f5eb5c01295118.js → 498.bundle.bb47c493dd02451f77ef.js} +17 -17
  27. package/dist/{552.bundle.38207568073bcd238dda.js → 502.bundle.643d0af06b6c354537f5.js} +8 -9
  28. package/dist/{835.bundle.5d1951da8bbc6afdf3e0.js → 530.bundle.87f8b13ff55bf7b2a6d1.js} +28 -28
  29. package/dist/{121.bundle.8646909d0f76791d8aee.js → 552.bundle.ed2be5e57376b8c6cc68.js} +733 -62
  30. package/dist/{265.bundle.61b0e1ce9d444704a976.js → 571.bundle.a80609c9815339516d77.js} +24 -24
  31. package/dist/{853.bundle.beae65b8de389f8ee983.js → 591.bundle.c93fbabf5840b8f0ded3.js} +8 -8
  32. package/dist/604.bundle.83f50929b208c60e48da.js +1950 -0
  33. package/dist/610.min.worker.js +1 -1
  34. package/dist/610.min.worker.js.map +1 -1
  35. package/dist/{792.bundle.485ad2f98823a4b3feb1.js → 658.bundle.219ed199728759098008.js} +17 -17
  36. package/dist/{989.bundle.eec61b62860e730cf23d.js → 791.bundle.eb41e31a5bf389639612.js} +11 -11
  37. package/dist/{722.bundle.1242e0348afc63ca4f5e.js → 793.bundle.c92f52ddff0e3bf506e6.js} +13 -13
  38. package/dist/{914.bundle.e15be8089bf422ed7b51.js → 818.bundle.cda4e369fdee5459a544.js} +1239 -627
  39. package/dist/{726.bundle.90d63d40a19b058034ee.js → 831.bundle.9e1a3495947e5bb49756.js} +512 -512
  40. package/dist/{382.bundle.2788481abeaaf6afbca9.js → 842.bundle.76740a57f690e753802e.js} +11 -11
  41. package/dist/{806.bundle.3b50260239f93b7787b6.js → 888.bundle.36415d4c9c396df1b83d.js} +14 -14
  42. package/dist/{702.bundle.963481fbf871984b646f.js → 909.bundle.1fbb8bb4c41d0bb2994d.js} +119 -381
  43. package/dist/{109.bundle.b4fee2a22b622839baf5.js → 931.bundle.f6fa2a436ace89ebf60f.js} +5036 -4642
  44. package/dist/{141.bundle.556b4c1e4cab770417ac.js → 937.bundle.cc709c922731f9496810.js} +86 -478
  45. package/dist/{444.bundle.7adebacc6760f45bf58b.js → 944.bundle.eb9723ea5f0a42cf8aa0.js} +9 -10
  46. package/dist/945.min.worker.js +1 -1
  47. package/dist/945.min.worker.js.map +1 -1
  48. package/dist/{194.bundle.31de18ad9ea9b05f21ea.js → 962.bundle.e63d19fabce8b7d85974.js} +33 -37
  49. package/dist/{920.bundle.d7c555d415240c7d3829.js → 978.bundle.7c0b275e22e6060fc893.js} +6 -6
  50. package/dist/{236.bundle.34db90a140e37d34fd71.js → 993.bundle.aa31ebda5a5f62c44de5.js} +2363 -2351
  51. package/dist/{717.bundle.96160aa973fbb4cb3f1e.js → 994.bundle.23f3108d0dfc114db43f.js} +90 -164
  52. package/dist/app-config.js +2 -3
  53. package/dist/app.bundle.css +3 -3
  54. package/dist/{app.bundle.3551ec3a588fe3841a9d.js → app.bundle.ee7962276756acbd637e.js} +52547 -36094
  55. package/dist/cornerstoneDICOMImageLoader.min.js +1 -1
  56. package/dist/cornerstoneDICOMImageLoader.min.js.map +1 -1
  57. package/dist/dicom-microscopy-viewer/5004fdc02f329ce53b69.wasm +0 -0
  58. package/dist/dicom-microscopy-viewer/c22b37c3488e1d6c3aa4.wasm +0 -0
  59. package/dist/dicom-microscopy-viewer/dicomMicroscopyViewer.min.js +3 -0
  60. package/dist/{dicomMicroscopyViewer.min.js.LICENSE.txt → dicom-microscopy-viewer/dicomMicroscopyViewer.min.js.LICENSE.txt} +11 -0
  61. package/dist/dicom-microscopy-viewer/index.worker.min.worker.js +2 -0
  62. package/dist/dicom-microscopy-viewer/index.worker.min.worker.js.map +1 -0
  63. package/dist/{histogram-worker.bundle.6b31e5ed4c4a7a6998f2.js → histogram-worker.bundle.e7e9fea2c3236b0e747a.js} +12 -16
  64. package/dist/index.html +1 -1
  65. package/dist/index.worker.5a5a581362c14598c3d9.worker.js +2 -0
  66. package/dist/index.worker.5a5a581362c14598c3d9.worker.js.map +1 -0
  67. package/dist/{polySeg.bundle.df492df5042827938ba4.js → polySeg.bundle.b25c61224998018d0f79.js} +24 -5
  68. package/dist/{suv-peak-worker.bundle.8f4b505fad3d371489fe.js → suv-peak-worker.bundle.eb11e71db02e52601ecf.js} +40 -21
  69. package/dist/sw.js +1 -1
  70. package/package.json +25 -33
  71. package/dist/117.bundle.1f7b56504d506e7259e3.js +0 -6552
  72. package/dist/172.bundle.19e8ff4bbcadcf7ec6ba.js +0 -662
  73. package/dist/36785fbd89b0e17f6099.wasm +0 -0
  74. package/dist/62ab5d58a2bea7b5a1dc.wasm +0 -0
  75. package/dist/644.bundle.1e77691d2eeb96a423b0.js +0 -19159
  76. package/dist/75a0c2dfe07b824c7d21.wasm +0 -0
  77. package/dist/dicom-microscopy-viewer.bundle.d3a56dc9f62df5e11019.js +0 -13
  78. package/dist/dicomMicroscopyViewer.min.js +0 -3
  79. package/dist/index.worker.f4bda803c15bc6359d5f.worker.js +0 -2
  80. package/dist/index.worker.f4bda803c15bc6359d5f.worker.js.map +0 -1
  81. package/dist/index.worker.min.worker.js +0 -2
  82. package/dist/index.worker.min.worker.js.map +0 -1
  83. /package/dist/{129.css → 210.css} +0 -0
  84. /package/dist/{727.css → 286.css} +0 -0
  85. /package/dist/{172.css → 552.css} +0 -0
  86. /package/dist/{404.css → 757.css} +0 -0
  87. /package/dist/{717.css → 994.css} +0 -0
  88. /package/dist/{65916ef3def695744bda.wasm → dicom-microscopy-viewer/65916ef3def695744bda.wasm} +0 -0
  89. /package/dist/{b6b803111e2d06a825bd.wasm → dicom-microscopy-viewer/b6b803111e2d06a825bd.wasm} +0 -0
@@ -1,662 +0,0 @@
1
- "use strict";
2
- (globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[172,404],{
3
-
4
- /***/ 66921:
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 */ src_DicomMicroscopyViewport)
13
- });
14
-
15
- // EXTERNAL MODULE: ../../../node_modules/react/index.js
16
- var react = __webpack_require__(41766);
17
- // EXTERNAL MODULE: ../../../node_modules/prop-types/index.js
18
- var prop_types = __webpack_require__(11374);
19
- var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
20
- // EXTERNAL MODULE: ../../ui/src/index.js + 782 modules
21
- var src = __webpack_require__(79047);
22
- ;// CONCATENATED MODULE: ../../../extensions/dicom-microscopy/src/DicomMicroscopyViewport.css
23
- // extracted by mini-css-extract-plugin
24
-
25
- // EXTERNAL MODULE: ../../../node_modules/classnames/index.js
26
- var classnames = __webpack_require__(61466);
27
- var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
28
- ;// CONCATENATED MODULE: ../../../extensions/dicom-microscopy/src/components/ViewportOverlay/listComponentGenerator.tsx
29
- const listComponentGenerator = props => {
30
- const {
31
- list,
32
- itemGenerator
33
- } = props;
34
- if (!list) {
35
- return;
36
- }
37
- return list.map(item => {
38
- if (!item) {
39
- return;
40
- }
41
- const generator = item.generator || itemGenerator;
42
- if (!generator) {
43
- throw new Error(`No generator for ${item}`);
44
- }
45
- return generator({
46
- ...props,
47
- item
48
- });
49
- });
50
- };
51
- /* harmony default export */ const ViewportOverlay_listComponentGenerator = (listComponentGenerator);
52
- ;// CONCATENATED MODULE: ../../../extensions/dicom-microscopy/src/components/ViewportOverlay/ViewportOverlay.css
53
- // extracted by mini-css-extract-plugin
54
-
55
- // EXTERNAL MODULE: ../../../node_modules/moment/moment.js
56
- var moment_moment = __webpack_require__(8291);
57
- // EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 28 modules
58
- var esm = __webpack_require__(92136);
59
- ;// CONCATENATED MODULE: ../../../extensions/dicom-microscopy/src/components/ViewportOverlay/utils.ts
60
-
61
-
62
-
63
- /**
64
- * Checks if value is valid.
65
- *
66
- * @param {number} value
67
- * @returns {boolean} is valid.
68
- */
69
- function isValidNumber(value) {
70
- return typeof value === 'number' && !isNaN(value);
71
- }
72
-
73
- /**
74
- * Formats number precision.
75
- *
76
- * @param {number} number
77
- * @param {number} precision
78
- * @returns {number} formatted number.
79
- */
80
- function utils_formatNumberPrecision(number, precision) {
81
- if (number !== null) {
82
- return parseFloat(number).toFixed(precision);
83
- }
84
- }
85
-
86
- /**
87
- * Formats DICOM date.
88
- *
89
- * @param {string} date
90
- * @param {string} strFormat
91
- * @returns {string} formatted date.
92
- */
93
- function utils_formatDICOMDate(date, strFormat = 'MMM D, YYYY') {
94
- return moment(date, 'YYYYMMDD').format(strFormat);
95
- }
96
-
97
- /**
98
- * DICOM Time is stored as HHmmss.SSS, where:
99
- * HH 24 hour time:
100
- * m mm 0..59 Minutes
101
- * s ss 0..59 Seconds
102
- * S SS SSS 0..999 Fractional seconds
103
- *
104
- * Goal: '24:12:12'
105
- *
106
- * @param {*} time
107
- * @param {string} strFormat
108
- * @returns {string} formatted name.
109
- */
110
- function utils_formatDICOMTime(time, strFormat = 'HH:mm:ss') {
111
- return moment(time, 'HH:mm:ss').format(strFormat);
112
- }
113
-
114
- /**
115
- * Formats a patient name for display purposes
116
- *
117
- * @param {string} name
118
- * @returns {string} formatted name.
119
- */
120
- function utils_formatPN(name) {
121
- if (!name) {
122
- return;
123
- }
124
-
125
- // Convert the first ^ to a ', '. String.replace() only affects
126
- // the first appearance of the character.
127
- const commaBetweenFirstAndLast = name.replace('^', ', ');
128
-
129
- // Replace any remaining '^' characters with spaces
130
- const cleaned = commaBetweenFirstAndLast.replace(/\^/g, ' ');
131
-
132
- // Trim any extraneous whitespace
133
- return cleaned.trim();
134
- }
135
-
136
- /**
137
- * Gets compression type
138
- *
139
- * @param {number} imageId
140
- * @returns {string} compression type.
141
- */
142
- function getCompression(imageId) {
143
- const generalImageModule = cornerstone.metaData.get('generalImageModule', imageId) || {};
144
- const {
145
- lossyImageCompression,
146
- lossyImageCompressionRatio,
147
- lossyImageCompressionMethod
148
- } = generalImageModule;
149
- if (lossyImageCompression === '01' && lossyImageCompressionRatio !== '') {
150
- const compressionMethod = lossyImageCompressionMethod || 'Lossy: ';
151
- const compressionRatio = utils_formatNumberPrecision(lossyImageCompressionRatio, 2);
152
- return compressionMethod + compressionRatio + ' : 1';
153
- }
154
- return 'Lossless / Uncompressed';
155
- }
156
- ;// CONCATENATED MODULE: ../../../extensions/dicom-microscopy/src/components/ViewportOverlay/index.tsx
157
-
158
-
159
-
160
-
161
-
162
- /**
163
- *
164
- * @param {*} config is a configuration object that defines four lists of elements,
165
- * one topLeft, topRight, bottomLeft, bottomRight contents.
166
- * @param {*} extensionManager is used to load the image data.
167
- * @returns
168
- */
169
- const generateFromConfig = ({
170
- topLeft = [],
171
- topRight = [],
172
- bottomLeft = [],
173
- bottomRight = [],
174
- itemGenerator = () => {}
175
- }) => {
176
- return props => {
177
- const topLeftClass = 'top-viewport left-viewport text-primary-light';
178
- const topRightClass = 'top-viewport right-viewport-scrollbar text-primary-light';
179
- const bottomRightClass = 'bottom-viewport right-viewport-scrollbar text-primary-light';
180
- const bottomLeftClass = 'bottom-viewport left-viewport text-primary-light';
181
- const overlay = 'absolute pointer-events-none microscopy-viewport-overlay';
182
- return /*#__PURE__*/react.createElement(react.Fragment, null, topLeft && topLeft.length > 0 && /*#__PURE__*/react.createElement("div", {
183
- "data-cy": 'viewport-overlay-top-left',
184
- className: classnames_default()(overlay, topLeftClass)
185
- }, ViewportOverlay_listComponentGenerator({
186
- ...props,
187
- list: topLeft,
188
- itemGenerator
189
- })), topRight && topRight.length > 0 && /*#__PURE__*/react.createElement("div", {
190
- "data-cy": 'viewport-overlay-top-right',
191
- className: classnames_default()(overlay, topRightClass)
192
- }, ViewportOverlay_listComponentGenerator({
193
- ...props,
194
- list: topRight,
195
- itemGenerator
196
- })), bottomRight && bottomRight.length > 0 && /*#__PURE__*/react.createElement("div", {
197
- "data-cy": 'viewport-overlay-bottom-right',
198
- className: classnames_default()(overlay, bottomRightClass)
199
- }, ViewportOverlay_listComponentGenerator({
200
- ...props,
201
- list: bottomRight,
202
- itemGenerator
203
- })), bottomLeft && bottomLeft.length > 0 && /*#__PURE__*/react.createElement("div", {
204
- "data-cy": 'viewport-overlay-bottom-left',
205
- className: classnames_default()(overlay, bottomLeftClass)
206
- }, ViewportOverlay_listComponentGenerator({
207
- ...props,
208
- list: bottomLeft,
209
- itemGenerator
210
- })));
211
- };
212
- };
213
- const itemGenerator = props => {
214
- const {
215
- item
216
- } = props;
217
- const {
218
- title,
219
- value: valueFunc,
220
- condition,
221
- contents
222
- } = item;
223
- props.image = {
224
- ...props.image,
225
- ...props.metadata
226
- };
227
- props.formatDate = formatDICOMDate;
228
- props.formatTime = formatDICOMTime;
229
- props.formatPN = formatPN;
230
- props.formatNumberPrecision = formatNumberPrecision;
231
- if (condition && !condition(props)) {
232
- return null;
233
- }
234
- if (!contents && !valueFunc) {
235
- return null;
236
- }
237
- const value = valueFunc && valueFunc(props);
238
- const contentsValue = contents && contents(props) || [{
239
- className: 'mr-1',
240
- value: title
241
- }, {
242
- classname: 'mr-1 font-light',
243
- value
244
- }];
245
- return /*#__PURE__*/React.createElement("div", {
246
- key: item.id,
247
- className: "flex flex-row"
248
- }, contentsValue.map((content, idx) => /*#__PURE__*/React.createElement("span", {
249
- key: idx,
250
- className: content.className
251
- }, content.value)));
252
- };
253
- /* harmony default export */ const ViewportOverlay = (generateFromConfig({}));
254
- // EXTERNAL MODULE: ../../core/src/index.ts + 72 modules
255
- var core_src = __webpack_require__(75186);
256
- // EXTERNAL MODULE: ../../../extensions/default/src/index.ts + 93 modules
257
- var default_src = __webpack_require__(45851);
258
- ;// CONCATENATED MODULE: ../../../extensions/dicom-microscopy/src/utils/dicomWebClient.ts
259
-
260
-
261
-
262
- /**
263
- * create a DICOMwebClient object to be used by Dicom Microscopy Viewer
264
- *
265
- * Referenced the code from `/extensions/default/src/DicomWebDataSource/index.js`
266
- *
267
- * @param param0
268
- * @returns
269
- */
270
- function getDicomWebClient({
271
- extensionManager,
272
- servicesManager
273
- }) {
274
- const dataSourceConfig = window.config.dataSources.find(ds => ds.sourceName === extensionManager.activeDataSource);
275
- const {
276
- userAuthenticationService
277
- } = servicesManager.services;
278
- const {
279
- wadoRoot,
280
- staticWado,
281
- singlepart
282
- } = dataSourceConfig.configuration;
283
- const wadoConfig = {
284
- url: wadoRoot || '/dicomlocal',
285
- staticWado,
286
- singlepart,
287
- headers: userAuthenticationService.getAuthorizationHeader(),
288
- errorInterceptor: core_src/* errorHandler */.r_.getHTTPErrorHandler()
289
- };
290
- const client = new default_src.StaticWadoClient(wadoConfig);
291
- client.wadoURL = wadoConfig.url;
292
- if (extensionManager.activeDataSource === 'dicomlocal') {
293
- /**
294
- * For local data source, override the retrieveInstanceFrames() method of the
295
- * dicomweb-client to retrieve image data from memory cached metadata.
296
- * Other methods of the client doesn't matter, as we are feeding the DMV
297
- * with the series metadata already.
298
- *
299
- * @param {Object} options
300
- * @param {String} options.studyInstanceUID - Study Instance UID
301
- * @param {String} options.seriesInstanceUID - Series Instance UID
302
- * @param {String} options.sopInstanceUID - SOP Instance UID
303
- * @param {String} options.frameNumbers - One-based indices of Frame Items
304
- * @param {Object} [options.queryParams] - HTTP query parameters
305
- * @returns {ArrayBuffer[]} Rendered Frame Items as byte arrays
306
- */
307
- //
308
- client.retrieveInstanceFrames = async options => {
309
- if (!('studyInstanceUID' in options)) {
310
- throw new Error('Study Instance UID is required for retrieval of instance frames');
311
- }
312
- if (!('seriesInstanceUID' in options)) {
313
- throw new Error('Series Instance UID is required for retrieval of instance frames');
314
- }
315
- if (!('sopInstanceUID' in options)) {
316
- throw new Error('SOP Instance UID is required for retrieval of instance frames');
317
- }
318
- if (!('frameNumbers' in options)) {
319
- throw new Error('frame numbers are required for retrieval of instance frames');
320
- }
321
- console.log(`retrieve frames ${options.frameNumbers.toString()} of instance ${options.sopInstanceUID}`);
322
- const instance = core_src.DicomMetadataStore.getInstance(options.studyInstanceUID, options.seriesInstanceUID, options.sopInstanceUID);
323
- const frameNumbers = Array.isArray(options.frameNumbers) ? options.frameNumbers : options.frameNumbers.split(',');
324
- return frameNumbers.map(fr => Array.isArray(instance.PixelData) ? instance.PixelData[+fr - 1] : instance.PixelData);
325
- };
326
- }
327
- return client;
328
- }
329
- // EXTERNAL MODULE: ../../../node_modules/dcmjs/build/dcmjs.es.js
330
- var dcmjs_es = __webpack_require__(31426);
331
- ;// CONCATENATED MODULE: ../../../extensions/dicom-microscopy/src/utils/cleanDenaturalizedDataset.ts
332
-
333
- function isPrimitive(v) {
334
- return !(typeof v == 'object' || Array.isArray(v));
335
- }
336
- const vrNumerics = ['DS', 'FL', 'FD', 'IS', 'OD', 'OF', 'OL', 'OV', 'SL', 'SS', 'SV', 'UL', 'US', 'UV'];
337
-
338
- /**
339
- * Specialized for DICOM JSON format dataset cleaning.
340
- * @param obj
341
- * @returns
342
- */
343
- function cleanDenaturalizedDataset(obj, options) {
344
- if (Array.isArray(obj)) {
345
- const newAry = obj.map(o => isPrimitive(o) ? o : cleanDenaturalizedDataset(o, options));
346
- return newAry;
347
- } else if (isPrimitive(obj)) {
348
- return obj;
349
- } else {
350
- Object.keys(obj).forEach(key => {
351
- if (obj[key].Value === null && obj[key].vr) {
352
- delete obj[key].Value;
353
- } else if (Array.isArray(obj[key].Value) && obj[key].vr) {
354
- if (obj[key].Value.length === 1 && obj[key].Value[0].BulkDataURI) {
355
- default_src.dicomWebUtils.fixBulkDataURI(obj[key].Value[0], options, options.dataSourceConfig);
356
- obj[key].BulkDataURI = obj[key].Value[0].BulkDataURI;
357
-
358
- // prevent mixed-content blockage
359
- if (window.location.protocol === 'https:' && obj[key].BulkDataURI.startsWith('http:')) {
360
- obj[key].BulkDataURI = obj[key].BulkDataURI.replace('http:', 'https:');
361
- }
362
- delete obj[key].Value;
363
- } else if (vrNumerics.includes(obj[key].vr)) {
364
- obj[key].Value = obj[key].Value.map(v => +v);
365
- } else {
366
- obj[key].Value = obj[key].Value.map(entry => cleanDenaturalizedDataset(entry, options));
367
- }
368
- }
369
- });
370
- return obj;
371
- }
372
- }
373
- ;// CONCATENATED MODULE: ../../../extensions/dicom-microscopy/src/DicomMicroscopyViewport.tsx
374
-
375
-
376
-
377
-
378
-
379
-
380
-
381
-
382
- class DicomMicroscopyViewport extends react.Component {
383
- constructor(props) {
384
- super(props);
385
- this.state = {
386
- error: null,
387
- isLoaded: false
388
- };
389
- this.microscopyService = void 0;
390
- this.viewer = null;
391
- // dicom-microscopy-viewer instance
392
- this.managedViewer = null;
393
- // managed wrapper of microscopy-dicom extension
394
- this.container = /*#__PURE__*/react.createRef();
395
- this.overlayElement = /*#__PURE__*/react.createRef();
396
- this.setViewportActiveHandler = () => {
397
- const {
398
- setViewportActive,
399
- viewportId,
400
- activeViewportId
401
- } = this.props;
402
- if (viewportId !== activeViewportId) {
403
- setViewportActive(viewportId);
404
- }
405
- };
406
- const {
407
- microscopyService
408
- } = this.props.servicesManager.services;
409
- this.microscopyService = microscopyService;
410
- }
411
- /**
412
- * Get the nearest ROI from the mouse click point
413
- *
414
- * @param event
415
- * @param autoselect
416
- * @returns
417
- */
418
- getNearbyROI(event, autoselect = true) {
419
- const symbols = Object.getOwnPropertySymbols(this.viewer);
420
- const _drawingSource = symbols.find(p => p.description === 'drawingSource');
421
- const _pyramid = symbols.find(p => p.description === 'pyramid');
422
- const _map = symbols.find(p => p.description === 'map');
423
- const _affine = symbols.find(p => p.description === 'affine');
424
- const feature = this.viewer[_drawingSource].getClosestFeatureToCoordinate(this.viewer[_map].getEventCoordinate(event));
425
- if (!feature) {
426
- return null;
427
- }
428
- const roiAnnotation = this.viewer._getROIFromFeature(feature, this.viewer[_pyramid].metadata, this.viewer[_affine]);
429
- if (roiAnnotation && autoselect) {
430
- this.microscopyService.selectAnnotation(roiAnnotation);
431
- }
432
- return roiAnnotation;
433
- }
434
-
435
- // install the microscopy renderer into the web page.
436
- // you should only do this once.
437
- async installOpenLayersRenderer(container, displaySet) {
438
- const loadViewer = async metadata => {
439
- const {
440
- viewer: DicomMicroscopyViewer,
441
- metadata: metadataUtils
442
- } = await __webpack_require__.e(/* import() | dicom-microscopy-viewer */ 525).then(__webpack_require__.t.bind(__webpack_require__, 95226, 23));
443
- const microscopyViewer = DicomMicroscopyViewer.VolumeImageViewer;
444
- const client = getDicomWebClient({
445
- extensionManager: this.props.extensionManager,
446
- servicesManager: this.props.servicesManager
447
- });
448
-
449
- // Parse, format, and filter metadata
450
- const volumeImages = [];
451
-
452
- /**
453
- * This block of code is the original way of loading DICOM into dicom-microscopy-viewer
454
- * as in their documentation.
455
- * But we have the metadata already loaded by our loaders.
456
- * As the metadata for microscopy DIOM files tends to be big and we don't
457
- * want to double load it, below we have the mechanism to reconstruct the
458
- * DICOM JSON structure (denaturalized) from naturalized metadata.
459
- * (NOTE: Our loaders cache only naturalized metadata, not the denaturalized.)
460
- */
461
- // {
462
- // const retrieveOptions = {
463
- // studyInstanceUID: metadata[0].StudyInstanceUID,
464
- // seriesInstanceUID: metadata[0].SeriesInstanceUID,
465
- // };
466
- // metadata = await client.retrieveSeriesMetadata(retrieveOptions);
467
- // // Parse, format, and filter metadata
468
- // metadata.forEach(m => {
469
- // if (
470
- // volumeImages.length > 0 &&
471
- // m['00200052'].Value[0] != volumeImages[0].FrameOfReferenceUID
472
- // ) {
473
- // console.warn(
474
- // 'Expected FrameOfReferenceUID of difference instances within a series to be the same, found multiple different values',
475
- // m['00200052'].Value[0]
476
- // );
477
- // m['00200052'].Value[0] = volumeImages[0].FrameOfReferenceUID;
478
- // }
479
- // NOTE: depending on different data source, image.ImageType sometimes
480
- // is a string, not a string array.
481
- // m['00080008'] = transformImageTypeUnnaturalized(m['00080008']);
482
-
483
- // const image = new metadataUtils.VLWholeSlideMicroscopyImage({
484
- // metadata: m,
485
- // });
486
- // const imageFlavor = image.ImageType[2];
487
- // if (imageFlavor === 'VOLUME' || imageFlavor === 'THUMBNAIL') {
488
- // volumeImages.push(image);
489
- // }
490
- // });
491
- // }
492
-
493
- metadata.forEach(m => {
494
- // NOTE: depending on different data source, image.ImageType sometimes
495
- // is a string, not a string array.
496
- m.ImageType = typeof m.ImageType === 'string' ? m.ImageType.split('\\') : m.ImageType;
497
- const inst = cleanDenaturalizedDataset(dcmjs_es/* default.data */.Ay.data.DicomMetaDictionary.denaturalizeDataset(m), {
498
- StudyInstanceUID: m.StudyInstanceUID,
499
- SeriesInstanceUID: m.SeriesInstanceUID,
500
- dataSourceConfig: this.props.dataSource.getConfig()
501
- });
502
- if (!inst['00480105']) {
503
- // Optical Path Sequence, no OpticalPathIdentifier?
504
- // NOTE: this is actually a not-well formatted DICOM VL Whole Slide Microscopy Image.
505
- inst['00480105'] = {
506
- vr: 'SQ',
507
- Value: [{
508
- '00480106': {
509
- vr: 'SH',
510
- Value: ['1']
511
- }
512
- }]
513
- };
514
- }
515
- const image = new metadataUtils.VLWholeSlideMicroscopyImage({
516
- metadata: inst
517
- });
518
- const imageFlavor = image.ImageType[2];
519
- if (imageFlavor === 'VOLUME' || imageFlavor === 'THUMBNAIL') {
520
- volumeImages.push(image);
521
- }
522
- });
523
-
524
- // format metadata for microscopy-viewer
525
- const options = {
526
- client,
527
- metadata: volumeImages,
528
- retrieveRendered: false,
529
- controls: ['overview', 'position']
530
- };
531
- this.viewer = new microscopyViewer(options);
532
- if (this.overlayElement && this.overlayElement.current && this.viewer.addViewportOverlay) {
533
- this.viewer.addViewportOverlay({
534
- element: this.overlayElement.current,
535
- coordinates: [0, 0],
536
- // TODO: dicom-microscopy-viewer documentation says this can be false to be automatically, but it is not.
537
- navigate: true,
538
- className: 'OpenLayersOverlay'
539
- });
540
- }
541
- this.viewer.render({
542
- container
543
- });
544
- const {
545
- StudyInstanceUID,
546
- SeriesInstanceUID
547
- } = displaySet;
548
- this.managedViewer = this.microscopyService.addViewer(this.viewer, this.props.viewportId, container, StudyInstanceUID, SeriesInstanceUID);
549
- this.managedViewer.addContextMenuCallback(event => {
550
- // TODO: refactor this after Bill's changes on ContextMenu feature get merged
551
- // const roiAnnotationNearBy = this.getNearbyROI(event);
552
- });
553
- };
554
- this.microscopyService.clearAnnotations();
555
- let smDisplaySet = displaySet;
556
- if (displaySet.Modality === 'SR') {
557
- // for SR displaySet, let's load the actual image displaySet
558
- smDisplaySet = displaySet.getSourceDisplaySet();
559
- }
560
- console.log('Loading viewer metadata', smDisplaySet);
561
- await loadViewer(smDisplaySet.others);
562
- if (displaySet.Modality === 'SR') {
563
- displaySet.load(smDisplaySet);
564
- }
565
- }
566
- componentDidMount() {
567
- const {
568
- displaySets,
569
- viewportOptions
570
- } = this.props;
571
- // Todo-rename: this is always getting the 0
572
- const displaySet = displaySets[0];
573
- this.installOpenLayersRenderer(this.container.current, displaySet).then(() => {
574
- this.setState({
575
- isLoaded: true
576
- });
577
- });
578
- }
579
- componentDidUpdate(prevProps, prevState, snapshot) {
580
- if (this.managedViewer && prevProps.displaySets !== this.props.displaySets) {
581
- const {
582
- displaySets
583
- } = this.props;
584
- const displaySet = displaySets[0];
585
- this.microscopyService.clearAnnotations();
586
-
587
- // loading SR
588
- if (displaySet.Modality === 'SR') {
589
- const referencedDisplaySet = displaySet.getSourceDisplaySet();
590
- displaySet.load(referencedDisplaySet);
591
- }
592
- }
593
- }
594
- componentWillUnmount() {
595
- this.microscopyService.removeViewer(this.viewer);
596
- }
597
- render() {
598
- const style = {
599
- width: '100%',
600
- height: '100%'
601
- };
602
- const displaySet = this.props.displaySets[0];
603
- const firstInstance = displaySet.firstInstance || displaySet.instance;
604
- return /*#__PURE__*/react.createElement("div", {
605
- className: 'DicomMicroscopyViewer',
606
- style: style,
607
- onClick: this.setViewportActiveHandler
608
- }, /*#__PURE__*/react.createElement("div", {
609
- style: {
610
- ...style,
611
- display: 'none'
612
- }
613
- }, /*#__PURE__*/react.createElement("div", {
614
- style: {
615
- ...style
616
- },
617
- ref: this.overlayElement
618
- }, /*#__PURE__*/react.createElement("div", {
619
- style: {
620
- position: 'relative',
621
- height: '100%',
622
- width: '100%'
623
- }
624
- }, displaySet && firstInstance.imageId && /*#__PURE__*/react.createElement(ViewportOverlay, {
625
- displaySet: displaySet,
626
- instance: displaySet.instance,
627
- metadata: displaySet.metadata
628
- })))), this.state.error ? /*#__PURE__*/react.createElement("h2", null, JSON.stringify(this.state.error)) : /*#__PURE__*/react.createElement("div", {
629
- style: style,
630
- ref: ref => {
631
- this.container.current = ref;
632
- this.props.resizeRef.current = ref;
633
- }
634
- }), this.state.isLoaded ? null : /*#__PURE__*/react.createElement(src/* LoadingIndicatorProgress */.Jx, {
635
- className: 'h-full w-full bg-black'
636
- }));
637
- }
638
- }
639
- DicomMicroscopyViewport.propTypes = {
640
- viewportData: (prop_types_default()).object,
641
- activeViewportId: (prop_types_default()).string,
642
- setViewportActive: (prop_types_default()).func,
643
- // props from OHIF Viewport Grid
644
- displaySets: (prop_types_default()).array,
645
- viewportId: (prop_types_default()).string,
646
- viewportLabel: (prop_types_default()).string,
647
- dataSource: (prop_types_default()).object,
648
- viewportOptions: (prop_types_default()).object,
649
- displaySetOptions: (prop_types_default()).array,
650
- // other props from wrapping component
651
- servicesManager: (prop_types_default()).object,
652
- extensionManager: (prop_types_default()).object,
653
- commandsManager: (prop_types_default()).object,
654
- resizeRef: prop_types_default().oneOfType([(prop_types_default()).func, prop_types_default().shape({
655
- current: (prop_types_default()).any
656
- })])
657
- };
658
- /* harmony default export */ const src_DicomMicroscopyViewport = (DicomMicroscopyViewport);
659
-
660
- /***/ })
661
-
662
- }]);
Binary file
Binary file