@ohif/app 3.8.0-beta.6 → 3.8.0-beta.60
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/{220.bundle.f7e1c96c94245e70f2be.js → 109.bundle.b4fee2a22b622839baf5.js} +4466 -3715
- package/dist/{471.bundle.b3d77b83b1593c09a504.js → 121.bundle.ed23e7752a11005322e6.js} +47 -51
- package/dist/{19.bundle.f6ac71d29001b0db0ec0.js → 155.bundle.a089b4e1dd8a13064c21.js} +198 -207
- package/dist/{687.bundle.f87fb1a36ef1ca951690.js → 164.bundle.6f0b21868890158eda40.js} +22 -38
- package/dist/17dd54813d5acc10bf8f.wasm +0 -0
- package/dist/{506.bundle.06f5c5620d0088ec0102.js → 188.bundle.903a17abf035c26e672f.js} +23 -28
- package/dist/20fc4c659b85ccd2a9c0.wasm +0 -0
- package/dist/214.bundle.7f5beb123035a163bf85.js +122755 -0
- package/dist/{126.bundle.cefdf26c03a5ab8d60c8.js → 250.bundle.13a1f5d003a00c2b8694.js} +63 -69
- package/dist/{236.bundle.3148dc4715c254801727.js → 270.bundle.4e3cd0e72bbff21f9596.js} +156 -178
- package/dist/290.bundle.fdf51412462b919e2772.js +8883 -0
- package/dist/{451.bundle.9fd36f52ff69594f0669.js → 295.bundle.462f3328c716cbe6c613.js} +45 -59
- package/dist/{125.bundle.253395f320b72180da63.js → 297.bundle.81d63bb0b66d63df6d86.js} +7 -8
- package/dist/{957.bundle.9ea4506963ef8b2d84ba.js → 307.bundle.6e884b1c8766c69560bd.js} +14569 -27570
- package/dist/{613.bundle.a0eee4dc2d2764c2f7cd.js → 317.bundle.9d9acdf28d8dfd3ab39e.js} +83 -57
- package/dist/{788.bundle.af903bf0598f0ad618e3.js → 339.bundle.d514a9189b0bbdedac75.js} +190 -239
- package/dist/342.bundle.8f20bc9a1fa5fed22d2d.js +51866 -0
- package/dist/457.bundle.64785b282dc8c9b64c92.js +30200 -0
- package/dist/{221.bundle.3f5f700b4c1ee8b1ce94.js → 50.bundle.5f1ddd2697906f8bde6b.js} +199 -189
- package/dist/{886.bundle.d5116d9b8ea4964b68a0.js → 530.bundle.ce13c30b93a28cc85098.js} +40 -44
- package/dist/{250.bundle.8084960e3318cda37317.js → 544.bundle.3f48123a58d3bdc052f5.js} +39 -44
- package/dist/{663.bundle.e3539f14edf9214e07eb.js → 559.bundle.7426bb86db4352f1c401.js} +149 -141
- package/dist/{410.bundle.5e16274b1082de6e127e.js → 594.bundle.9eb2863c4d3fbe4120c5.js} +31 -35
- package/dist/{774.bundle.4b2dc46a35012b898e1a.js → 644.bundle.1e77691d2eeb96a423b0.js} +1852 -8945
- package/dist/{82.bundle.ae82f6434056c8d79fec.js → 68.bundle.7ca79597088a0784c4ee.js} +313 -324
- package/dist/{342.bundle.e485b92bd6d91bb7cc04.js → 704.bundle.9ecbe7b05ea278ef6ba8.js} +1128 -737
- package/dist/{359.bundle.dedb5b782335939bdc52.js → 724.bundle.46d9ce1eb6867cdd81c0.js} +34 -37
- package/dist/{757.bundle.ec8301d8e70d2b990f65.js → 726.bundle.2bdb443d1b5620d74e6e.js} +512 -879
- package/dist/{530.bundle.a03b6f942ace3e1baa1e.js → 835.bundle.15aff0b7433bb0dd6d6d.js} +37 -30
- package/dist/{822.bundle.891f2e57b1b7bc2f4cb4.js → 862.bundle.d20d6b2d29fd89bf2f83.js} +27 -29
- package/dist/{181.bundle.2ddc6f90740895a3949c.js → 889.bundle.d77bbd1805d4f0bd0565.js} +135 -107
- package/dist/{181.css → 889.css} +1 -1
- package/dist/{281.bundle.e4c37762343dc03e4fa0.js → 905.bundle.53a0daccf13d3e134ab9.js} +29 -31
- package/dist/{814.bundle.98e400df965d000d78e6.js → 907.bundle.b1f7dffcc6187de1b7ad.js} +16 -18
- package/dist/{417.bundle.af0a207c29b109f84159.js → 931.bundle.d270a1fda9a2836c3cc5.js} +26 -26
- package/dist/{686.bundle.dccef1f36e4bc79bcc48.js → 939.bundle.84ee0b844023d924a22b.js} +7 -8
- package/dist/{12.bundle.75c761bd89ad782675c8.js → 961.bundle.54abd182a494b2e1d8ec.js} +16 -18
- package/dist/{776.bundle.08eb381dc3d06708eb0f.js → 963.bundle.8110049ad01d956455a2.js} +1629 -845
- package/dist/app.bundle.css +11 -11
- package/dist/{app.bundle.eeb94536f34535b1153f.js → app.bundle.f783ca295d5aa9042c31.js} +142266 -61058
- package/dist/cornerstoneDICOMImageLoader.min.js +1 -1
- package/dist/cornerstoneDICOMImageLoader.min.js.map +1 -1
- package/dist/{dicom-microscopy-viewer.bundle.2c146384eb9466d02ff8.js → dicom-microscopy-viewer.bundle.d3a56dc9f62df5e11019.js} +3 -3
- package/dist/index.html +1 -1
- package/dist/{index.worker.e62ecca63f1a2e124230.worker.js → index.worker.64c896c4316fcd506666.worker.js} +2 -2
- package/dist/index.worker.64c896c4316fcd506666.worker.js.map +1 -0
- package/dist/polySeg.bundle.cffa671e87c4c9110149.js +252 -0
- package/dist/serve.json +12 -0
- package/dist/sw.js +1 -1
- package/package.json +25 -22
- package/dist/202.bundle.d3490836f71e001dd30f.js +0 -6336
- package/dist/23.bundle.e008ad788170f2ed5569.js +0 -900
- package/dist/604.bundle.a51f83e64004bca5f497.js +0 -1848
- package/dist/743.bundle.489f7df3a089d4d374e1.js +0 -78007
- package/dist/75788f12450d4c5ed494.wasm +0 -0
- package/dist/775.bundle.2285e7e0e67878948c0d.js +0 -1009
- package/dist/index.worker.e62ecca63f1a2e124230.worker.js.map +0 -1
- /package/dist/{19.css → 155.css} +0 -0
- /package/dist/{579.css → 481.css} +0 -0
- /package/dist/{221.css → 50.css} +0 -0
- /package/dist/{250.css → 544.css} +0 -0
- /package/dist/{776.css → 963.css} +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
(globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[963],{
|
|
2
3
|
|
|
3
|
-
/***/
|
|
4
|
+
/***/ 34963:
|
|
4
5
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
5
6
|
|
|
6
|
-
"use strict";
|
|
7
7
|
// ESM COMPAT FLAG
|
|
8
8
|
__webpack_require__.r(__webpack_exports__);
|
|
9
9
|
|
|
10
10
|
// EXPORTS
|
|
11
11
|
__webpack_require__.d(__webpack_exports__, {
|
|
12
|
+
ImageOverlayViewerTool: () => (/* reexport */ tools_ImageOverlayViewerTool),
|
|
12
13
|
Types: () => (/* reexport */ types_namespaceObject),
|
|
13
14
|
"default": () => (/* binding */ cornerstone_src),
|
|
14
15
|
getActiveViewportEnabledElement: () => (/* reexport */ getActiveViewportEnabledElement),
|
|
@@ -23,7 +24,7 @@ __webpack_require__.d(utils_namespaceObject, {
|
|
|
23
24
|
getDisplayUnit: () => (utils_getDisplayUnit),
|
|
24
25
|
getFirstAnnotationSelected: () => (getFirstAnnotationSelected),
|
|
25
26
|
getHandlesFromPoints: () => (getHandlesFromPoints),
|
|
26
|
-
getSOPInstanceAttributes: () => (getSOPInstanceAttributes/* default */.
|
|
27
|
+
getSOPInstanceAttributes: () => (getSOPInstanceAttributes/* default */.A),
|
|
27
28
|
isAnnotationSelected: () => (isAnnotationSelected),
|
|
28
29
|
setAnnotationSelected: () => (setAnnotationSelected)
|
|
29
30
|
});
|
|
@@ -33,20 +34,20 @@ var types_namespaceObject = {};
|
|
|
33
34
|
__webpack_require__.r(types_namespaceObject);
|
|
34
35
|
|
|
35
36
|
// EXTERNAL MODULE: ../../../node_modules/react/index.js
|
|
36
|
-
var react = __webpack_require__(
|
|
37
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js +
|
|
38
|
-
var esm = __webpack_require__(
|
|
39
|
-
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js +
|
|
40
|
-
var dist_esm = __webpack_require__(
|
|
41
|
-
// EXTERNAL MODULE: ../../core/src/index.ts +
|
|
42
|
-
var src = __webpack_require__(
|
|
37
|
+
var react = __webpack_require__(41766);
|
|
38
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/core/dist/esm/index.js + 382 modules
|
|
39
|
+
var esm = __webpack_require__(39526);
|
|
40
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/index.js + 14 modules
|
|
41
|
+
var dist_esm = __webpack_require__(72980);
|
|
42
|
+
// EXTERNAL MODULE: ../../core/src/index.ts + 66 modules
|
|
43
|
+
var src = __webpack_require__(14283);
|
|
43
44
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/streaming-image-volume-loader/dist/esm/index.js + 13 modules
|
|
44
|
-
var streaming_image_volume_loader_dist_esm = __webpack_require__(
|
|
45
|
+
var streaming_image_volume_loader_dist_esm = __webpack_require__(23722);
|
|
45
46
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/dicom-image-loader/dist/dynamic-import/cornerstoneDICOMImageLoader.min.js
|
|
46
|
-
var cornerstoneDICOMImageLoader_min = __webpack_require__(
|
|
47
|
+
var cornerstoneDICOMImageLoader_min = __webpack_require__(54578);
|
|
47
48
|
var cornerstoneDICOMImageLoader_min_default = /*#__PURE__*/__webpack_require__.n(cornerstoneDICOMImageLoader_min);
|
|
48
49
|
// EXTERNAL MODULE: ../../../node_modules/dicom-parser/dist/dicomParser.min.js
|
|
49
|
-
var dicomParser_min = __webpack_require__(
|
|
50
|
+
var dicomParser_min = __webpack_require__(45561);
|
|
50
51
|
var dicomParser_min_default = /*#__PURE__*/__webpack_require__.n(dicomParser_min);
|
|
51
52
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/initWADOImageLoader.js
|
|
52
53
|
|
|
@@ -79,7 +80,7 @@ function initWebWorkers(appConfig) {
|
|
|
79
80
|
function initWADOImageLoader(userAuthenticationService, appConfig, extensionManager) {
|
|
80
81
|
(cornerstoneDICOMImageLoader_min_default()).external.cornerstone = esm;
|
|
81
82
|
(cornerstoneDICOMImageLoader_min_default()).external.dicomParser = (dicomParser_min_default());
|
|
82
|
-
registerVolumeLoader('cornerstoneStreamingImageVolume', streaming_image_volume_loader_dist_esm/* cornerstoneStreamingImageVolumeLoader */.
|
|
83
|
+
registerVolumeLoader('cornerstoneStreamingImageVolume', streaming_image_volume_loader_dist_esm/* cornerstoneStreamingImageVolumeLoader */.FC);
|
|
83
84
|
cornerstoneDICOMImageLoader_min_default().configure({
|
|
84
85
|
decodeConfig: {
|
|
85
86
|
// !! IMPORTANT !!
|
|
@@ -88,7 +89,7 @@ function initWADOImageLoader(userAuthenticationService, appConfig, extensionMana
|
|
|
88
89
|
// Until the default is set to true (which is the case for cornerstone3D),
|
|
89
90
|
// we should set this flag to false.
|
|
90
91
|
convertFloatPixelDataToInt: false,
|
|
91
|
-
use16BitDataType: Boolean(appConfig.
|
|
92
|
+
use16BitDataType: Boolean(appConfig.useNorm16Texture) || Boolean(appConfig.preferSizeOverAccuracy)
|
|
92
93
|
},
|
|
93
94
|
beforeSend: function (xhr) {
|
|
94
95
|
//TODO should be removed in the future and request emitted by DicomWebDataSource
|
|
@@ -104,7 +105,7 @@ function initWADOImageLoader(userAuthenticationService, appConfig, extensionMana
|
|
|
104
105
|
return xhrRequestHeaders;
|
|
105
106
|
},
|
|
106
107
|
errorInterceptor: error => {
|
|
107
|
-
src/* errorHandler */.
|
|
108
|
+
src/* errorHandler */.r_.getHTTPErrorHandler(error);
|
|
108
109
|
}
|
|
109
110
|
});
|
|
110
111
|
initWebWorkers(appConfig);
|
|
@@ -118,8 +119,8 @@ function destroy() {
|
|
|
118
119
|
}
|
|
119
120
|
webWorkers.length = 0;
|
|
120
121
|
}
|
|
121
|
-
// EXTERNAL MODULE: ../../ui/src/index.js +
|
|
122
|
-
var ui_src = __webpack_require__(
|
|
122
|
+
// EXTERNAL MODULE: ../../ui/src/index.js + 487 modules
|
|
123
|
+
var ui_src = __webpack_require__(55395);
|
|
123
124
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/callInputDialog.tsx
|
|
124
125
|
|
|
125
126
|
|
|
@@ -136,9 +137,7 @@ var ui_src = __webpack_require__(71783);
|
|
|
136
137
|
* @param {string?} dialogConfig.dialogTitle - title of the input dialog
|
|
137
138
|
* @param {string?} dialogConfig.inputLabel - show label above the input
|
|
138
139
|
*/
|
|
139
|
-
function callInputDialog(uiDialogService, data, callback) {
|
|
140
|
-
let isArrowAnnotateInputDialog = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
141
|
-
let dialogConfig = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
140
|
+
function callInputDialog(uiDialogService, data, callback, isArrowAnnotateInputDialog = true, dialogConfig = {}) {
|
|
142
141
|
const dialogId = 'dialog-enter-annotation';
|
|
143
142
|
const label = data ? isArrowAnnotateInputDialog ? data.text : data.label : '';
|
|
144
143
|
const {
|
|
@@ -146,11 +145,10 @@ function callInputDialog(uiDialogService, data, callback) {
|
|
|
146
145
|
inputLabel = 'Enter your annotation',
|
|
147
146
|
validateFunc = value => true
|
|
148
147
|
} = dialogConfig;
|
|
149
|
-
const onSubmitHandler =
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
} = _ref;
|
|
148
|
+
const onSubmitHandler = ({
|
|
149
|
+
action,
|
|
150
|
+
value
|
|
151
|
+
}) => {
|
|
154
152
|
switch (action.id) {
|
|
155
153
|
case 'save':
|
|
156
154
|
if (typeof validateFunc === 'function' && !validateFunc(value.label)) {
|
|
@@ -172,7 +170,7 @@ function callInputDialog(uiDialogService, data, callback) {
|
|
|
172
170
|
centralize: true,
|
|
173
171
|
isDraggable: false,
|
|
174
172
|
showOverlay: true,
|
|
175
|
-
content: ui_src/* Dialog */.
|
|
173
|
+
content: ui_src/* Dialog */.lG,
|
|
176
174
|
contentProps: {
|
|
177
175
|
title: dialogTitle,
|
|
178
176
|
value: {
|
|
@@ -185,19 +183,18 @@ function callInputDialog(uiDialogService, data, callback) {
|
|
|
185
183
|
actions: [{
|
|
186
184
|
id: 'cancel',
|
|
187
185
|
text: 'Cancel',
|
|
188
|
-
type: ui_src/* ButtonEnums.type */.
|
|
186
|
+
type: ui_src/* ButtonEnums.type */.Ny.NW.secondary
|
|
189
187
|
}, {
|
|
190
188
|
id: 'save',
|
|
191
189
|
text: 'Save',
|
|
192
|
-
type: ui_src/* ButtonEnums.type */.
|
|
190
|
+
type: ui_src/* ButtonEnums.type */.Ny.NW.primary
|
|
193
191
|
}],
|
|
194
192
|
onSubmit: onSubmitHandler,
|
|
195
|
-
body:
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return /*#__PURE__*/react.createElement(ui_src/* Input */.II, {
|
|
193
|
+
body: ({
|
|
194
|
+
value,
|
|
195
|
+
setValue
|
|
196
|
+
}) => {
|
|
197
|
+
return /*#__PURE__*/react.createElement(ui_src/* Input */.pd, {
|
|
201
198
|
autoFocus: true,
|
|
202
199
|
className: "border-primary-main bg-black",
|
|
203
200
|
type: "text",
|
|
@@ -230,7 +227,7 @@ function callInputDialog(uiDialogService, data, callback) {
|
|
|
230
227
|
}
|
|
231
228
|
/* harmony default export */ const utils_callInputDialog = (callInputDialog);
|
|
232
229
|
// EXTERNAL MODULE: ../../../extensions/cornerstone/src/state.ts
|
|
233
|
-
var state = __webpack_require__(
|
|
230
|
+
var state = __webpack_require__(71353);
|
|
234
231
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/getActiveViewportEnabledElement.ts
|
|
235
232
|
|
|
236
233
|
|
|
@@ -240,7 +237,7 @@ function getActiveViewportEnabledElement(viewportGridService) {
|
|
|
240
237
|
} = viewportGridService.getState();
|
|
241
238
|
const {
|
|
242
239
|
element
|
|
243
|
-
} = (0,state/* getEnabledElement */.
|
|
240
|
+
} = (0,state/* getEnabledElement */.kJ)(activeViewportId) || {};
|
|
244
241
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
245
242
|
return enabledElement;
|
|
246
243
|
}
|
|
@@ -256,8 +253,8 @@ const {
|
|
|
256
253
|
* Calibration Line tool works almost the same as the
|
|
257
254
|
*/
|
|
258
255
|
class CalibrationLineTool extends dist_esm.LengthTool {
|
|
259
|
-
constructor() {
|
|
260
|
-
super(...
|
|
256
|
+
constructor(...args) {
|
|
257
|
+
super(...args);
|
|
261
258
|
this._renderingViewport = void 0;
|
|
262
259
|
this._lengthToolRenderAnnotation = this.renderAnnotation;
|
|
263
260
|
this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
|
|
@@ -350,8 +347,46 @@ function onCompletedCalibrationLine(servicesManager, csToolsEvent) {
|
|
|
350
347
|
});
|
|
351
348
|
});
|
|
352
349
|
}
|
|
353
|
-
// EXTERNAL MODULE: ../../core/src/utils/index.js +
|
|
354
|
-
var utils = __webpack_require__(
|
|
350
|
+
// EXTERNAL MODULE: ../../core/src/utils/index.js + 26 modules
|
|
351
|
+
var utils = __webpack_require__(17541);
|
|
352
|
+
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/tools/OverlayPlaneModuleProvider.ts
|
|
353
|
+
|
|
354
|
+
const _cachedOverlayMetadata = new Map();
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Image Overlay Viewer tool is not a traditional tool that requires user interactin.
|
|
358
|
+
* But it is used to display Pixel Overlays. And it will provide toggling capability.
|
|
359
|
+
*
|
|
360
|
+
* The documentation for Overlay Plane Module of DICOM can be found in [C.9.2 of
|
|
361
|
+
* Part-3 of DICOM standard](https://dicom.nema.org/medical/dicom/2018b/output/chtml/part03/sect_C.9.2.html)
|
|
362
|
+
*
|
|
363
|
+
* Image Overlay rendered by this tool can be toggled on and off using
|
|
364
|
+
* toolGroup.setToolEnabled() and toolGroup.setToolDisabled()
|
|
365
|
+
*/
|
|
366
|
+
const OverlayPlaneModuleProvider = {
|
|
367
|
+
/** Adds the metadata for overlayPlaneModule */
|
|
368
|
+
add: (imageId, metadata) => {
|
|
369
|
+
if (_cachedOverlayMetadata.get(imageId) === metadata) {
|
|
370
|
+
// This is a no-op here as the tool re-caches the data
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
_cachedOverlayMetadata.set(imageId, metadata);
|
|
374
|
+
},
|
|
375
|
+
/** Standard getter for metadata */
|
|
376
|
+
get: (type, query) => {
|
|
377
|
+
if (Array.isArray(query)) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
if (type !== 'overlayPlaneModule') {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
return _cachedOverlayMetadata.get(query);
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
// Needs to be higher priority than default provider
|
|
388
|
+
esm.metaData.addProvider(OverlayPlaneModuleProvider.get, 10_000);
|
|
389
|
+
/* harmony default export */ const tools_OverlayPlaneModuleProvider = (OverlayPlaneModuleProvider);
|
|
355
390
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/tools/ImageOverlayViewerTool.tsx
|
|
356
391
|
|
|
357
392
|
|
|
@@ -368,21 +403,14 @@ var utils = __webpack_require__(77250);
|
|
|
368
403
|
* toolGroup.setToolEnabled() and toolGroup.setToolDisabled()
|
|
369
404
|
*/
|
|
370
405
|
class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
|
|
371
|
-
constructor(
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
};
|
|
406
|
+
constructor(toolProps = {}, defaultToolProps = {
|
|
407
|
+
supportedInteractionTypes: [],
|
|
408
|
+
configuration: {
|
|
409
|
+
fillColor: [255, 127, 127, 255]
|
|
410
|
+
}
|
|
411
|
+
}) {
|
|
379
412
|
super(toolProps, defaultToolProps);
|
|
380
|
-
this.
|
|
381
|
-
this._cachedStats = {};
|
|
382
|
-
this.onSetToolDisabled = () => {
|
|
383
|
-
this._cachedStats = {};
|
|
384
|
-
this._cachedOverlayMetadata = new Map();
|
|
385
|
-
};
|
|
413
|
+
this.onSetToolDisabled = () => {};
|
|
386
414
|
this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
|
|
387
415
|
const {
|
|
388
416
|
viewport
|
|
@@ -391,14 +419,23 @@ class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
|
|
|
391
419
|
if (!imageId) {
|
|
392
420
|
return;
|
|
393
421
|
}
|
|
394
|
-
const
|
|
422
|
+
const overlayMetadata = esm.metaData.get('overlayPlaneModule', imageId);
|
|
423
|
+
const overlays = overlayMetadata?.overlays;
|
|
395
424
|
|
|
396
425
|
// no overlays
|
|
397
426
|
if (!overlays?.length) {
|
|
398
427
|
return;
|
|
399
428
|
}
|
|
400
|
-
|
|
401
|
-
|
|
429
|
+
|
|
430
|
+
// Fix the x, y positions
|
|
431
|
+
overlays.forEach(overlay => {
|
|
432
|
+
overlay.x ||= 0;
|
|
433
|
+
overlay.y ||= 0;
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
// Will clear cached stat data when the overlay data changes
|
|
437
|
+
ImageOverlayViewerTool.addOverlayPlaneModule(imageId, overlayMetadata);
|
|
438
|
+
this._getCachedStat(imageId, overlayMetadata, this.configuration.fillColor).then(cachedStat => {
|
|
402
439
|
cachedStat.overlays.forEach(overlay => {
|
|
403
440
|
this._renderOverlay(enabledElement, svgDrawingHelper, overlay);
|
|
404
441
|
});
|
|
@@ -472,10 +509,11 @@ class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
|
|
|
472
509
|
return true;
|
|
473
510
|
}
|
|
474
511
|
async _getCachedStat(imageId, overlayMetadata, color) {
|
|
475
|
-
|
|
476
|
-
|
|
512
|
+
const missingOverlay = overlayMetadata.overlays.filter(overlay => overlay.pixelData && !overlay.dataUrl);
|
|
513
|
+
if (missingOverlay.length === 0) {
|
|
514
|
+
return overlayMetadata;
|
|
477
515
|
}
|
|
478
|
-
const overlays = await Promise.all(overlayMetadata.filter(overlay => overlay.pixelData).map(async (overlay, idx) => {
|
|
516
|
+
const overlays = await Promise.all(overlayMetadata.overlays.filter(overlay => overlay.pixelData).map(async (overlay, idx) => {
|
|
479
517
|
let pixelData = null;
|
|
480
518
|
if (overlay.pixelData.Value) {
|
|
481
519
|
pixelData = overlay.pixelData.Value;
|
|
@@ -483,6 +521,10 @@ class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
|
|
|
483
521
|
pixelData = overlay.pixelData[0];
|
|
484
522
|
} else if (overlay.pixelData.retrieveBulkData) {
|
|
485
523
|
pixelData = await overlay.pixelData.retrieveBulkData();
|
|
524
|
+
} else if (overlay.pixelData.InlineBinary) {
|
|
525
|
+
const blob = (0,utils/* b64toBlob */.Vk)(overlay.pixelData.InlineBinary);
|
|
526
|
+
const arrayBuffer = await blob.arrayBuffer();
|
|
527
|
+
pixelData = arrayBuffer;
|
|
486
528
|
}
|
|
487
529
|
if (!pixelData) {
|
|
488
530
|
return;
|
|
@@ -490,20 +532,17 @@ class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
|
|
|
490
532
|
const dataUrl = this._renderOverlayToDataUrl({
|
|
491
533
|
width: overlay.columns,
|
|
492
534
|
height: overlay.rows
|
|
493
|
-
}, color, pixelData);
|
|
535
|
+
}, overlay.color || color, pixelData);
|
|
494
536
|
return {
|
|
495
537
|
...overlay,
|
|
496
|
-
_id: (0,utils/* guid */.
|
|
538
|
+
_id: (0,utils/* guid */.Os)(),
|
|
497
539
|
dataUrl,
|
|
498
540
|
// this will be a data url expression of the rendered image
|
|
499
541
|
color
|
|
500
542
|
};
|
|
501
543
|
}));
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
overlays: overlays.filter(overlay => overlay)
|
|
505
|
-
};
|
|
506
|
-
return this._cachedStats[imageId];
|
|
544
|
+
overlayMetadata.overlays = overlays;
|
|
545
|
+
return overlayMetadata;
|
|
507
546
|
}
|
|
508
547
|
|
|
509
548
|
/**
|
|
@@ -526,11 +565,10 @@ class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
|
|
|
526
565
|
* @param color
|
|
527
566
|
* @returns
|
|
528
567
|
*/
|
|
529
|
-
_renderOverlayToDataUrl(
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
} = _ref;
|
|
568
|
+
_renderOverlayToDataUrl({
|
|
569
|
+
width,
|
|
570
|
+
height
|
|
571
|
+
}, color, pixelDataRaw) {
|
|
534
572
|
const pixelDataView = new DataView(pixelDataRaw);
|
|
535
573
|
const totalBits = width * height;
|
|
536
574
|
const canvas = document.createElement('canvas');
|
|
@@ -562,13 +600,17 @@ class ImageOverlayViewerTool extends dist_esm.AnnotationDisplayTool {
|
|
|
562
600
|
}
|
|
563
601
|
}
|
|
564
602
|
ImageOverlayViewerTool.toolName = 'ImageOverlayViewer';
|
|
603
|
+
/**
|
|
604
|
+
* The overlay plane module provider add method is exposed here to be used
|
|
605
|
+
* when updating the overlay for this tool to use for displaying data.
|
|
606
|
+
*/
|
|
607
|
+
ImageOverlayViewerTool.addOverlayPlaneModule = tools_OverlayPlaneModuleProvider.add;
|
|
565
608
|
/* harmony default export */ const tools_ImageOverlayViewerTool = (ImageOverlayViewerTool);
|
|
566
609
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/initCornerstoneTools.js
|
|
567
610
|
|
|
568
611
|
|
|
569
612
|
|
|
570
|
-
function initCornerstoneTools() {
|
|
571
|
-
let configuration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
613
|
+
function initCornerstoneTools(configuration = {}) {
|
|
572
614
|
dist_esm.CrosshairsTool.isAnnotation = false;
|
|
573
615
|
dist_esm.ReferenceLinesTool.isAnnotation = false;
|
|
574
616
|
(0,dist_esm.init)(configuration);
|
|
@@ -648,7 +690,7 @@ const toolNames = {
|
|
|
648
690
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/measurementServiceMappings/constants/supportedTools.js
|
|
649
691
|
/* harmony default export */ const supportedTools = (['Length', 'EllipticalROI', 'CircleROI', 'Bidirectional', 'ArrowAnnotate', 'Angle', 'CobbAngle', 'Probe', 'RectangleROI', 'PlanarFreehandROI']);
|
|
650
692
|
// EXTERNAL MODULE: ../../../extensions/cornerstone/src/utils/measurementServiceMappings/utils/getSOPInstanceAttributes.js
|
|
651
|
-
var getSOPInstanceAttributes = __webpack_require__(
|
|
693
|
+
var getSOPInstanceAttributes = __webpack_require__(1663);
|
|
652
694
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/measurementServiceMappings/Length.ts
|
|
653
695
|
|
|
654
696
|
|
|
@@ -688,7 +730,7 @@ const Length = {
|
|
|
688
730
|
SOPInstanceUID,
|
|
689
731
|
SeriesInstanceUID,
|
|
690
732
|
StudyInstanceUID
|
|
691
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
733
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId, cornerstoneViewportService, viewportId);
|
|
692
734
|
let displaySet;
|
|
693
735
|
if (SOPInstanceUID) {
|
|
694
736
|
displaySet = displaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID);
|
|
@@ -696,7 +738,8 @@ const Length = {
|
|
|
696
738
|
displaySet = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
|
|
697
739
|
}
|
|
698
740
|
const {
|
|
699
|
-
points
|
|
741
|
+
points,
|
|
742
|
+
textBox
|
|
700
743
|
} = data.handles;
|
|
701
744
|
const mappedAnnotations = getMappedAnnotations(annotation, displaySetService);
|
|
702
745
|
const displayText = getDisplayText(mappedAnnotations, displaySet);
|
|
@@ -706,6 +749,7 @@ const Length = {
|
|
|
706
749
|
SOPInstanceUID,
|
|
707
750
|
FrameOfReferenceUID,
|
|
708
751
|
points,
|
|
752
|
+
textBox,
|
|
709
753
|
metadata,
|
|
710
754
|
referenceSeriesUID: SeriesInstanceUID,
|
|
711
755
|
referenceStudyUID: StudyInstanceUID,
|
|
@@ -745,7 +789,7 @@ function getMappedAnnotations(annotation, displaySetService) {
|
|
|
745
789
|
SOPInstanceUID,
|
|
746
790
|
SeriesInstanceUID,
|
|
747
791
|
frameNumber
|
|
748
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
792
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId);
|
|
749
793
|
const displaySet = displaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID, frameNumber);
|
|
750
794
|
const {
|
|
751
795
|
SeriesNumber
|
|
@@ -925,7 +969,7 @@ const Bidirectional = {
|
|
|
925
969
|
SOPInstanceUID,
|
|
926
970
|
SeriesInstanceUID,
|
|
927
971
|
StudyInstanceUID
|
|
928
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
972
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId, cornerstoneViewportService, viewportId);
|
|
929
973
|
let displaySet;
|
|
930
974
|
if (SOPInstanceUID) {
|
|
931
975
|
displaySet = displaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID);
|
|
@@ -933,7 +977,8 @@ const Bidirectional = {
|
|
|
933
977
|
displaySet = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
|
|
934
978
|
}
|
|
935
979
|
const {
|
|
936
|
-
points
|
|
980
|
+
points,
|
|
981
|
+
textBox
|
|
937
982
|
} = data.handles;
|
|
938
983
|
const mappedAnnotations = Bidirectional_getMappedAnnotations(annotation, displaySetService);
|
|
939
984
|
const displayText = Bidirectional_getDisplayText(mappedAnnotations, displaySet);
|
|
@@ -943,6 +988,7 @@ const Bidirectional = {
|
|
|
943
988
|
SOPInstanceUID,
|
|
944
989
|
FrameOfReferenceUID,
|
|
945
990
|
points,
|
|
991
|
+
textBox,
|
|
946
992
|
metadata,
|
|
947
993
|
referenceSeriesUID: SeriesInstanceUID,
|
|
948
994
|
referenceStudyUID: StudyInstanceUID,
|
|
@@ -983,7 +1029,7 @@ function Bidirectional_getMappedAnnotations(annotation, displaySetService) {
|
|
|
983
1029
|
SOPInstanceUID,
|
|
984
1030
|
SeriesInstanceUID,
|
|
985
1031
|
frameNumber
|
|
986
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
1032
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId);
|
|
987
1033
|
const displaySet = displaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID, frameNumber);
|
|
988
1034
|
const {
|
|
989
1035
|
SeriesNumber
|
|
@@ -1106,7 +1152,7 @@ const EllipticalROI = {
|
|
|
1106
1152
|
SOPInstanceUID,
|
|
1107
1153
|
SeriesInstanceUID,
|
|
1108
1154
|
StudyInstanceUID
|
|
1109
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
1155
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId, cornerstoneViewportService, viewportId);
|
|
1110
1156
|
let displaySet;
|
|
1111
1157
|
if (SOPInstanceUID) {
|
|
1112
1158
|
displaySet = displaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID);
|
|
@@ -1114,7 +1160,8 @@ const EllipticalROI = {
|
|
|
1114
1160
|
displaySet = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
|
|
1115
1161
|
}
|
|
1116
1162
|
const {
|
|
1117
|
-
points
|
|
1163
|
+
points,
|
|
1164
|
+
textBox
|
|
1118
1165
|
} = data.handles;
|
|
1119
1166
|
const mappedAnnotations = EllipticalROI_getMappedAnnotations(annotation, displaySetService);
|
|
1120
1167
|
const displayText = EllipticalROI_getDisplayText(mappedAnnotations, displaySet);
|
|
@@ -1124,6 +1171,7 @@ const EllipticalROI = {
|
|
|
1124
1171
|
SOPInstanceUID,
|
|
1125
1172
|
FrameOfReferenceUID,
|
|
1126
1173
|
points,
|
|
1174
|
+
textBox,
|
|
1127
1175
|
metadata,
|
|
1128
1176
|
referenceSeriesUID: SeriesInstanceUID,
|
|
1129
1177
|
referenceStudyUID: StudyInstanceUID,
|
|
@@ -1164,7 +1212,7 @@ function EllipticalROI_getMappedAnnotations(annotation, displaySetService) {
|
|
|
1164
1212
|
SOPInstanceUID,
|
|
1165
1213
|
SeriesInstanceUID,
|
|
1166
1214
|
frameNumber
|
|
1167
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
1215
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId);
|
|
1168
1216
|
const displaySet = displaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID, frameNumber);
|
|
1169
1217
|
const {
|
|
1170
1218
|
SeriesNumber
|
|
@@ -1315,7 +1363,7 @@ const CircleROI = {
|
|
|
1315
1363
|
SOPInstanceUID,
|
|
1316
1364
|
SeriesInstanceUID,
|
|
1317
1365
|
StudyInstanceUID
|
|
1318
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
1366
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId, CornerstoneViewportService, viewportId);
|
|
1319
1367
|
let displaySet;
|
|
1320
1368
|
if (SOPInstanceUID) {
|
|
1321
1369
|
displaySet = DisplaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID);
|
|
@@ -1323,7 +1371,8 @@ const CircleROI = {
|
|
|
1323
1371
|
displaySet = DisplaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
|
|
1324
1372
|
}
|
|
1325
1373
|
const {
|
|
1326
|
-
points
|
|
1374
|
+
points,
|
|
1375
|
+
textBox
|
|
1327
1376
|
} = data.handles;
|
|
1328
1377
|
const mappedAnnotations = CircleROI_getMappedAnnotations(annotation, DisplaySetService);
|
|
1329
1378
|
const displayText = CircleROI_getDisplayText(mappedAnnotations, displaySet);
|
|
@@ -1333,6 +1382,7 @@ const CircleROI = {
|
|
|
1333
1382
|
SOPInstanceUID,
|
|
1334
1383
|
FrameOfReferenceUID,
|
|
1335
1384
|
points,
|
|
1385
|
+
textBox,
|
|
1336
1386
|
metadata,
|
|
1337
1387
|
referenceSeriesUID: SeriesInstanceUID,
|
|
1338
1388
|
referenceStudyUID: StudyInstanceUID,
|
|
@@ -1373,7 +1423,7 @@ function CircleROI_getMappedAnnotations(annotation, DisplaySetService) {
|
|
|
1373
1423
|
SOPInstanceUID,
|
|
1374
1424
|
SeriesInstanceUID,
|
|
1375
1425
|
frameNumber
|
|
1376
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
1426
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId);
|
|
1377
1427
|
const displaySet = DisplaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID, frameNumber);
|
|
1378
1428
|
const {
|
|
1379
1429
|
SeriesNumber
|
|
@@ -1530,7 +1580,7 @@ const ArrowAnnotate_Length = {
|
|
|
1530
1580
|
SOPInstanceUID,
|
|
1531
1581
|
SeriesInstanceUID,
|
|
1532
1582
|
StudyInstanceUID
|
|
1533
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
1583
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId, cornerstoneViewportService, viewportId);
|
|
1534
1584
|
let displaySet;
|
|
1535
1585
|
if (SOPInstanceUID) {
|
|
1536
1586
|
displaySet = displaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID);
|
|
@@ -1538,7 +1588,8 @@ const ArrowAnnotate_Length = {
|
|
|
1538
1588
|
displaySet = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
|
|
1539
1589
|
}
|
|
1540
1590
|
const {
|
|
1541
|
-
points
|
|
1591
|
+
points,
|
|
1592
|
+
textBox
|
|
1542
1593
|
} = data.handles;
|
|
1543
1594
|
const mappedAnnotations = ArrowAnnotate_getMappedAnnotations(annotation, displaySetService);
|
|
1544
1595
|
const displayText = ArrowAnnotate_getDisplayText(mappedAnnotations, displaySet);
|
|
@@ -1547,6 +1598,7 @@ const ArrowAnnotate_Length = {
|
|
|
1547
1598
|
SOPInstanceUID,
|
|
1548
1599
|
FrameOfReferenceUID,
|
|
1549
1600
|
points,
|
|
1601
|
+
textBox,
|
|
1550
1602
|
metadata,
|
|
1551
1603
|
referenceSeriesUID: SeriesInstanceUID,
|
|
1552
1604
|
referenceStudyUID: StudyInstanceUID,
|
|
@@ -1554,7 +1606,6 @@ const ArrowAnnotate_Length = {
|
|
|
1554
1606
|
toolName: metadata.toolName,
|
|
1555
1607
|
displaySetInstanceUID: displaySet.displaySetInstanceUID,
|
|
1556
1608
|
label: data.text,
|
|
1557
|
-
text: data.text,
|
|
1558
1609
|
displayText: displayText,
|
|
1559
1610
|
data: data.cachedStats,
|
|
1560
1611
|
type: getValueTypeFromToolType(toolName),
|
|
@@ -1580,7 +1631,7 @@ function ArrowAnnotate_getMappedAnnotations(annotation, displaySetService) {
|
|
|
1580
1631
|
SOPInstanceUID,
|
|
1581
1632
|
SeriesInstanceUID,
|
|
1582
1633
|
frameNumber
|
|
1583
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
1634
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId);
|
|
1584
1635
|
const displaySet = displaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID, frameNumber);
|
|
1585
1636
|
const {
|
|
1586
1637
|
SeriesNumber
|
|
@@ -1657,7 +1708,7 @@ const CobbAngle = {
|
|
|
1657
1708
|
SOPInstanceUID,
|
|
1658
1709
|
SeriesInstanceUID,
|
|
1659
1710
|
StudyInstanceUID
|
|
1660
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
1711
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId, CornerstoneViewportService, viewportId);
|
|
1661
1712
|
let displaySet;
|
|
1662
1713
|
if (SOPInstanceUID) {
|
|
1663
1714
|
displaySet = displaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID);
|
|
@@ -1665,7 +1716,8 @@ const CobbAngle = {
|
|
|
1665
1716
|
displaySet = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
|
|
1666
1717
|
}
|
|
1667
1718
|
const {
|
|
1668
|
-
points
|
|
1719
|
+
points,
|
|
1720
|
+
textBox
|
|
1669
1721
|
} = data.handles;
|
|
1670
1722
|
const mappedAnnotations = CobbAngle_getMappedAnnotations(annotation, displaySetService);
|
|
1671
1723
|
const displayText = CobbAngle_getDisplayText(mappedAnnotations, displaySet);
|
|
@@ -1675,6 +1727,7 @@ const CobbAngle = {
|
|
|
1675
1727
|
SOPInstanceUID,
|
|
1676
1728
|
FrameOfReferenceUID,
|
|
1677
1729
|
points,
|
|
1730
|
+
textBox,
|
|
1678
1731
|
metadata,
|
|
1679
1732
|
referenceSeriesUID: SeriesInstanceUID,
|
|
1680
1733
|
referenceStudyUID: StudyInstanceUID,
|
|
@@ -1714,7 +1767,7 @@ function CobbAngle_getMappedAnnotations(annotation, DisplaySetService) {
|
|
|
1714
1767
|
SOPInstanceUID,
|
|
1715
1768
|
SeriesInstanceUID,
|
|
1716
1769
|
frameNumber
|
|
1717
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
1770
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId);
|
|
1718
1771
|
const displaySet = DisplaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID, frameNumber);
|
|
1719
1772
|
const {
|
|
1720
1773
|
SeriesNumber
|
|
@@ -1840,7 +1893,7 @@ const Angle = {
|
|
|
1840
1893
|
SOPInstanceUID,
|
|
1841
1894
|
SeriesInstanceUID,
|
|
1842
1895
|
StudyInstanceUID
|
|
1843
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
1896
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId, CornerstoneViewportService, viewportId);
|
|
1844
1897
|
let displaySet;
|
|
1845
1898
|
if (SOPInstanceUID) {
|
|
1846
1899
|
displaySet = displaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID);
|
|
@@ -1848,7 +1901,8 @@ const Angle = {
|
|
|
1848
1901
|
displaySet = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
|
|
1849
1902
|
}
|
|
1850
1903
|
const {
|
|
1851
|
-
points
|
|
1904
|
+
points,
|
|
1905
|
+
textBox
|
|
1852
1906
|
} = data.handles;
|
|
1853
1907
|
const mappedAnnotations = Angle_getMappedAnnotations(annotation, displaySetService);
|
|
1854
1908
|
const displayText = Angle_getDisplayText(mappedAnnotations, displaySet);
|
|
@@ -1858,6 +1912,7 @@ const Angle = {
|
|
|
1858
1912
|
SOPInstanceUID,
|
|
1859
1913
|
FrameOfReferenceUID,
|
|
1860
1914
|
points,
|
|
1915
|
+
textBox,
|
|
1861
1916
|
metadata,
|
|
1862
1917
|
referenceSeriesUID: SeriesInstanceUID,
|
|
1863
1918
|
referenceStudyUID: StudyInstanceUID,
|
|
@@ -1897,7 +1952,7 @@ function Angle_getMappedAnnotations(annotation, DisplaySetService) {
|
|
|
1897
1952
|
SOPInstanceUID,
|
|
1898
1953
|
SeriesInstanceUID,
|
|
1899
1954
|
frameNumber
|
|
1900
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
1955
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId);
|
|
1901
1956
|
const displaySet = DisplaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID, frameNumber);
|
|
1902
1957
|
const {
|
|
1903
1958
|
SeriesNumber
|
|
@@ -2021,7 +2076,7 @@ const PlanarFreehandROI = {
|
|
|
2021
2076
|
SOPInstanceUID,
|
|
2022
2077
|
SeriesInstanceUID,
|
|
2023
2078
|
StudyInstanceUID
|
|
2024
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
2079
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId, CornerstoneViewportService, viewportId);
|
|
2025
2080
|
let displaySet;
|
|
2026
2081
|
if (SOPInstanceUID) {
|
|
2027
2082
|
displaySet = DisplaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID);
|
|
@@ -2029,7 +2084,8 @@ const PlanarFreehandROI = {
|
|
|
2029
2084
|
displaySet = DisplaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
|
|
2030
2085
|
}
|
|
2031
2086
|
const {
|
|
2032
|
-
points
|
|
2087
|
+
points,
|
|
2088
|
+
textBox
|
|
2033
2089
|
} = data.handles;
|
|
2034
2090
|
const mappedAnnotations = PlanarFreehandROI_getMappedAnnotations(annotation, DisplaySetService);
|
|
2035
2091
|
const displayText = PlanarFreehandROI_getDisplayText(mappedAnnotations);
|
|
@@ -2039,6 +2095,7 @@ const PlanarFreehandROI = {
|
|
|
2039
2095
|
SOPInstanceUID,
|
|
2040
2096
|
FrameOfReferenceUID,
|
|
2041
2097
|
points,
|
|
2098
|
+
textBox,
|
|
2042
2099
|
metadata,
|
|
2043
2100
|
referenceSeriesUID: SeriesInstanceUID,
|
|
2044
2101
|
referenceStudyUID: StudyInstanceUID,
|
|
@@ -2078,7 +2135,7 @@ function PlanarFreehandROI_getMappedAnnotations(annotationData, DisplaySetServic
|
|
|
2078
2135
|
const {
|
|
2079
2136
|
SOPInstanceUID: _SOPInstanceUID,
|
|
2080
2137
|
SeriesInstanceUID: _SeriesInstanceUID
|
|
2081
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
2138
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId) || {};
|
|
2082
2139
|
if (!_SOPInstanceUID || !_SeriesInstanceUID) {
|
|
2083
2140
|
return annotations;
|
|
2084
2141
|
}
|
|
@@ -2151,7 +2208,7 @@ const RectangleROI = {
|
|
|
2151
2208
|
SOPInstanceUID,
|
|
2152
2209
|
SeriesInstanceUID,
|
|
2153
2210
|
StudyInstanceUID
|
|
2154
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
2211
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId, CornerstoneViewportService, viewportId);
|
|
2155
2212
|
let displaySet;
|
|
2156
2213
|
if (SOPInstanceUID) {
|
|
2157
2214
|
displaySet = DisplaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID);
|
|
@@ -2159,7 +2216,8 @@ const RectangleROI = {
|
|
|
2159
2216
|
displaySet = DisplaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
|
|
2160
2217
|
}
|
|
2161
2218
|
const {
|
|
2162
|
-
points
|
|
2219
|
+
points,
|
|
2220
|
+
textBox
|
|
2163
2221
|
} = data.handles;
|
|
2164
2222
|
const mappedAnnotations = RectangleROI_getMappedAnnotations(annotation, DisplaySetService);
|
|
2165
2223
|
const displayText = RectangleROI_getDisplayText(mappedAnnotations, displaySet);
|
|
@@ -2169,6 +2227,7 @@ const RectangleROI = {
|
|
|
2169
2227
|
SOPInstanceUID,
|
|
2170
2228
|
FrameOfReferenceUID,
|
|
2171
2229
|
points,
|
|
2230
|
+
textBox,
|
|
2172
2231
|
metadata,
|
|
2173
2232
|
referenceSeriesUID: SeriesInstanceUID,
|
|
2174
2233
|
referenceStudyUID: StudyInstanceUID,
|
|
@@ -2209,7 +2268,7 @@ function RectangleROI_getMappedAnnotations(annotation, DisplaySetService) {
|
|
|
2209
2268
|
SOPInstanceUID,
|
|
2210
2269
|
SeriesInstanceUID,
|
|
2211
2270
|
frameNumber
|
|
2212
|
-
} = (0,getSOPInstanceAttributes/* default */.
|
|
2271
|
+
} = (0,getSOPInstanceAttributes/* default */.A)(referencedImageId);
|
|
2213
2272
|
const displaySet = DisplaySetService.getDisplaySetForSOPInstanceUID(SOPInstanceUID, SeriesInstanceUID, frameNumber);
|
|
2214
2273
|
const {
|
|
2215
2274
|
SeriesNumber
|
|
@@ -2639,10 +2698,9 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
|
|
|
2639
2698
|
RAW_MEASUREMENT_ADDED
|
|
2640
2699
|
} = measurementService.EVENTS;
|
|
2641
2700
|
const csTools3DVer1MeasurementSource = measurementService.getSource(CORNERSTONE_3D_TOOLS_SOURCE_NAME, CORNERSTONE_3D_TOOLS_SOURCE_VERSION);
|
|
2642
|
-
measurementService.subscribe(MEASUREMENTS_CLEARED,
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
} = _ref;
|
|
2701
|
+
measurementService.subscribe(MEASUREMENTS_CLEARED, ({
|
|
2702
|
+
measurements
|
|
2703
|
+
}) => {
|
|
2646
2704
|
if (!Object.keys(measurements).length) {
|
|
2647
2705
|
return;
|
|
2648
2706
|
}
|
|
@@ -2657,12 +2715,11 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
|
|
|
2657
2715
|
removeAnnotation(uid);
|
|
2658
2716
|
}
|
|
2659
2717
|
});
|
|
2660
|
-
measurementService.subscribe(MEASUREMENT_UPDATED,
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
} = _ref2;
|
|
2718
|
+
measurementService.subscribe(MEASUREMENT_UPDATED, ({
|
|
2719
|
+
source,
|
|
2720
|
+
measurement,
|
|
2721
|
+
notYetUpdatedAtSource
|
|
2722
|
+
}) => {
|
|
2666
2723
|
if (source.name !== CORNERSTONE_3D_TOOLS_SOURCE_NAME) {
|
|
2667
2724
|
return;
|
|
2668
2725
|
}
|
|
@@ -2692,14 +2749,12 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
|
|
|
2692
2749
|
|
|
2693
2750
|
// Todo: trigger render for annotation
|
|
2694
2751
|
});
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
dataSource
|
|
2702
|
-
} = _ref3;
|
|
2752
|
+
measurementService.subscribe(RAW_MEASUREMENT_ADDED, ({
|
|
2753
|
+
source,
|
|
2754
|
+
measurement,
|
|
2755
|
+
data,
|
|
2756
|
+
dataSource
|
|
2757
|
+
}) => {
|
|
2703
2758
|
if (source.name !== CORNERSTONE_3D_TOOLS_SOURCE_NAME) {
|
|
2704
2759
|
return;
|
|
2705
2760
|
}
|
|
@@ -2713,7 +2768,7 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
|
|
|
2713
2768
|
let frameNumber = 1;
|
|
2714
2769
|
if (measurement?.metadata?.referencedImageId) {
|
|
2715
2770
|
imageId = measurement.metadata.referencedImageId;
|
|
2716
|
-
frameNumber = (0,getSOPInstanceAttributes/* default */.
|
|
2771
|
+
frameNumber = (0,getSOPInstanceAttributes/* default */.A)(measurement.metadata.referencedImageId).frameNumber;
|
|
2717
2772
|
} else {
|
|
2718
2773
|
imageId = dataSource.getImageIdsForInstance({
|
|
2719
2774
|
instance
|
|
@@ -2743,11 +2798,10 @@ const connectMeasurementServiceToTools = (measurementService, cornerstoneViewpor
|
|
|
2743
2798
|
}
|
|
2744
2799
|
});
|
|
2745
2800
|
});
|
|
2746
|
-
measurementService.subscribe(MEASUREMENT_REMOVED,
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
} = _ref4;
|
|
2801
|
+
measurementService.subscribe(MEASUREMENT_REMOVED, ({
|
|
2802
|
+
source,
|
|
2803
|
+
measurement: removedMeasurementId
|
|
2804
|
+
}) => {
|
|
2751
2805
|
if (source?.name && source.name !== CORNERSTONE_3D_TOOLS_SOURCE_NAME) {
|
|
2752
2806
|
return;
|
|
2753
2807
|
}
|
|
@@ -2826,7 +2880,7 @@ function getInterleavedFrames(imageIds) {
|
|
|
2826
2880
|
return imageIdsToPrefetch;
|
|
2827
2881
|
}
|
|
2828
2882
|
// EXTERNAL MODULE: ../../../node_modules/lodash/lodash.js
|
|
2829
|
-
var lodash = __webpack_require__(
|
|
2883
|
+
var lodash = __webpack_require__(5517);
|
|
2830
2884
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/interleaveCenterLoader.ts
|
|
2831
2885
|
|
|
2832
2886
|
|
|
@@ -2844,15 +2898,14 @@ const viewportIdVolumeInputArrayMap = new Map();
|
|
|
2844
2898
|
* @param {Object} props image loading properties from Cornerstone ViewportService
|
|
2845
2899
|
* @returns
|
|
2846
2900
|
*/
|
|
2847
|
-
function interleaveCenterLoader(
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
} = _ref;
|
|
2901
|
+
function interleaveCenterLoader({
|
|
2902
|
+
data: {
|
|
2903
|
+
viewportId,
|
|
2904
|
+
volumeInputArray
|
|
2905
|
+
},
|
|
2906
|
+
displaySetsMatchDetails,
|
|
2907
|
+
viewportMatchDetails: matchDetails
|
|
2908
|
+
}) {
|
|
2856
2909
|
viewportIdVolumeInputArrayMap.set(viewportId, volumeInputArray);
|
|
2857
2910
|
|
|
2858
2911
|
// Based on the volumeInputs store the volumeIds and SeriesInstanceIds
|
|
@@ -2921,10 +2974,9 @@ function interleaveCenterLoader(_ref) {
|
|
|
2921
2974
|
return request.imageId;
|
|
2922
2975
|
});
|
|
2923
2976
|
const imageIds = getInterleavedFrames(requestImageIds);
|
|
2924
|
-
const reOrderedRequests = imageIds.map(
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
} = _ref2;
|
|
2977
|
+
const reOrderedRequests = imageIds.map(({
|
|
2978
|
+
imageId
|
|
2979
|
+
}) => {
|
|
2928
2980
|
const request = requests.find(req => req.imageId === imageId);
|
|
2929
2981
|
return request;
|
|
2930
2982
|
});
|
|
@@ -2950,14 +3002,13 @@ function interleaveCenterLoader(_ref) {
|
|
|
2950
3002
|
});
|
|
2951
3003
|
const requestType = esm.Enums.RequestType.Prefetch;
|
|
2952
3004
|
const priority = 0;
|
|
2953
|
-
finalRequests.forEach(
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
} = _ref3;
|
|
3005
|
+
finalRequests.forEach(({
|
|
3006
|
+
callLoadImage,
|
|
3007
|
+
additionalDetails,
|
|
3008
|
+
imageId,
|
|
3009
|
+
imageIdIndex,
|
|
3010
|
+
options
|
|
3011
|
+
}) => {
|
|
2961
3012
|
const callLoadImageBound = callLoadImage.bind(null, imageId, imageIdIndex, options);
|
|
2962
3013
|
esm.imageLoadPoolManager.addRequest(callLoadImageBound, requestType, additionalDetails, priority);
|
|
2963
3014
|
});
|
|
@@ -3055,14 +3106,13 @@ const nthLoader_viewportIdVolumeInputArrayMap = new Map();
|
|
|
3055
3106
|
* visually much better.
|
|
3056
3107
|
* @param {Object} props image loading properties from Cornerstone ViewportService
|
|
3057
3108
|
*/
|
|
3058
|
-
function interleaveNthLoader(
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
} = _ref;
|
|
3109
|
+
function interleaveNthLoader({
|
|
3110
|
+
data: {
|
|
3111
|
+
viewportId,
|
|
3112
|
+
volumeInputArray
|
|
3113
|
+
},
|
|
3114
|
+
displaySetsMatchDetails
|
|
3115
|
+
}) {
|
|
3066
3116
|
nthLoader_viewportIdVolumeInputArrayMap.set(viewportId, volumeInputArray);
|
|
3067
3117
|
|
|
3068
3118
|
// Based on the volumeInputs store the volumeIds and SeriesInstanceIds
|
|
@@ -3100,14 +3150,13 @@ function interleaveNthLoader(_ref) {
|
|
|
3100
3150
|
const finalRequests = interleave(orderedRequests);
|
|
3101
3151
|
const requestType = esm.Enums.RequestType.Prefetch;
|
|
3102
3152
|
const priority = 0;
|
|
3103
|
-
finalRequests.forEach(
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
} = _ref2;
|
|
3153
|
+
finalRequests.forEach(({
|
|
3154
|
+
callLoadImage,
|
|
3155
|
+
additionalDetails,
|
|
3156
|
+
imageId,
|
|
3157
|
+
imageIdIndex,
|
|
3158
|
+
options
|
|
3159
|
+
}) => {
|
|
3111
3160
|
const callLoadImageBound = callLoadImage.bind(null, imageId, imageIdIndex, options);
|
|
3112
3161
|
esm.imageLoadPoolManager.addRequest(callLoadImageBound, requestType, additionalDetails, priority);
|
|
3113
3162
|
});
|
|
@@ -3138,15 +3187,14 @@ const interleaveTopToBottom_viewportIdVolumeInputArrayMap = new Map();
|
|
|
3138
3187
|
* @param {Object} {viewportData, displaySetMatchDetails}
|
|
3139
3188
|
* @returns
|
|
3140
3189
|
*/
|
|
3141
|
-
function interleaveTopToBottom(
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
} = _ref;
|
|
3190
|
+
function interleaveTopToBottom({
|
|
3191
|
+
data: {
|
|
3192
|
+
viewportId,
|
|
3193
|
+
volumeInputArray
|
|
3194
|
+
},
|
|
3195
|
+
displaySetsMatchDetails,
|
|
3196
|
+
viewportMatchDetails: matchDetails
|
|
3197
|
+
}) {
|
|
3150
3198
|
interleaveTopToBottom_viewportIdVolumeInputArrayMap.set(viewportId, volumeInputArray);
|
|
3151
3199
|
|
|
3152
3200
|
// Based on the volumeInputs store the volumeIds and SeriesInstanceIds
|
|
@@ -3235,14 +3283,13 @@ function interleaveTopToBottom(_ref) {
|
|
|
3235
3283
|
});
|
|
3236
3284
|
const requestType = esm.Enums.RequestType.Prefetch;
|
|
3237
3285
|
const priority = 0;
|
|
3238
|
-
finalRequests.forEach(
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
} = _ref2;
|
|
3286
|
+
finalRequests.forEach(({
|
|
3287
|
+
callLoadImage,
|
|
3288
|
+
additionalDetails,
|
|
3289
|
+
imageId,
|
|
3290
|
+
imageIdIndex,
|
|
3291
|
+
options
|
|
3292
|
+
}) => {
|
|
3246
3293
|
const callLoadImageBound = callLoadImage.bind(null, imageId, imageIdIndex, options);
|
|
3247
3294
|
esm.imageLoadPoolManager.addRequest(callLoadImageBound, requestType, additionalDetails, priority);
|
|
3248
3295
|
});
|
|
@@ -3324,12 +3371,11 @@ function getEventName(evt) {
|
|
|
3324
3371
|
nameArr.push(button);
|
|
3325
3372
|
return nameArr.join('');
|
|
3326
3373
|
}
|
|
3327
|
-
function initContextMenu(
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
} = _ref;
|
|
3374
|
+
function initContextMenu({
|
|
3375
|
+
cornerstoneViewportService,
|
|
3376
|
+
customizationService,
|
|
3377
|
+
commandsManager
|
|
3378
|
+
}) {
|
|
3333
3379
|
/*
|
|
3334
3380
|
* Run the commands associated with the given button press,
|
|
3335
3381
|
* defaults on button1 and button2
|
|
@@ -3367,7 +3413,7 @@ function initContextMenu(_ref) {
|
|
|
3367
3413
|
return;
|
|
3368
3414
|
}
|
|
3369
3415
|
// TODO check update upstream
|
|
3370
|
-
(0,state/* setEnabledElement */.
|
|
3416
|
+
(0,state/* setEnabledElement */.ye)(viewportId, element);
|
|
3371
3417
|
element.addEventListener(cs3DToolsEvents.MOUSE_CLICK, cornerstoneViewportHandleClick);
|
|
3372
3418
|
}
|
|
3373
3419
|
function elementDisabledHandler(evt) {
|
|
@@ -3413,11 +3459,10 @@ function getDoubleClickEventName(evt) {
|
|
|
3413
3459
|
nameArr.push('doubleClick');
|
|
3414
3460
|
return nameArr.join('');
|
|
3415
3461
|
}
|
|
3416
|
-
function initDoubleClick(
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
} = _ref;
|
|
3462
|
+
function initDoubleClick({
|
|
3463
|
+
customizationService,
|
|
3464
|
+
commandsManager
|
|
3465
|
+
}) {
|
|
3421
3466
|
const cornerstoneViewportHandleDoubleClick = evt => {
|
|
3422
3467
|
// Do not allow double click on a tool.
|
|
3423
3468
|
const nearbyToolData = findNearbyToolData(commandsManager, evt);
|
|
@@ -3453,10 +3498,7 @@ function initDoubleClick(_ref) {
|
|
|
3453
3498
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/initViewTiming.ts
|
|
3454
3499
|
|
|
3455
3500
|
|
|
3456
|
-
const
|
|
3457
|
-
TimingEnum
|
|
3458
|
-
} = src.Types;
|
|
3459
|
-
const IMAGE_TIMING_KEYS = [TimingEnum.DISPLAY_SETS_TO_ALL_IMAGES, TimingEnum.DISPLAY_SETS_TO_FIRST_IMAGE, TimingEnum.STUDY_TO_FIRST_IMAGE];
|
|
3501
|
+
const IMAGE_TIMING_KEYS = [];
|
|
3460
3502
|
const imageTiming = {
|
|
3461
3503
|
viewportsWaiting: 0
|
|
3462
3504
|
};
|
|
@@ -3470,11 +3512,18 @@ const imageTiming = {
|
|
|
3470
3512
|
*
|
|
3471
3513
|
*/
|
|
3472
3514
|
|
|
3473
|
-
function initViewTiming(
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3515
|
+
function initViewTiming({
|
|
3516
|
+
element
|
|
3517
|
+
}) {
|
|
3518
|
+
if (!IMAGE_TIMING_KEYS.length) {
|
|
3519
|
+
// Work around a bug in WebPack that doesn't getting the enums initialized
|
|
3520
|
+
// quite fast enough to be declared statically.
|
|
3521
|
+
const {
|
|
3522
|
+
TimingEnum
|
|
3523
|
+
} = src.Enums;
|
|
3524
|
+
IMAGE_TIMING_KEYS.push(TimingEnum.DISPLAY_SETS_TO_ALL_IMAGES, TimingEnum.DISPLAY_SETS_TO_FIRST_IMAGE, TimingEnum.STUDY_TO_FIRST_IMAGE);
|
|
3525
|
+
}
|
|
3526
|
+
if (!IMAGE_TIMING_KEYS.find(key => src/* log */.Rm.timingKeys[key])) {
|
|
3478
3527
|
return;
|
|
3479
3528
|
}
|
|
3480
3529
|
imageTiming.viewportsWaiting += 1;
|
|
@@ -3484,13 +3533,16 @@ function imageRenderedListener(evt) {
|
|
|
3484
3533
|
if (evt.detail.viewportStatus === 'preRender') {
|
|
3485
3534
|
return;
|
|
3486
3535
|
}
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3536
|
+
const {
|
|
3537
|
+
TimingEnum
|
|
3538
|
+
} = src.Enums;
|
|
3539
|
+
src/* log */.Rm.timeEnd(TimingEnum.DISPLAY_SETS_TO_FIRST_IMAGE);
|
|
3540
|
+
src/* log */.Rm.timeEnd(TimingEnum.STUDY_TO_FIRST_IMAGE);
|
|
3541
|
+
src/* log */.Rm.timeEnd(TimingEnum.SCRIPT_TO_VIEW);
|
|
3490
3542
|
imageTiming.viewportsWaiting -= 1;
|
|
3491
3543
|
evt.detail.element.removeEventListener(esm.EVENTS.IMAGE_RENDERED, imageRenderedListener);
|
|
3492
3544
|
if (!imageTiming.viewportsWaiting) {
|
|
3493
|
-
src/* log */.
|
|
3545
|
+
src/* log */.Rm.timeEnd(TimingEnum.DISPLAY_SETS_TO_ALL_IMAGES);
|
|
3494
3546
|
}
|
|
3495
3547
|
}
|
|
3496
3548
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/init.tsx
|
|
@@ -3518,14 +3570,13 @@ window.cornerstoneTools = dist_esm;
|
|
|
3518
3570
|
/**
|
|
3519
3571
|
*
|
|
3520
3572
|
*/
|
|
3521
|
-
async function init(
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
} = _ref;
|
|
3573
|
+
async function init({
|
|
3574
|
+
servicesManager,
|
|
3575
|
+
commandsManager,
|
|
3576
|
+
extensionManager,
|
|
3577
|
+
configuration,
|
|
3578
|
+
appConfig
|
|
3579
|
+
}) {
|
|
3529
3580
|
// Note: this should run first before initializing the cornerstone
|
|
3530
3581
|
// DO NOT CHANGE THE ORDER
|
|
3531
3582
|
const value = appConfig.useSharedArrayBuffer;
|
|
@@ -3540,8 +3591,8 @@ async function init(_ref) {
|
|
|
3540
3591
|
}
|
|
3541
3592
|
await (0,esm.init)({
|
|
3542
3593
|
rendering: {
|
|
3543
|
-
preferSizeOverAccuracy: Boolean(appConfig.
|
|
3544
|
-
useNorm16Texture: Boolean(appConfig.
|
|
3594
|
+
preferSizeOverAccuracy: Boolean(appConfig.preferSizeOverAccuracy),
|
|
3595
|
+
useNorm16Texture: Boolean(appConfig.useNorm16Texture)
|
|
3545
3596
|
}
|
|
3546
3597
|
});
|
|
3547
3598
|
|
|
@@ -3575,7 +3626,8 @@ async function init(_ref) {
|
|
|
3575
3626
|
toolGroupService,
|
|
3576
3627
|
toolbarService,
|
|
3577
3628
|
viewportGridService,
|
|
3578
|
-
stateSyncService
|
|
3629
|
+
stateSyncService,
|
|
3630
|
+
syncGroupService
|
|
3579
3631
|
} = servicesManager.services;
|
|
3580
3632
|
window.services = servicesManager.services;
|
|
3581
3633
|
window.extensionManager = extensionManager;
|
|
@@ -3597,6 +3649,11 @@ async function init(_ref) {
|
|
|
3597
3649
|
clearOnModeExit: true
|
|
3598
3650
|
});
|
|
3599
3651
|
|
|
3652
|
+
// Stores synchronizers state to be restored
|
|
3653
|
+
stateSyncService.register('synchronizersStore', {
|
|
3654
|
+
clearOnModeExit: true
|
|
3655
|
+
});
|
|
3656
|
+
|
|
3600
3657
|
// Stores a map from `positionPresentationId` to a Presentation object so that
|
|
3601
3658
|
// an OHIFCornerstoneViewport can be redisplayed with the same position
|
|
3602
3659
|
stateSyncService.register('positionPresentationStore', {
|
|
@@ -3615,8 +3672,8 @@ async function init(_ref) {
|
|
|
3615
3672
|
outlineOpacity: 1,
|
|
3616
3673
|
outlineOpacityInactive: 0.65
|
|
3617
3674
|
});
|
|
3618
|
-
const metadataProvider = src
|
|
3619
|
-
esm.volumeLoader.registerVolumeLoader('cornerstoneStreamingImageVolume', streaming_image_volume_loader_dist_esm/* cornerstoneStreamingImageVolumeLoader */.
|
|
3675
|
+
const metadataProvider = src/* default.classes */.Ay.classes.MetadataProvider;
|
|
3676
|
+
esm.volumeLoader.registerVolumeLoader('cornerstoneStreamingImageVolume', streaming_image_volume_loader_dist_esm/* cornerstoneStreamingImageVolumeLoader */.FC);
|
|
3620
3677
|
hangingProtocolService.registerImageLoadStrategy('interleaveCenter', interleaveCenterLoader);
|
|
3621
3678
|
hangingProtocolService.registerImageLoadStrategy('interleaveTopToBottom', interleaveTopToBottom);
|
|
3622
3679
|
hangingProtocolService.registerImageLoadStrategy('nth', interleaveNthLoader);
|
|
@@ -3655,6 +3712,16 @@ async function init(_ref) {
|
|
|
3655
3712
|
cornerstoneViewportService.setVolumesForViewport(viewport, volumeInputArray, presentations);
|
|
3656
3713
|
}
|
|
3657
3714
|
});
|
|
3715
|
+
|
|
3716
|
+
// resize the cornerstone viewport service when the grid size changes
|
|
3717
|
+
// IMPORTANT: this should happen outside of the OHIFCornerstoneViewport
|
|
3718
|
+
// since it will trigger a rerender of each viewport and each resizing
|
|
3719
|
+
// the offscreen canvas which would result in a performance hit, this should
|
|
3720
|
+
// done only once per grid resize here. Doing it once here, allows us to reduce
|
|
3721
|
+
// the refreshRage(in ms) to 10 from 50. I tried with even 1 or 5 ms it worked fine
|
|
3722
|
+
viewportGridService.subscribe(viewportGridService.EVENTS.GRID_SIZE_CHANGED, () => {
|
|
3723
|
+
cornerstoneViewportService.resize(true);
|
|
3724
|
+
});
|
|
3658
3725
|
src_initContextMenu({
|
|
3659
3726
|
cornerstoneViewportService,
|
|
3660
3727
|
customizationService,
|
|
@@ -3710,6 +3777,17 @@ async function init(_ref) {
|
|
|
3710
3777
|
});
|
|
3711
3778
|
});
|
|
3712
3779
|
};
|
|
3780
|
+
|
|
3781
|
+
/**
|
|
3782
|
+
* Runs error handler for failed requests.
|
|
3783
|
+
* @param event
|
|
3784
|
+
*/
|
|
3785
|
+
const imageLoadFailedHandler = ({
|
|
3786
|
+
detail
|
|
3787
|
+
}) => {
|
|
3788
|
+
const handler = src/* errorHandler */.r_.getHTTPErrorHandler();
|
|
3789
|
+
handler(detail.error);
|
|
3790
|
+
};
|
|
3713
3791
|
const resetCrosshairs = evt => {
|
|
3714
3792
|
const {
|
|
3715
3793
|
element
|
|
@@ -3737,6 +3815,8 @@ async function init(_ref) {
|
|
|
3737
3815
|
} = evt.detail;
|
|
3738
3816
|
dist_esm.utilities.stackContextPrefetch.enable(element);
|
|
3739
3817
|
});
|
|
3818
|
+
esm.eventTarget.addEventListener(esm.EVENTS.IMAGE_LOAD_FAILED, imageLoadFailedHandler);
|
|
3819
|
+
esm.eventTarget.addEventListener(esm.EVENTS.IMAGE_LOAD_ERROR, imageLoadFailedHandler);
|
|
3740
3820
|
function elementEnabledHandler(evt) {
|
|
3741
3821
|
const {
|
|
3742
3822
|
element
|
|
@@ -3760,7 +3840,6 @@ async function init(_ref) {
|
|
|
3760
3840
|
// newStackCallback
|
|
3761
3841
|
// );
|
|
3762
3842
|
}
|
|
3763
|
-
|
|
3764
3843
|
esm.eventTarget.addEventListener(esm.EVENTS.ELEMENT_ENABLED, elementEnabledHandler.bind(null));
|
|
3765
3844
|
esm.eventTarget.addEventListener(esm.EVENTS.ELEMENT_DISABLED, elementDisabledHandler.bind(null));
|
|
3766
3845
|
viewportGridService.subscribe(viewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED, activeViewportEventListener);
|
|
@@ -3788,12 +3867,12 @@ function _showCPURenderingModal(uiModalService, hangingProtocolService) {
|
|
|
3788
3867
|
});
|
|
3789
3868
|
}
|
|
3790
3869
|
// EXTERNAL MODULE: ../../../node_modules/react-dropzone/dist/es/index.js + 5 modules
|
|
3791
|
-
var es = __webpack_require__(
|
|
3870
|
+
var es = __webpack_require__(5013);
|
|
3792
3871
|
// EXTERNAL MODULE: ../../../node_modules/prop-types/index.js
|
|
3793
|
-
var prop_types = __webpack_require__(
|
|
3872
|
+
var prop_types = __webpack_require__(11374);
|
|
3794
3873
|
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
|
|
3795
3874
|
// EXTERNAL MODULE: ../../../node_modules/classnames/index.js
|
|
3796
|
-
var classnames = __webpack_require__(
|
|
3875
|
+
var classnames = __webpack_require__(61466);
|
|
3797
3876
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
3798
3877
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/DicomFileUploader.ts
|
|
3799
3878
|
|
|
@@ -3817,7 +3896,7 @@ class UploadRejection {
|
|
|
3817
3896
|
this.status = status;
|
|
3818
3897
|
}
|
|
3819
3898
|
}
|
|
3820
|
-
class DicomFileUploader extends src/* PubSubService */.
|
|
3899
|
+
class DicomFileUploader extends src/* PubSubService */.Rc {
|
|
3821
3900
|
constructor(file, dataSource) {
|
|
3822
3901
|
super(EVENTS);
|
|
3823
3902
|
this._file = void 0;
|
|
@@ -3956,10 +4035,9 @@ class DicomFileUploader extends src/* PubSubService */.hC {
|
|
|
3956
4035
|
|
|
3957
4036
|
|
|
3958
4037
|
// eslint-disable-next-line react/display-name
|
|
3959
|
-
const DicomUploadProgressItem = /*#__PURE__*/(0,react.memo)(
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
} = _ref;
|
|
4038
|
+
const DicomUploadProgressItem = /*#__PURE__*/(0,react.memo)(({
|
|
4039
|
+
dicomFileUploader
|
|
4040
|
+
}) => {
|
|
3963
4041
|
const [percentComplete, setPercentComplete] = (0,react.useState)(dicomFileUploader.getPercentComplete());
|
|
3964
4042
|
const [failedReason, setFailedReason] = (0,react.useState)('');
|
|
3965
4043
|
const [status, setStatus] = (0,react.useState)(dicomFileUploader.getStatus());
|
|
@@ -3982,20 +4060,20 @@ const DicomUploadProgressItem = /*#__PURE__*/(0,react.memo)(_ref => {
|
|
|
3982
4060
|
const getStatusIcon = () => {
|
|
3983
4061
|
switch (dicomFileUploader.getStatus()) {
|
|
3984
4062
|
case UploadStatus.Success:
|
|
3985
|
-
return /*#__PURE__*/react.createElement(ui_src/* Icon */.
|
|
4063
|
+
return /*#__PURE__*/react.createElement(ui_src/* Icon */.In, {
|
|
3986
4064
|
name: "status-tracked",
|
|
3987
4065
|
className: "text-primary-light"
|
|
3988
4066
|
});
|
|
3989
4067
|
case UploadStatus.InProgress:
|
|
3990
|
-
return /*#__PURE__*/react.createElement(ui_src/* Icon */.
|
|
4068
|
+
return /*#__PURE__*/react.createElement(ui_src/* Icon */.In, {
|
|
3991
4069
|
name: "icon-transferring"
|
|
3992
4070
|
});
|
|
3993
4071
|
case UploadStatus.Failed:
|
|
3994
|
-
return /*#__PURE__*/react.createElement(ui_src/* Icon */.
|
|
4072
|
+
return /*#__PURE__*/react.createElement(ui_src/* Icon */.In, {
|
|
3995
4073
|
name: "icon-alert-small"
|
|
3996
4074
|
});
|
|
3997
4075
|
case UploadStatus.Cancelled:
|
|
3998
|
-
return /*#__PURE__*/react.createElement(ui_src/* Icon */.
|
|
4076
|
+
return /*#__PURE__*/react.createElement(ui_src/* Icon */.In, {
|
|
3999
4077
|
name: "icon-alert-outline"
|
|
4000
4078
|
});
|
|
4001
4079
|
default:
|
|
@@ -4020,7 +4098,7 @@ const DicomUploadProgressItem = /*#__PURE__*/(0,react.memo)(_ref => {
|
|
|
4020
4098
|
className: "w-10 text-right"
|
|
4021
4099
|
}, percentComplete, "%"), /*#__PURE__*/react.createElement("div", {
|
|
4022
4100
|
className: "ml-auto flex cursor-pointer"
|
|
4023
|
-
}, /*#__PURE__*/react.createElement(ui_src/* Icon */.
|
|
4101
|
+
}, /*#__PURE__*/react.createElement(ui_src/* Icon */.In, {
|
|
4024
4102
|
className: "text-primary-active self-center",
|
|
4025
4103
|
name: "close",
|
|
4026
4104
|
onClick: cancelUpload
|
|
@@ -4055,11 +4133,10 @@ const BASE_INTERVAL_TIME = 15000;
|
|
|
4055
4133
|
// calculate the upload rate.
|
|
4056
4134
|
const UPLOAD_RATE_THRESHOLD = 75;
|
|
4057
4135
|
const NO_WRAP_ELLIPSIS_CLASS_NAMES = 'text-ellipsis whitespace-nowrap overflow-hidden';
|
|
4058
|
-
function DicomUploadProgress(
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
} = _ref;
|
|
4136
|
+
function DicomUploadProgress({
|
|
4137
|
+
dicomFileUploaderArr,
|
|
4138
|
+
onComplete
|
|
4139
|
+
}) {
|
|
4063
4140
|
const [totalUploadSize] = (0,react.useState)(dicomFileUploaderArr.reduce((acc, fileUploader) => acc + fileUploader.getFileSize(), 0));
|
|
4064
4141
|
const currentUploadSizeRef = (0,react.useRef)(0);
|
|
4065
4142
|
const uploadRateRef = (0,react.useRef)(0);
|
|
@@ -4251,7 +4328,7 @@ function DicomUploadProgress(_ref) {
|
|
|
4251
4328
|
className: "bg-primary-dark flex h-14 items-center px-1 pb-4 text-lg"
|
|
4252
4329
|
}, numFilesCompleted === dicomFileUploaderArr.length ? /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("span", {
|
|
4253
4330
|
className: NO_WRAP_ELLIPSIS_CLASS_NAMES
|
|
4254
|
-
}, `${dicomFileUploaderArr.length} ${dicomFileUploaderArr.length > 1 ? 'files' : 'file'} completed.`), /*#__PURE__*/react.createElement(ui_src/* Button
|
|
4331
|
+
}, `${dicomFileUploaderArr.length} ${dicomFileUploaderArr.length > 1 ? 'files' : 'file'} completed.`), /*#__PURE__*/react.createElement(ui_src/* Button */.$n, {
|
|
4255
4332
|
disabled: false,
|
|
4256
4333
|
className: "ml-auto",
|
|
4257
4334
|
onClick: onComplete
|
|
@@ -4272,7 +4349,7 @@ function DicomUploadProgress(_ref) {
|
|
|
4272
4349
|
className: "ml-auto flex w-6 justify-center"
|
|
4273
4350
|
}, numFails > 0 && /*#__PURE__*/react.createElement("div", {
|
|
4274
4351
|
onClick: () => setShowFailedOnly(currentShowFailedOnly => !currentShowFailedOnly)
|
|
4275
|
-
}, /*#__PURE__*/react.createElement(ui_src/* Icon */.
|
|
4352
|
+
}, /*#__PURE__*/react.createElement(ui_src/* Icon */.In, {
|
|
4276
4353
|
className: "cursor-pointer",
|
|
4277
4354
|
name: "icon-status-alert"
|
|
4278
4355
|
})));
|
|
@@ -4287,7 +4364,7 @@ function DicomUploadProgress(_ref) {
|
|
|
4287
4364
|
}, numFails > 0 ? `Completed with ${numFails} ${numFails > 1 ? 'errors' : 'error'}!` : 'Completed!'), getShowFailedOnlyIconComponent()) : /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("div", {
|
|
4288
4365
|
ref: progressBarContainerRef,
|
|
4289
4366
|
className: "flex-grow"
|
|
4290
|
-
}, /*#__PURE__*/react.createElement(ui_src/* ProgressLoadingBar */.
|
|
4367
|
+
}, /*#__PURE__*/react.createElement(ui_src/* ProgressLoadingBar */.dD, {
|
|
4291
4368
|
progress: showInfiniteProgressBar() ? undefined : Math.min(100, percentComplete)
|
|
4292
4369
|
})), /*#__PURE__*/react.createElement("div", {
|
|
4293
4370
|
className: "ml-1 flex w-24 items-center"
|
|
@@ -4324,12 +4401,11 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
4324
4401
|
|
|
4325
4402
|
|
|
4326
4403
|
|
|
4327
|
-
function DicomUpload(
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
} = _ref;
|
|
4404
|
+
function DicomUpload({
|
|
4405
|
+
dataSource,
|
|
4406
|
+
onComplete,
|
|
4407
|
+
onStarted
|
|
4408
|
+
}) {
|
|
4333
4409
|
const baseClassNames = 'min-h-[480px] flex flex-col bg-black select-none';
|
|
4334
4410
|
const [dicomFileUploaderArr, setDicomFileUploaderArr] = (0,react.useState)([]);
|
|
4335
4411
|
const onDrop = (0,react.useCallback)(async acceptedFiles => {
|
|
@@ -4337,53 +4413,44 @@ function DicomUpload(_ref) {
|
|
|
4337
4413
|
setDicomFileUploaderArr(acceptedFiles.map(file => new DicomFileUploader(file, dataSource)));
|
|
4338
4414
|
}, []);
|
|
4339
4415
|
const getDropZoneComponent = () => {
|
|
4340
|
-
return /*#__PURE__*/react.createElement(es/* default */.
|
|
4416
|
+
return /*#__PURE__*/react.createElement(es/* default */.A, {
|
|
4341
4417
|
onDrop: acceptedFiles => {
|
|
4342
4418
|
onDrop(acceptedFiles);
|
|
4343
4419
|
},
|
|
4344
4420
|
noClick: true
|
|
4345
|
-
},
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
webkitdirectory: "true",
|
|
4379
|
-
mozdirectory: "true"
|
|
4380
|
-
}))));
|
|
4381
|
-
})), /*#__PURE__*/react.createElement("div", {
|
|
4382
|
-
className: "pt-5"
|
|
4383
|
-
}, "or drag images or folders here"), /*#__PURE__*/react.createElement("div", {
|
|
4384
|
-
className: "text-aqua-pale pt-3 text-lg"
|
|
4385
|
-
}, "(DICOM files supported)"));
|
|
4386
|
-
});
|
|
4421
|
+
}, ({
|
|
4422
|
+
getRootProps
|
|
4423
|
+
}) => /*#__PURE__*/react.createElement("div", _extends({}, getRootProps(), {
|
|
4424
|
+
className: "dicom-upload-drop-area-border-dash m-5 flex h-full flex-col items-center justify-center"
|
|
4425
|
+
}), /*#__PURE__*/react.createElement("div", {
|
|
4426
|
+
className: "flex gap-3"
|
|
4427
|
+
}, /*#__PURE__*/react.createElement(es/* default */.A, {
|
|
4428
|
+
onDrop: onDrop,
|
|
4429
|
+
noDrag: true
|
|
4430
|
+
}, ({
|
|
4431
|
+
getRootProps,
|
|
4432
|
+
getInputProps
|
|
4433
|
+
}) => /*#__PURE__*/react.createElement("div", getRootProps(), /*#__PURE__*/react.createElement(ui_src/* Button */.$n, {
|
|
4434
|
+
disabled: false,
|
|
4435
|
+
onClick: () => {}
|
|
4436
|
+
}, 'Add files', /*#__PURE__*/react.createElement("input", getInputProps())))), /*#__PURE__*/react.createElement(es/* default */.A, {
|
|
4437
|
+
onDrop: onDrop,
|
|
4438
|
+
noDrag: true
|
|
4439
|
+
}, ({
|
|
4440
|
+
getRootProps,
|
|
4441
|
+
getInputProps
|
|
4442
|
+
}) => /*#__PURE__*/react.createElement("div", getRootProps(), /*#__PURE__*/react.createElement(ui_src/* Button */.$n, {
|
|
4443
|
+
type: ui_src/* ButtonEnums.type */.Ny.NW.secondary,
|
|
4444
|
+
disabled: false,
|
|
4445
|
+
onClick: () => {}
|
|
4446
|
+
}, 'Add folder', /*#__PURE__*/react.createElement("input", _extends({}, getInputProps(), {
|
|
4447
|
+
webkitdirectory: "true",
|
|
4448
|
+
mozdirectory: "true"
|
|
4449
|
+
})))))), /*#__PURE__*/react.createElement("div", {
|
|
4450
|
+
className: "pt-5"
|
|
4451
|
+
}, "or drag images or folders here"), /*#__PURE__*/react.createElement("div", {
|
|
4452
|
+
className: "text-aqua-pale pt-3 text-lg"
|
|
4453
|
+
}, "(DICOM files supported)")));
|
|
4387
4454
|
};
|
|
4388
4455
|
return /*#__PURE__*/react.createElement(react.Fragment, null, dicomFileUploaderArr.length ? /*#__PURE__*/react.createElement("div", {
|
|
4389
4456
|
className: classnames_default()('h-[calc(100vh-300px)]', baseClassNames)
|
|
@@ -4444,8 +4511,10 @@ function getCustomizationModule() {
|
|
|
4444
4511
|
}];
|
|
4445
4512
|
}
|
|
4446
4513
|
/* harmony default export */ const src_getCustomizationModule = (getCustomizationModule);
|
|
4514
|
+
// EXTERNAL MODULE: ../../../node_modules/gl-matrix/esm/index.js + 10 modules
|
|
4515
|
+
var gl_matrix_esm = __webpack_require__(83636);
|
|
4447
4516
|
// EXTERNAL MODULE: ../../../node_modules/html2canvas/dist/html2canvas.esm.js
|
|
4448
|
-
var html2canvas_esm = __webpack_require__(
|
|
4517
|
+
var html2canvas_esm = __webpack_require__(90445);
|
|
4449
4518
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/CornerstoneViewportDownloadForm.tsx
|
|
4450
4519
|
|
|
4451
4520
|
|
|
@@ -4458,13 +4527,12 @@ const MINIMUM_SIZE = 100;
|
|
|
4458
4527
|
const DEFAULT_SIZE = 512;
|
|
4459
4528
|
const MAX_TEXTURE_SIZE = 10000;
|
|
4460
4529
|
const VIEWPORT_ID = 'cornerstone-viewport-download-form';
|
|
4461
|
-
const CornerstoneViewportDownloadForm =
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
const enabledElement = (0,state/* getEnabledElement */.K8)(activeViewportIdProp);
|
|
4530
|
+
const CornerstoneViewportDownloadForm = ({
|
|
4531
|
+
onClose,
|
|
4532
|
+
activeViewportId: activeViewportIdProp,
|
|
4533
|
+
cornerstoneViewportService
|
|
4534
|
+
}) => {
|
|
4535
|
+
const enabledElement = (0,state/* getEnabledElement */.kJ)(activeViewportIdProp);
|
|
4468
4536
|
const activeViewportElement = enabledElement?.element;
|
|
4469
4537
|
const activeViewportEnabledElement = (0,esm.getEnabledElement)(activeViewportElement);
|
|
4470
4538
|
const {
|
|
@@ -4541,6 +4609,7 @@ const CornerstoneViewportDownloadForm = _ref => {
|
|
|
4541
4609
|
renderingEngine.resize();
|
|
4542
4610
|
|
|
4543
4611
|
// Trigger the render on the viewport to update the on screen
|
|
4612
|
+
downloadViewport.resetCamera();
|
|
4544
4613
|
downloadViewport.render();
|
|
4545
4614
|
downloadViewportElement.addEventListener(esm.Enums.Events.IMAGE_RENDERED, function updateViewport(event) {
|
|
4546
4615
|
const enabledElement = (0,esm.getEnabledElement)(event.target);
|
|
@@ -4647,19 +4716,18 @@ const CornerstoneViewportDownloadForm = _ref => {
|
|
|
4647
4716
|
const downloadBlob = (filename, fileType) => {
|
|
4648
4717
|
const file = `${filename}.${fileType}`;
|
|
4649
4718
|
const divForDownloadViewport = document.querySelector(`div[data-viewport-uid="${VIEWPORT_ID}"]`);
|
|
4650
|
-
(0,html2canvas_esm/* default */.
|
|
4719
|
+
(0,html2canvas_esm/* default */.A)(divForDownloadViewport).then(canvas => {
|
|
4651
4720
|
const link = document.createElement('a');
|
|
4652
4721
|
link.download = file;
|
|
4653
4722
|
link.href = canvas.toDataURL(fileType, 1.0);
|
|
4654
4723
|
link.click();
|
|
4655
4724
|
});
|
|
4656
4725
|
};
|
|
4657
|
-
return /*#__PURE__*/react.createElement(ui_src/* ViewportDownloadForm */.
|
|
4726
|
+
return /*#__PURE__*/react.createElement(ui_src/* ViewportDownloadForm */.VS, {
|
|
4658
4727
|
onClose: onClose,
|
|
4659
4728
|
minimumSize: MINIMUM_SIZE,
|
|
4660
4729
|
maximumSize: MAX_TEXTURE_SIZE,
|
|
4661
4730
|
defaultSize: DEFAULT_SIZE,
|
|
4662
|
-
canvasClass: 'cornerstone-canvas',
|
|
4663
4731
|
activeViewportElement: activeViewportElement,
|
|
4664
4732
|
enableViewport: enableViewport,
|
|
4665
4733
|
disableViewport: disableViewport,
|
|
@@ -4674,16 +4742,15 @@ CornerstoneViewportDownloadForm.propTypes = {
|
|
|
4674
4742
|
activeViewportId: (prop_types_default()).string.isRequired
|
|
4675
4743
|
};
|
|
4676
4744
|
/* harmony default export */ const utils_CornerstoneViewportDownloadForm = (CornerstoneViewportDownloadForm);
|
|
4677
|
-
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/
|
|
4678
|
-
const
|
|
4679
|
-
function
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
} = _ref;
|
|
4745
|
+
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/imageSliceSync/toggleImageSliceSync.ts
|
|
4746
|
+
const IMAGE_SLICE_SYNC_NAME = 'IMAGE_SLICE_SYNC';
|
|
4747
|
+
function toggleImageSliceSync({
|
|
4748
|
+
toggledState,
|
|
4749
|
+
servicesManager,
|
|
4750
|
+
viewports: providedViewports
|
|
4751
|
+
}) {
|
|
4685
4752
|
if (!toggledState) {
|
|
4686
|
-
return disableSync(
|
|
4753
|
+
return disableSync(IMAGE_SLICE_SYNC_NAME, servicesManager);
|
|
4687
4754
|
}
|
|
4688
4755
|
const {
|
|
4689
4756
|
syncGroupService,
|
|
@@ -4704,7 +4771,7 @@ function toggleStackImageSync(_ref) {
|
|
|
4704
4771
|
}
|
|
4705
4772
|
syncGroupService.addViewportToSyncGroup(viewportId, viewport.getRenderingEngine().id, {
|
|
4706
4773
|
type: 'stackimage',
|
|
4707
|
-
id:
|
|
4774
|
+
id: IMAGE_SLICE_SYNC_NAME,
|
|
4708
4775
|
source: true,
|
|
4709
4776
|
target: true
|
|
4710
4777
|
});
|
|
@@ -4767,11 +4834,11 @@ function getReconstructableStackViewports(viewportGridService, displaySetService
|
|
|
4767
4834
|
|
|
4768
4835
|
|
|
4769
4836
|
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4837
|
+
|
|
4838
|
+
function commandsModule({
|
|
4839
|
+
servicesManager,
|
|
4840
|
+
commandsManager
|
|
4841
|
+
}) {
|
|
4775
4842
|
const {
|
|
4776
4843
|
viewportGridService,
|
|
4777
4844
|
toolGroupService,
|
|
@@ -4835,19 +4902,17 @@ function commandsModule(_ref) {
|
|
|
4835
4902
|
};
|
|
4836
4903
|
commandsManager.run(options, optionsToUse);
|
|
4837
4904
|
},
|
|
4838
|
-
getNearbyToolData(
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
} = _ref2;
|
|
4905
|
+
getNearbyToolData({
|
|
4906
|
+
nearbyToolData,
|
|
4907
|
+
element,
|
|
4908
|
+
canvasCoordinates
|
|
4909
|
+
}) {
|
|
4844
4910
|
return nearbyToolData ?? dist_esm.utilities.getAnnotationNearPoint(element, canvasCoordinates);
|
|
4845
4911
|
},
|
|
4846
|
-
getNearbyAnnotation(
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
} = _ref3;
|
|
4912
|
+
getNearbyAnnotation({
|
|
4913
|
+
element,
|
|
4914
|
+
canvasCoordinates
|
|
4915
|
+
}) {
|
|
4851
4916
|
const nearbyToolData = actions.getNearbyToolData({
|
|
4852
4917
|
nearbyToolData: null,
|
|
4853
4918
|
element,
|
|
@@ -4871,10 +4936,9 @@ function commandsModule(_ref) {
|
|
|
4871
4936
|
// Measurement tool commands:
|
|
4872
4937
|
|
|
4873
4938
|
/** Delete the given measurement */
|
|
4874
|
-
deleteMeasurement:
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
} = _ref4;
|
|
4939
|
+
deleteMeasurement: ({
|
|
4940
|
+
uid
|
|
4941
|
+
}) => {
|
|
4878
4942
|
if (uid) {
|
|
4879
4943
|
measurementServiceSource.remove(uid);
|
|
4880
4944
|
}
|
|
@@ -4883,10 +4947,9 @@ function commandsModule(_ref) {
|
|
|
4883
4947
|
* Show the measurement labelling input dialog and update the label
|
|
4884
4948
|
* on the measurement with a response if not cancelled.
|
|
4885
4949
|
*/
|
|
4886
|
-
setMeasurementLabel:
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
} = _ref5;
|
|
4950
|
+
setMeasurementLabel: ({
|
|
4951
|
+
uid
|
|
4952
|
+
}) => {
|
|
4890
4953
|
const measurement = measurementService.getMeasurement(uid);
|
|
4891
4954
|
utils_callInputDialog(uiDialogService, measurement, (label, actionId) => {
|
|
4892
4955
|
if (actionId === 'cancel') {
|
|
@@ -4961,10 +5024,9 @@ function commandsModule(_ref) {
|
|
|
4961
5024
|
},
|
|
4962
5025
|
// Retrieve value commands
|
|
4963
5026
|
getActiveViewportEnabledElement: _getActiveViewportEnabledElement,
|
|
4964
|
-
setViewportActive:
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
} = _ref6;
|
|
5027
|
+
setViewportActive: ({
|
|
5028
|
+
viewportId
|
|
5029
|
+
}) => {
|
|
4968
5030
|
const viewportInfo = cornerstoneViewportService.getViewportInfo(viewportId);
|
|
4969
5031
|
if (!viewportInfo) {
|
|
4970
5032
|
console.warn('No viewport found for viewportId:', viewportId);
|
|
@@ -4972,11 +5034,10 @@ function commandsModule(_ref) {
|
|
|
4972
5034
|
}
|
|
4973
5035
|
viewportGridService.setActiveViewportId(viewportId);
|
|
4974
5036
|
},
|
|
4975
|
-
arrowTextCallback:
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
} = _ref7;
|
|
5037
|
+
arrowTextCallback: ({
|
|
5038
|
+
callback,
|
|
5039
|
+
data
|
|
5040
|
+
}) => {
|
|
4980
5041
|
utils_callInputDialog(uiDialogService, data, callback);
|
|
4981
5042
|
},
|
|
4982
5043
|
cleanUpCrosshairs: () => {
|
|
@@ -5013,12 +5074,11 @@ function commandsModule(_ref) {
|
|
|
5013
5074
|
isPlaying: false
|
|
5014
5075
|
}));
|
|
5015
5076
|
},
|
|
5016
|
-
setWindowLevel(
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
} = _ref8;
|
|
5077
|
+
setWindowLevel({
|
|
5078
|
+
window,
|
|
5079
|
+
level,
|
|
5080
|
+
toolGroupId
|
|
5081
|
+
}) {
|
|
5022
5082
|
// convert to numbers
|
|
5023
5083
|
const windowWidthNum = Number(window);
|
|
5024
5084
|
const windowCenterNum = Number(level);
|
|
@@ -5056,12 +5116,11 @@ function commandsModule(_ref) {
|
|
|
5056
5116
|
setToolbarToggled: props => {
|
|
5057
5117
|
toolbarService.setToggled(props.toolId, props.isActive ?? true);
|
|
5058
5118
|
},
|
|
5059
|
-
setToolActive:
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
} = _ref9;
|
|
5119
|
+
setToolActive: ({
|
|
5120
|
+
toolName,
|
|
5121
|
+
toolGroupId = null,
|
|
5122
|
+
toggledState
|
|
5123
|
+
}) => {
|
|
5065
5124
|
if (toolName === 'Crosshairs') {
|
|
5066
5125
|
const activeViewportToolGroup = toolGroupService.getToolGroup(null);
|
|
5067
5126
|
if (!activeViewportToolGroup._toolInstances.Crosshairs) {
|
|
@@ -5146,10 +5205,9 @@ function commandsModule(_ref) {
|
|
|
5146
5205
|
});
|
|
5147
5206
|
}
|
|
5148
5207
|
},
|
|
5149
|
-
rotateViewport:
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
} = _ref10;
|
|
5208
|
+
rotateViewport: ({
|
|
5209
|
+
rotation
|
|
5210
|
+
}) => {
|
|
5153
5211
|
const enabledElement = _getActiveViewportEnabledElement();
|
|
5154
5212
|
if (!enabledElement) {
|
|
5155
5213
|
return;
|
|
@@ -5157,10 +5215,18 @@ function commandsModule(_ref) {
|
|
|
5157
5215
|
const {
|
|
5158
5216
|
viewport
|
|
5159
5217
|
} = enabledElement;
|
|
5160
|
-
if (viewport instanceof esm.
|
|
5161
|
-
const
|
|
5162
|
-
|
|
5163
|
-
|
|
5218
|
+
if (viewport instanceof esm.BaseVolumeViewport) {
|
|
5219
|
+
const camera = viewport.getCamera();
|
|
5220
|
+
const rotAngle = rotation * Math.PI / 180;
|
|
5221
|
+
const rotMat = gl_matrix_esm/* mat4.identity */.pB.identity(new Float32Array(16));
|
|
5222
|
+
gl_matrix_esm/* mat4.rotate */.pB.rotate(rotMat, rotMat, rotAngle, camera.viewPlaneNormal);
|
|
5223
|
+
const rotatedViewUp = gl_matrix_esm/* vec3.transformMat4 */.eR.transformMat4(gl_matrix_esm/* vec3.create */.eR.create(), camera.viewUp, rotMat);
|
|
5224
|
+
viewport.setCamera({
|
|
5225
|
+
viewUp: rotatedViewUp
|
|
5226
|
+
});
|
|
5227
|
+
viewport.render();
|
|
5228
|
+
} else if (viewport.getRotation !== undefined) {
|
|
5229
|
+
const currentRotation = viewport.getRotation();
|
|
5164
5230
|
const newRotation = (currentRotation + rotation) % 360;
|
|
5165
5231
|
viewport.setProperties({
|
|
5166
5232
|
rotation: newRotation
|
|
@@ -5204,10 +5270,9 @@ function commandsModule(_ref) {
|
|
|
5204
5270
|
viewport.render();
|
|
5205
5271
|
}
|
|
5206
5272
|
},
|
|
5207
|
-
invertViewport:
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
} = _ref11;
|
|
5273
|
+
invertViewport: ({
|
|
5274
|
+
element
|
|
5275
|
+
}) => {
|
|
5211
5276
|
let enabledElement;
|
|
5212
5277
|
if (element === undefined) {
|
|
5213
5278
|
enabledElement = _getActiveViewportEnabledElement();
|
|
@@ -5240,10 +5305,9 @@ function commandsModule(_ref) {
|
|
|
5240
5305
|
viewport.resetCamera();
|
|
5241
5306
|
viewport.render();
|
|
5242
5307
|
},
|
|
5243
|
-
scaleViewport:
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
} = _ref12;
|
|
5308
|
+
scaleViewport: ({
|
|
5309
|
+
direction
|
|
5310
|
+
}) => {
|
|
5247
5311
|
const enabledElement = _getActiveViewportEnabledElement();
|
|
5248
5312
|
const scaleFactor = direction > 0 ? 0.9 : 1.1;
|
|
5249
5313
|
if (!enabledElement) {
|
|
@@ -5268,11 +5332,10 @@ function commandsModule(_ref) {
|
|
|
5268
5332
|
}
|
|
5269
5333
|
},
|
|
5270
5334
|
/** Jumps the active viewport or the specified one to the given slice index */
|
|
5271
|
-
jumpToImage:
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
} = _ref13;
|
|
5335
|
+
jumpToImage: ({
|
|
5336
|
+
imageIndex,
|
|
5337
|
+
viewport: gridViewport
|
|
5338
|
+
}) => {
|
|
5276
5339
|
// Get current active viewport (return if none active)
|
|
5277
5340
|
let viewport;
|
|
5278
5341
|
if (!gridViewport) {
|
|
@@ -5306,10 +5369,9 @@ function commandsModule(_ref) {
|
|
|
5306
5369
|
};
|
|
5307
5370
|
dist_esm.utilities.jumpToSlice(viewport.element, options);
|
|
5308
5371
|
},
|
|
5309
|
-
scroll:
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
} = _ref14;
|
|
5372
|
+
scroll: ({
|
|
5373
|
+
direction
|
|
5374
|
+
}) => {
|
|
5313
5375
|
const enabledElement = _getActiveViewportEnabledElement();
|
|
5314
5376
|
if (!enabledElement) {
|
|
5315
5377
|
return;
|
|
@@ -5322,13 +5384,12 @@ function commandsModule(_ref) {
|
|
|
5322
5384
|
};
|
|
5323
5385
|
dist_esm.utilities.scroll(viewport, options);
|
|
5324
5386
|
},
|
|
5325
|
-
setViewportColormap:
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
} = _ref15;
|
|
5387
|
+
setViewportColormap: ({
|
|
5388
|
+
viewportId,
|
|
5389
|
+
displaySetInstanceUID,
|
|
5390
|
+
colormap,
|
|
5391
|
+
immediate = false
|
|
5392
|
+
}) => {
|
|
5332
5393
|
const viewport = cornerstoneViewportService.getCornerstoneViewport(viewportId);
|
|
5333
5394
|
const actorEntries = viewport.getActors();
|
|
5334
5395
|
const actorEntry = actorEntries.find(actorEntry => {
|
|
@@ -5346,10 +5407,9 @@ function commandsModule(_ref) {
|
|
|
5346
5407
|
viewport.render();
|
|
5347
5408
|
}
|
|
5348
5409
|
},
|
|
5349
|
-
changeActiveViewport:
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
} = _ref16;
|
|
5410
|
+
changeActiveViewport: ({
|
|
5411
|
+
direction = 1
|
|
5412
|
+
}) => {
|
|
5353
5413
|
const {
|
|
5354
5414
|
activeViewportId,
|
|
5355
5415
|
viewports
|
|
@@ -5359,20 +5419,18 @@ function commandsModule(_ref) {
|
|
|
5359
5419
|
const nextViewportIndex = (currentIndex + direction + viewportIds.length) % viewportIds.length;
|
|
5360
5420
|
viewportGridService.setActiveViewportId(viewportIds[nextViewportIndex]);
|
|
5361
5421
|
},
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
toggleStackImageSync({
|
|
5422
|
+
toggleImageSliceSync: ({
|
|
5423
|
+
toggledState
|
|
5424
|
+
}) => {
|
|
5425
|
+
toggleImageSliceSync({
|
|
5367
5426
|
servicesManager,
|
|
5368
5427
|
toggledState
|
|
5369
5428
|
});
|
|
5370
5429
|
},
|
|
5371
|
-
setSourceViewportForReferenceLinesTool:
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
} = _ref18;
|
|
5430
|
+
setSourceViewportForReferenceLinesTool: ({
|
|
5431
|
+
toggledState,
|
|
5432
|
+
viewportId
|
|
5433
|
+
}) => {
|
|
5376
5434
|
if (!viewportId) {
|
|
5377
5435
|
const {
|
|
5378
5436
|
activeViewportId
|
|
@@ -5385,14 +5443,32 @@ function commandsModule(_ref) {
|
|
|
5385
5443
|
}, true // overwrite
|
|
5386
5444
|
);
|
|
5387
5445
|
},
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
viewportId
|
|
5392
|
-
} = _ref19;
|
|
5446
|
+
storePresentation: ({
|
|
5447
|
+
viewportId
|
|
5448
|
+
}) => {
|
|
5393
5449
|
cornerstoneViewportService.storePresentation({
|
|
5394
5450
|
viewportId
|
|
5395
5451
|
});
|
|
5452
|
+
},
|
|
5453
|
+
attachProtocolViewportDataListener: ({
|
|
5454
|
+
protocol,
|
|
5455
|
+
stageIndex
|
|
5456
|
+
}) => {
|
|
5457
|
+
const EVENT = cornerstoneViewportService.EVENTS.VIEWPORT_DATA_CHANGED;
|
|
5458
|
+
const command = protocol.callbacks.onViewportDataInitialized;
|
|
5459
|
+
const numPanes = protocol.stages?.[stageIndex]?.viewports.length ?? 1;
|
|
5460
|
+
let numPanesWithData = 0;
|
|
5461
|
+
const {
|
|
5462
|
+
unsubscribe
|
|
5463
|
+
} = cornerstoneViewportService.subscribe(EVENT, evt => {
|
|
5464
|
+
numPanesWithData++;
|
|
5465
|
+
if (numPanesWithData === numPanes) {
|
|
5466
|
+
commandsManager.run(...command);
|
|
5467
|
+
|
|
5468
|
+
// Unsubscribe from the event
|
|
5469
|
+
unsubscribe(EVENT);
|
|
5470
|
+
}
|
|
5471
|
+
});
|
|
5396
5472
|
}
|
|
5397
5473
|
};
|
|
5398
5474
|
const definitions = {
|
|
@@ -5527,8 +5603,8 @@ function commandsModule(_ref) {
|
|
|
5527
5603
|
setViewportColormap: {
|
|
5528
5604
|
commandFn: actions.setViewportColormap
|
|
5529
5605
|
},
|
|
5530
|
-
|
|
5531
|
-
commandFn: actions.
|
|
5606
|
+
toggleImageSliceSync: {
|
|
5607
|
+
commandFn: actions.toggleImageSliceSync
|
|
5532
5608
|
},
|
|
5533
5609
|
setSourceViewportForReferenceLinesTool: {
|
|
5534
5610
|
commandFn: actions.setSourceViewportForReferenceLinesTool
|
|
@@ -5541,6 +5617,9 @@ function commandsModule(_ref) {
|
|
|
5541
5617
|
},
|
|
5542
5618
|
cleanUpCrosshairs: {
|
|
5543
5619
|
commandFn: actions.cleanUpCrosshairs
|
|
5620
|
+
},
|
|
5621
|
+
attachProtocolViewportDataListener: {
|
|
5622
|
+
commandFn: actions.attachProtocolViewportDataListener
|
|
5544
5623
|
}
|
|
5545
5624
|
};
|
|
5546
5625
|
return {
|
|
@@ -5550,35 +5629,19 @@ function commandsModule(_ref) {
|
|
|
5550
5629
|
};
|
|
5551
5630
|
}
|
|
5552
5631
|
/* harmony default export */ const src_commandsModule = (commandsModule);
|
|
5553
|
-
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/
|
|
5554
|
-
const
|
|
5555
|
-
id: '
|
|
5556
|
-
name: 'Multi-Planar Reconstruction',
|
|
5632
|
+
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/fourUp.ts
|
|
5633
|
+
const fourUp = {
|
|
5634
|
+
id: 'fourUp',
|
|
5557
5635
|
locked: true,
|
|
5558
|
-
|
|
5559
|
-
|
|
5636
|
+
name: 'fourUp',
|
|
5637
|
+
createdDate: '2023-03-15T10:29:44.894Z',
|
|
5638
|
+
modifiedDate: '2023-03-15T10:29:44.894Z',
|
|
5560
5639
|
availableTo: {},
|
|
5561
5640
|
editableBy: {},
|
|
5562
|
-
// Unknown number of priors referenced - so just match any study
|
|
5563
|
-
numberOfPriorsReferenced: 0,
|
|
5564
5641
|
protocolMatchingRules: [],
|
|
5565
|
-
imageLoadStrategy: '
|
|
5566
|
-
callbacks: {
|
|
5567
|
-
// Switches out of MPR mode when the layout change button is used
|
|
5568
|
-
onLayoutChange: [{
|
|
5569
|
-
commandName: 'toggleHangingProtocol',
|
|
5570
|
-
commandOptions: {
|
|
5571
|
-
protocolId: 'mpr'
|
|
5572
|
-
},
|
|
5573
|
-
context: 'DEFAULT'
|
|
5574
|
-
}],
|
|
5575
|
-
// Turns off crosshairs when switching out of MPR mode
|
|
5576
|
-
onProtocolExit: [{
|
|
5577
|
-
commandName: 'cleanUpCrosshairs'
|
|
5578
|
-
}]
|
|
5579
|
-
},
|
|
5642
|
+
imageLoadStrategy: 'interleaveCenter',
|
|
5580
5643
|
displaySetSelectors: {
|
|
5581
|
-
|
|
5644
|
+
mprDisplaySet: {
|
|
5582
5645
|
seriesMatchingRules: [{
|
|
5583
5646
|
weight: 1,
|
|
5584
5647
|
attribute: 'isReconstructable',
|
|
@@ -5592,33 +5655,17 @@ const mpr = {
|
|
|
5592
5655
|
}
|
|
5593
5656
|
},
|
|
5594
5657
|
stages: [{
|
|
5595
|
-
|
|
5658
|
+
id: 'fourUpStage',
|
|
5659
|
+
name: 'fourUp',
|
|
5596
5660
|
viewportStructure: {
|
|
5597
5661
|
layoutType: 'grid',
|
|
5598
5662
|
properties: {
|
|
5599
|
-
rows:
|
|
5600
|
-
columns:
|
|
5601
|
-
layoutOptions: [{
|
|
5602
|
-
x: 0,
|
|
5603
|
-
y: 0,
|
|
5604
|
-
width: 1 / 3,
|
|
5605
|
-
height: 1
|
|
5606
|
-
}, {
|
|
5607
|
-
x: 1 / 3,
|
|
5608
|
-
y: 0,
|
|
5609
|
-
width: 1 / 3,
|
|
5610
|
-
height: 1
|
|
5611
|
-
}, {
|
|
5612
|
-
x: 2 / 3,
|
|
5613
|
-
y: 0,
|
|
5614
|
-
width: 1 / 3,
|
|
5615
|
-
height: 1
|
|
5616
|
-
}]
|
|
5663
|
+
rows: 2,
|
|
5664
|
+
columns: 2
|
|
5617
5665
|
}
|
|
5618
5666
|
},
|
|
5619
5667
|
viewports: [{
|
|
5620
5668
|
viewportOptions: {
|
|
5621
|
-
viewportId: 'mpr-axial',
|
|
5622
5669
|
toolGroupId: 'mpr',
|
|
5623
5670
|
viewportType: 'volume',
|
|
5624
5671
|
orientation: 'axial',
|
|
@@ -5633,14 +5680,29 @@ const mpr = {
|
|
|
5633
5680
|
}]
|
|
5634
5681
|
},
|
|
5635
5682
|
displaySets: [{
|
|
5636
|
-
id: '
|
|
5683
|
+
id: 'mprDisplaySet'
|
|
5684
|
+
}]
|
|
5685
|
+
}, {
|
|
5686
|
+
viewportOptions: {
|
|
5687
|
+
toolGroupId: 'volume3d',
|
|
5688
|
+
viewportType: 'volume3d',
|
|
5689
|
+
orientation: 'coronal',
|
|
5690
|
+
customViewportProps: {
|
|
5691
|
+
hideOverlays: true
|
|
5692
|
+
}
|
|
5693
|
+
},
|
|
5694
|
+
displaySets: [{
|
|
5695
|
+
id: 'mprDisplaySet',
|
|
5696
|
+
options: {
|
|
5697
|
+
// ToDo: choose appropriate preset
|
|
5698
|
+
displayPreset: 'CT-Bone'
|
|
5699
|
+
}
|
|
5637
5700
|
}]
|
|
5638
5701
|
}, {
|
|
5639
5702
|
viewportOptions: {
|
|
5640
|
-
viewportId: 'mpr-sagittal',
|
|
5641
5703
|
toolGroupId: 'mpr',
|
|
5642
5704
|
viewportType: 'volume',
|
|
5643
|
-
orientation: '
|
|
5705
|
+
orientation: 'coronal',
|
|
5644
5706
|
initialImageOptions: {
|
|
5645
5707
|
preset: 'middle'
|
|
5646
5708
|
},
|
|
@@ -5652,14 +5714,13 @@ const mpr = {
|
|
|
5652
5714
|
}]
|
|
5653
5715
|
},
|
|
5654
5716
|
displaySets: [{
|
|
5655
|
-
id: '
|
|
5717
|
+
id: 'mprDisplaySet'
|
|
5656
5718
|
}]
|
|
5657
5719
|
}, {
|
|
5658
5720
|
viewportOptions: {
|
|
5659
|
-
viewportId: 'mpr-coronal',
|
|
5660
5721
|
toolGroupId: 'mpr',
|
|
5661
5722
|
viewportType: 'volume',
|
|
5662
|
-
orientation: '
|
|
5723
|
+
orientation: 'sagittal',
|
|
5663
5724
|
initialImageOptions: {
|
|
5664
5725
|
preset: 'middle'
|
|
5665
5726
|
},
|
|
@@ -5671,15 +5732,16 @@ const mpr = {
|
|
|
5671
5732
|
}]
|
|
5672
5733
|
},
|
|
5673
5734
|
displaySets: [{
|
|
5674
|
-
id: '
|
|
5735
|
+
id: 'mprDisplaySet'
|
|
5675
5736
|
}]
|
|
5676
5737
|
}]
|
|
5677
5738
|
}]
|
|
5678
5739
|
};
|
|
5679
|
-
|
|
5680
|
-
|
|
5740
|
+
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/main3D.ts
|
|
5741
|
+
const main3D = {
|
|
5742
|
+
id: 'main3D',
|
|
5681
5743
|
locked: true,
|
|
5682
|
-
name: '
|
|
5744
|
+
name: 'main3D',
|
|
5683
5745
|
createdDate: '2023-03-15T10:29:44.894Z',
|
|
5684
5746
|
modifiedDate: '2023-03-15T10:29:44.894Z',
|
|
5685
5747
|
availableTo: {},
|
|
@@ -5697,25 +5759,280 @@ const mprAnd3DVolumeViewport = {
|
|
|
5697
5759
|
}
|
|
5698
5760
|
},
|
|
5699
5761
|
required: true
|
|
5700
|
-
}, {
|
|
5701
|
-
attribute: 'Modality',
|
|
5702
|
-
constraint: {
|
|
5703
|
-
equals: {
|
|
5704
|
-
value: 'CT'
|
|
5705
|
-
}
|
|
5706
|
-
},
|
|
5707
|
-
required: true
|
|
5708
5762
|
}]
|
|
5709
5763
|
}
|
|
5710
5764
|
},
|
|
5711
5765
|
stages: [{
|
|
5712
|
-
id: '
|
|
5713
|
-
name: '
|
|
5766
|
+
id: 'main3DStage',
|
|
5767
|
+
name: 'main3D',
|
|
5714
5768
|
viewportStructure: {
|
|
5715
5769
|
layoutType: 'grid',
|
|
5716
5770
|
properties: {
|
|
5717
5771
|
rows: 2,
|
|
5718
|
-
columns:
|
|
5772
|
+
columns: 3,
|
|
5773
|
+
layoutOptions: [{
|
|
5774
|
+
x: 0,
|
|
5775
|
+
y: 0,
|
|
5776
|
+
width: 1,
|
|
5777
|
+
height: 1 / 2
|
|
5778
|
+
}, {
|
|
5779
|
+
x: 0,
|
|
5780
|
+
y: 1 / 2,
|
|
5781
|
+
width: 1 / 3,
|
|
5782
|
+
height: 1 / 2
|
|
5783
|
+
}, {
|
|
5784
|
+
x: 1 / 3,
|
|
5785
|
+
y: 1 / 2,
|
|
5786
|
+
width: 1 / 3,
|
|
5787
|
+
height: 1 / 2
|
|
5788
|
+
}, {
|
|
5789
|
+
x: 2 / 3,
|
|
5790
|
+
y: 1 / 2,
|
|
5791
|
+
width: 1 / 3,
|
|
5792
|
+
height: 1 / 2
|
|
5793
|
+
}]
|
|
5794
|
+
}
|
|
5795
|
+
},
|
|
5796
|
+
viewports: [{
|
|
5797
|
+
viewportOptions: {
|
|
5798
|
+
toolGroupId: 'volume3d',
|
|
5799
|
+
viewportType: 'volume3d',
|
|
5800
|
+
orientation: 'coronal',
|
|
5801
|
+
customViewportProps: {
|
|
5802
|
+
hideOverlays: true
|
|
5803
|
+
}
|
|
5804
|
+
},
|
|
5805
|
+
displaySets: [{
|
|
5806
|
+
id: 'mprDisplaySet',
|
|
5807
|
+
options: {
|
|
5808
|
+
// ToDo: choose appropriate preset
|
|
5809
|
+
displayPreset: 'CT-Bone'
|
|
5810
|
+
}
|
|
5811
|
+
}]
|
|
5812
|
+
}, {
|
|
5813
|
+
viewportOptions: {
|
|
5814
|
+
toolGroupId: 'mpr',
|
|
5815
|
+
viewportType: 'volume',
|
|
5816
|
+
orientation: 'axial',
|
|
5817
|
+
initialImageOptions: {
|
|
5818
|
+
preset: 'middle'
|
|
5819
|
+
},
|
|
5820
|
+
syncGroups: [{
|
|
5821
|
+
type: 'voi',
|
|
5822
|
+
id: 'mpr',
|
|
5823
|
+
source: true,
|
|
5824
|
+
target: true
|
|
5825
|
+
}]
|
|
5826
|
+
},
|
|
5827
|
+
displaySets: [{
|
|
5828
|
+
id: 'mprDisplaySet'
|
|
5829
|
+
}]
|
|
5830
|
+
}, {
|
|
5831
|
+
viewportOptions: {
|
|
5832
|
+
toolGroupId: 'mpr',
|
|
5833
|
+
viewportType: 'volume',
|
|
5834
|
+
orientation: 'coronal',
|
|
5835
|
+
initialImageOptions: {
|
|
5836
|
+
preset: 'middle'
|
|
5837
|
+
},
|
|
5838
|
+
syncGroups: [{
|
|
5839
|
+
type: 'voi',
|
|
5840
|
+
id: 'mpr',
|
|
5841
|
+
source: true,
|
|
5842
|
+
target: true
|
|
5843
|
+
}]
|
|
5844
|
+
},
|
|
5845
|
+
displaySets: [{
|
|
5846
|
+
id: 'mprDisplaySet'
|
|
5847
|
+
}]
|
|
5848
|
+
}, {
|
|
5849
|
+
viewportOptions: {
|
|
5850
|
+
toolGroupId: 'mpr',
|
|
5851
|
+
viewportType: 'volume',
|
|
5852
|
+
orientation: 'sagittal',
|
|
5853
|
+
initialImageOptions: {
|
|
5854
|
+
preset: 'middle'
|
|
5855
|
+
},
|
|
5856
|
+
syncGroups: [{
|
|
5857
|
+
type: 'voi',
|
|
5858
|
+
id: 'mpr',
|
|
5859
|
+
source: true,
|
|
5860
|
+
target: true
|
|
5861
|
+
}]
|
|
5862
|
+
},
|
|
5863
|
+
displaySets: [{
|
|
5864
|
+
id: 'mprDisplaySet'
|
|
5865
|
+
}]
|
|
5866
|
+
}]
|
|
5867
|
+
}]
|
|
5868
|
+
};
|
|
5869
|
+
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/mpr.ts
|
|
5870
|
+
const mpr = {
|
|
5871
|
+
id: 'mpr',
|
|
5872
|
+
name: 'Multi-Planar Reconstruction',
|
|
5873
|
+
locked: true,
|
|
5874
|
+
createdDate: '2021-02-23',
|
|
5875
|
+
modifiedDate: '2023-08-15',
|
|
5876
|
+
availableTo: {},
|
|
5877
|
+
editableBy: {},
|
|
5878
|
+
// Unknown number of priors referenced - so just match any study
|
|
5879
|
+
numberOfPriorsReferenced: 0,
|
|
5880
|
+
protocolMatchingRules: [],
|
|
5881
|
+
imageLoadStrategy: 'nth',
|
|
5882
|
+
callbacks: {
|
|
5883
|
+
// Switches out of MPR mode when the layout change button is used
|
|
5884
|
+
onLayoutChange: [{
|
|
5885
|
+
commandName: 'toggleHangingProtocol',
|
|
5886
|
+
commandOptions: {
|
|
5887
|
+
protocolId: 'mpr'
|
|
5888
|
+
},
|
|
5889
|
+
context: 'DEFAULT'
|
|
5890
|
+
}],
|
|
5891
|
+
// Turns off crosshairs when switching out of MPR mode
|
|
5892
|
+
onProtocolExit: [{
|
|
5893
|
+
commandName: 'cleanUpCrosshairs'
|
|
5894
|
+
}]
|
|
5895
|
+
},
|
|
5896
|
+
displaySetSelectors: {
|
|
5897
|
+
activeDisplaySet: {
|
|
5898
|
+
seriesMatchingRules: [{
|
|
5899
|
+
weight: 1,
|
|
5900
|
+
attribute: 'isReconstructable',
|
|
5901
|
+
constraint: {
|
|
5902
|
+
equals: {
|
|
5903
|
+
value: true
|
|
5904
|
+
}
|
|
5905
|
+
},
|
|
5906
|
+
required: true
|
|
5907
|
+
}]
|
|
5908
|
+
}
|
|
5909
|
+
},
|
|
5910
|
+
stages: [{
|
|
5911
|
+
name: 'MPR 1x3',
|
|
5912
|
+
viewportStructure: {
|
|
5913
|
+
layoutType: 'grid',
|
|
5914
|
+
properties: {
|
|
5915
|
+
rows: 1,
|
|
5916
|
+
columns: 3,
|
|
5917
|
+
layoutOptions: [{
|
|
5918
|
+
x: 0,
|
|
5919
|
+
y: 0,
|
|
5920
|
+
width: 1 / 3,
|
|
5921
|
+
height: 1
|
|
5922
|
+
}, {
|
|
5923
|
+
x: 1 / 3,
|
|
5924
|
+
y: 0,
|
|
5925
|
+
width: 1 / 3,
|
|
5926
|
+
height: 1
|
|
5927
|
+
}, {
|
|
5928
|
+
x: 2 / 3,
|
|
5929
|
+
y: 0,
|
|
5930
|
+
width: 1 / 3,
|
|
5931
|
+
height: 1
|
|
5932
|
+
}]
|
|
5933
|
+
}
|
|
5934
|
+
},
|
|
5935
|
+
viewports: [{
|
|
5936
|
+
viewportOptions: {
|
|
5937
|
+
viewportId: 'mpr-axial',
|
|
5938
|
+
toolGroupId: 'mpr',
|
|
5939
|
+
viewportType: 'volume',
|
|
5940
|
+
orientation: 'axial',
|
|
5941
|
+
initialImageOptions: {
|
|
5942
|
+
preset: 'middle'
|
|
5943
|
+
},
|
|
5944
|
+
syncGroups: [{
|
|
5945
|
+
type: 'voi',
|
|
5946
|
+
id: 'mpr',
|
|
5947
|
+
source: true,
|
|
5948
|
+
target: true
|
|
5949
|
+
}]
|
|
5950
|
+
},
|
|
5951
|
+
displaySets: [{
|
|
5952
|
+
id: 'activeDisplaySet'
|
|
5953
|
+
}]
|
|
5954
|
+
}, {
|
|
5955
|
+
viewportOptions: {
|
|
5956
|
+
viewportId: 'mpr-sagittal',
|
|
5957
|
+
toolGroupId: 'mpr',
|
|
5958
|
+
viewportType: 'volume',
|
|
5959
|
+
orientation: 'sagittal',
|
|
5960
|
+
initialImageOptions: {
|
|
5961
|
+
preset: 'middle'
|
|
5962
|
+
},
|
|
5963
|
+
syncGroups: [{
|
|
5964
|
+
type: 'voi',
|
|
5965
|
+
id: 'mpr',
|
|
5966
|
+
source: true,
|
|
5967
|
+
target: true
|
|
5968
|
+
}]
|
|
5969
|
+
},
|
|
5970
|
+
displaySets: [{
|
|
5971
|
+
id: 'activeDisplaySet'
|
|
5972
|
+
}]
|
|
5973
|
+
}, {
|
|
5974
|
+
viewportOptions: {
|
|
5975
|
+
viewportId: 'mpr-coronal',
|
|
5976
|
+
toolGroupId: 'mpr',
|
|
5977
|
+
viewportType: 'volume',
|
|
5978
|
+
orientation: 'coronal',
|
|
5979
|
+
initialImageOptions: {
|
|
5980
|
+
preset: 'middle'
|
|
5981
|
+
},
|
|
5982
|
+
syncGroups: [{
|
|
5983
|
+
type: 'voi',
|
|
5984
|
+
id: 'mpr',
|
|
5985
|
+
source: true,
|
|
5986
|
+
target: true
|
|
5987
|
+
}]
|
|
5988
|
+
},
|
|
5989
|
+
displaySets: [{
|
|
5990
|
+
id: 'activeDisplaySet'
|
|
5991
|
+
}]
|
|
5992
|
+
}]
|
|
5993
|
+
}]
|
|
5994
|
+
};
|
|
5995
|
+
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/mprAnd3DVolumeViewport.ts
|
|
5996
|
+
const mprAnd3DVolumeViewport = {
|
|
5997
|
+
id: 'mprAnd3DVolumeViewport',
|
|
5998
|
+
locked: true,
|
|
5999
|
+
name: 'mpr',
|
|
6000
|
+
createdDate: '2023-03-15T10:29:44.894Z',
|
|
6001
|
+
modifiedDate: '2023-03-15T10:29:44.894Z',
|
|
6002
|
+
availableTo: {},
|
|
6003
|
+
editableBy: {},
|
|
6004
|
+
protocolMatchingRules: [],
|
|
6005
|
+
imageLoadStrategy: 'interleaveCenter',
|
|
6006
|
+
displaySetSelectors: {
|
|
6007
|
+
mprDisplaySet: {
|
|
6008
|
+
seriesMatchingRules: [{
|
|
6009
|
+
weight: 1,
|
|
6010
|
+
attribute: 'isReconstructable',
|
|
6011
|
+
constraint: {
|
|
6012
|
+
equals: {
|
|
6013
|
+
value: true
|
|
6014
|
+
}
|
|
6015
|
+
},
|
|
6016
|
+
required: true
|
|
6017
|
+
}, {
|
|
6018
|
+
attribute: 'Modality',
|
|
6019
|
+
constraint: {
|
|
6020
|
+
equals: {
|
|
6021
|
+
value: 'CT'
|
|
6022
|
+
}
|
|
6023
|
+
},
|
|
6024
|
+
required: true
|
|
6025
|
+
}]
|
|
6026
|
+
}
|
|
6027
|
+
},
|
|
6028
|
+
stages: [{
|
|
6029
|
+
id: 'mpr3Stage',
|
|
6030
|
+
name: 'mpr',
|
|
6031
|
+
viewportStructure: {
|
|
6032
|
+
layoutType: 'grid',
|
|
6033
|
+
properties: {
|
|
6034
|
+
rows: 2,
|
|
6035
|
+
columns: 2
|
|
5719
6036
|
}
|
|
5720
6037
|
},
|
|
5721
6038
|
viewports: [{
|
|
@@ -5755,7 +6072,298 @@ const mprAnd3DVolumeViewport = {
|
|
|
5755
6072
|
viewportOptions: {
|
|
5756
6073
|
toolGroupId: 'mpr',
|
|
5757
6074
|
viewportType: 'volume',
|
|
5758
|
-
orientation: 'coronal',
|
|
6075
|
+
orientation: 'coronal',
|
|
6076
|
+
initialImageOptions: {
|
|
6077
|
+
preset: 'middle'
|
|
6078
|
+
},
|
|
6079
|
+
syncGroups: [{
|
|
6080
|
+
type: 'voi',
|
|
6081
|
+
id: 'mpr',
|
|
6082
|
+
source: true,
|
|
6083
|
+
target: true
|
|
6084
|
+
}]
|
|
6085
|
+
},
|
|
6086
|
+
displaySets: [{
|
|
6087
|
+
id: 'mprDisplaySet'
|
|
6088
|
+
}]
|
|
6089
|
+
}, {
|
|
6090
|
+
viewportOptions: {
|
|
6091
|
+
toolGroupId: 'mpr',
|
|
6092
|
+
viewportType: 'volume',
|
|
6093
|
+
orientation: 'sagittal',
|
|
6094
|
+
initialImageOptions: {
|
|
6095
|
+
preset: 'middle'
|
|
6096
|
+
},
|
|
6097
|
+
syncGroups: [{
|
|
6098
|
+
type: 'voi',
|
|
6099
|
+
id: 'mpr',
|
|
6100
|
+
source: true,
|
|
6101
|
+
target: true
|
|
6102
|
+
}]
|
|
6103
|
+
},
|
|
6104
|
+
displaySets: [{
|
|
6105
|
+
id: 'mprDisplaySet'
|
|
6106
|
+
}]
|
|
6107
|
+
}]
|
|
6108
|
+
}]
|
|
6109
|
+
};
|
|
6110
|
+
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/only3D.ts
|
|
6111
|
+
const only3D = {
|
|
6112
|
+
id: 'only3D',
|
|
6113
|
+
locked: true,
|
|
6114
|
+
name: 'only3D',
|
|
6115
|
+
createdDate: '2023-03-15T10:29:44.894Z',
|
|
6116
|
+
modifiedDate: '2023-03-15T10:29:44.894Z',
|
|
6117
|
+
availableTo: {},
|
|
6118
|
+
editableBy: {},
|
|
6119
|
+
protocolMatchingRules: [],
|
|
6120
|
+
imageLoadStrategy: 'interleaveCenter',
|
|
6121
|
+
displaySetSelectors: {
|
|
6122
|
+
mprDisplaySet: {
|
|
6123
|
+
seriesMatchingRules: [{
|
|
6124
|
+
weight: 1,
|
|
6125
|
+
attribute: 'isReconstructable',
|
|
6126
|
+
constraint: {
|
|
6127
|
+
equals: {
|
|
6128
|
+
value: true
|
|
6129
|
+
}
|
|
6130
|
+
},
|
|
6131
|
+
required: true
|
|
6132
|
+
}]
|
|
6133
|
+
}
|
|
6134
|
+
},
|
|
6135
|
+
stages: [{
|
|
6136
|
+
id: 'only3DStage',
|
|
6137
|
+
name: 'only3D',
|
|
6138
|
+
viewportStructure: {
|
|
6139
|
+
layoutType: 'grid',
|
|
6140
|
+
properties: {
|
|
6141
|
+
rows: 1,
|
|
6142
|
+
columns: 1
|
|
6143
|
+
}
|
|
6144
|
+
},
|
|
6145
|
+
viewports: [{
|
|
6146
|
+
viewportOptions: {
|
|
6147
|
+
toolGroupId: 'volume3d',
|
|
6148
|
+
viewportType: 'volume3d',
|
|
6149
|
+
orientation: 'coronal',
|
|
6150
|
+
customViewportProps: {
|
|
6151
|
+
hideOverlays: true
|
|
6152
|
+
}
|
|
6153
|
+
},
|
|
6154
|
+
displaySets: [{
|
|
6155
|
+
id: 'mprDisplaySet',
|
|
6156
|
+
options: {
|
|
6157
|
+
// ToDo: choose appropriate preset
|
|
6158
|
+
displayPreset: 'CT-Bone'
|
|
6159
|
+
}
|
|
6160
|
+
}]
|
|
6161
|
+
}]
|
|
6162
|
+
}]
|
|
6163
|
+
};
|
|
6164
|
+
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/primary3D.ts
|
|
6165
|
+
const primary3D = {
|
|
6166
|
+
id: 'primary3D',
|
|
6167
|
+
locked: true,
|
|
6168
|
+
name: 'primary3D',
|
|
6169
|
+
createdDate: '2023-03-15T10:29:44.894Z',
|
|
6170
|
+
modifiedDate: '2023-03-15T10:29:44.894Z',
|
|
6171
|
+
availableTo: {},
|
|
6172
|
+
editableBy: {},
|
|
6173
|
+
protocolMatchingRules: [],
|
|
6174
|
+
imageLoadStrategy: 'interleaveCenter',
|
|
6175
|
+
displaySetSelectors: {
|
|
6176
|
+
mprDisplaySet: {
|
|
6177
|
+
seriesMatchingRules: [{
|
|
6178
|
+
weight: 1,
|
|
6179
|
+
attribute: 'isReconstructable',
|
|
6180
|
+
constraint: {
|
|
6181
|
+
equals: {
|
|
6182
|
+
value: true
|
|
6183
|
+
}
|
|
6184
|
+
},
|
|
6185
|
+
required: true
|
|
6186
|
+
}]
|
|
6187
|
+
}
|
|
6188
|
+
},
|
|
6189
|
+
stages: [{
|
|
6190
|
+
id: 'primary3DStage',
|
|
6191
|
+
name: 'primary3D',
|
|
6192
|
+
viewportStructure: {
|
|
6193
|
+
layoutType: 'grid',
|
|
6194
|
+
properties: {
|
|
6195
|
+
rows: 3,
|
|
6196
|
+
columns: 3,
|
|
6197
|
+
layoutOptions: [{
|
|
6198
|
+
x: 0,
|
|
6199
|
+
y: 0,
|
|
6200
|
+
width: 2 / 3,
|
|
6201
|
+
height: 1
|
|
6202
|
+
}, {
|
|
6203
|
+
x: 2 / 3,
|
|
6204
|
+
y: 0,
|
|
6205
|
+
width: 1 / 3,
|
|
6206
|
+
height: 1 / 3
|
|
6207
|
+
}, {
|
|
6208
|
+
x: 2 / 3,
|
|
6209
|
+
y: 1 / 3,
|
|
6210
|
+
width: 1 / 3,
|
|
6211
|
+
height: 1 / 3
|
|
6212
|
+
}, {
|
|
6213
|
+
x: 2 / 3,
|
|
6214
|
+
y: 2 / 3,
|
|
6215
|
+
width: 1 / 3,
|
|
6216
|
+
height: 1 / 3
|
|
6217
|
+
}]
|
|
6218
|
+
}
|
|
6219
|
+
},
|
|
6220
|
+
viewports: [{
|
|
6221
|
+
viewportOptions: {
|
|
6222
|
+
toolGroupId: 'volume3d',
|
|
6223
|
+
viewportType: 'volume3d',
|
|
6224
|
+
orientation: 'coronal',
|
|
6225
|
+
customViewportProps: {
|
|
6226
|
+
hideOverlays: true
|
|
6227
|
+
}
|
|
6228
|
+
},
|
|
6229
|
+
displaySets: [{
|
|
6230
|
+
id: 'mprDisplaySet',
|
|
6231
|
+
options: {
|
|
6232
|
+
// ToDo: choose appropriate preset
|
|
6233
|
+
displayPreset: 'CT-Bone'
|
|
6234
|
+
}
|
|
6235
|
+
}]
|
|
6236
|
+
}, {
|
|
6237
|
+
viewportOptions: {
|
|
6238
|
+
toolGroupId: 'mpr',
|
|
6239
|
+
viewportType: 'volume',
|
|
6240
|
+
orientation: 'axial',
|
|
6241
|
+
initialImageOptions: {
|
|
6242
|
+
preset: 'middle'
|
|
6243
|
+
},
|
|
6244
|
+
syncGroups: [{
|
|
6245
|
+
type: 'voi',
|
|
6246
|
+
id: 'mpr',
|
|
6247
|
+
source: true,
|
|
6248
|
+
target: true
|
|
6249
|
+
}]
|
|
6250
|
+
},
|
|
6251
|
+
displaySets: [{
|
|
6252
|
+
id: 'mprDisplaySet'
|
|
6253
|
+
}]
|
|
6254
|
+
}, {
|
|
6255
|
+
viewportOptions: {
|
|
6256
|
+
toolGroupId: 'mpr',
|
|
6257
|
+
viewportType: 'volume',
|
|
6258
|
+
orientation: 'coronal',
|
|
6259
|
+
initialImageOptions: {
|
|
6260
|
+
preset: 'middle'
|
|
6261
|
+
},
|
|
6262
|
+
syncGroups: [{
|
|
6263
|
+
type: 'voi',
|
|
6264
|
+
id: 'mpr',
|
|
6265
|
+
source: true,
|
|
6266
|
+
target: true
|
|
6267
|
+
}]
|
|
6268
|
+
},
|
|
6269
|
+
displaySets: [{
|
|
6270
|
+
id: 'mprDisplaySet'
|
|
6271
|
+
}]
|
|
6272
|
+
}, {
|
|
6273
|
+
viewportOptions: {
|
|
6274
|
+
toolGroupId: 'mpr',
|
|
6275
|
+
viewportType: 'volume',
|
|
6276
|
+
orientation: 'sagittal',
|
|
6277
|
+
initialImageOptions: {
|
|
6278
|
+
preset: 'middle'
|
|
6279
|
+
},
|
|
6280
|
+
syncGroups: [{
|
|
6281
|
+
type: 'voi',
|
|
6282
|
+
id: 'mpr',
|
|
6283
|
+
source: true,
|
|
6284
|
+
target: true
|
|
6285
|
+
}]
|
|
6286
|
+
},
|
|
6287
|
+
displaySets: [{
|
|
6288
|
+
id: 'mprDisplaySet'
|
|
6289
|
+
}]
|
|
6290
|
+
}]
|
|
6291
|
+
}]
|
|
6292
|
+
};
|
|
6293
|
+
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/hps/primaryAxial.ts
|
|
6294
|
+
const primaryAxial = {
|
|
6295
|
+
id: 'primaryAxial',
|
|
6296
|
+
locked: true,
|
|
6297
|
+
name: 'primaryAxial',
|
|
6298
|
+
createdDate: '2023-03-15T10:29:44.894Z',
|
|
6299
|
+
modifiedDate: '2023-03-15T10:29:44.894Z',
|
|
6300
|
+
availableTo: {},
|
|
6301
|
+
editableBy: {},
|
|
6302
|
+
protocolMatchingRules: [],
|
|
6303
|
+
imageLoadStrategy: 'interleaveCenter',
|
|
6304
|
+
displaySetSelectors: {
|
|
6305
|
+
mprDisplaySet: {
|
|
6306
|
+
seriesMatchingRules: [{
|
|
6307
|
+
weight: 1,
|
|
6308
|
+
attribute: 'isReconstructable',
|
|
6309
|
+
constraint: {
|
|
6310
|
+
equals: {
|
|
6311
|
+
value: true
|
|
6312
|
+
}
|
|
6313
|
+
},
|
|
6314
|
+
required: true
|
|
6315
|
+
}]
|
|
6316
|
+
}
|
|
6317
|
+
},
|
|
6318
|
+
stages: [{
|
|
6319
|
+
id: 'primaryAxialStage',
|
|
6320
|
+
name: 'primaryAxial',
|
|
6321
|
+
viewportStructure: {
|
|
6322
|
+
layoutType: 'grid',
|
|
6323
|
+
properties: {
|
|
6324
|
+
rows: 2,
|
|
6325
|
+
columns: 3,
|
|
6326
|
+
layoutOptions: [{
|
|
6327
|
+
x: 0,
|
|
6328
|
+
y: 0,
|
|
6329
|
+
width: 2 / 3,
|
|
6330
|
+
height: 1
|
|
6331
|
+
}, {
|
|
6332
|
+
x: 2 / 3,
|
|
6333
|
+
y: 0,
|
|
6334
|
+
width: 1 / 3,
|
|
6335
|
+
height: 1 / 2
|
|
6336
|
+
}, {
|
|
6337
|
+
x: 2 / 3,
|
|
6338
|
+
y: 1 / 2,
|
|
6339
|
+
width: 1 / 3,
|
|
6340
|
+
height: 1 / 2
|
|
6341
|
+
}]
|
|
6342
|
+
}
|
|
6343
|
+
},
|
|
6344
|
+
viewports: [{
|
|
6345
|
+
viewportOptions: {
|
|
6346
|
+
toolGroupId: 'mpr',
|
|
6347
|
+
viewportType: 'volume',
|
|
6348
|
+
orientation: 'axial',
|
|
6349
|
+
initialImageOptions: {
|
|
6350
|
+
preset: 'middle'
|
|
6351
|
+
},
|
|
6352
|
+
syncGroups: [{
|
|
6353
|
+
type: 'voi',
|
|
6354
|
+
id: 'mpr',
|
|
6355
|
+
source: true,
|
|
6356
|
+
target: true
|
|
6357
|
+
}]
|
|
6358
|
+
},
|
|
6359
|
+
displaySets: [{
|
|
6360
|
+
id: 'mprDisplaySet'
|
|
6361
|
+
}]
|
|
6362
|
+
}, {
|
|
6363
|
+
viewportOptions: {
|
|
6364
|
+
toolGroupId: 'mpr',
|
|
6365
|
+
viewportType: 'volume',
|
|
6366
|
+
orientation: 'sagittal',
|
|
5759
6367
|
initialImageOptions: {
|
|
5760
6368
|
preset: 'middle'
|
|
5761
6369
|
},
|
|
@@ -5773,7 +6381,7 @@ const mprAnd3DVolumeViewport = {
|
|
|
5773
6381
|
viewportOptions: {
|
|
5774
6382
|
toolGroupId: 'mpr',
|
|
5775
6383
|
viewportType: 'volume',
|
|
5776
|
-
orientation: '
|
|
6384
|
+
orientation: 'coronal',
|
|
5777
6385
|
initialImageOptions: {
|
|
5778
6386
|
preset: 'middle'
|
|
5779
6387
|
},
|
|
@@ -5790,6 +6398,14 @@ const mprAnd3DVolumeViewport = {
|
|
|
5790
6398
|
}]
|
|
5791
6399
|
}]
|
|
5792
6400
|
};
|
|
6401
|
+
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/getHangingProtocolModule.ts
|
|
6402
|
+
|
|
6403
|
+
|
|
6404
|
+
|
|
6405
|
+
|
|
6406
|
+
|
|
6407
|
+
|
|
6408
|
+
|
|
5793
6409
|
function getHangingProtocolModule() {
|
|
5794
6410
|
return [{
|
|
5795
6411
|
name: mpr.id,
|
|
@@ -5797,10 +6413,26 @@ function getHangingProtocolModule() {
|
|
|
5797
6413
|
}, {
|
|
5798
6414
|
name: mprAnd3DVolumeViewport.id,
|
|
5799
6415
|
protocol: mprAnd3DVolumeViewport
|
|
6416
|
+
}, {
|
|
6417
|
+
name: fourUp.id,
|
|
6418
|
+
protocol: fourUp
|
|
6419
|
+
}, {
|
|
6420
|
+
name: main3D.id,
|
|
6421
|
+
protocol: main3D
|
|
6422
|
+
}, {
|
|
6423
|
+
name: primaryAxial.id,
|
|
6424
|
+
protocol: primaryAxial
|
|
6425
|
+
}, {
|
|
6426
|
+
name: only3D.id,
|
|
6427
|
+
protocol: only3D
|
|
6428
|
+
}, {
|
|
6429
|
+
name: primary3D.id,
|
|
6430
|
+
protocol: primary3D
|
|
5800
6431
|
}];
|
|
5801
6432
|
}
|
|
5802
6433
|
/* harmony default export */ const src_getHangingProtocolModule = (getHangingProtocolModule);
|
|
5803
6434
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/ToolGroupService/ToolGroupService.ts
|
|
6435
|
+
var _class;
|
|
5804
6436
|
|
|
5805
6437
|
|
|
5806
6438
|
|
|
@@ -5825,7 +6457,7 @@ class ToolGroupService {
|
|
|
5825
6457
|
this.viewportGridService = viewportGridService;
|
|
5826
6458
|
this.listeners = {};
|
|
5827
6459
|
this.EVENTS = ToolGroupService_EVENTS;
|
|
5828
|
-
Object.assign(this, src/* pubSubServiceInterface */.
|
|
6460
|
+
Object.assign(this, src/* pubSubServiceInterface */.Ml);
|
|
5829
6461
|
}
|
|
5830
6462
|
onModeExit() {
|
|
5831
6463
|
this.destroy();
|
|
@@ -5924,8 +6556,7 @@ class ToolGroupService {
|
|
|
5924
6556
|
});
|
|
5925
6557
|
return toolGroup;
|
|
5926
6558
|
}
|
|
5927
|
-
addToolsToToolGroup(toolGroupId, tools) {
|
|
5928
|
-
let configs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
6559
|
+
addToolsToToolGroup(toolGroupId, tools, configs = {}) {
|
|
5929
6560
|
const toolGroup = dist_esm.ToolGroupManager.getToolGroup(toolGroupId);
|
|
5930
6561
|
// this.changeConfigurationIfNecessary(toolGroup, volumeId);
|
|
5931
6562
|
this._addTools(toolGroup, tools, configs);
|
|
@@ -5987,49 +6618,44 @@ class ToolGroupService {
|
|
|
5987
6618
|
disabled
|
|
5988
6619
|
} = tools;
|
|
5989
6620
|
if (active) {
|
|
5990
|
-
active.forEach(
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
} = _ref;
|
|
6621
|
+
active.forEach(({
|
|
6622
|
+
toolName,
|
|
6623
|
+
bindings
|
|
6624
|
+
}) => {
|
|
5995
6625
|
toolGroup.setToolActive(toolName, {
|
|
5996
6626
|
bindings
|
|
5997
6627
|
});
|
|
5998
6628
|
});
|
|
5999
6629
|
}
|
|
6000
6630
|
if (passive) {
|
|
6001
|
-
passive.forEach(
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
} = _ref2;
|
|
6631
|
+
passive.forEach(({
|
|
6632
|
+
toolName
|
|
6633
|
+
}) => {
|
|
6005
6634
|
toolGroup.setToolPassive(toolName);
|
|
6006
6635
|
});
|
|
6007
6636
|
}
|
|
6008
6637
|
if (enabled) {
|
|
6009
|
-
enabled.forEach(
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
} = _ref3;
|
|
6638
|
+
enabled.forEach(({
|
|
6639
|
+
toolName
|
|
6640
|
+
}) => {
|
|
6013
6641
|
toolGroup.setToolEnabled(toolName);
|
|
6014
6642
|
});
|
|
6015
6643
|
}
|
|
6016
6644
|
if (disabled) {
|
|
6017
|
-
disabled.forEach(
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
} = _ref4;
|
|
6645
|
+
disabled.forEach(({
|
|
6646
|
+
toolName
|
|
6647
|
+
}) => {
|
|
6021
6648
|
toolGroup.setToolDisabled(toolName);
|
|
6022
6649
|
});
|
|
6023
6650
|
}
|
|
6024
6651
|
}
|
|
6025
6652
|
_addTools(toolGroup, tools) {
|
|
6026
6653
|
const addTools = tools => {
|
|
6027
|
-
tools.forEach(
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
} = _ref5;
|
|
6654
|
+
tools.forEach(({
|
|
6655
|
+
toolName,
|
|
6656
|
+
parentTool,
|
|
6657
|
+
configuration
|
|
6658
|
+
}) => {
|
|
6033
6659
|
if (parentTool) {
|
|
6034
6660
|
toolGroup.addToolInstance(toolName, parentTool, {
|
|
6035
6661
|
...configuration
|
|
@@ -6055,20 +6681,21 @@ class ToolGroupService {
|
|
|
6055
6681
|
}
|
|
6056
6682
|
}
|
|
6057
6683
|
}
|
|
6684
|
+
_class = ToolGroupService;
|
|
6058
6685
|
ToolGroupService.REGISTRATION = {
|
|
6059
6686
|
name: 'toolGroupService',
|
|
6060
6687
|
altName: 'ToolGroupService',
|
|
6061
|
-
create:
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
return new ToolGroupService(servicesManager);
|
|
6688
|
+
create: ({
|
|
6689
|
+
servicesManager
|
|
6690
|
+
}) => {
|
|
6691
|
+
return new _class(servicesManager);
|
|
6066
6692
|
}
|
|
6067
6693
|
};
|
|
6068
6694
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/ToolGroupService/index.js
|
|
6069
6695
|
|
|
6070
6696
|
/* harmony default export */ const services_ToolGroupService = (ToolGroupService);
|
|
6071
6697
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/SyncGroupService/SyncGroupService.ts
|
|
6698
|
+
var SyncGroupService_class;
|
|
6072
6699
|
|
|
6073
6700
|
|
|
6074
6701
|
const SyncGroupService_EVENTS = {
|
|
@@ -6096,13 +6723,13 @@ class SyncGroupService {
|
|
|
6096
6723
|
[POSITION]: dist_esm.synchronizers.createCameraPositionSynchronizer,
|
|
6097
6724
|
[VOI]: dist_esm.synchronizers.createVOISynchronizer,
|
|
6098
6725
|
[ZOOMPAN]: dist_esm.synchronizers.createZoomPanSynchronizer,
|
|
6099
|
-
[STACKIMAGE]: dist_esm.synchronizers.
|
|
6726
|
+
[STACKIMAGE]: dist_esm.synchronizers.createImageSliceSynchronizer
|
|
6100
6727
|
};
|
|
6101
6728
|
this.servicesManager = serviceManager;
|
|
6102
6729
|
this.listeners = {};
|
|
6103
6730
|
this.EVENTS = SyncGroupService_EVENTS;
|
|
6104
6731
|
//
|
|
6105
|
-
Object.assign(this, src/* pubSubServiceInterface */.
|
|
6732
|
+
Object.assign(this, src/* pubSubServiceInterface */.Ml);
|
|
6106
6733
|
}
|
|
6107
6734
|
_createSynchronizer(type, id, options) {
|
|
6108
6735
|
const syncCreator = this.synchronizerCreators[type.toLowerCase()];
|
|
@@ -6121,6 +6748,9 @@ class SyncGroupService {
|
|
|
6121
6748
|
addSynchronizerType(type, creator) {
|
|
6122
6749
|
this.synchronizerCreators[type.toLowerCase()] = creator;
|
|
6123
6750
|
}
|
|
6751
|
+
getSynchronizer(id) {
|
|
6752
|
+
return dist_esm.SynchronizerManager.getSynchronizer(id);
|
|
6753
|
+
}
|
|
6124
6754
|
_getOrCreateSynchronizer(type, id, options) {
|
|
6125
6755
|
let synchronizer = dist_esm.SynchronizerManager.getSynchronizer(id);
|
|
6126
6756
|
if (!synchronizer) {
|
|
@@ -6161,6 +6791,9 @@ class SyncGroupService {
|
|
|
6161
6791
|
destroy() {
|
|
6162
6792
|
dist_esm.SynchronizerManager.destroy();
|
|
6163
6793
|
}
|
|
6794
|
+
getSynchronizersForViewport(viewportId, renderingEngineId) {
|
|
6795
|
+
return dist_esm.SynchronizerManager.getAllSynchronizers().filter(s => s.hasSourceViewport(renderingEngineId, viewportId) || s.hasTargetViewport(renderingEngineId, viewportId));
|
|
6796
|
+
}
|
|
6164
6797
|
removeViewportFromSyncGroup(viewportId, renderingEngineId, syncGroupId) {
|
|
6165
6798
|
const synchronizers = dist_esm.SynchronizerManager.getAllSynchronizers();
|
|
6166
6799
|
const filteredSynchronizers = syncGroupId ? synchronizers.filter(s => s.id === syncGroupId) : synchronizers;
|
|
@@ -6182,24 +6815,21 @@ class SyncGroupService {
|
|
|
6182
6815
|
});
|
|
6183
6816
|
}
|
|
6184
6817
|
}
|
|
6818
|
+
SyncGroupService_class = SyncGroupService;
|
|
6185
6819
|
SyncGroupService.REGISTRATION = {
|
|
6186
6820
|
name: 'syncGroupService',
|
|
6187
6821
|
altName: 'SyncGroupService',
|
|
6188
|
-
create:
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
return new SyncGroupService(servicesManager);
|
|
6822
|
+
create: ({
|
|
6823
|
+
servicesManager
|
|
6824
|
+
}) => {
|
|
6825
|
+
return new SyncGroupService_class(servicesManager);
|
|
6193
6826
|
}
|
|
6194
6827
|
};
|
|
6195
6828
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/SyncGroupService/index.js
|
|
6196
6829
|
|
|
6197
6830
|
/* harmony default export */ const services_SyncGroupService = (SyncGroupService);
|
|
6198
|
-
// EXTERNAL MODULE: ../../../node_modules/lodash.clonedeep/index.js
|
|
6199
|
-
var lodash_clonedeep = __webpack_require__(11677);
|
|
6200
|
-
var lodash_clonedeep_default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep);
|
|
6201
6831
|
// EXTERNAL MODULE: ../../../node_modules/lodash.isequal/index.js
|
|
6202
|
-
var lodash_isequal = __webpack_require__(
|
|
6832
|
+
var lodash_isequal = __webpack_require__(71932);
|
|
6203
6833
|
var lodash_isequal_default = /*#__PURE__*/__webpack_require__.n(lodash_isequal);
|
|
6204
6834
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/transitions.ts
|
|
6205
6835
|
/**
|
|
@@ -6249,24 +6879,21 @@ function reverseEaseInOutBell(x, baseline) {
|
|
|
6249
6879
|
* and geometry Id
|
|
6250
6880
|
*/
|
|
6251
6881
|
function mapROIContoursToRTStructData(structureSet, rtDisplaySetUID) {
|
|
6252
|
-
return structureSet.ROIContours.map(
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
y,
|
|
6268
|
-
z
|
|
6269
|
-
} = _ref3;
|
|
6882
|
+
return structureSet.ROIContours.map(({
|
|
6883
|
+
contourPoints,
|
|
6884
|
+
ROINumber,
|
|
6885
|
+
ROIName,
|
|
6886
|
+
colorArray
|
|
6887
|
+
}) => {
|
|
6888
|
+
const data = contourPoints.map(({
|
|
6889
|
+
points,
|
|
6890
|
+
...rest
|
|
6891
|
+
}) => {
|
|
6892
|
+
const newPoints = points.map(({
|
|
6893
|
+
x,
|
|
6894
|
+
y,
|
|
6895
|
+
z
|
|
6896
|
+
}) => {
|
|
6270
6897
|
return [x, y, z];
|
|
6271
6898
|
});
|
|
6272
6899
|
return {
|
|
@@ -6285,16 +6912,13 @@ function mapROIContoursToRTStructData(structureSet, rtDisplaySetUID) {
|
|
|
6285
6912
|
});
|
|
6286
6913
|
}
|
|
6287
6914
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/SegmentationService/SegmentationService.ts
|
|
6915
|
+
var SegmentationService_class;
|
|
6288
6916
|
|
|
6289
6917
|
|
|
6290
6918
|
|
|
6291
6919
|
|
|
6292
6920
|
|
|
6293
6921
|
|
|
6294
|
-
|
|
6295
|
-
const {
|
|
6296
|
-
COLOR_LUT
|
|
6297
|
-
} = dist_esm.CONSTANTS;
|
|
6298
6922
|
const LABELMAP = dist_esm.Enums.SegmentationRepresentations.Labelmap;
|
|
6299
6923
|
const CONTOUR = dist_esm.Enums.SegmentationRepresentations.Contour;
|
|
6300
6924
|
const SegmentationService_EVENTS = {
|
|
@@ -6320,14 +6944,11 @@ const SEGMENT_CONSTANT = {
|
|
|
6320
6944
|
isLocked: false
|
|
6321
6945
|
};
|
|
6322
6946
|
const VOLUME_LOADER_SCHEME = 'cornerstoneStreamingImageVolume';
|
|
6323
|
-
class SegmentationService extends src/* PubSubService */.
|
|
6324
|
-
constructor(
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
servicesManager
|
|
6328
|
-
} = _ref;
|
|
6947
|
+
class SegmentationService extends src/* PubSubService */.Rc {
|
|
6948
|
+
constructor({
|
|
6949
|
+
servicesManager
|
|
6950
|
+
}) {
|
|
6329
6951
|
super(SegmentationService_EVENTS);
|
|
6330
|
-
_this = this;
|
|
6331
6952
|
this.segmentations = void 0;
|
|
6332
6953
|
this.servicesManager = void 0;
|
|
6333
6954
|
this.highlightIntervalId = null;
|
|
@@ -6468,7 +7089,6 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
6468
7089
|
}
|
|
6469
7090
|
}
|
|
6470
7091
|
};
|
|
6471
|
-
|
|
6472
7092
|
this.addOrUpdateSegmentation(segmentation);
|
|
6473
7093
|
return segmentationId;
|
|
6474
7094
|
};
|
|
@@ -6481,11 +7101,8 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
6481
7101
|
this.toggleSegmentationVisibility = segmentationId => {
|
|
6482
7102
|
this._toggleSegmentationVisibility(segmentationId, false);
|
|
6483
7103
|
};
|
|
6484
|
-
this.addSegmentationRepresentationToToolGroup = async
|
|
6485
|
-
|
|
6486
|
-
let representationType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : dist_esm.Enums.SegmentationRepresentations.Labelmap;
|
|
6487
|
-
let suppressEvents = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
6488
|
-
const segmentation = _this.getSegmentation(segmentationId);
|
|
7104
|
+
this.addSegmentationRepresentationToToolGroup = async (toolGroupId, segmentationId, hydrateSegmentation = false, representationType = dist_esm.Enums.SegmentationRepresentations.Labelmap, suppressEvents = false) => {
|
|
7105
|
+
const segmentation = this.getSegmentation(segmentationId);
|
|
6489
7106
|
if (!segmentation) {
|
|
6490
7107
|
throw new Error(`Segmentation with segmentationId ${segmentationId} not found.`);
|
|
6491
7108
|
}
|
|
@@ -6493,9 +7110,6 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
6493
7110
|
// hydrate the segmentation if it's not hydrated yet
|
|
6494
7111
|
segmentation.hydrated = true;
|
|
6495
7112
|
}
|
|
6496
|
-
const {
|
|
6497
|
-
colorLUTIndex
|
|
6498
|
-
} = segmentation;
|
|
6499
7113
|
|
|
6500
7114
|
// Based on the segmentationId, set the colorLUTIndex.
|
|
6501
7115
|
const segmentationRepresentationUIDs = await dist_esm.segmentation.addSegmentationRepresentations(toolGroupId, [{
|
|
@@ -6504,8 +7118,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
6504
7118
|
}]);
|
|
6505
7119
|
|
|
6506
7120
|
// set the latest segmentation representation as active one
|
|
6507
|
-
|
|
6508
|
-
dist_esm.segmentation.config.color.setColorLUT(toolGroupId, segmentationRepresentationUIDs[0], colorLUTIndex);
|
|
7121
|
+
this._setActiveSegmentationForToolGroup(segmentationId, toolGroupId, segmentationRepresentationUIDs[0]);
|
|
6509
7122
|
|
|
6510
7123
|
// add the segmentation segments properly
|
|
6511
7124
|
for (const segment of segmentation.segments) {
|
|
@@ -6521,20 +7134,20 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
6521
7134
|
} = segment;
|
|
6522
7135
|
const suppressEvents = true;
|
|
6523
7136
|
if (color !== undefined) {
|
|
6524
|
-
|
|
7137
|
+
this._setSegmentColor(segmentationId, segmentIndex, color, toolGroupId, suppressEvents);
|
|
6525
7138
|
}
|
|
6526
7139
|
if (opacity !== undefined) {
|
|
6527
|
-
|
|
7140
|
+
this._setSegmentOpacity(segmentationId, segmentIndex, opacity, toolGroupId, suppressEvents);
|
|
6528
7141
|
}
|
|
6529
7142
|
if (visibility !== undefined) {
|
|
6530
|
-
|
|
7143
|
+
this._setSegmentVisibility(segmentationId, segmentIndex, visibility, toolGroupId, suppressEvents);
|
|
6531
7144
|
}
|
|
6532
7145
|
if (isLocked) {
|
|
6533
|
-
|
|
7146
|
+
this._setSegmentLocked(segmentationId, segmentIndex, isLocked, suppressEvents);
|
|
6534
7147
|
}
|
|
6535
7148
|
}
|
|
6536
7149
|
if (!suppressEvents) {
|
|
6537
|
-
|
|
7150
|
+
this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
|
|
6538
7151
|
segmentation
|
|
6539
7152
|
});
|
|
6540
7153
|
}
|
|
@@ -6558,18 +7171,17 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
6558
7171
|
const toolGroupIds = dist_esm.segmentation.state.getToolGroupIdsWithSegmentation(segmentationId);
|
|
6559
7172
|
return toolGroupIds;
|
|
6560
7173
|
};
|
|
6561
|
-
this.hydrateSegmentation =
|
|
6562
|
-
|
|
6563
|
-
const segmentation = _this.getSegmentation(segmentationId);
|
|
7174
|
+
this.hydrateSegmentation = (segmentationId, suppressEvents = false) => {
|
|
7175
|
+
const segmentation = this.getSegmentation(segmentationId);
|
|
6564
7176
|
if (!segmentation) {
|
|
6565
7177
|
throw new Error(`Segmentation with segmentationId ${segmentationId} not found.`);
|
|
6566
7178
|
}
|
|
6567
7179
|
segmentation.hydrated = true;
|
|
6568
7180
|
|
|
6569
7181
|
// Not all segmentations have dipslaysets, some of them are derived in the client
|
|
6570
|
-
|
|
7182
|
+
this._setDisplaySetIsHydrated(segmentationId, true);
|
|
6571
7183
|
if (!suppressEvents) {
|
|
6572
|
-
|
|
7184
|
+
this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
|
|
6573
7185
|
segmentation
|
|
6574
7186
|
});
|
|
6575
7187
|
}
|
|
@@ -6627,11 +7239,10 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
6627
7239
|
renderInactiveSegmentations,
|
|
6628
7240
|
renderOutline
|
|
6629
7241
|
} = configuration;
|
|
6630
|
-
const setConfigValueIfDefined =
|
|
6631
|
-
let transformFn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
7242
|
+
const setConfigValueIfDefined = (key, value, transformFn = null) => {
|
|
6632
7243
|
if (value !== undefined) {
|
|
6633
7244
|
const transformedValue = transformFn ? transformFn(value) : value;
|
|
6634
|
-
|
|
7245
|
+
this._setSegmentationConfig(key, transformedValue);
|
|
6635
7246
|
}
|
|
6636
7247
|
};
|
|
6637
7248
|
setConfigValueIfDefined('renderOutline', renderOutline);
|
|
@@ -6678,32 +7289,30 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
6678
7289
|
this.getSegmentationRepresentationsForToolGroup = toolGroupId => {
|
|
6679
7290
|
return dist_esm.segmentation.state.getSegmentationRepresentations(toolGroupId);
|
|
6680
7291
|
};
|
|
6681
|
-
this._toggleSegmentationVisibility =
|
|
6682
|
-
|
|
6683
|
-
const segmentation = _this.segmentations[segmentationId];
|
|
7292
|
+
this._toggleSegmentationVisibility = (segmentationId, suppressEvents = false) => {
|
|
7293
|
+
const segmentation = this.segmentations[segmentationId];
|
|
6684
7294
|
if (!segmentation) {
|
|
6685
7295
|
throw new Error(`Segmentation with segmentationId ${segmentationId} not found.`);
|
|
6686
7296
|
}
|
|
6687
7297
|
segmentation.isVisible = !segmentation.isVisible;
|
|
6688
|
-
|
|
7298
|
+
this._updateCornerstoneSegmentationVisibility(segmentationId);
|
|
6689
7299
|
if (suppressEvents === false) {
|
|
6690
|
-
|
|
7300
|
+
this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
|
|
6691
7301
|
segmentation
|
|
6692
7302
|
});
|
|
6693
7303
|
}
|
|
6694
7304
|
};
|
|
6695
|
-
this._setSegmentColor =
|
|
6696
|
-
|
|
6697
|
-
const segmentation = _this.getSegmentation(segmentationId);
|
|
7305
|
+
this._setSegmentColor = (segmentationId, segmentIndex, color, toolGroupId, suppressEvents = false) => {
|
|
7306
|
+
const segmentation = this.getSegmentation(segmentationId);
|
|
6698
7307
|
if (segmentation === undefined) {
|
|
6699
7308
|
throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
|
|
6700
7309
|
}
|
|
6701
|
-
const segmentInfo =
|
|
7310
|
+
const segmentInfo = this._getSegmentInfo(segmentation, segmentIndex);
|
|
6702
7311
|
if (segmentInfo === undefined) {
|
|
6703
7312
|
throw new Error(`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`);
|
|
6704
7313
|
}
|
|
6705
|
-
toolGroupId = toolGroupId ??
|
|
6706
|
-
const segmentationRepresentation =
|
|
7314
|
+
toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
|
|
7315
|
+
const segmentationRepresentation = this._getSegmentationRepresentation(segmentationId, toolGroupId);
|
|
6707
7316
|
if (!segmentationRepresentation) {
|
|
6708
7317
|
throw new Error('Must add representation to toolgroup before setting segments');
|
|
6709
7318
|
}
|
|
@@ -6714,23 +7323,22 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
6714
7323
|
dist_esm.segmentation.config.color.setColorForSegmentIndex(toolGroupId, segmentationRepresentationUID, segmentIndex, [...color, rgbaColor[3]]);
|
|
6715
7324
|
segmentInfo.color = color;
|
|
6716
7325
|
if (suppressEvents === false) {
|
|
6717
|
-
|
|
7326
|
+
this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
|
|
6718
7327
|
segmentation
|
|
6719
7328
|
});
|
|
6720
7329
|
}
|
|
6721
7330
|
};
|
|
6722
|
-
this._setSegmentOpacity =
|
|
6723
|
-
|
|
6724
|
-
const segmentation = _this.getSegmentation(segmentationId);
|
|
7331
|
+
this._setSegmentOpacity = (segmentationId, segmentIndex, opacity, toolGroupId, suppressEvents = false) => {
|
|
7332
|
+
const segmentation = this.getSegmentation(segmentationId);
|
|
6725
7333
|
if (segmentation === undefined) {
|
|
6726
7334
|
throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
|
|
6727
7335
|
}
|
|
6728
|
-
const segmentInfo =
|
|
7336
|
+
const segmentInfo = this._getSegmentInfo(segmentation, segmentIndex);
|
|
6729
7337
|
if (segmentInfo === undefined) {
|
|
6730
7338
|
throw new Error(`Segment ${segmentIndex} not yet added to segmentation: ${segmentationId}`);
|
|
6731
7339
|
}
|
|
6732
|
-
toolGroupId = toolGroupId ??
|
|
6733
|
-
const segmentationRepresentation =
|
|
7340
|
+
toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
|
|
7341
|
+
const segmentationRepresentation = this._getSegmentationRepresentation(segmentationId, toolGroupId);
|
|
6734
7342
|
if (!segmentationRepresentation) {
|
|
6735
7343
|
throw new Error('Must add representation to toolgroup before setting segments');
|
|
6736
7344
|
}
|
|
@@ -6741,7 +7349,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
6741
7349
|
dist_esm.segmentation.config.color.setColorForSegmentIndex(toolGroupId, segmentationRepresentationUID, segmentIndex, [rgbaColor[0], rgbaColor[1], rgbaColor[2], opacity]);
|
|
6742
7350
|
segmentInfo.opacity = opacity;
|
|
6743
7351
|
if (suppressEvents === false) {
|
|
6744
|
-
|
|
7352
|
+
this._broadcastEvent(this.EVENTS.SEGMENTATION_UPDATED, {
|
|
6745
7353
|
segmentation
|
|
6746
7354
|
});
|
|
6747
7355
|
}
|
|
@@ -6864,15 +7472,6 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
6864
7472
|
}
|
|
6865
7473
|
return viewportInfo.getToolGroupId();
|
|
6866
7474
|
};
|
|
6867
|
-
this.getNextColorLUTIndex = () => {
|
|
6868
|
-
let i = 0;
|
|
6869
|
-
while (true) {
|
|
6870
|
-
if (dist_esm.segmentation.state.getColorLUT(i) === undefined) {
|
|
6871
|
-
return i;
|
|
6872
|
-
}
|
|
6873
|
-
i++;
|
|
6874
|
-
}
|
|
6875
|
-
};
|
|
6876
7475
|
/**
|
|
6877
7476
|
* Converts object of objects to array.
|
|
6878
7477
|
*
|
|
@@ -6901,8 +7500,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
6901
7500
|
* - isLocked: (optional) Whether the new segment should be locked for editing. If not provided, the segment will not be locked by default.
|
|
6902
7501
|
* - active: (optional) Whether the new segment should be the active segment to be edited. If not provided, the segment will not be active by default.
|
|
6903
7502
|
*/
|
|
6904
|
-
addSegment(segmentationId) {
|
|
6905
|
-
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
7503
|
+
addSegment(segmentationId, config = {}) {
|
|
6906
7504
|
if (config?.segmentIndex === 0) {
|
|
6907
7505
|
throw new Error('Segment index 0 is reserved for "no label"');
|
|
6908
7506
|
}
|
|
@@ -7016,8 +7614,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7016
7614
|
segmentation
|
|
7017
7615
|
});
|
|
7018
7616
|
}
|
|
7019
|
-
setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId) {
|
|
7020
|
-
let suppressEvents = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
7617
|
+
setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId, suppressEvents = false) {
|
|
7021
7618
|
this._setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId, suppressEvents);
|
|
7022
7619
|
}
|
|
7023
7620
|
setSegmentLocked(segmentationId, segmentIndex, isLocked) {
|
|
@@ -7062,8 +7659,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7062
7659
|
*
|
|
7063
7660
|
* @return Array of segmentations
|
|
7064
7661
|
*/
|
|
7065
|
-
getSegmentations() {
|
|
7066
|
-
let filterNonHydratedSegmentations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
7662
|
+
getSegmentations(filterNonHydratedSegmentations = true) {
|
|
7067
7663
|
const segmentations = this._getSegmentations();
|
|
7068
7664
|
return segmentations && segmentations.filter(segmentation => {
|
|
7069
7665
|
return !filterNonHydratedSegmentations || segmentation.hydrated;
|
|
@@ -7098,9 +7694,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7098
7694
|
getSegmentation(segmentationId) {
|
|
7099
7695
|
return this.segmentations[segmentationId];
|
|
7100
7696
|
}
|
|
7101
|
-
addOrUpdateSegmentation(segmentation) {
|
|
7102
|
-
let suppressEvents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7103
|
-
let notYetUpdatedAtSource = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7697
|
+
addOrUpdateSegmentation(segmentation, suppressEvents = false, notYetUpdatedAtSource = false) {
|
|
7104
7698
|
const {
|
|
7105
7699
|
id: segmentationId
|
|
7106
7700
|
} = segmentation;
|
|
@@ -7130,15 +7724,6 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7130
7724
|
}
|
|
7131
7725
|
}
|
|
7132
7726
|
}]);
|
|
7133
|
-
|
|
7134
|
-
// if first segmentation, we can use the default colorLUT, otherwise
|
|
7135
|
-
// we need to generate a new one and use a new colorLUT
|
|
7136
|
-
const colorLUTIndex = 0;
|
|
7137
|
-
if (Object.keys(this.segmentations).length !== 0) {
|
|
7138
|
-
const newColorLUT = this.generateNewColorLUT();
|
|
7139
|
-
const colorLUTIndex = this.getNextColorLUTIndex();
|
|
7140
|
-
dist_esm.segmentation.config.color.addColorLUT(newColorLUT, colorLUTIndex);
|
|
7141
|
-
}
|
|
7142
7727
|
this.segmentations[segmentationId] = {
|
|
7143
7728
|
...segmentation,
|
|
7144
7729
|
label: segmentation.label || '',
|
|
@@ -7146,8 +7731,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7146
7731
|
activeSegmentIndex: segmentation.activeSegmentIndex ?? null,
|
|
7147
7732
|
segmentCount: segmentation.segmentCount ?? 0,
|
|
7148
7733
|
isActive: false,
|
|
7149
|
-
isVisible: true
|
|
7150
|
-
colorLUTIndex
|
|
7734
|
+
isVisible: true
|
|
7151
7735
|
};
|
|
7152
7736
|
cachedSegmentation = this.segmentations[segmentationId];
|
|
7153
7737
|
this._updateCornerstoneSegmentations({
|
|
@@ -7161,8 +7745,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7161
7745
|
}
|
|
7162
7746
|
return cachedSegmentation.id;
|
|
7163
7747
|
}
|
|
7164
|
-
async createSegmentationForSEGDisplaySet(segDisplaySet, segmentationId) {
|
|
7165
|
-
let suppressEvents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7748
|
+
async createSegmentationForSEGDisplaySet(segDisplaySet, segmentationId, suppressEvents = false) {
|
|
7166
7749
|
// Todo: we only support creating labelmap for SEG displaySets for now
|
|
7167
7750
|
const representationType = LABELMAP;
|
|
7168
7751
|
segmentationId = segmentationId ?? segDisplaySet.displaySetInstanceUID;
|
|
@@ -7268,8 +7851,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7268
7851
|
});
|
|
7269
7852
|
return this.addOrUpdateSegmentation(segmentation, suppressEvents);
|
|
7270
7853
|
}
|
|
7271
|
-
async createSegmentationForRTDisplaySet(rtDisplaySet, segmentationId) {
|
|
7272
|
-
let suppressEvents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7854
|
+
async createSegmentationForRTDisplaySet(rtDisplaySet, segmentationId, suppressEvents = false) {
|
|
7273
7855
|
// Todo: we currently only have support for contour representation for initial
|
|
7274
7856
|
// RT display
|
|
7275
7857
|
const representationType = CONTOUR;
|
|
@@ -7286,12 +7868,9 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7286
7868
|
|
|
7287
7869
|
// sort by segmentIndex
|
|
7288
7870
|
allRTStructData.sort((a, b) => a.segmentIndex - b.segmentIndex);
|
|
7289
|
-
const geometryIds = allRTStructData.map(
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
} = _ref2;
|
|
7293
|
-
return geometryId;
|
|
7294
|
-
});
|
|
7871
|
+
const geometryIds = allRTStructData.map(({
|
|
7872
|
+
geometryId
|
|
7873
|
+
}) => geometryId);
|
|
7295
7874
|
const segmentation = {
|
|
7296
7875
|
...defaultScheme,
|
|
7297
7876
|
id: segmentationId,
|
|
@@ -7344,7 +7923,6 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7344
7923
|
},
|
|
7345
7924
|
modifiedTime: rtDisplaySet.SeriesDate // we use the SeriesDate as the modifiedTime since this is the first time we are creating the segmentation
|
|
7346
7925
|
};
|
|
7347
|
-
|
|
7348
7926
|
segmentation.segments[segmentIndex] = {
|
|
7349
7927
|
label: id,
|
|
7350
7928
|
segmentIndex,
|
|
@@ -7392,12 +7970,8 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7392
7970
|
});
|
|
7393
7971
|
return this.addOrUpdateSegmentation(segmentation, suppressEvents);
|
|
7394
7972
|
}
|
|
7395
|
-
jumpToSegmentCenter(segmentationId, segmentIndex, toolGroupId
|
|
7396
|
-
|
|
7397
|
-
let highlightSegment = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
7398
|
-
let animationLength = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 750;
|
|
7399
|
-
let highlightHideOthers = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
7400
|
-
let highlightFunctionType = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 'ease-in-out';
|
|
7973
|
+
jumpToSegmentCenter(segmentationId, segmentIndex, toolGroupId, highlightAlpha = 0.9, highlightSegment = true, animationLength = 750, highlightHideOthers = false, highlightFunctionType = 'ease-in-out' // todo: make animation functions configurable from outside
|
|
7974
|
+
) {
|
|
7401
7975
|
const {
|
|
7402
7976
|
toolGroupService
|
|
7403
7977
|
} = this.servicesManager.services;
|
|
@@ -7437,11 +8011,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7437
8011
|
}
|
|
7438
8012
|
});
|
|
7439
8013
|
}
|
|
7440
|
-
highlightSegment(segmentationId, segmentIndex, toolGroupId) {
|
|
7441
|
-
let alpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.9;
|
|
7442
|
-
let animationLength = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 750;
|
|
7443
|
-
let hideOthers = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
|
|
7444
|
-
let highlightFunctionType = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 'ease-in-out';
|
|
8014
|
+
highlightSegment(segmentationId, segmentIndex, toolGroupId, alpha = 0.9, animationLength = 750, hideOthers = true, highlightFunctionType = 'ease-in-out') {
|
|
7445
8015
|
if (this.highlightIntervalId) {
|
|
7446
8016
|
clearInterval(this.highlightIntervalId);
|
|
7447
8017
|
}
|
|
@@ -7587,8 +8157,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7587
8157
|
setSegmentLabel(segmentationId, segmentIndex, label) {
|
|
7588
8158
|
this._setSegmentLabel(segmentationId, segmentIndex, label);
|
|
7589
8159
|
}
|
|
7590
|
-
_setSegmentLabel(segmentationId, segmentIndex, label) {
|
|
7591
|
-
let suppressEvents = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
8160
|
+
_setSegmentLabel(segmentationId, segmentIndex, label, suppressEvents = false) {
|
|
7592
8161
|
const segmentation = this.getSegmentation(segmentationId);
|
|
7593
8162
|
if (segmentation === undefined) {
|
|
7594
8163
|
throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
|
|
@@ -7640,12 +8209,10 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7640
8209
|
segmentCount: 0,
|
|
7641
8210
|
segments: [],
|
|
7642
8211
|
isVisible: true,
|
|
7643
|
-
isActive: false
|
|
7644
|
-
colorLUTIndex: 0
|
|
8212
|
+
isActive: false
|
|
7645
8213
|
};
|
|
7646
8214
|
}
|
|
7647
|
-
_setActiveSegmentationForToolGroup(segmentationId, toolGroupId) {
|
|
7648
|
-
let suppressEvents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
8215
|
+
_setActiveSegmentationForToolGroup(segmentationId, toolGroupId, suppressEvents = false) {
|
|
7649
8216
|
const segmentations = this._getSegmentations();
|
|
7650
8217
|
const targetSegmentation = this.getSegmentation(segmentationId);
|
|
7651
8218
|
if (targetSegmentation === undefined) {
|
|
@@ -7662,8 +8229,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7662
8229
|
});
|
|
7663
8230
|
}
|
|
7664
8231
|
}
|
|
7665
|
-
_setActiveSegment(segmentationId, segmentIndex) {
|
|
7666
|
-
let suppressEvents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
8232
|
+
_setActiveSegment(segmentationId, segmentIndex, suppressEvents = false) {
|
|
7667
8233
|
const segmentation = this.getSegmentation(segmentationId);
|
|
7668
8234
|
if (segmentation === undefined) {
|
|
7669
8235
|
throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
|
|
@@ -7711,8 +8277,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7711
8277
|
} = segmentCenter[segmentIndex];
|
|
7712
8278
|
return center;
|
|
7713
8279
|
}
|
|
7714
|
-
_setSegmentLocked(segmentationId, segmentIndex, isLocked) {
|
|
7715
|
-
let suppressEvents = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
8280
|
+
_setSegmentLocked(segmentationId, segmentIndex, isLocked, suppressEvents = false) {
|
|
7716
8281
|
const segmentation = this.getSegmentation(segmentationId);
|
|
7717
8282
|
if (segmentation === undefined) {
|
|
7718
8283
|
throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
|
|
@@ -7729,8 +8294,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7729
8294
|
});
|
|
7730
8295
|
}
|
|
7731
8296
|
}
|
|
7732
|
-
_setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId) {
|
|
7733
|
-
let suppressEvents = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
8297
|
+
_setSegmentVisibility(segmentationId, segmentIndex, isVisible, toolGroupId, suppressEvents = false) {
|
|
7734
8298
|
toolGroupId = toolGroupId ?? this._getApplicableToolGroupId();
|
|
7735
8299
|
const {
|
|
7736
8300
|
segmentationRepresentationUID,
|
|
@@ -7756,8 +8320,7 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7756
8320
|
});
|
|
7757
8321
|
}
|
|
7758
8322
|
}
|
|
7759
|
-
_setSegmentLabel(segmentationId, segmentIndex, segmentLabel) {
|
|
7760
|
-
let suppressEvents = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
8323
|
+
_setSegmentLabel(segmentationId, segmentIndex, segmentLabel, suppressEvents = false) {
|
|
7761
8324
|
const segmentation = this.getSegmentation(segmentationId);
|
|
7762
8325
|
if (segmentation === undefined) {
|
|
7763
8326
|
throw new Error(`no segmentation for segmentationId: ${segmentationId}`);
|
|
@@ -7835,11 +8398,10 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7835
8398
|
esm.cache.removeVolumeLoadObject(segmentationId);
|
|
7836
8399
|
}
|
|
7837
8400
|
}
|
|
7838
|
-
_updateCornerstoneSegmentations(
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
} = _ref3;
|
|
8401
|
+
_updateCornerstoneSegmentations({
|
|
8402
|
+
segmentationId,
|
|
8403
|
+
notYetUpdatedAtSource
|
|
8404
|
+
}) {
|
|
7843
8405
|
if (notYetUpdatedAtSource === false) {
|
|
7844
8406
|
return;
|
|
7845
8407
|
}
|
|
@@ -7876,19 +8438,15 @@ class SegmentationService extends src/* PubSubService */.hC {
|
|
|
7876
8438
|
return referencedFrameOfReferenceSequence.FrameOfReferenceUID;
|
|
7877
8439
|
}
|
|
7878
8440
|
}
|
|
7879
|
-
generateNewColorLUT() {
|
|
7880
|
-
const newColorLUT = lodash_clonedeep_default()(COLOR_LUT);
|
|
7881
|
-
return newColorLUT;
|
|
7882
|
-
}
|
|
7883
8441
|
}
|
|
8442
|
+
SegmentationService_class = SegmentationService;
|
|
7884
8443
|
SegmentationService.REGISTRATION = {
|
|
7885
8444
|
name: 'segmentationService',
|
|
7886
8445
|
altName: 'SegmentationService',
|
|
7887
|
-
create:
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
return new SegmentationService({
|
|
8446
|
+
create: ({
|
|
8447
|
+
servicesManager
|
|
8448
|
+
}) => {
|
|
8449
|
+
return new SegmentationService_class({
|
|
7892
8450
|
servicesManager
|
|
7893
8451
|
});
|
|
7894
8452
|
}
|
|
@@ -7918,6 +8476,7 @@ function getCornerstoneViewportType(viewportType) {
|
|
|
7918
8476
|
throw new Error(`Invalid viewport type: ${viewportType}. Valid types are: stack, volume`);
|
|
7919
8477
|
}
|
|
7920
8478
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/CornerstoneCacheService/CornerstoneCacheService.ts
|
|
8479
|
+
var CornerstoneCacheService_class;
|
|
7921
8480
|
|
|
7922
8481
|
|
|
7923
8482
|
const CornerstoneCacheService_VOLUME_LOADER_SCHEME = 'cornerstoneStreamingImageVolume';
|
|
@@ -7971,12 +8530,9 @@ class CornerstoneCacheService {
|
|
|
7971
8530
|
esm.cache.removeVolumeLoadObject(volumeId);
|
|
7972
8531
|
this.volumeImageIds.delete(volumeId);
|
|
7973
8532
|
}
|
|
7974
|
-
const displaySets = viewportData.data.map(
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
} = _ref;
|
|
7978
|
-
return displaySetService.getDisplaySetByUID(displaySetInstanceUID);
|
|
7979
|
-
});
|
|
8533
|
+
const displaySets = viewportData.data.map(({
|
|
8534
|
+
displaySetInstanceUID
|
|
8535
|
+
}) => displaySetService.getDisplaySetByUID(displaySetInstanceUID));
|
|
7980
8536
|
const newViewportData = await this._getVolumeViewportData(dataSource, displaySets, viewportData.viewportType);
|
|
7981
8537
|
return newViewportData;
|
|
7982
8538
|
}
|
|
@@ -8063,12 +8619,9 @@ class CornerstoneCacheService {
|
|
|
8063
8619
|
segmentationService,
|
|
8064
8620
|
displaySetService
|
|
8065
8621
|
} = this.servicesManager.services;
|
|
8066
|
-
const viewportDisplaySetInstanceUIDs = displaySets.map(
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
} = _ref2;
|
|
8070
|
-
return displaySetInstanceUID;
|
|
8071
|
-
});
|
|
8622
|
+
const viewportDisplaySetInstanceUIDs = displaySets.map(({
|
|
8623
|
+
displaySetInstanceUID
|
|
8624
|
+
}) => displaySetInstanceUID);
|
|
8072
8625
|
|
|
8073
8626
|
// check inside segmentations if any of them are referencing the displaySets
|
|
8074
8627
|
// that are about to be displayed
|
|
@@ -8091,14 +8644,14 @@ class CornerstoneCacheService {
|
|
|
8091
8644
|
return stackImageIds;
|
|
8092
8645
|
}
|
|
8093
8646
|
}
|
|
8647
|
+
CornerstoneCacheService_class = CornerstoneCacheService;
|
|
8094
8648
|
CornerstoneCacheService.REGISTRATION = {
|
|
8095
8649
|
name: 'cornerstoneCacheService',
|
|
8096
8650
|
altName: 'CornerstoneCacheService',
|
|
8097
|
-
create:
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
return new CornerstoneCacheService(servicesManager);
|
|
8651
|
+
create: ({
|
|
8652
|
+
servicesManager
|
|
8653
|
+
}) => {
|
|
8654
|
+
return new CornerstoneCacheService_class(servicesManager);
|
|
8102
8655
|
}
|
|
8103
8656
|
};
|
|
8104
8657
|
/* harmony default export */ const CornerstoneCacheService_CornerstoneCacheService = (CornerstoneCacheService);
|
|
@@ -8228,12 +8781,9 @@ class ViewportInfo {
|
|
|
8228
8781
|
let viewportData = this.getViewportData();
|
|
8229
8782
|
if (viewportData.viewportType === esm.Enums.ViewportType.ORTHOGRAPHIC || viewportData.viewportType === esm.Enums.ViewportType.VOLUME_3D) {
|
|
8230
8783
|
viewportData = viewportData;
|
|
8231
|
-
return viewportData.data.some(
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
} = _ref;
|
|
8235
|
-
return dsUID === displaySetInstanceUID;
|
|
8236
|
-
});
|
|
8784
|
+
return viewportData.data.some(({
|
|
8785
|
+
displaySetInstanceUID: dsUID
|
|
8786
|
+
}) => dsUID === displaySetInstanceUID);
|
|
8237
8787
|
}
|
|
8238
8788
|
viewportData = viewportData;
|
|
8239
8789
|
return viewportData.data.displaySetInstanceUID === displaySetInstanceUID;
|
|
@@ -8274,6 +8824,12 @@ class ViewportInfo {
|
|
|
8274
8824
|
getViewportOptions() {
|
|
8275
8825
|
return this.viewportOptions;
|
|
8276
8826
|
}
|
|
8827
|
+
getPresentationIds() {
|
|
8828
|
+
const {
|
|
8829
|
+
presentationIds
|
|
8830
|
+
} = this.viewportOptions;
|
|
8831
|
+
return presentationIds;
|
|
8832
|
+
}
|
|
8277
8833
|
setDisplaySetOptions(displaySetOptions) {
|
|
8278
8834
|
this.displaySetOptions = displaySetOptions;
|
|
8279
8835
|
}
|
|
@@ -8305,8 +8861,7 @@ class ViewportInfo {
|
|
|
8305
8861
|
|
|
8306
8862
|
// Handle incoming public display set options or a display set select
|
|
8307
8863
|
// with a contained options.
|
|
8308
|
-
mapDisplaySetOptions() {
|
|
8309
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [{}];
|
|
8864
|
+
mapDisplaySetOptions(options = [{}]) {
|
|
8310
8865
|
const displaySetOptions = [];
|
|
8311
8866
|
options.forEach(item => {
|
|
8312
8867
|
let option = item?.options || item;
|
|
@@ -8346,6 +8901,7 @@ var JumpPresets = /*#__PURE__*/function (JumpPresets) {
|
|
|
8346
8901
|
}(JumpPresets || {});
|
|
8347
8902
|
/* harmony default export */ const utils_JumpPresets = (JumpPresets);
|
|
8348
8903
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts
|
|
8904
|
+
var CornerstoneViewportService_class;
|
|
8349
8905
|
|
|
8350
8906
|
|
|
8351
8907
|
|
|
@@ -8360,18 +8916,23 @@ const CornerstoneViewportService_EVENTS = {
|
|
|
8360
8916
|
* Handles cornerstone viewport logic including enabling, disabling, and
|
|
8361
8917
|
* updating the viewport.
|
|
8362
8918
|
*/
|
|
8363
|
-
class CornerstoneViewportService extends src/* PubSubService */.
|
|
8919
|
+
class CornerstoneViewportService extends src/* PubSubService */.Rc {
|
|
8364
8920
|
constructor(servicesManager) {
|
|
8365
8921
|
super(CornerstoneViewportService_EVENTS);
|
|
8366
8922
|
this.renderingEngine = void 0;
|
|
8367
8923
|
this.viewportsById = new Map();
|
|
8368
8924
|
this.viewportGridResizeObserver = void 0;
|
|
8369
8925
|
this.viewportsDisplaySets = new Map();
|
|
8926
|
+
this.beforeResizePositionPresentations = new Map();
|
|
8370
8927
|
// Some configs
|
|
8371
8928
|
this.enableResizeDetector = void 0;
|
|
8372
8929
|
this.resizeRefreshRateMs = void 0;
|
|
8373
8930
|
this.resizeRefreshMode = void 0;
|
|
8374
8931
|
this.servicesManager = null;
|
|
8932
|
+
this.resizeQueue = [];
|
|
8933
|
+
this.viewportResizeTimer = null;
|
|
8934
|
+
this.gridResizeDelay = 50;
|
|
8935
|
+
this.gridResizeTimeOut = null;
|
|
8375
8936
|
this.renderingEngine = null;
|
|
8376
8937
|
this.viewportGridResizeObserver = null;
|
|
8377
8938
|
this.servicesManager = servicesManager;
|
|
@@ -8409,13 +8970,28 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
|
|
|
8409
8970
|
}
|
|
8410
8971
|
|
|
8411
8972
|
/**
|
|
8412
|
-
* It triggers the resize on the rendering engine
|
|
8973
|
+
* It triggers the resize on the rendering engine, and renders the viewports
|
|
8974
|
+
*
|
|
8975
|
+
* @param isGridResize - if the resize is triggered by a grid resize
|
|
8976
|
+
* this is used to avoid double resize of the viewports since if the
|
|
8977
|
+
* grid is resized, all viewports will be resized so there is no need
|
|
8978
|
+
* to resize them individually which will get triggered by their
|
|
8979
|
+
* individual resize observers
|
|
8413
8980
|
*/
|
|
8414
|
-
resize() {
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8981
|
+
resize(isGridResize = false) {
|
|
8982
|
+
// if there is a grid resize happening, it means the viewport grid
|
|
8983
|
+
// has been manipulated (e.g., panels closed, added, etc.) and we need
|
|
8984
|
+
// to resize all viewports, so we will add a timeout here to make sure
|
|
8985
|
+
// we don't double resize the viewports when viewports in the grid are
|
|
8986
|
+
// resized individually
|
|
8987
|
+
if (isGridResize) {
|
|
8988
|
+
this.performResize();
|
|
8989
|
+
this.resetGridResizeTimeout();
|
|
8990
|
+
this.resizeQueue = [];
|
|
8991
|
+
clearTimeout(this.viewportResizeTimer);
|
|
8992
|
+
} else {
|
|
8993
|
+
this.enqueueViewportResizeRequest();
|
|
8994
|
+
}
|
|
8419
8995
|
}
|
|
8420
8996
|
|
|
8421
8997
|
/**
|
|
@@ -8451,83 +9027,222 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
|
|
|
8451
9027
|
this.viewportsById.delete(viewportId);
|
|
8452
9028
|
this.viewportsDisplaySets.delete(viewportId);
|
|
8453
9029
|
}
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
9030
|
+
|
|
9031
|
+
/**
|
|
9032
|
+
* Sets the presentations for a given viewport. Presentations is an object
|
|
9033
|
+
* that can define the lut or position for a viewport.
|
|
9034
|
+
*
|
|
9035
|
+
* @param viewportId - The ID of the viewport.
|
|
9036
|
+
* @param presentations - The presentations to apply to the viewport.
|
|
9037
|
+
*/
|
|
9038
|
+
setPresentations(viewportId, presentations) {
|
|
9039
|
+
const viewport = this.getCornerstoneViewport(viewportId);
|
|
9040
|
+
if (!viewport) {
|
|
9041
|
+
return;
|
|
9042
|
+
}
|
|
9043
|
+
if (!presentations) {
|
|
9044
|
+
return;
|
|
9045
|
+
}
|
|
9046
|
+
const {
|
|
9047
|
+
lutPresentation,
|
|
9048
|
+
positionPresentation
|
|
9049
|
+
} = presentations;
|
|
9050
|
+
if (lutPresentation) {
|
|
9051
|
+
const {
|
|
9052
|
+
presentation
|
|
9053
|
+
} = lutPresentation;
|
|
9054
|
+
if (viewport instanceof esm.BaseVolumeViewport) {
|
|
9055
|
+
Object.entries(presentation).forEach(([volumeId, properties]) => {
|
|
9056
|
+
viewport.setProperties(properties, volumeId);
|
|
9057
|
+
});
|
|
9058
|
+
} else {
|
|
9059
|
+
viewport.setProperties(presentation);
|
|
9060
|
+
}
|
|
8458
9061
|
}
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
9062
|
+
if (positionPresentation) {
|
|
9063
|
+
const {
|
|
9064
|
+
viewPlaneNormal,
|
|
9065
|
+
viewUp,
|
|
9066
|
+
zoom,
|
|
9067
|
+
pan
|
|
9068
|
+
} = positionPresentation.presentation;
|
|
9069
|
+
viewport.setCamera({
|
|
9070
|
+
viewPlaneNormal,
|
|
9071
|
+
viewUp
|
|
9072
|
+
});
|
|
9073
|
+
if (zoom !== undefined) {
|
|
9074
|
+
viewport.setZoom(zoom);
|
|
9075
|
+
}
|
|
9076
|
+
if (pan !== undefined) {
|
|
9077
|
+
viewport.setPan(pan);
|
|
9078
|
+
}
|
|
8462
9079
|
}
|
|
8463
9080
|
}
|
|
8464
|
-
|
|
9081
|
+
|
|
9082
|
+
/**
|
|
9083
|
+
* Retrieves the position presentation information for a given viewport.
|
|
9084
|
+
* @param viewportId The ID of the viewport.
|
|
9085
|
+
* @returns The position presentation object containing various properties
|
|
9086
|
+
* such as ID, viewport type, initial image index, view plane normal, view up, zoom, and pan.
|
|
9087
|
+
*/
|
|
9088
|
+
getPositionPresentation(viewportId) {
|
|
8465
9089
|
const viewportInfo = this.viewportsById.get(viewportId);
|
|
8466
9090
|
if (!viewportInfo) {
|
|
8467
9091
|
return;
|
|
8468
9092
|
}
|
|
9093
|
+
const presentationIds = viewportInfo.getPresentationIds();
|
|
9094
|
+
if (!presentationIds) {
|
|
9095
|
+
return;
|
|
9096
|
+
}
|
|
8469
9097
|
const {
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
} = viewportInfo.getViewportOptions();
|
|
9098
|
+
positionPresentationId
|
|
9099
|
+
} = presentationIds;
|
|
8473
9100
|
const csViewport = this.getCornerstoneViewport(viewportId);
|
|
8474
9101
|
if (!csViewport) {
|
|
8475
9102
|
return;
|
|
8476
9103
|
}
|
|
8477
|
-
const
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
}
|
|
9104
|
+
const {
|
|
9105
|
+
viewPlaneNormal,
|
|
9106
|
+
viewUp
|
|
9107
|
+
} = csViewport.getCamera();
|
|
8482
9108
|
const initialImageIndex = csViewport.getCurrentImageIdIndex();
|
|
8483
|
-
const
|
|
9109
|
+
const zoom = csViewport.getZoom();
|
|
9110
|
+
const pan = csViewport.getPan();
|
|
8484
9111
|
return {
|
|
8485
|
-
|
|
8486
|
-
viewportType:
|
|
8487
|
-
|
|
8488
|
-
|
|
8489
|
-
|
|
9112
|
+
id: positionPresentationId,
|
|
9113
|
+
viewportType: viewportInfo.getViewportType(),
|
|
9114
|
+
presentation: {
|
|
9115
|
+
initialImageIndex,
|
|
9116
|
+
viewUp,
|
|
9117
|
+
viewPlaneNormal,
|
|
9118
|
+
zoom,
|
|
9119
|
+
pan
|
|
9120
|
+
}
|
|
8490
9121
|
};
|
|
8491
9122
|
}
|
|
8492
|
-
|
|
8493
|
-
|
|
8494
|
-
|
|
8495
|
-
|
|
8496
|
-
|
|
8497
|
-
|
|
9123
|
+
|
|
9124
|
+
/**
|
|
9125
|
+
* Retrieves the LUT (Lookup Table) presentation for a given viewport.
|
|
9126
|
+
* @param viewportId The ID of the viewport.
|
|
9127
|
+
* @returns The LUT presentation object, or undefined if the viewport does not exist.
|
|
9128
|
+
*/
|
|
9129
|
+
getLutPresentation(viewportId) {
|
|
9130
|
+
const viewportInfo = this.viewportsById.get(viewportId);
|
|
9131
|
+
if (!viewportInfo) {
|
|
9132
|
+
return;
|
|
9133
|
+
}
|
|
9134
|
+
const presentationIds = viewportInfo.getPresentationIds();
|
|
9135
|
+
if (!presentationIds) {
|
|
9136
|
+
return;
|
|
9137
|
+
}
|
|
9138
|
+
const {
|
|
9139
|
+
lutPresentationId
|
|
9140
|
+
} = presentationIds;
|
|
9141
|
+
const csViewport = this.getCornerstoneViewport(viewportId);
|
|
9142
|
+
if (!csViewport) {
|
|
9143
|
+
return;
|
|
9144
|
+
}
|
|
9145
|
+
const cleanProperties = properties => {
|
|
9146
|
+
if (properties.isComputedVOI) {
|
|
9147
|
+
delete properties.voiRange;
|
|
9148
|
+
delete properties.VOILUTFunction;
|
|
9149
|
+
}
|
|
9150
|
+
return properties;
|
|
9151
|
+
};
|
|
9152
|
+
const presentation = csViewport instanceof esm.BaseVolumeViewport ? new Map() : cleanProperties(csViewport.getProperties());
|
|
9153
|
+
if (presentation instanceof Map) {
|
|
9154
|
+
csViewport.getActors().forEach(({
|
|
9155
|
+
uid: volumeId
|
|
9156
|
+
}) => {
|
|
9157
|
+
const properties = cleanProperties(csViewport.getProperties(volumeId));
|
|
9158
|
+
presentation.set(volumeId, properties);
|
|
9159
|
+
});
|
|
9160
|
+
}
|
|
9161
|
+
return {
|
|
9162
|
+
id: lutPresentationId,
|
|
9163
|
+
viewportType: viewportInfo.getViewportType(),
|
|
9164
|
+
presentation
|
|
9165
|
+
};
|
|
9166
|
+
}
|
|
9167
|
+
|
|
9168
|
+
/**
|
|
9169
|
+
* Retrieves the presentations for a given viewport.
|
|
9170
|
+
* @param viewportId - The ID of the viewport.
|
|
9171
|
+
* @returns The presentations for the viewport.
|
|
9172
|
+
*/
|
|
9173
|
+
getPresentations(viewportId) {
|
|
9174
|
+
const viewportInfo = this.viewportsById.get(viewportId);
|
|
9175
|
+
if (!viewportInfo) {
|
|
9176
|
+
return;
|
|
9177
|
+
}
|
|
9178
|
+
const positionPresentation = this.getPositionPresentation(viewportId);
|
|
9179
|
+
const lutPresentation = this.getLutPresentation(viewportId);
|
|
9180
|
+
return {
|
|
9181
|
+
positionPresentation,
|
|
9182
|
+
lutPresentation
|
|
9183
|
+
};
|
|
9184
|
+
}
|
|
9185
|
+
|
|
9186
|
+
/**
|
|
9187
|
+
* Stores the presentation state for a given viewport inside the
|
|
9188
|
+
* stateSyncService. This is used to persist the presentation state
|
|
9189
|
+
* across different scenarios e.g., when the viewport is changing the
|
|
9190
|
+
* display set, or when the viewport is moving to a different layout.
|
|
9191
|
+
*
|
|
9192
|
+
* @param viewportId The ID of the viewport.
|
|
9193
|
+
*/
|
|
9194
|
+
storePresentation({
|
|
9195
|
+
viewportId
|
|
9196
|
+
}) {
|
|
9197
|
+
let presentations = null;
|
|
8498
9198
|
try {
|
|
8499
|
-
|
|
9199
|
+
presentations = this.getPresentations(viewportId);
|
|
9200
|
+
if (!presentations?.positionPresentation && !presentations?.lutPresentation) {
|
|
9201
|
+
return;
|
|
9202
|
+
}
|
|
8500
9203
|
} catch (error) {
|
|
8501
9204
|
console.warn(error);
|
|
8502
|
-
}
|
|
8503
|
-
if (!presentation || !presentation.presentationIds) {
|
|
8504
9205
|
return;
|
|
8505
9206
|
}
|
|
8506
9207
|
const {
|
|
8507
|
-
|
|
8508
|
-
|
|
9208
|
+
stateSyncService,
|
|
9209
|
+
syncGroupService
|
|
9210
|
+
} = this.servicesManager.services;
|
|
9211
|
+
const synchronizers = syncGroupService.getSynchronizersForViewport(viewportId, this.renderingEngine.id);
|
|
9212
|
+
const {
|
|
9213
|
+
positionPresentationStore,
|
|
9214
|
+
synchronizersStore,
|
|
9215
|
+
lutPresentationStore
|
|
8509
9216
|
} = stateSyncService.getState();
|
|
8510
9217
|
const {
|
|
8511
|
-
|
|
8512
|
-
|
|
9218
|
+
lutPresentation,
|
|
9219
|
+
positionPresentation
|
|
9220
|
+
} = presentations;
|
|
8513
9221
|
const {
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
9222
|
+
id: positionPresentationId
|
|
9223
|
+
} = positionPresentation;
|
|
9224
|
+
const {
|
|
9225
|
+
id: lutPresentationId
|
|
9226
|
+
} = lutPresentation;
|
|
9227
|
+
const updateStore = (store, id, value) => ({
|
|
9228
|
+
...store,
|
|
9229
|
+
[id]: value
|
|
9230
|
+
});
|
|
9231
|
+
const newState = {};
|
|
8518
9232
|
if (lutPresentationId) {
|
|
8519
|
-
|
|
8520
|
-
...lutPresentationStore,
|
|
8521
|
-
[lutPresentationId]: presentation
|
|
8522
|
-
};
|
|
9233
|
+
newState.lutPresentationStore = updateStore(lutPresentationStore, lutPresentationId, lutPresentation);
|
|
8523
9234
|
}
|
|
8524
9235
|
if (positionPresentationId) {
|
|
8525
|
-
|
|
8526
|
-
...positionPresentationStore,
|
|
8527
|
-
[positionPresentationId]: presentation
|
|
8528
|
-
};
|
|
9236
|
+
newState.positionPresentationStore = updateStore(positionPresentationStore, positionPresentationId, positionPresentation);
|
|
8529
9237
|
}
|
|
8530
|
-
|
|
9238
|
+
if (synchronizers?.length) {
|
|
9239
|
+
newState.synchronizersStore = updateStore(synchronizersStore, viewportId, synchronizers.map(synchronizer => ({
|
|
9240
|
+
id: synchronizer.id,
|
|
9241
|
+
sourceViewports: [...synchronizer.getSourceViewports()],
|
|
9242
|
+
targetViewports: [...synchronizer.getTargetViewports()]
|
|
9243
|
+
})));
|
|
9244
|
+
}
|
|
9245
|
+
stateSyncService.store(newState);
|
|
8531
9246
|
}
|
|
8532
9247
|
|
|
8533
9248
|
/**
|
|
@@ -8595,16 +9310,25 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
|
|
|
8595
9310
|
viewportInfo.setViewportId(viewportId);
|
|
8596
9311
|
this.viewportsById.set(viewportId, viewportInfo);
|
|
8597
9312
|
const viewport = renderingEngine.getViewport(viewportId);
|
|
8598
|
-
this._setDisplaySets(viewport, viewportData, viewportInfo, presentations);
|
|
9313
|
+
const displaySetPromise = this._setDisplaySets(viewport, viewportData, viewportInfo, presentations);
|
|
8599
9314
|
|
|
8600
9315
|
// The broadcast event here ensures that listeners have a valid, up to date
|
|
8601
9316
|
// viewport to access. Doing it too early can result in exceptions or
|
|
8602
9317
|
// invalid data.
|
|
8603
|
-
|
|
8604
|
-
|
|
8605
|
-
|
|
9318
|
+
displaySetPromise.then(() => {
|
|
9319
|
+
this._broadcastEvent(this.EVENTS.VIEWPORT_DATA_CHANGED, {
|
|
9320
|
+
viewportData,
|
|
9321
|
+
viewportId
|
|
9322
|
+
});
|
|
8606
9323
|
});
|
|
8607
9324
|
}
|
|
9325
|
+
|
|
9326
|
+
/**
|
|
9327
|
+
* Retrieves the Cornerstone viewport with the specified ID.
|
|
9328
|
+
*
|
|
9329
|
+
* @param viewportId - The ID of the viewport.
|
|
9330
|
+
* @returns The Cornerstone viewport object if found, otherwise null.
|
|
9331
|
+
*/
|
|
8608
9332
|
getCornerstoneViewport(viewportId) {
|
|
8609
9333
|
const viewportInfo = this.getViewportInfo(viewportId);
|
|
8610
9334
|
if (!viewportInfo || !this.renderingEngine || this.renderingEngine.hasBeenDestroyed) {
|
|
@@ -8613,10 +9337,40 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
|
|
|
8613
9337
|
const viewport = this.renderingEngine.getViewport(viewportId);
|
|
8614
9338
|
return viewport;
|
|
8615
9339
|
}
|
|
9340
|
+
|
|
9341
|
+
/**
|
|
9342
|
+
* Retrieves the viewport information for a given viewport ID. The viewport information
|
|
9343
|
+
* is the OHIF construct that holds different options and data for a given viewport and
|
|
9344
|
+
* is different from the cornerstone viewport.
|
|
9345
|
+
*
|
|
9346
|
+
* @param viewportId The ID of the viewport.
|
|
9347
|
+
* @returns The viewport information.
|
|
9348
|
+
*/
|
|
8616
9349
|
getViewportInfo(viewportId) {
|
|
8617
9350
|
return this.viewportsById.get(viewportId);
|
|
8618
9351
|
}
|
|
8619
|
-
|
|
9352
|
+
|
|
9353
|
+
/**
|
|
9354
|
+
* Looks through the viewports to see if the specified measurement can be
|
|
9355
|
+
* displayed in one of the viewports.
|
|
9356
|
+
*
|
|
9357
|
+
* @param measurement
|
|
9358
|
+
* The measurement that is desired to view.
|
|
9359
|
+
* @param activeViewportId - the index that was active at the time the jump
|
|
9360
|
+
* was initiated.
|
|
9361
|
+
* @return the viewportId that the measurement should be displayed in.
|
|
9362
|
+
*/
|
|
9363
|
+
getViewportIdToJump(activeViewportId, displaySetInstanceUID, cameraProps) {
|
|
9364
|
+
const viewportInfo = this.getViewportInfo(activeViewportId);
|
|
9365
|
+
const {
|
|
9366
|
+
referencedImageId
|
|
9367
|
+
} = cameraProps;
|
|
9368
|
+
if (viewportInfo?.contains(displaySetInstanceUID, referencedImageId)) {
|
|
9369
|
+
return activeViewportId;
|
|
9370
|
+
}
|
|
9371
|
+
return [...this.viewportsById.values()].find(viewportInfo => viewportInfo.contains(displaySetInstanceUID, referencedImageId))?.viewportId ?? null;
|
|
9372
|
+
}
|
|
9373
|
+
async _setStackViewport(viewport, viewportData, viewportInfo, presentations = {}) {
|
|
8620
9374
|
const displaySetOptions = viewportInfo.getDisplaySetOptions();
|
|
8621
9375
|
const {
|
|
8622
9376
|
imageIds,
|
|
@@ -8634,7 +9388,8 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
|
|
|
8634
9388
|
if (!presentations.lutPresentation?.properties) {
|
|
8635
9389
|
const {
|
|
8636
9390
|
voi,
|
|
8637
|
-
voiInverted
|
|
9391
|
+
voiInverted,
|
|
9392
|
+
colormap
|
|
8638
9393
|
} = displaySetOptions[0];
|
|
8639
9394
|
if (voi && (voi.windowWidth || voi.windowCenter)) {
|
|
8640
9395
|
const {
|
|
@@ -8649,15 +9404,15 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
|
|
|
8649
9404
|
if (voiInverted !== undefined) {
|
|
8650
9405
|
properties.invert = voiInverted;
|
|
8651
9406
|
}
|
|
9407
|
+
if (colormap !== undefined) {
|
|
9408
|
+
properties.colormap = colormap;
|
|
9409
|
+
}
|
|
8652
9410
|
}
|
|
8653
|
-
viewport.setStack(imageIds, initialImageIndexToUse).then(() => {
|
|
9411
|
+
return viewport.setStack(imageIds, initialImageIndexToUse).then(() => {
|
|
8654
9412
|
viewport.setProperties({
|
|
8655
9413
|
...properties
|
|
8656
9414
|
});
|
|
8657
|
-
|
|
8658
|
-
if (camera) {
|
|
8659
|
-
viewport.setCamera(camera);
|
|
8660
|
-
}
|
|
9415
|
+
this.setPresentations(viewport.id, presentations);
|
|
8661
9416
|
});
|
|
8662
9417
|
}
|
|
8663
9418
|
_getInitialImageIndexForViewport(viewportInfo, imageIds) {
|
|
@@ -8709,7 +9464,7 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
|
|
|
8709
9464
|
}
|
|
8710
9465
|
return 0;
|
|
8711
9466
|
}
|
|
8712
|
-
async _setVolumeViewport(viewport, viewportData, viewportInfo, presentations) {
|
|
9467
|
+
async _setVolumeViewport(viewport, viewportData, viewportInfo, presentations = {}) {
|
|
8713
9468
|
// TODO: We need to overhaul the way data sources work so requests can be made
|
|
8714
9469
|
// async. I think we should follow the image loader pattern which is async and
|
|
8715
9470
|
// has a cache behind it.
|
|
@@ -8814,14 +9569,13 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
|
|
|
8814
9569
|
};
|
|
8815
9570
|
});
|
|
8816
9571
|
await viewport.setVolumes(volumeInputArray);
|
|
8817
|
-
volumesProperties.forEach(
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
} = _ref2;
|
|
9572
|
+
volumesProperties.forEach(({
|
|
9573
|
+
properties,
|
|
9574
|
+
volumeId
|
|
9575
|
+
}) => {
|
|
8822
9576
|
viewport.setProperties(properties, volumeId);
|
|
8823
9577
|
});
|
|
8824
|
-
this.setPresentations(viewport, presentations);
|
|
9578
|
+
this.setPresentations(viewport.id, presentations);
|
|
8825
9579
|
|
|
8826
9580
|
// load any secondary displaySets
|
|
8827
9581
|
const displaySetInstanceUIDs = this.viewportsDisplaySets.get(viewport.id);
|
|
@@ -8918,34 +9672,37 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
|
|
|
8918
9672
|
|
|
8919
9673
|
// Todo: keepCamera is an interim solution until we have a better solution for
|
|
8920
9674
|
// keeping the camera position when the viewport data is changed
|
|
8921
|
-
updateViewport(viewportId, viewportData) {
|
|
8922
|
-
let keepCamera = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
9675
|
+
updateViewport(viewportId, viewportData, keepCamera = false) {
|
|
8923
9676
|
const viewportInfo = this.getViewportInfo(viewportId);
|
|
8924
9677
|
const viewport = this.getCornerstoneViewport(viewportId);
|
|
8925
9678
|
const viewportCamera = viewport.getCamera();
|
|
9679
|
+
let displaySetPromise;
|
|
8926
9680
|
if (viewport instanceof esm.VolumeViewport || viewport instanceof esm.VolumeViewport3D) {
|
|
8927
|
-
this._setVolumeViewport(viewport, viewportData, viewportInfo).then(() => {
|
|
9681
|
+
displaySetPromise = this._setVolumeViewport(viewport, viewportData, viewportInfo).then(() => {
|
|
8928
9682
|
if (keepCamera) {
|
|
8929
9683
|
viewport.setCamera(viewportCamera);
|
|
8930
9684
|
viewport.render();
|
|
8931
9685
|
}
|
|
8932
9686
|
});
|
|
8933
|
-
return;
|
|
8934
9687
|
}
|
|
8935
9688
|
if (viewport instanceof esm.StackViewport) {
|
|
8936
|
-
this._setStackViewport(viewport, viewportData, viewportInfo);
|
|
8937
|
-
return;
|
|
9689
|
+
displaySetPromise = this._setStackViewport(viewport, viewportData, viewportInfo);
|
|
8938
9690
|
}
|
|
9691
|
+
displaySetPromise.then(() => {
|
|
9692
|
+
this._broadcastEvent(this.EVENTS.VIEWPORT_DATA_CHANGED, {
|
|
9693
|
+
viewportData,
|
|
9694
|
+
viewportId
|
|
9695
|
+
});
|
|
9696
|
+
});
|
|
8939
9697
|
}
|
|
8940
|
-
_setDisplaySets(viewport, viewportData, viewportInfo) {
|
|
8941
|
-
let presentations = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
9698
|
+
_setDisplaySets(viewport, viewportData, viewportInfo, presentations = {}) {
|
|
8942
9699
|
if (viewport instanceof esm.StackViewport) {
|
|
8943
|
-
this._setStackViewport(viewport, viewportData, viewportInfo, presentations);
|
|
8944
|
-
} else if (viewport instanceof esm.VolumeViewport || viewport instanceof esm.VolumeViewport3D) {
|
|
8945
|
-
this._setVolumeViewport(viewport, viewportData, viewportInfo, presentations);
|
|
8946
|
-
} else {
|
|
8947
|
-
throw new Error('Unknown viewport type');
|
|
9700
|
+
return this._setStackViewport(viewport, viewportData, viewportInfo, presentations);
|
|
8948
9701
|
}
|
|
9702
|
+
if ([esm.VolumeViewport, esm.VolumeViewport3D].some(type => viewport instanceof type)) {
|
|
9703
|
+
return this._setVolumeViewport(viewport, viewportData, viewportInfo, presentations);
|
|
9704
|
+
}
|
|
9705
|
+
throw new Error('Unknown viewport type');
|
|
8949
9706
|
}
|
|
8950
9707
|
|
|
8951
9708
|
/**
|
|
@@ -9008,36 +9765,67 @@ class CornerstoneViewportService extends src/* PubSubService */.hC {
|
|
|
9008
9765
|
return images[0].FrameOfReferenceUID;
|
|
9009
9766
|
}
|
|
9010
9767
|
}
|
|
9768
|
+
enqueueViewportResizeRequest() {
|
|
9769
|
+
this.resizeQueue.push(false); // false indicates viewport resize
|
|
9011
9770
|
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
*/
|
|
9022
|
-
getViewportIdToJump(activeViewportId, displaySetInstanceUID, cameraProps) {
|
|
9023
|
-
const viewportInfo = this.getViewportInfo(activeViewportId);
|
|
9024
|
-
const {
|
|
9025
|
-
referencedImageId
|
|
9026
|
-
} = cameraProps;
|
|
9027
|
-
if (viewportInfo?.contains(displaySetInstanceUID, referencedImageId)) {
|
|
9028
|
-
return activeViewportId;
|
|
9771
|
+
clearTimeout(this.viewportResizeTimer);
|
|
9772
|
+
this.viewportResizeTimer = setTimeout(() => {
|
|
9773
|
+
this.processViewportResizeQueue();
|
|
9774
|
+
}, this.gridResizeDelay);
|
|
9775
|
+
}
|
|
9776
|
+
processViewportResizeQueue() {
|
|
9777
|
+
const isGridResizeInQueue = this.resizeQueue.some(isGridResize => isGridResize);
|
|
9778
|
+
if (this.resizeQueue.length > 0 && !isGridResizeInQueue && !this.gridResizeTimeOut) {
|
|
9779
|
+
this.performResize();
|
|
9029
9780
|
}
|
|
9030
|
-
|
|
9781
|
+
|
|
9782
|
+
// Clear the queue after processing viewport resizes
|
|
9783
|
+
this.resizeQueue = [];
|
|
9784
|
+
}
|
|
9785
|
+
performResize() {
|
|
9786
|
+
const isImmediate = false;
|
|
9787
|
+
const viewports = this.getRenderingEngine().getViewports();
|
|
9788
|
+
|
|
9789
|
+
// Store the current position presentations for each viewport.
|
|
9790
|
+
viewports.forEach(({
|
|
9791
|
+
id
|
|
9792
|
+
}) => {
|
|
9793
|
+
const presentation = this.getPositionPresentation(id);
|
|
9794
|
+
this.beforeResizePositionPresentations.set(id, presentation);
|
|
9795
|
+
});
|
|
9796
|
+
|
|
9797
|
+
// Resize the rendering engine and render.
|
|
9798
|
+
const renderingEngine = this.renderingEngine;
|
|
9799
|
+
renderingEngine.resize(isImmediate);
|
|
9800
|
+
renderingEngine.render();
|
|
9801
|
+
|
|
9802
|
+
// Reset the camera for viewports that should reset their camera on resize,
|
|
9803
|
+
// which means only those viewports that have a zoom level of 1.
|
|
9804
|
+
this.beforeResizePositionPresentations.forEach((positionPresentation, viewportId) => {
|
|
9805
|
+
this.setPresentations(viewportId, {
|
|
9806
|
+
positionPresentation
|
|
9807
|
+
});
|
|
9808
|
+
});
|
|
9809
|
+
|
|
9810
|
+
// Resize and render the rendering engine again.
|
|
9811
|
+
renderingEngine.resize(isImmediate);
|
|
9812
|
+
renderingEngine.render();
|
|
9813
|
+
}
|
|
9814
|
+
resetGridResizeTimeout() {
|
|
9815
|
+
clearTimeout(this.gridResizeTimeOut);
|
|
9816
|
+
this.gridResizeTimeOut = setTimeout(() => {
|
|
9817
|
+
this.gridResizeTimeOut = null;
|
|
9818
|
+
}, this.gridResizeDelay);
|
|
9031
9819
|
}
|
|
9032
9820
|
}
|
|
9821
|
+
CornerstoneViewportService_class = CornerstoneViewportService;
|
|
9033
9822
|
CornerstoneViewportService.REGISTRATION = {
|
|
9034
9823
|
name: 'cornerstoneViewportService',
|
|
9035
9824
|
altName: 'CornerstoneViewportService',
|
|
9036
|
-
create:
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
return new CornerstoneViewportService(servicesManager);
|
|
9825
|
+
create: ({
|
|
9826
|
+
servicesManager
|
|
9827
|
+
}) => {
|
|
9828
|
+
return new CornerstoneViewportService_class(servicesManager);
|
|
9041
9829
|
}
|
|
9042
9830
|
};
|
|
9043
9831
|
/* harmony default export */ const ViewportService_CornerstoneViewportService = (CornerstoneViewportService);
|
|
@@ -9045,7 +9833,7 @@ CornerstoneViewportService.REGISTRATION = {
|
|
|
9045
9833
|
|
|
9046
9834
|
|
|
9047
9835
|
// EXTERNAL MODULE: ../../../node_modules/dicomweb-client/build/dicomweb-client.es.js
|
|
9048
|
-
var dicomweb_client_es = __webpack_require__(
|
|
9836
|
+
var dicomweb_client_es = __webpack_require__(36922);
|
|
9049
9837
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/dicomLoaderService.js
|
|
9050
9838
|
|
|
9051
9839
|
|
|
@@ -9086,8 +9874,7 @@ const getNonImageInstance = dataset => {
|
|
|
9086
9874
|
const getImageInstanceId = imageInstance => {
|
|
9087
9875
|
return getImageId(imageInstance);
|
|
9088
9876
|
};
|
|
9089
|
-
const fetchIt =
|
|
9090
|
-
let headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : src.DICOMWeb.getAuthorizationHeader();
|
|
9877
|
+
const fetchIt = (url, headers = src.DICOMWeb.getAuthorizationHeader()) => {
|
|
9091
9878
|
return fetch(url, headers).then(response => response.arrayBuffer());
|
|
9092
9879
|
};
|
|
9093
9880
|
const cornerstoneRetriever = imageId => {
|
|
@@ -9095,15 +9882,13 @@ const cornerstoneRetriever = imageId => {
|
|
|
9095
9882
|
return image && image.data && image.data.byteArray.buffer;
|
|
9096
9883
|
});
|
|
9097
9884
|
};
|
|
9098
|
-
const wadorsRetriever =
|
|
9099
|
-
let headers = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : src.DICOMWeb.getAuthorizationHeader();
|
|
9100
|
-
let errorInterceptor = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : src/* errorHandler */.Po.getHTTPErrorHandler();
|
|
9885
|
+
const wadorsRetriever = (url, studyInstanceUID, seriesInstanceUID, sopInstanceUID, headers = src.DICOMWeb.getAuthorizationHeader(), errorInterceptor = src/* errorHandler */.r_.getHTTPErrorHandler()) => {
|
|
9101
9886
|
const config = {
|
|
9102
9887
|
url,
|
|
9103
9888
|
headers,
|
|
9104
9889
|
errorInterceptor
|
|
9105
9890
|
};
|
|
9106
|
-
const dicomWeb = new dicomweb_client_es
|
|
9891
|
+
const dicomWeb = new dicomweb_client_es/* api */.FH.DICOMwebClient(config);
|
|
9107
9892
|
return dicomWeb.retrieveInstance({
|
|
9108
9893
|
studyInstanceUID,
|
|
9109
9894
|
seriesInstanceUID,
|
|
@@ -9176,7 +9961,8 @@ class DicomLoaderService {
|
|
|
9176
9961
|
SOPInstanceUID,
|
|
9177
9962
|
authorizationHeaders,
|
|
9178
9963
|
wadoRoot,
|
|
9179
|
-
wadoUri
|
|
9964
|
+
wadoUri,
|
|
9965
|
+
instance
|
|
9180
9966
|
} = dataset;
|
|
9181
9967
|
// Retrieve wadors or just try to fetch wadouri
|
|
9182
9968
|
if (!someInvalidStrings(wadoRoot)) {
|
|
@@ -9185,6 +9971,15 @@ class DicomLoaderService {
|
|
|
9185
9971
|
return fetchIt(wadoUri, {
|
|
9186
9972
|
headers: authorizationHeaders
|
|
9187
9973
|
});
|
|
9974
|
+
} else if (!someInvalidStrings(instance?.url)) {
|
|
9975
|
+
// make sure the url is absolute, remove the scope
|
|
9976
|
+
// from it if it is not absolute. For instance it might be dicomweb:http://....
|
|
9977
|
+
// and we need to remove the dicomweb: part
|
|
9978
|
+
const url = instance.url;
|
|
9979
|
+
const absoluteUrl = url.startsWith('http') ? url : url.substring(url.indexOf(':') + 1);
|
|
9980
|
+
return fetchIt(absoluteUrl, {
|
|
9981
|
+
headers: authorizationHeaders
|
|
9982
|
+
});
|
|
9188
9983
|
}
|
|
9189
9984
|
}
|
|
9190
9985
|
*getLoaderIterator(dataset, studies, headers) {
|
|
@@ -9209,10 +10004,10 @@ class DicomLoaderService {
|
|
|
9209
10004
|
const dicomLoaderService = new DicomLoaderService();
|
|
9210
10005
|
/* harmony default export */ const utils_dicomLoaderService = (dicomLoaderService);
|
|
9211
10006
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/package.json
|
|
9212
|
-
const package_namespaceObject = JSON.parse('{"
|
|
10007
|
+
const package_namespaceObject = /*#__PURE__*/JSON.parse('{"UU":"@ohif/extension-cornerstone"}');
|
|
9213
10008
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/id.js
|
|
9214
10009
|
|
|
9215
|
-
const id = package_namespaceObject.
|
|
10010
|
+
const id = package_namespaceObject.UU;
|
|
9216
10011
|
|
|
9217
10012
|
;// CONCATENATED MODULE: ../../../extensions/cornerstone/src/utils/measurementServiceMappings/index.ts
|
|
9218
10013
|
|
|
@@ -9238,10 +10033,11 @@ function src_extends() { src_extends = Object.assign ? Object.assign.bind() : fu
|
|
|
9238
10033
|
|
|
9239
10034
|
|
|
9240
10035
|
|
|
10036
|
+
|
|
9241
10037
|
|
|
9242
10038
|
|
|
9243
10039
|
const Component = /*#__PURE__*/react.lazy(() => {
|
|
9244
|
-
return
|
|
10040
|
+
return __webpack_require__.e(/* import() */ 889).then(__webpack_require__.bind(__webpack_require__, 1889));
|
|
9245
10041
|
});
|
|
9246
10042
|
const OHIFCornerstoneViewport = props => {
|
|
9247
10043
|
return /*#__PURE__*/react.createElement(react.Suspense, {
|
|
@@ -9264,7 +10060,7 @@ const cornerstoneExtension = {
|
|
|
9264
10060
|
esm.imageLoadPoolManager.clearRequestStack(type);
|
|
9265
10061
|
esm.imageRetrievalPoolManager.clearRequestStack(type);
|
|
9266
10062
|
});
|
|
9267
|
-
(0,state/* reset */.
|
|
10063
|
+
(0,state/* reset */.cL)();
|
|
9268
10064
|
},
|
|
9269
10065
|
/**
|
|
9270
10066
|
* Register the Cornerstone 3D services and set them up for use.
|
|
@@ -9283,11 +10079,10 @@ const cornerstoneExtension = {
|
|
|
9283
10079
|
return init.call(this, props);
|
|
9284
10080
|
},
|
|
9285
10081
|
getHangingProtocolModule: src_getHangingProtocolModule,
|
|
9286
|
-
getViewportModule(
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
} = _ref;
|
|
10082
|
+
getViewportModule({
|
|
10083
|
+
servicesManager,
|
|
10084
|
+
commandsManager
|
|
10085
|
+
}) {
|
|
9291
10086
|
const ExtendedOHIFCornerstoneViewport = props => {
|
|
9292
10087
|
// const onNewImageHandler = jumpData => {
|
|
9293
10088
|
// commandsManager.runCommand('jumpToImage', jumpData);
|
|
@@ -9308,10 +10103,9 @@ const cornerstoneExtension = {
|
|
|
9308
10103
|
},
|
|
9309
10104
|
getCommandsModule: src_commandsModule,
|
|
9310
10105
|
getCustomizationModule: src_getCustomizationModule,
|
|
9311
|
-
getUtilityModule(
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
} = _ref2;
|
|
10106
|
+
getUtilityModule({
|
|
10107
|
+
servicesManager
|
|
10108
|
+
}) {
|
|
9315
10109
|
return [{
|
|
9316
10110
|
name: 'common',
|
|
9317
10111
|
exports: {
|
|
@@ -9321,7 +10115,7 @@ const cornerstoneExtension = {
|
|
|
9321
10115
|
cornerstoneTools: dist_esm
|
|
9322
10116
|
};
|
|
9323
10117
|
},
|
|
9324
|
-
getEnabledElement: state/* getEnabledElement */.
|
|
10118
|
+
getEnabledElement: state/* getEnabledElement */.kJ,
|
|
9325
10119
|
dicomLoaderService: utils_dicomLoaderService
|
|
9326
10120
|
}
|
|
9327
10121
|
}, {
|
|
@@ -9343,14 +10137,13 @@ const cornerstoneExtension = {
|
|
|
9343
10137
|
|
|
9344
10138
|
/***/ }),
|
|
9345
10139
|
|
|
9346
|
-
/***/
|
|
10140
|
+
/***/ 71353:
|
|
9347
10141
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
9348
10142
|
|
|
9349
|
-
"use strict";
|
|
9350
10143
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9351
|
-
/* harmony export */
|
|
9352
|
-
/* harmony export */
|
|
9353
|
-
/* harmony export */
|
|
10144
|
+
/* harmony export */ cL: () => (/* binding */ reset),
|
|
10145
|
+
/* harmony export */ kJ: () => (/* binding */ getEnabledElement),
|
|
10146
|
+
/* harmony export */ ye: () => (/* binding */ setEnabledElement)
|
|
9354
10147
|
/* harmony export */ });
|
|
9355
10148
|
const state = {
|
|
9356
10149
|
// The `defaultContext` of an extension's commandsModule
|
|
@@ -9386,14 +10179,13 @@ const reset = () => {
|
|
|
9386
10179
|
|
|
9387
10180
|
/***/ }),
|
|
9388
10181
|
|
|
9389
|
-
/***/
|
|
10182
|
+
/***/ 1663:
|
|
9390
10183
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
9391
10184
|
|
|
9392
|
-
"use strict";
|
|
9393
10185
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9394
|
-
/* harmony export */
|
|
10186
|
+
/* harmony export */ A: () => (/* binding */ getSOPInstanceAttributes)
|
|
9395
10187
|
/* harmony export */ });
|
|
9396
|
-
/* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
10188
|
+
/* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39526);
|
|
9397
10189
|
|
|
9398
10190
|
|
|
9399
10191
|
/**
|
|
@@ -9410,7 +10202,6 @@ function getSOPInstanceAttributes(imageId) {
|
|
|
9410
10202
|
|
|
9411
10203
|
// Todo: implement for volume viewports and use the referencedSeriesInstanceUID
|
|
9412
10204
|
}
|
|
9413
|
-
|
|
9414
10205
|
function _getUIDFromImageID(imageId) {
|
|
9415
10206
|
const instance = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.metaData.get('instance', imageId);
|
|
9416
10207
|
return {
|
|
@@ -9421,13 +10212,6 @@ function _getUIDFromImageID(imageId) {
|
|
|
9421
10212
|
};
|
|
9422
10213
|
}
|
|
9423
10214
|
|
|
9424
|
-
/***/ }),
|
|
9425
|
-
|
|
9426
|
-
/***/ 78753:
|
|
9427
|
-
/***/ (() => {
|
|
9428
|
-
|
|
9429
|
-
/* (ignored) */
|
|
9430
|
-
|
|
9431
10215
|
/***/ })
|
|
9432
10216
|
|
|
9433
10217
|
}]);
|