@ohif/app 3.7.0-beta.79 → 3.7.0-beta.80
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/{128.bundle.d4536952e6eda267cb5a.js → 128.bundle.5198a2266456afecd420.js} +37 -55
- package/dist/{181.bundle.9a76ce585a7139d4862f.js → 181.bundle.fa57199595cf28f44c7b.js} +3 -3
- package/dist/{30.bundle.16bfc3a374fc4eda5ffc.js → 19.bundle.75ec1ec14786e136b7b3.js} +114 -260
- package/dist/19.css +1 -0
- package/dist/{202.bundle.6c3b5e9f37d88388e5c8.js → 202.bundle.96bbb4547a346fe3921f.js} +3 -3
- package/dist/221.bundle.8a81cea315fa7697c0e0.js +1722 -0
- package/dist/221.css +2 -0
- package/dist/{236.bundle.2386ed58739fdbdd53f8.js → 236.bundle.d2da6d1991e1229bf913.js} +11 -16
- package/dist/{250.bundle.77985c008fc579308ca9.js → 250.bundle.36909d7bc681d66087d1.js} +4 -4
- package/dist/{90.bundle.1d113c4a201e850c98c0.js → 342.bundle.70da5239bd664aa5d41a.js} +408 -152
- package/dist/{348.bundle.343c39a8c96a044b0fe2.js → 348.bundle.8c5b950d30e5aa992290.js} +45 -56
- package/dist/{359.bundle.2618db789083f7d3007d.js → 359.bundle.d2a3abe1a5cd3ca3cd8e.js} +36 -115
- package/dist/{410.bundle.5cc4909f3c608350a71e.js → 410.bundle.be538faa9c7fad92189b.js} +3 -4
- package/dist/{451.bundle.aaabf094eb8fa67da819.js → 451.bundle.dc0d14c3724464cca2bf.js} +27 -19
- package/dist/{471.bundle.953dacdccd46028efba7.js → 471.bundle.2206d4c0ac2ad0df2362.js} +26 -19
- package/dist/{506.bundle.c0258b1d7299fdb7628e.js → 506.bundle.97e53732423192fee818.js} +1 -75
- package/dist/{677.bundle.ec5f2b4707db33bd4d8e.js → 530.bundle.a03b6f942ace3e1baa1e.js} +5 -10
- package/dist/613.bundle.549d71231abfed24a2dc.js +532 -0
- package/dist/{754.bundle.6618bdd7f648b532c682.js → 754.bundle.e3ce6855d8d4d187f224.js} +36 -46
- package/dist/{777.bundle.82a7cc23a7b6a8bd12fa.js → 777.bundle.ae3fdb8a470caecc0c6a.js} +2 -2
- package/dist/{782.bundle.6fa60a24d3d4ad76c8db.js → 782.bundle.ee8dba2e8582b55cb38d.js} +7 -7
- package/dist/{822.bundle.4767349eb43b79145b3e.js → 822.bundle.5fca45a4f40f5259aec5.js} +2 -2
- package/dist/831.bundle.83658f62fcc769043605.js +16700 -0
- package/dist/{886.bundle.7ee671b1d5656455d067.js → 886.bundle.a9de117c3a42b7907cf6.js} +2 -2
- package/dist/{967.bundle.ab062b0b325bed3b9af9.js → 967.bundle.cce1d004b2ff178b1a8e.js} +242 -101
- package/dist/app-config.js +1 -5
- package/dist/{app.bundle.adf312c193d56262fa41.js → app.bundle.681f66ab37cef811e68b.js} +21839 -18707
- package/dist/app.bundle.css +8 -7
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +19 -19
- package/dist/150.bundle.1fff6b0c3496b6367f58.js +0 -742
- /package/dist/{12.bundle.653904a1682368c34d6b.js → 12.bundle.4a052141b46dec16862d.js} +0 -0
- /package/dist/{125.bundle.aeaad798561853bf6939.js → 125.bundle.253395f320b72180da63.js} +0 -0
- /package/dist/{281.bundle.fbb8c83b343a6903d529.js → 281.bundle.21a9e3178ddebe01b958.js} +0 -0
- /package/dist/{417.bundle.6cadc61b8a455776de31.js → 417.bundle.af0a207c29b109f84159.js} +0 -0
- /package/dist/{663.bundle.5175469e25c5196a739c.js → 663.bundle.b0f98b6e7221b1b9cf6a.js} +0 -0
- /package/dist/{686.bundle.b3dbf84eefbef768843f.js → 686.bundle.dccef1f36e4bc79bcc48.js} +0 -0
- /package/dist/{687.bundle.60d3856e6e77c027c174.js → 687.bundle.ab0ffdccae4610b00224.js} +0 -0
- /package/dist/{814.bundle.ba4f6267b43f8dbc803f.js → 814.bundle.eec4458e893e6055f0fc.js} +0 -0
|
@@ -1,742 +0,0 @@
|
|
|
1
|
-
(self["webpackChunk"] = self["webpackChunk"] || []).push([[150],{
|
|
2
|
-
|
|
3
|
-
/***/ 48228:
|
|
4
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
5
|
-
|
|
6
|
-
"use strict";
|
|
7
|
-
// ESM COMPAT FLAG
|
|
8
|
-
__webpack_require__.r(__webpack_exports__);
|
|
9
|
-
|
|
10
|
-
// EXPORTS
|
|
11
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
12
|
-
"default": () => (/* binding */ cornerstone_dicom_seg_src),
|
|
13
|
-
hydrateSEGDisplaySet: () => (/* reexport */ _hydrateSEG/* default */.Z)
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-seg/package.json
|
|
17
|
-
const package_namespaceObject = JSON.parse('{"u2":"@ohif/extension-cornerstone-dicom-seg"}');
|
|
18
|
-
;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-seg/src/id.js
|
|
19
|
-
|
|
20
|
-
const id = package_namespaceObject.u2;
|
|
21
|
-
const SOPClassHandlerName = 'dicom-seg';
|
|
22
|
-
const SOPClassHandlerId = `${id}.sopClassHandlerModule.${SOPClassHandlerName}`;
|
|
23
|
-
|
|
24
|
-
// EXTERNAL MODULE: ../../../node_modules/react/index.js
|
|
25
|
-
var react = __webpack_require__(43001);
|
|
26
|
-
// EXTERNAL MODULE: ../../core/src/index.ts + 75 modules
|
|
27
|
-
var src = __webpack_require__(34491);
|
|
28
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 337 modules
|
|
29
|
-
var esm = __webpack_require__(45754);
|
|
30
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/adapters/dist/adapters.es.js
|
|
31
|
-
var adapters_es = __webpack_require__(91202);
|
|
32
|
-
// EXTERNAL MODULE: ../../../node_modules/dcmjs/build/dcmjs.es.js
|
|
33
|
-
var dcmjs_es = __webpack_require__(67540);
|
|
34
|
-
;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-seg/src/utils/dicomlabToRGB.ts
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Converts a CIELAB color to an RGB color using the dcmjs library.
|
|
39
|
-
* @param cielab - The CIELAB color to convert.
|
|
40
|
-
* @returns The RGB color as an array of three integers between 0 and 255.
|
|
41
|
-
*/
|
|
42
|
-
function dicomlabToRGB(cielab) {
|
|
43
|
-
const rgb = dcmjs_es["default"].data.Colors.dicomlab2RGB(cielab).map(x => Math.round(x * 255));
|
|
44
|
-
return rgb;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-seg/src/getSopClassHandlerModule.js
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const sopClassUids = ['1.2.840.10008.5.1.4.1.1.66.4'];
|
|
54
|
-
let loadPromises = {};
|
|
55
|
-
function _getDisplaySetsFromSeries(instances, servicesManager, extensionManager) {
|
|
56
|
-
const instance = instances[0];
|
|
57
|
-
const {
|
|
58
|
-
StudyInstanceUID,
|
|
59
|
-
SeriesInstanceUID,
|
|
60
|
-
SOPInstanceUID,
|
|
61
|
-
SeriesDescription,
|
|
62
|
-
SeriesNumber,
|
|
63
|
-
SeriesDate,
|
|
64
|
-
SOPClassUID,
|
|
65
|
-
wadoRoot,
|
|
66
|
-
wadoUri,
|
|
67
|
-
wadoUriRoot
|
|
68
|
-
} = instance;
|
|
69
|
-
const displaySet = {
|
|
70
|
-
Modality: 'SEG',
|
|
71
|
-
loading: false,
|
|
72
|
-
isReconstructable: true,
|
|
73
|
-
// by default for now since it is a volumetric SEG currently
|
|
74
|
-
displaySetInstanceUID: src.utils.guid(),
|
|
75
|
-
SeriesDescription,
|
|
76
|
-
SeriesNumber,
|
|
77
|
-
SeriesDate,
|
|
78
|
-
SOPInstanceUID,
|
|
79
|
-
SeriesInstanceUID,
|
|
80
|
-
StudyInstanceUID,
|
|
81
|
-
SOPClassHandlerId: SOPClassHandlerId,
|
|
82
|
-
SOPClassUID,
|
|
83
|
-
referencedImages: null,
|
|
84
|
-
referencedSeriesInstanceUID: null,
|
|
85
|
-
referencedDisplaySetInstanceUID: null,
|
|
86
|
-
isDerivedDisplaySet: true,
|
|
87
|
-
isLoaded: false,
|
|
88
|
-
isHydrated: false,
|
|
89
|
-
segments: {},
|
|
90
|
-
sopClassUids,
|
|
91
|
-
instance,
|
|
92
|
-
instances: [instance],
|
|
93
|
-
wadoRoot,
|
|
94
|
-
wadoUriRoot,
|
|
95
|
-
wadoUri,
|
|
96
|
-
isOverlayDisplaySet: true
|
|
97
|
-
};
|
|
98
|
-
const referencedSeriesSequence = instance.ReferencedSeriesSequence;
|
|
99
|
-
if (!referencedSeriesSequence) {
|
|
100
|
-
throw new Error('ReferencedSeriesSequence is missing for the SEG');
|
|
101
|
-
}
|
|
102
|
-
const referencedSeries = referencedSeriesSequence[0];
|
|
103
|
-
displaySet.referencedImages = instance.ReferencedSeriesSequence.ReferencedInstanceSequence;
|
|
104
|
-
displaySet.referencedSeriesInstanceUID = referencedSeries.SeriesInstanceUID;
|
|
105
|
-
displaySet.getReferenceDisplaySet = () => {
|
|
106
|
-
const {
|
|
107
|
-
displaySetService
|
|
108
|
-
} = servicesManager.services;
|
|
109
|
-
const referencedDisplaySets = displaySetService.getDisplaySetsForSeries(displaySet.referencedSeriesInstanceUID);
|
|
110
|
-
if (!referencedDisplaySets || referencedDisplaySets.length === 0) {
|
|
111
|
-
throw new Error('Referenced DisplaySet is missing for the SEG');
|
|
112
|
-
}
|
|
113
|
-
const referencedDisplaySet = referencedDisplaySets[0];
|
|
114
|
-
displaySet.referencedDisplaySetInstanceUID = referencedDisplaySet.displaySetInstanceUID;
|
|
115
|
-
|
|
116
|
-
// Todo: this needs to be able to work with other reference volumes (other than streaming) such as nifti, etc.
|
|
117
|
-
displaySet.referencedVolumeURI = referencedDisplaySet.displaySetInstanceUID;
|
|
118
|
-
const referencedVolumeId = `cornerstoneStreamingImageVolume:${displaySet.referencedVolumeURI}`;
|
|
119
|
-
displaySet.referencedVolumeId = referencedVolumeId;
|
|
120
|
-
return referencedDisplaySet;
|
|
121
|
-
};
|
|
122
|
-
displaySet.load = async _ref => {
|
|
123
|
-
let {
|
|
124
|
-
headers
|
|
125
|
-
} = _ref;
|
|
126
|
-
return await _load(displaySet, servicesManager, extensionManager, headers);
|
|
127
|
-
};
|
|
128
|
-
return [displaySet];
|
|
129
|
-
}
|
|
130
|
-
function _load(segDisplaySet, servicesManager, extensionManager, headers) {
|
|
131
|
-
const {
|
|
132
|
-
SOPInstanceUID
|
|
133
|
-
} = segDisplaySet;
|
|
134
|
-
const {
|
|
135
|
-
segmentationService
|
|
136
|
-
} = servicesManager.services;
|
|
137
|
-
if ((segDisplaySet.loading || segDisplaySet.isLoaded) && loadPromises[SOPInstanceUID] && _segmentationExists(segDisplaySet, segmentationService)) {
|
|
138
|
-
return loadPromises[SOPInstanceUID];
|
|
139
|
-
}
|
|
140
|
-
segDisplaySet.loading = true;
|
|
141
|
-
|
|
142
|
-
// We don't want to fire multiple loads, so we'll wait for the first to finish
|
|
143
|
-
// and also return the same promise to any other callers.
|
|
144
|
-
loadPromises[SOPInstanceUID] = new Promise(async (resolve, reject) => {
|
|
145
|
-
if (!segDisplaySet.segments || Object.keys(segDisplaySet.segments).length === 0) {
|
|
146
|
-
await _loadSegments({
|
|
147
|
-
extensionManager,
|
|
148
|
-
servicesManager,
|
|
149
|
-
segDisplaySet,
|
|
150
|
-
headers
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
const suppressEvents = true;
|
|
154
|
-
segmentationService.createSegmentationForSEGDisplaySet(segDisplaySet, null, suppressEvents).then(() => {
|
|
155
|
-
segDisplaySet.loading = false;
|
|
156
|
-
resolve();
|
|
157
|
-
}).catch(error => {
|
|
158
|
-
segDisplaySet.loading = false;
|
|
159
|
-
reject(error);
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
return loadPromises[SOPInstanceUID];
|
|
163
|
-
}
|
|
164
|
-
async function _loadSegments(_ref2) {
|
|
165
|
-
let {
|
|
166
|
-
extensionManager,
|
|
167
|
-
servicesManager,
|
|
168
|
-
segDisplaySet,
|
|
169
|
-
headers
|
|
170
|
-
} = _ref2;
|
|
171
|
-
const utilityModule = extensionManager.getModuleEntry('@ohif/extension-cornerstone.utilityModule.common');
|
|
172
|
-
const {
|
|
173
|
-
segmentationService
|
|
174
|
-
} = servicesManager.services;
|
|
175
|
-
const {
|
|
176
|
-
dicomLoaderService
|
|
177
|
-
} = utilityModule.exports;
|
|
178
|
-
const arrayBuffer = await dicomLoaderService.findDicomDataPromise(segDisplaySet, null, headers);
|
|
179
|
-
const cachedReferencedVolume = esm.cache.getVolume(segDisplaySet.referencedVolumeId);
|
|
180
|
-
if (!cachedReferencedVolume) {
|
|
181
|
-
throw new Error('Referenced Volume is missing for the SEG, and stack viewport SEG is not supported yet');
|
|
182
|
-
}
|
|
183
|
-
const {
|
|
184
|
-
imageIds
|
|
185
|
-
} = cachedReferencedVolume;
|
|
186
|
-
|
|
187
|
-
// Todo: what should be defaults here
|
|
188
|
-
const tolerance = 0.001;
|
|
189
|
-
const skipOverlapping = true;
|
|
190
|
-
esm.eventTarget.addEventListener(adapters_es/* Enums */.Yb.Events.SEGMENTATION_LOAD_PROGRESS, evt => {
|
|
191
|
-
const {
|
|
192
|
-
percentComplete
|
|
193
|
-
} = evt.detail;
|
|
194
|
-
segmentationService._broadcastEvent(segmentationService.EVENTS.SEGMENT_LOADING_COMPLETE, {
|
|
195
|
-
percentComplete
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
const results = await adapters_es/* adaptersSEG */.ok.Cornerstone3D.Segmentation.generateToolState(imageIds, arrayBuffer, esm.metaData, {
|
|
199
|
-
skipOverlapping,
|
|
200
|
-
tolerance,
|
|
201
|
-
eventTarget: esm.eventTarget,
|
|
202
|
-
triggerEvent: esm.triggerEvent
|
|
203
|
-
});
|
|
204
|
-
results.segMetadata.data.forEach((data, i) => {
|
|
205
|
-
if (i > 0) {
|
|
206
|
-
data.rgba = dicomlabToRGB(data.RecommendedDisplayCIELabValue);
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
Object.assign(segDisplaySet, results);
|
|
210
|
-
}
|
|
211
|
-
function _segmentationExists(segDisplaySet, segmentationService) {
|
|
212
|
-
// This should be abstracted with the CornerstoneCacheService
|
|
213
|
-
return segmentationService.getSegmentation(segDisplaySet.displaySetInstanceUID);
|
|
214
|
-
}
|
|
215
|
-
function getSopClassHandlerModule(_ref3) {
|
|
216
|
-
let {
|
|
217
|
-
servicesManager,
|
|
218
|
-
extensionManager
|
|
219
|
-
} = _ref3;
|
|
220
|
-
const getDisplaySetsFromSeries = instances => {
|
|
221
|
-
return _getDisplaySetsFromSeries(instances, servicesManager, extensionManager);
|
|
222
|
-
};
|
|
223
|
-
return [{
|
|
224
|
-
name: 'dicom-seg',
|
|
225
|
-
sopClassUids,
|
|
226
|
-
getDisplaySetsFromSeries
|
|
227
|
-
}];
|
|
228
|
-
}
|
|
229
|
-
/* harmony default export */ const src_getSopClassHandlerModule = (getSopClassHandlerModule);
|
|
230
|
-
// EXTERNAL MODULE: ../../../node_modules/prop-types/index.js
|
|
231
|
-
var prop_types = __webpack_require__(3827);
|
|
232
|
-
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
|
|
233
|
-
// EXTERNAL MODULE: ../../ui/src/index.js + 458 modules
|
|
234
|
-
var ui_src = __webpack_require__(88344);
|
|
235
|
-
;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-seg/src/panels/callInputDialog.tsx
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
function callInputDialog(uiDialogService, label, callback) {
|
|
239
|
-
const dialogId = 'enter-segment-label';
|
|
240
|
-
const onSubmitHandler = _ref => {
|
|
241
|
-
let {
|
|
242
|
-
action,
|
|
243
|
-
value
|
|
244
|
-
} = _ref;
|
|
245
|
-
switch (action.id) {
|
|
246
|
-
case 'save':
|
|
247
|
-
callback(value.label, action.id);
|
|
248
|
-
break;
|
|
249
|
-
case 'cancel':
|
|
250
|
-
callback('', action.id);
|
|
251
|
-
break;
|
|
252
|
-
}
|
|
253
|
-
uiDialogService.dismiss({
|
|
254
|
-
id: dialogId
|
|
255
|
-
});
|
|
256
|
-
};
|
|
257
|
-
if (uiDialogService) {
|
|
258
|
-
uiDialogService.create({
|
|
259
|
-
id: dialogId,
|
|
260
|
-
centralize: true,
|
|
261
|
-
isDraggable: false,
|
|
262
|
-
showOverlay: true,
|
|
263
|
-
content: ui_src/* Dialog */.Vq,
|
|
264
|
-
contentProps: {
|
|
265
|
-
title: 'Segment',
|
|
266
|
-
value: {
|
|
267
|
-
label
|
|
268
|
-
},
|
|
269
|
-
noCloseButton: true,
|
|
270
|
-
onClose: () => uiDialogService.dismiss({
|
|
271
|
-
id: dialogId
|
|
272
|
-
}),
|
|
273
|
-
actions: [{
|
|
274
|
-
id: 'cancel',
|
|
275
|
-
text: 'Cancel',
|
|
276
|
-
type: ui_src/* ButtonEnums.type */.LZ.U.secondary
|
|
277
|
-
}, {
|
|
278
|
-
id: 'save',
|
|
279
|
-
text: 'Confirm',
|
|
280
|
-
type: ui_src/* ButtonEnums.type */.LZ.U.primary
|
|
281
|
-
}],
|
|
282
|
-
onSubmit: onSubmitHandler,
|
|
283
|
-
body: _ref2 => {
|
|
284
|
-
let {
|
|
285
|
-
value,
|
|
286
|
-
setValue
|
|
287
|
-
} = _ref2;
|
|
288
|
-
return /*#__PURE__*/react.createElement(ui_src/* Input */.II, {
|
|
289
|
-
label: "Enter the segment label",
|
|
290
|
-
labelClassName: "text-white text-[14px] leading-[1.2]",
|
|
291
|
-
autoFocus: true,
|
|
292
|
-
className: "border-primary-main bg-black",
|
|
293
|
-
type: "text",
|
|
294
|
-
value: value.label,
|
|
295
|
-
onChange: event => {
|
|
296
|
-
event.persist();
|
|
297
|
-
setValue(value => ({
|
|
298
|
-
...value,
|
|
299
|
-
label: event.target.value
|
|
300
|
-
}));
|
|
301
|
-
},
|
|
302
|
-
onKeyPress: event => {
|
|
303
|
-
if (event.key === 'Enter') {
|
|
304
|
-
onSubmitHandler({
|
|
305
|
-
value,
|
|
306
|
-
action: {
|
|
307
|
-
id: 'save'
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
/* harmony default export */ const panels_callInputDialog = (callInputDialog);
|
|
319
|
-
// EXTERNAL MODULE: ./state/index.js + 1 modules
|
|
320
|
-
var state = __webpack_require__(62657);
|
|
321
|
-
// EXTERNAL MODULE: ../../../node_modules/react-i18next/dist/es/index.js + 15 modules
|
|
322
|
-
var es = __webpack_require__(69190);
|
|
323
|
-
;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-seg/src/panels/PanelSegmentation.tsx
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
function PanelSegmentation(_ref) {
|
|
331
|
-
let {
|
|
332
|
-
servicesManager,
|
|
333
|
-
commandsManager
|
|
334
|
-
} = _ref;
|
|
335
|
-
const {
|
|
336
|
-
segmentationService,
|
|
337
|
-
uiDialogService
|
|
338
|
-
} = servicesManager.services;
|
|
339
|
-
const [appConfig] = (0,state/* useAppConfig */.M)();
|
|
340
|
-
const disableEditing = appConfig?.disableEditing;
|
|
341
|
-
const {
|
|
342
|
-
t
|
|
343
|
-
} = (0,es/* useTranslation */.$G)('PanelSegmentation');
|
|
344
|
-
const [selectedSegmentationId, setSelectedSegmentationId] = (0,react.useState)(null);
|
|
345
|
-
const [segmentationConfiguration, setSegmentationConfiguration] = (0,react.useState)(segmentationService.getConfiguration());
|
|
346
|
-
const [segmentations, setSegmentations] = (0,react.useState)(() => segmentationService.getSegmentations());
|
|
347
|
-
const [isMinimized, setIsMinimized] = (0,react.useState)({});
|
|
348
|
-
const onToggleMinimizeSegmentation = (0,react.useCallback)(id => {
|
|
349
|
-
setIsMinimized(prevState => ({
|
|
350
|
-
...prevState,
|
|
351
|
-
[id]: !prevState[id]
|
|
352
|
-
}));
|
|
353
|
-
}, [setIsMinimized]);
|
|
354
|
-
|
|
355
|
-
// Only expand the last segmentation added to the list and collapse the rest
|
|
356
|
-
(0,react.useEffect)(() => {
|
|
357
|
-
const lastSegmentationId = segmentations[segmentations.length - 1]?.id;
|
|
358
|
-
if (lastSegmentationId) {
|
|
359
|
-
setIsMinimized(prevState => ({
|
|
360
|
-
...prevState,
|
|
361
|
-
[lastSegmentationId]: false
|
|
362
|
-
}));
|
|
363
|
-
}
|
|
364
|
-
}, [segmentations, setIsMinimized]);
|
|
365
|
-
(0,react.useEffect)(() => {
|
|
366
|
-
// ~~ Subscription
|
|
367
|
-
const added = segmentationService.EVENTS.SEGMENTATION_ADDED;
|
|
368
|
-
const updated = segmentationService.EVENTS.SEGMENTATION_UPDATED;
|
|
369
|
-
const removed = segmentationService.EVENTS.SEGMENTATION_REMOVED;
|
|
370
|
-
const subscriptions = [];
|
|
371
|
-
[added, updated, removed].forEach(evt => {
|
|
372
|
-
const {
|
|
373
|
-
unsubscribe
|
|
374
|
-
} = segmentationService.subscribe(evt, () => {
|
|
375
|
-
const segmentations = segmentationService.getSegmentations();
|
|
376
|
-
setSegmentations(segmentations);
|
|
377
|
-
setSegmentationConfiguration(segmentationService.getConfiguration());
|
|
378
|
-
});
|
|
379
|
-
subscriptions.push(unsubscribe);
|
|
380
|
-
});
|
|
381
|
-
return () => {
|
|
382
|
-
subscriptions.forEach(unsub => {
|
|
383
|
-
unsub();
|
|
384
|
-
});
|
|
385
|
-
};
|
|
386
|
-
}, []);
|
|
387
|
-
const onSegmentationClick = segmentationId => {
|
|
388
|
-
segmentationService.setActiveSegmentationForToolGroup(segmentationId);
|
|
389
|
-
};
|
|
390
|
-
const onSegmentationDelete = segmentationId => {
|
|
391
|
-
segmentationService.remove(segmentationId);
|
|
392
|
-
};
|
|
393
|
-
const getToolGroupIds = segmentationId => {
|
|
394
|
-
const toolGroupIds = segmentationService.getToolGroupIdsWithSegmentation(segmentationId);
|
|
395
|
-
return toolGroupIds;
|
|
396
|
-
};
|
|
397
|
-
const onSegmentClick = (segmentationId, segmentIndex) => {
|
|
398
|
-
segmentationService.setActiveSegmentForSegmentation(segmentationId, segmentIndex);
|
|
399
|
-
const toolGroupIds = getToolGroupIds(segmentationId);
|
|
400
|
-
toolGroupIds.forEach(toolGroupId => {
|
|
401
|
-
// const toolGroupId =
|
|
402
|
-
segmentationService.setActiveSegmentationForToolGroup(segmentationId, toolGroupId);
|
|
403
|
-
segmentationService.jumpToSegmentCenter(segmentationId, segmentIndex, toolGroupId);
|
|
404
|
-
});
|
|
405
|
-
};
|
|
406
|
-
const onSegmentEdit = (segmentationId, segmentIndex) => {
|
|
407
|
-
const segmentation = segmentationService.getSegmentation(segmentationId);
|
|
408
|
-
const segment = segmentation.segments[segmentIndex];
|
|
409
|
-
const {
|
|
410
|
-
label
|
|
411
|
-
} = segment;
|
|
412
|
-
panels_callInputDialog(uiDialogService, label, (label, actionId) => {
|
|
413
|
-
if (label === '') {
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
segmentationService.setSegmentLabelForSegmentation(segmentationId, segmentIndex, label);
|
|
417
|
-
});
|
|
418
|
-
};
|
|
419
|
-
const onSegmentationEdit = segmentationId => {
|
|
420
|
-
const segmentation = segmentationService.getSegmentation(segmentationId);
|
|
421
|
-
const {
|
|
422
|
-
label
|
|
423
|
-
} = segmentation;
|
|
424
|
-
panels_callInputDialog(uiDialogService, label, (label, actionId) => {
|
|
425
|
-
if (label === '') {
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
segmentationService.addOrUpdateSegmentation({
|
|
429
|
-
id: segmentationId,
|
|
430
|
-
label
|
|
431
|
-
}, false,
|
|
432
|
-
// suppress event
|
|
433
|
-
true // notYetUpdatedAtSource
|
|
434
|
-
);
|
|
435
|
-
});
|
|
436
|
-
};
|
|
437
|
-
|
|
438
|
-
const onSegmentColorClick = (segmentationId, segmentIndex) => {
|
|
439
|
-
// Todo: Implement color picker later
|
|
440
|
-
return;
|
|
441
|
-
};
|
|
442
|
-
const onSegmentDelete = (segmentationId, segmentIndex) => {
|
|
443
|
-
// segmentationService.removeSegmentFromSegmentation(
|
|
444
|
-
// segmentationId,
|
|
445
|
-
// segmentIndex
|
|
446
|
-
// );
|
|
447
|
-
console.warn('not implemented yet');
|
|
448
|
-
};
|
|
449
|
-
const onToggleSegmentVisibility = (segmentationId, segmentIndex) => {
|
|
450
|
-
const segmentation = segmentationService.getSegmentation(segmentationId);
|
|
451
|
-
const segmentInfo = segmentation.segments[segmentIndex];
|
|
452
|
-
const isVisible = !segmentInfo.isVisible;
|
|
453
|
-
const toolGroupIds = getToolGroupIds(segmentationId);
|
|
454
|
-
|
|
455
|
-
// Todo: right now we apply the visibility to all tool groups
|
|
456
|
-
toolGroupIds.forEach(toolGroupId => {
|
|
457
|
-
segmentationService.setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId);
|
|
458
|
-
});
|
|
459
|
-
};
|
|
460
|
-
const onToggleSegmentationVisibility = segmentationId => {
|
|
461
|
-
segmentationService.toggleSegmentationVisibility(segmentationId);
|
|
462
|
-
};
|
|
463
|
-
const _setSegmentationConfiguration = (0,react.useCallback)((segmentationId, key, value) => {
|
|
464
|
-
segmentationService.setConfiguration({
|
|
465
|
-
segmentationId,
|
|
466
|
-
[key]: value
|
|
467
|
-
});
|
|
468
|
-
}, [segmentationService]);
|
|
469
|
-
return /*#__PURE__*/react.createElement("div", {
|
|
470
|
-
className: "mt-1 flex min-h-0 flex-auto flex-col justify-between"
|
|
471
|
-
}, segmentations?.length ? /*#__PURE__*/react.createElement(ui_src/* SegmentationGroupTable */.cX, {
|
|
472
|
-
title: t('Segmentations'),
|
|
473
|
-
showAddSegmentation: false,
|
|
474
|
-
segmentations: segmentations,
|
|
475
|
-
isMinimized: isMinimized,
|
|
476
|
-
activeSegmentationId: selectedSegmentationId || '',
|
|
477
|
-
onSegmentationClick: onSegmentationClick,
|
|
478
|
-
onSegmentationDelete: onSegmentationDelete,
|
|
479
|
-
onSegmentationEdit: onSegmentationEdit,
|
|
480
|
-
onSegmentClick: onSegmentClick,
|
|
481
|
-
onSegmentEdit: onSegmentEdit,
|
|
482
|
-
disableEditing: disableEditing,
|
|
483
|
-
onSegmentColorClick: onSegmentColorClick,
|
|
484
|
-
onSegmentDelete: onSegmentDelete,
|
|
485
|
-
onToggleSegmentVisibility: onToggleSegmentVisibility,
|
|
486
|
-
onToggleSegmentationVisibility: onToggleSegmentationVisibility,
|
|
487
|
-
onToggleMinimizeSegmentation: onToggleMinimizeSegmentation,
|
|
488
|
-
segmentationConfig: {
|
|
489
|
-
initialConfig: segmentationConfiguration
|
|
490
|
-
},
|
|
491
|
-
setRenderOutline: value => _setSegmentationConfiguration(selectedSegmentationId, 'renderOutline', value),
|
|
492
|
-
setOutlineOpacityActive: value => _setSegmentationConfiguration(selectedSegmentationId, 'outlineOpacity', value),
|
|
493
|
-
setRenderFill: value => _setSegmentationConfiguration(selectedSegmentationId, 'renderFill', value),
|
|
494
|
-
setRenderInactiveSegmentations: value => _setSegmentationConfiguration(selectedSegmentationId, 'renderInactiveSegmentations', value),
|
|
495
|
-
setOutlineWidthActive: value => _setSegmentationConfiguration(selectedSegmentationId, 'outlineWidthActive', value),
|
|
496
|
-
setFillAlpha: value => _setSegmentationConfiguration(selectedSegmentationId, 'fillAlpha', value),
|
|
497
|
-
setFillAlphaInactive: value => _setSegmentationConfiguration(selectedSegmentationId, 'fillAlphaInactive', value)
|
|
498
|
-
}) : null);
|
|
499
|
-
}
|
|
500
|
-
PanelSegmentation.propTypes = {
|
|
501
|
-
commandsManager: prop_types_default().shape({
|
|
502
|
-
runCommand: (prop_types_default()).func.isRequired
|
|
503
|
-
}),
|
|
504
|
-
servicesManager: prop_types_default().shape({
|
|
505
|
-
services: prop_types_default().shape({
|
|
506
|
-
segmentationService: prop_types_default().shape({
|
|
507
|
-
getSegmentation: (prop_types_default()).func.isRequired,
|
|
508
|
-
getSegmentations: (prop_types_default()).func.isRequired,
|
|
509
|
-
toggleSegmentationVisibility: (prop_types_default()).func.isRequired,
|
|
510
|
-
subscribe: (prop_types_default()).func.isRequired,
|
|
511
|
-
EVENTS: (prop_types_default()).object.isRequired
|
|
512
|
-
}).isRequired
|
|
513
|
-
}).isRequired
|
|
514
|
-
}).isRequired
|
|
515
|
-
};
|
|
516
|
-
;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-seg/src/getHangingProtocolModule.ts
|
|
517
|
-
const segProtocol = {
|
|
518
|
-
id: '@ohif/seg',
|
|
519
|
-
// Don't store this hanging protocol as it applies to the currently active
|
|
520
|
-
// display set by default
|
|
521
|
-
// cacheId: null,
|
|
522
|
-
name: 'Segmentations',
|
|
523
|
-
// Just apply this one when specifically listed
|
|
524
|
-
protocolMatchingRules: [],
|
|
525
|
-
toolGroupIds: ['default'],
|
|
526
|
-
// -1 would be used to indicate active only, whereas other values are
|
|
527
|
-
// the number of required priors referenced - so 0 means active with
|
|
528
|
-
// 0 or more priors.
|
|
529
|
-
numberOfPriorsReferenced: 0,
|
|
530
|
-
// Default viewport is used to define the viewport when
|
|
531
|
-
// additional viewports are added using the layout tool
|
|
532
|
-
defaultViewport: {
|
|
533
|
-
viewportOptions: {
|
|
534
|
-
viewportType: 'stack',
|
|
535
|
-
toolGroupId: 'default',
|
|
536
|
-
allowUnmatchedView: true
|
|
537
|
-
},
|
|
538
|
-
displaySets: [{
|
|
539
|
-
id: 'segDisplaySetId',
|
|
540
|
-
matchedDisplaySetsIndex: -1
|
|
541
|
-
}]
|
|
542
|
-
},
|
|
543
|
-
displaySetSelectors: {
|
|
544
|
-
segDisplaySetId: {
|
|
545
|
-
seriesMatchingRules: [{
|
|
546
|
-
attribute: 'Modality',
|
|
547
|
-
constraint: {
|
|
548
|
-
equals: 'SEG'
|
|
549
|
-
}
|
|
550
|
-
}]
|
|
551
|
-
}
|
|
552
|
-
},
|
|
553
|
-
stages: [{
|
|
554
|
-
name: 'Segmentations',
|
|
555
|
-
viewportStructure: {
|
|
556
|
-
layoutType: 'grid',
|
|
557
|
-
properties: {
|
|
558
|
-
rows: 1,
|
|
559
|
-
columns: 1
|
|
560
|
-
}
|
|
561
|
-
},
|
|
562
|
-
viewports: [{
|
|
563
|
-
viewportOptions: {
|
|
564
|
-
allowUnmatchedView: true
|
|
565
|
-
},
|
|
566
|
-
displaySets: [{
|
|
567
|
-
id: 'segDisplaySetId'
|
|
568
|
-
}]
|
|
569
|
-
}]
|
|
570
|
-
}]
|
|
571
|
-
};
|
|
572
|
-
function getHangingProtocolModule() {
|
|
573
|
-
return [{
|
|
574
|
-
name: segProtocol.id,
|
|
575
|
-
protocol: segProtocol
|
|
576
|
-
}];
|
|
577
|
-
}
|
|
578
|
-
/* harmony default export */ const src_getHangingProtocolModule = (getHangingProtocolModule);
|
|
579
|
-
|
|
580
|
-
// EXTERNAL MODULE: ../../../extensions/cornerstone-dicom-seg/src/utils/_hydrateSEG.ts
|
|
581
|
-
var _hydrateSEG = __webpack_require__(28417);
|
|
582
|
-
;// CONCATENATED MODULE: ../../../extensions/cornerstone-dicom-seg/src/index.tsx
|
|
583
|
-
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); }
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
const Component = /*#__PURE__*/react.lazy(() => {
|
|
591
|
-
return __webpack_require__.e(/* import() */ 451).then(__webpack_require__.bind(__webpack_require__, 4451));
|
|
592
|
-
});
|
|
593
|
-
const OHIFCornerstoneSEGViewport = props => {
|
|
594
|
-
return /*#__PURE__*/react.createElement(react.Suspense, {
|
|
595
|
-
fallback: /*#__PURE__*/react.createElement("div", null, "Loading...")
|
|
596
|
-
}, /*#__PURE__*/react.createElement(Component, props));
|
|
597
|
-
};
|
|
598
|
-
|
|
599
|
-
/**
|
|
600
|
-
* You can remove any of the following modules if you don't need them.
|
|
601
|
-
*/
|
|
602
|
-
const extension = {
|
|
603
|
-
/**
|
|
604
|
-
* Only required property. Should be a unique value across all extensions.
|
|
605
|
-
* You ID can be anything you want, but it should be unique.
|
|
606
|
-
*/
|
|
607
|
-
id: id,
|
|
608
|
-
/**
|
|
609
|
-
* PanelModule should provide a list of panels that will be available in OHIF
|
|
610
|
-
* for Modes to consume and render. Each panel is defined by a {name,
|
|
611
|
-
* iconName, iconLabel, label, component} object. Example of a panel module
|
|
612
|
-
* is the StudyBrowserPanel that is provided by the default extension in OHIF.
|
|
613
|
-
*/
|
|
614
|
-
getPanelModule: _ref => {
|
|
615
|
-
let {
|
|
616
|
-
servicesManager,
|
|
617
|
-
commandsManager,
|
|
618
|
-
extensionManager
|
|
619
|
-
} = _ref;
|
|
620
|
-
const wrappedPanelSegmentation = () => {
|
|
621
|
-
return /*#__PURE__*/react.createElement(PanelSegmentation, {
|
|
622
|
-
commandsManager: commandsManager,
|
|
623
|
-
servicesManager: servicesManager,
|
|
624
|
-
extensionManager: extensionManager
|
|
625
|
-
});
|
|
626
|
-
};
|
|
627
|
-
return [{
|
|
628
|
-
name: 'panelSegmentation',
|
|
629
|
-
iconName: 'tab-segmentation',
|
|
630
|
-
iconLabel: 'Segmentation',
|
|
631
|
-
label: 'Segmentation',
|
|
632
|
-
component: wrappedPanelSegmentation
|
|
633
|
-
}];
|
|
634
|
-
},
|
|
635
|
-
getViewportModule(_ref2) {
|
|
636
|
-
let {
|
|
637
|
-
servicesManager,
|
|
638
|
-
extensionManager
|
|
639
|
-
} = _ref2;
|
|
640
|
-
const ExtendedOHIFCornerstoneSEGViewport = props => {
|
|
641
|
-
return /*#__PURE__*/react.createElement(OHIFCornerstoneSEGViewport, _extends({
|
|
642
|
-
servicesManager: servicesManager,
|
|
643
|
-
extensionManager: extensionManager,
|
|
644
|
-
commandsManager: commandsManager
|
|
645
|
-
}, props));
|
|
646
|
-
};
|
|
647
|
-
return [{
|
|
648
|
-
name: 'dicom-seg',
|
|
649
|
-
component: ExtendedOHIFCornerstoneSEGViewport
|
|
650
|
-
}];
|
|
651
|
-
},
|
|
652
|
-
/**
|
|
653
|
-
* SopClassHandlerModule should provide a list of sop class handlers that will be
|
|
654
|
-
* available in OHIF for Modes to consume and use to create displaySets from Series.
|
|
655
|
-
* Each sop class handler is defined by a { name, sopClassUids, getDisplaySetsFromSeries}.
|
|
656
|
-
* Examples include the default sop class handler provided by the default extension
|
|
657
|
-
*/
|
|
658
|
-
getSopClassHandlerModule: src_getSopClassHandlerModule,
|
|
659
|
-
getHangingProtocolModule: src_getHangingProtocolModule
|
|
660
|
-
};
|
|
661
|
-
/* harmony default export */ const cornerstone_dicom_seg_src = (extension);
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
/***/ }),
|
|
665
|
-
|
|
666
|
-
/***/ 28417:
|
|
667
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
668
|
-
|
|
669
|
-
"use strict";
|
|
670
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
671
|
-
/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
672
|
-
/* harmony export */ });
|
|
673
|
-
async function _hydrateSEGDisplaySet(_ref) {
|
|
674
|
-
let {
|
|
675
|
-
segDisplaySet,
|
|
676
|
-
viewportId: targetViewportId,
|
|
677
|
-
servicesManager
|
|
678
|
-
} = _ref;
|
|
679
|
-
const {
|
|
680
|
-
segmentationService,
|
|
681
|
-
hangingProtocolService,
|
|
682
|
-
viewportGridService
|
|
683
|
-
} = servicesManager.services;
|
|
684
|
-
const displaySetInstanceUID = segDisplaySet.referencedDisplaySetInstanceUID;
|
|
685
|
-
let segmentationId = null;
|
|
686
|
-
|
|
687
|
-
// We need the hydration to notify panels about the new segmentation added
|
|
688
|
-
const suppressEvents = false;
|
|
689
|
-
segmentationId = await segmentationService.createSegmentationForSEGDisplaySet(segDisplaySet, segmentationId, suppressEvents);
|
|
690
|
-
segmentationService.hydrateSegmentation(segDisplaySet.displaySetInstanceUID);
|
|
691
|
-
const {
|
|
692
|
-
viewports
|
|
693
|
-
} = viewportGridService.getState();
|
|
694
|
-
const updatedViewports = hangingProtocolService.getViewportsRequireUpdate(targetViewportId, displaySetInstanceUID);
|
|
695
|
-
|
|
696
|
-
// Todo: fix this after we have a better way for stack viewport segmentations
|
|
697
|
-
|
|
698
|
-
// check every viewport in the viewports to see if the displaySetInstanceUID
|
|
699
|
-
// is being displayed, if so we need to update the viewport to use volume viewport
|
|
700
|
-
// (if already is not using it) since Cornerstone3D currently only supports
|
|
701
|
-
// volume viewport for segmentation
|
|
702
|
-
viewports.forEach((viewport, viewportId) => {
|
|
703
|
-
if (targetViewportId === viewportId) {
|
|
704
|
-
return;
|
|
705
|
-
}
|
|
706
|
-
const shouldDisplaySeg = segmentationService.shouldRenderSegmentation(viewport.displaySetInstanceUIDs, segDisplaySet.displaySetInstanceUID);
|
|
707
|
-
if (shouldDisplaySeg) {
|
|
708
|
-
updatedViewports.push({
|
|
709
|
-
viewportId,
|
|
710
|
-
displaySetInstanceUIDs: viewport.displaySetInstanceUIDs,
|
|
711
|
-
viewportOptions: {
|
|
712
|
-
// Note: This is a hack to get the grid to re-render the OHIFCornerstoneViewport component
|
|
713
|
-
// Used for segmentation hydration right now, since the logic to decide whether
|
|
714
|
-
// a viewport needs to render a segmentation lives inside the CornerstoneViewportService
|
|
715
|
-
// so we need to re-render (force update via change of the needsRerendering) so that React
|
|
716
|
-
// does the diffing and decides we should render this again (although the id and element has not changed)
|
|
717
|
-
// so that the CornerstoneViewportService can decide whether to render the segmentation or not.
|
|
718
|
-
needsRerendering: true,
|
|
719
|
-
initialImageOptions: {
|
|
720
|
-
preset: 'middle'
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
});
|
|
724
|
-
}
|
|
725
|
-
});
|
|
726
|
-
|
|
727
|
-
// Do the entire update at once
|
|
728
|
-
viewportGridService.setDisplaySetsForViewports(updatedViewports);
|
|
729
|
-
return true;
|
|
730
|
-
}
|
|
731
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_hydrateSEGDisplaySet);
|
|
732
|
-
|
|
733
|
-
/***/ }),
|
|
734
|
-
|
|
735
|
-
/***/ 78753:
|
|
736
|
-
/***/ (() => {
|
|
737
|
-
|
|
738
|
-
/* (ignored) */
|
|
739
|
-
|
|
740
|
-
/***/ })
|
|
741
|
-
|
|
742
|
-
}]);
|