@ohif/app 3.14.0-beta.72 → 3.14.0-beta.73
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/{2894.bundle.770d3d9e.js → 1153.bundle.efd8a415.js} +3129 -166
- package/dist/{1566.bundle.e9f5d851.js → 1566.bundle.d58db206.js} +47 -9
- package/dist/{1645.bundle.1a86b10e.js → 1645.bundle.a8ee81ea.js} +73 -20
- package/dist/{1793.bundle.7b6d510f.js → 1793.bundle.27458a55.js} +2 -2
- package/dist/{1862.bundle.10bed54a.js → 1862.bundle.79bfe469.js} +1 -1
- package/dist/{2717.bundle.4167aa16.js → 2717.bundle.e4bad54f.js} +2 -2
- package/dist/{2748.bundle.a90b290d.js → 2748.bundle.eaa94e2e.js} +0 -805
- package/dist/{513.bundle.9c0548cf.js → 2894.bundle.d612efb2.js} +1 -1
- package/dist/{3004.bundle.cbd2e499.js → 3004.bundle.c6734d77.js} +2 -2
- package/dist/3723.bundle.eab70100.js +808 -0
- package/dist/{3771.bundle.1c9e74f3.js → 3771.bundle.6cb07c14.js} +2 -2
- package/dist/{4500.bundle.79728db8.js → 4449.bundle.3e4b07e6.js} +1043 -69
- package/dist/{4606.bundle.05282205.js → 4606.bundle.a2a1aa34.js} +1 -1
- package/dist/{5076.bundle.157252dd.js → 5076.bundle.95c07142.js} +50 -8
- package/dist/{5143.bundle.1ddc3eb4.js → 5143.bundle.2ea0b15d.js} +1145 -134
- package/dist/{5320.bundle.43308cb4.js → 5320.bundle.335efd86.js} +247 -210
- package/dist/{5914.bundle.00f408d2.js → 5914.bundle.f6e9fc4a.js} +37 -9
- package/dist/{5989.bundle.6da1ff18.js → 5989.bundle.2999d206.js} +320 -231
- package/dist/{213.bundle.6bbe580b.js → 6133.bundle.d4f7403f.js} +3062 -117
- package/dist/{3386.bundle.bdaa8014.js → 6289.bundle.2795699d.js} +95 -26
- package/dist/{6847.bundle.7fd47a86.js → 6847.bundle.5a087332.js} +27 -4
- package/dist/{7604.bundle.2d399cf0.js → 7604.bundle.e703a54d.js} +1 -1
- package/dist/{7464.bundle.36e9c349.js → 8037.bundle.8b5f4114.js} +2753 -495
- package/dist/{8699.bundle.c00d7ae1.js → 8699.bundle.024fb1bc.js} +2 -2
- package/dist/{9187.bundle.134a42b2.js → 9187.bundle.7d18bb1c.js} +2 -2
- package/dist/{9481.bundle.65162f9d.js → 9481.bundle.f443c81b.js} +2 -2
- package/dist/{9620.bundle.e098e167.js → 9620.bundle.24273cf3.js} +2 -2
- package/dist/{9886.bundle.5c1ff898.js → 9886.bundle.cabb4a24.js} +2 -2
- package/dist/{9892.bundle.fe68e426.js → 9892.bundle.9bc28476.js} +2 -2
- package/dist/{9948.bundle.29548cec.js → 9948.bundle.b4ff610d.js} +2 -2
- package/dist/app-config.js +2 -0
- package/dist/{app.bundle.58791784.js → app.bundle.220fbf72.js} +38 -38
- package/dist/{compute.bundle.09be4c13.js → compute.bundle.19cf1283.js} +10 -10
- package/dist/customizations/gpu/high-texture-4096.jsonc +9 -0
- package/dist/customizations/gpu/high.jsonc +8 -0
- package/dist/customizations/gpu/low-tablet.jsonc +7 -0
- package/dist/customizations/gpu/low.jsonc +7 -0
- package/dist/customizations/gpu/medium.jsonc +7 -0
- package/dist/customizations/index.html +39 -0
- package/dist/{histogram-worker.bundle.a8bb873a.js → histogram-worker.bundle.58e60d7c.js} +4 -4
- package/dist/index.html +1 -1
- package/dist/{interpolation.bundle.1eeebcfe.js → interpolation.bundle.7b3850e6.js} +7 -7
- package/dist/{polySeg.bundle.5bc24361.js → polySeg.bundle.157e1e17.js} +11 -11
- package/dist/sw.js +1 -1
- package/package.json +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis["rspackChunk_ohif_app"] ||= []).push([[
|
|
1
|
+
(globalThis["rspackChunk_ohif_app"] ||= []).push([[1153], {
|
|
2
2
|
85631(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
3
3
|
"use strict";
|
|
4
4
|
/* provided dependency */ var Buffer = __webpack_require__(1048).hp;
|
|
@@ -28258,13 +28258,17 @@ module.exports = sr;
|
|
|
28258
28258
|
/* import */ var _enums_ViewportType_js__rspack_import_6 = __webpack_require__(32168);
|
|
28259
28259
|
/* import */ var _helpers_viewportTypeUsesCustomRenderingPipeline_js__rspack_import_7 = __webpack_require__(6167);
|
|
28260
28260
|
/* import */ var _helpers_getOrCreateCanvas_js__rspack_import_8 = __webpack_require__(567);
|
|
28261
|
-
/* import */ var
|
|
28262
|
-
/* import */ var
|
|
28263
|
-
/* import */ var
|
|
28264
|
-
/* import */ var
|
|
28265
|
-
/* import */ var
|
|
28266
|
-
/* import */ var
|
|
28267
|
-
/* import */ var
|
|
28261
|
+
/* import */ var _helpers_actorsWaitingForStorage_js__rspack_import_9 = __webpack_require__(72667);
|
|
28262
|
+
/* import */ var _helpers_elementTouchAction_js__rspack_import_10 = __webpack_require__(39745);
|
|
28263
|
+
/* import */ var _init_js__rspack_import_11 = __webpack_require__(90934);
|
|
28264
|
+
/* import */ var _helpers_viewportTypeToViewportClass_js__rspack_import_12 = __webpack_require__(35586);
|
|
28265
|
+
/* import */ var _enums_ViewportStatus_js__rspack_import_13 = __webpack_require__(12182);
|
|
28266
|
+
/* import */ var _enums_index_js__rspack_import_14 = __webpack_require__(71088);
|
|
28267
|
+
/* import */ var _helpers_stats_index_js__rspack_import_15 = __webpack_require__(62274);
|
|
28268
|
+
/* import */ var _helpers_fidelityIndicator_index_js__rspack_import_16 = __webpack_require__(93348);
|
|
28269
|
+
/* import */ var _utilities_convertColorArrayToRgbString_js__rspack_import_17 = __webpack_require__(83860);
|
|
28270
|
+
|
|
28271
|
+
|
|
28268
28272
|
|
|
28269
28273
|
|
|
28270
28274
|
|
|
@@ -28298,16 +28302,16 @@ class BaseRenderingEngine {
|
|
|
28298
28302
|
this.renderViewports(viewportIdsWithSameFrameOfReferenceUID);
|
|
28299
28303
|
};
|
|
28300
28304
|
this.id = id ? id : (0,_utilities_uuidv4_js__rspack_import_3/* ["default"] */.A)();
|
|
28301
|
-
this.useCPURendering = (0,
|
|
28305
|
+
this.useCPURendering = (0,_init_js__rspack_import_11/* .getShouldUseCPURendering */.LH)();
|
|
28302
28306
|
_renderingEngineCache_js__rspack_import_1/* ["default"].set */.A.set(this);
|
|
28303
|
-
if (!(0,
|
|
28307
|
+
if (!(0,_init_js__rspack_import_11/* .isCornerstoneInitialized */.Dh)()) {
|
|
28304
28308
|
throw new Error('@cornerstonejs/core is not initialized, run init() first');
|
|
28305
28309
|
}
|
|
28306
28310
|
this._viewports = new Map();
|
|
28307
28311
|
this.hasBeenDestroyed = false;
|
|
28308
|
-
const config = (0,
|
|
28312
|
+
const config = (0,_init_js__rspack_import_11/* .getConfiguration */.D0)();
|
|
28309
28313
|
if (config?.debug?.statsOverlay) {
|
|
28310
|
-
|
|
28314
|
+
_helpers_stats_index_js__rspack_import_15/* .StatsOverlay.setup */.y.setup();
|
|
28311
28315
|
}
|
|
28312
28316
|
}
|
|
28313
28317
|
enableElement(viewportInputEntry) {
|
|
@@ -28332,6 +28336,10 @@ class BaseRenderingEngine {
|
|
|
28332
28336
|
const canvas = (0,_helpers_getOrCreateCanvas_js__rspack_import_8/* ["default"] */.Ay)(element);
|
|
28333
28337
|
const { background } = viewportInput.defaultOptions;
|
|
28334
28338
|
this.fillCanvasWithBackgroundColor(canvas, background);
|
|
28339
|
+
const enabledViewport = this.getViewport(viewportId);
|
|
28340
|
+
if (enabledViewport) {
|
|
28341
|
+
(0,_helpers_fidelityIndicator_index_js__rspack_import_16/* .maybeAttachFidelityIndicator */.lO)(enabledViewport);
|
|
28342
|
+
}
|
|
28335
28343
|
}
|
|
28336
28344
|
disableElement(viewportId) {
|
|
28337
28345
|
this._throwIfDestroyed();
|
|
@@ -28377,6 +28385,9 @@ class BaseRenderingEngine {
|
|
|
28377
28385
|
const { background } = vp.defaultOptions;
|
|
28378
28386
|
this.fillCanvasWithBackgroundColor(canvas, background);
|
|
28379
28387
|
});
|
|
28388
|
+
this._getViewportsAsArray().forEach((viewport) => {
|
|
28389
|
+
(0,_helpers_fidelityIndicator_index_js__rspack_import_16/* .maybeAttachFidelityIndicator */.lO)(viewport);
|
|
28390
|
+
});
|
|
28380
28391
|
}
|
|
28381
28392
|
resize(immediate = true, keepCamera = true) {
|
|
28382
28393
|
this._throwIfDestroyed();
|
|
@@ -28420,7 +28431,7 @@ class BaseRenderingEngine {
|
|
|
28420
28431
|
if (this.hasBeenDestroyed) {
|
|
28421
28432
|
return;
|
|
28422
28433
|
}
|
|
28423
|
-
|
|
28434
|
+
_helpers_stats_index_js__rspack_import_15/* .StatsOverlay.cleanup */.y.cleanup();
|
|
28424
28435
|
const viewports = this._getViewportsAsArray();
|
|
28425
28436
|
this._reset();
|
|
28426
28437
|
if (this.offscreenMultiRenderWindow) {
|
|
@@ -28440,7 +28451,7 @@ class BaseRenderingEngine {
|
|
|
28440
28451
|
fillCanvasWithBackgroundColor(canvas, backgroundColor) {
|
|
28441
28452
|
const ctx = canvas.getContext('2d');
|
|
28442
28453
|
const fillStyle = backgroundColor
|
|
28443
|
-
? (0,
|
|
28454
|
+
? (0,_utilities_convertColorArrayToRgbString_js__rspack_import_17/* .convertColorArrayToRgbString */.J)(backgroundColor)
|
|
28444
28455
|
: 'black';
|
|
28445
28456
|
ctx.fillStyle = fillStyle;
|
|
28446
28457
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
@@ -28449,7 +28460,7 @@ class BaseRenderingEngine {
|
|
|
28449
28460
|
const requestedType = viewportInputEntry.type;
|
|
28450
28461
|
let { type } = viewportInputEntry;
|
|
28451
28462
|
const { defaultOptions } = viewportInputEntry;
|
|
28452
|
-
if ((0,
|
|
28463
|
+
if ((0,_init_js__rspack_import_11/* .getUseGenericViewport */.xu)()) {
|
|
28453
28464
|
const remapped = BaseRenderingEngine.NEXT_TYPE_REMAP[type];
|
|
28454
28465
|
if (remapped) {
|
|
28455
28466
|
type = remapped;
|
|
@@ -28465,13 +28476,13 @@ class BaseRenderingEngine {
|
|
|
28465
28476
|
if (requestedType === _enums_ViewportType_js__rspack_import_6/* ["default"].ORTHOGRAPHIC */.A.ORTHOGRAPHIC) {
|
|
28466
28477
|
options = {
|
|
28467
28478
|
...options,
|
|
28468
|
-
orientation:
|
|
28479
|
+
orientation: _enums_index_js__rspack_import_14.OrientationAxis.AXIAL,
|
|
28469
28480
|
};
|
|
28470
28481
|
}
|
|
28471
28482
|
}
|
|
28472
28483
|
return {
|
|
28473
28484
|
...viewportInputEntry,
|
|
28474
|
-
requestedType: requestedType !== type || (0,
|
|
28485
|
+
requestedType: requestedType !== type || (0,_init_js__rspack_import_11/* .getUseGenericViewport */.xu)()
|
|
28475
28486
|
? requestedType
|
|
28476
28487
|
: undefined,
|
|
28477
28488
|
type,
|
|
@@ -28504,7 +28515,7 @@ class BaseRenderingEngine {
|
|
|
28504
28515
|
addCustomViewport(viewportInputEntry) {
|
|
28505
28516
|
const { element, viewportId, type, defaultOptions } = viewportInputEntry;
|
|
28506
28517
|
element.tabIndex = -1;
|
|
28507
|
-
(0,
|
|
28518
|
+
(0,_helpers_elementTouchAction_js__rspack_import_10/* .setElementTouchActionNone */.u)(element);
|
|
28508
28519
|
const canvas = (0,_helpers_getOrCreateCanvas_js__rspack_import_8/* ["default"] */.Ay)(element);
|
|
28509
28520
|
const { clientWidth, clientHeight } = canvas;
|
|
28510
28521
|
if (canvas.width !== clientWidth || canvas.height !== clientHeight) {
|
|
@@ -28523,7 +28534,7 @@ class BaseRenderingEngine {
|
|
|
28523
28534
|
sHeight: clientHeight,
|
|
28524
28535
|
defaultOptions: defaultOptions || {},
|
|
28525
28536
|
};
|
|
28526
|
-
const ViewportClass = (0,
|
|
28537
|
+
const ViewportClass = (0,_helpers_viewportTypeToViewportClass_js__rspack_import_12/* .getViewportClassForInput */.aZ)(viewportInputEntry);
|
|
28527
28538
|
const viewport = new ViewportClass(viewportInput);
|
|
28528
28539
|
viewport.requestedType = type;
|
|
28529
28540
|
this._viewports.set(viewportId, viewport);
|
|
@@ -28551,12 +28562,27 @@ class BaseRenderingEngine {
|
|
|
28551
28562
|
_getViewportsAsArray() {
|
|
28552
28563
|
return Array.from(this._viewports.values());
|
|
28553
28564
|
}
|
|
28565
|
+
_notifyFidelityOfRenderedViewports(viewports) {
|
|
28566
|
+
viewports.forEach((viewport) => {
|
|
28567
|
+
if (this.hasBeenDestroyed ||
|
|
28568
|
+
this._viewports.get(viewport.id) !== viewport) {
|
|
28569
|
+
return;
|
|
28570
|
+
}
|
|
28571
|
+
viewport.notifyFidelityStateChanged();
|
|
28572
|
+
});
|
|
28573
|
+
}
|
|
28574
|
+
_waitsForStorage(viewport, renderStart) {
|
|
28575
|
+
const actors = viewport.getActors?.();
|
|
28576
|
+
return (Array.isArray(actors) &&
|
|
28577
|
+
actors.length > 0 &&
|
|
28578
|
+
actors.every((entry) => entry?.actor && (0,_helpers_actorsWaitingForStorage_js__rspack_import_9/* .skippedDrawSince */.t)(entry.actor, renderStart)));
|
|
28579
|
+
}
|
|
28554
28580
|
_setViewportsToBeRenderedNextFrame(viewportIds) {
|
|
28555
28581
|
viewportIds.forEach((viewportId) => {
|
|
28556
28582
|
this._needsRender.add(viewportId);
|
|
28557
28583
|
const viewport = this._viewports.get(viewportId);
|
|
28558
28584
|
if (viewport) {
|
|
28559
|
-
viewport.viewportStatus =
|
|
28585
|
+
viewport.viewportStatus = _enums_ViewportStatus_js__rspack_import_13/* ["default"].NEEDS_RENDER */.A.NEEDS_RENDER;
|
|
28560
28586
|
}
|
|
28561
28587
|
});
|
|
28562
28588
|
this._render();
|
|
@@ -28575,12 +28601,13 @@ class BaseRenderingEngine {
|
|
|
28575
28601
|
viewportId,
|
|
28576
28602
|
renderingEngineId,
|
|
28577
28603
|
};
|
|
28604
|
+
(0,_helpers_fidelityIndicator_index_js__rspack_import_16/* .detachFidelityIndicator */.TB)(viewport);
|
|
28578
28605
|
viewport.removeWidgets();
|
|
28579
28606
|
(0,_utilities_triggerEvent_js__rspack_import_4/* ["default"] */.A)(_eventTarget_js__rspack_import_2/* ["default"] */.A, _enums_Events_js__rspack_import_0/* ["default"].ELEMENT_DISABLED */.A.ELEMENT_DISABLED, eventDetail);
|
|
28580
28607
|
viewport.destroy?.();
|
|
28581
28608
|
element.removeAttribute('data-viewport-uid');
|
|
28582
28609
|
element.removeAttribute('data-rendering-engine-uid');
|
|
28583
|
-
(0,
|
|
28610
|
+
(0,_helpers_elementTouchAction_js__rspack_import_10/* .restoreElementTouchAction */.M)(element);
|
|
28584
28611
|
const context = canvas.getContext('2d');
|
|
28585
28612
|
context.clearRect(0, 0, canvas.width, canvas.height);
|
|
28586
28613
|
}
|
|
@@ -28656,6 +28683,8 @@ BaseRenderingEngine.NEXT_TYPE_REMAP = {
|
|
|
28656
28683
|
/* import */ var _helpers_isInvalidNumber_js__rspack_import_35 = __webpack_require__(76172);
|
|
28657
28684
|
/* import */ var _utilities_getVolumeViewReferenceId_js__rspack_import_36 = __webpack_require__(95045);
|
|
28658
28685
|
/* import */ var _renderPasses_index_js__rspack_import_37 = __webpack_require__(82484);
|
|
28686
|
+
/* import */ var _helpers_fidelityIndicator_collectFidelityLines_js__rspack_import_38 = __webpack_require__(91339);
|
|
28687
|
+
|
|
28659
28688
|
|
|
28660
28689
|
|
|
28661
28690
|
|
|
@@ -28697,6 +28726,61 @@ BaseRenderingEngine.NEXT_TYPE_REMAP = {
|
|
|
28697
28726
|
|
|
28698
28727
|
const log = _utilities_logger_js__rspack_import_3.coreLog.getLogger('RenderingEngine', 'BaseVolumeViewport');
|
|
28699
28728
|
class BaseVolumeViewport extends _Viewport_js__rspack_import_21/* ["default"] */.A {
|
|
28729
|
+
canReportFidelity() {
|
|
28730
|
+
return true;
|
|
28731
|
+
}
|
|
28732
|
+
collectFidelityLines() {
|
|
28733
|
+
this.ensureFidelityRecordInvalidation();
|
|
28734
|
+
return (0,_helpers_fidelityIndicator_collectFidelityLines_js__rspack_import_38/* .fidelityLinesFromVolumeActors */.yb)(this, this._fidelityRecords);
|
|
28735
|
+
}
|
|
28736
|
+
ensureFidelityRecordInvalidation() {
|
|
28737
|
+
if (this._fidelityRecordListenersAttached ||
|
|
28738
|
+
this._fidelityRecordsDisposed ||
|
|
28739
|
+
this.isDisabled) {
|
|
28740
|
+
return;
|
|
28741
|
+
}
|
|
28742
|
+
this._fidelityRecordListenersAttached = true;
|
|
28743
|
+
const cancelFrame = () => {
|
|
28744
|
+
cancelAnimationFrame(this._fidelityNotifyFrame);
|
|
28745
|
+
this._fidelityNotifyFrame = 0;
|
|
28746
|
+
};
|
|
28747
|
+
const invalidate = (evt) => {
|
|
28748
|
+
const { volumeId } = evt.detail;
|
|
28749
|
+
if (volumeId) {
|
|
28750
|
+
this._fidelityRecords.delete(volumeId);
|
|
28751
|
+
}
|
|
28752
|
+
else {
|
|
28753
|
+
this._fidelityRecords.clear();
|
|
28754
|
+
}
|
|
28755
|
+
if (evt.type !== _enums_index_js__rspack_import_5.Events.IMAGE_VOLUME_MODIFIED) {
|
|
28756
|
+
cancelFrame();
|
|
28757
|
+
this.notifyFidelityStateChanged();
|
|
28758
|
+
}
|
|
28759
|
+
else if (!this._fidelityNotifyFrame) {
|
|
28760
|
+
this._fidelityNotifyFrame = requestAnimationFrame(() => {
|
|
28761
|
+
this._fidelityNotifyFrame = 0;
|
|
28762
|
+
if (!this._fidelityRecordsDisposed && !this.isDisabled) {
|
|
28763
|
+
this.notifyFidelityStateChanged();
|
|
28764
|
+
}
|
|
28765
|
+
});
|
|
28766
|
+
}
|
|
28767
|
+
};
|
|
28768
|
+
const cleanUp = (evt) => {
|
|
28769
|
+
if (evt.detail?.element !==
|
|
28770
|
+
this.element) {
|
|
28771
|
+
return;
|
|
28772
|
+
}
|
|
28773
|
+
_eventTarget_js__rspack_import_7/* ["default"].removeEventListener */.A.removeEventListener(_enums_index_js__rspack_import_5.Events.IMAGE_VOLUME_MODIFIED, invalidate);
|
|
28774
|
+
_eventTarget_js__rspack_import_7/* ["default"].removeEventListener */.A.removeEventListener(_enums_index_js__rspack_import_5.Events.IMAGE_VOLUME_LOADING_COMPLETED, invalidate);
|
|
28775
|
+
_eventTarget_js__rspack_import_7/* ["default"].removeEventListener */.A.removeEventListener(_enums_index_js__rspack_import_5.Events.ELEMENT_DISABLED, cleanUp);
|
|
28776
|
+
cancelFrame();
|
|
28777
|
+
this._fidelityRecords.clear();
|
|
28778
|
+
this._fidelityRecordsDisposed = true;
|
|
28779
|
+
};
|
|
28780
|
+
_eventTarget_js__rspack_import_7/* ["default"].addEventListener */.A.addEventListener(_enums_index_js__rspack_import_5.Events.IMAGE_VOLUME_MODIFIED, invalidate);
|
|
28781
|
+
_eventTarget_js__rspack_import_7/* ["default"].addEventListener */.A.addEventListener(_enums_index_js__rspack_import_5.Events.IMAGE_VOLUME_LOADING_COMPLETED, invalidate);
|
|
28782
|
+
_eventTarget_js__rspack_import_7/* ["default"].addEventListener */.A.addEventListener(_enums_index_js__rspack_import_5.Events.ELEMENT_DISABLED, cleanUp);
|
|
28783
|
+
}
|
|
28700
28784
|
constructor(props) {
|
|
28701
28785
|
super(props);
|
|
28702
28786
|
this.useCPURendering = false;
|
|
@@ -28705,6 +28789,10 @@ class BaseVolumeViewport extends _Viewport_js__rspack_import_21/* ["default"] */
|
|
|
28705
28789
|
this.perVolumeIdDefaultProperties = new Map();
|
|
28706
28790
|
this.viewportProperties = {};
|
|
28707
28791
|
this.volumeIds = new Set();
|
|
28792
|
+
this._fidelityRecords = new Map();
|
|
28793
|
+
this._fidelityRecordListenersAttached = false;
|
|
28794
|
+
this._fidelityRecordsDisposed = false;
|
|
28795
|
+
this._fidelityNotifyFrame = 0;
|
|
28708
28796
|
this.setRotation = (rotation) => {
|
|
28709
28797
|
const panFit = this.getPan(this.fitToCanvasCamera);
|
|
28710
28798
|
const pan = this.getPan();
|
|
@@ -29027,6 +29115,7 @@ class BaseVolumeViewport extends _Viewport_js__rspack_import_21/* ["default"] */
|
|
|
29027
29115
|
throw new Error(`Unrecognized viewport type: ${this.type}`);
|
|
29028
29116
|
}
|
|
29029
29117
|
this.initializeVolumeNewImageEventDispatcher();
|
|
29118
|
+
this.initializeVolumeModifiedRenderDispatcher();
|
|
29030
29119
|
}
|
|
29031
29120
|
static get useCustomRenderingPipeline() {
|
|
29032
29121
|
return false;
|
|
@@ -29083,6 +29172,44 @@ class BaseVolumeViewport extends _Viewport_js__rspack_import_21/* ["default"] */
|
|
|
29083
29172
|
this.element.addEventListener(_enums_index_js__rspack_import_5.Events.CAMERA_MODIFIED, volumeNewImageHandlerBound);
|
|
29084
29173
|
_eventTarget_js__rspack_import_7/* ["default"].addEventListener */.A.addEventListener(_enums_index_js__rspack_import_5.Events.ELEMENT_DISABLED, volumeNewImageCleanUpBound);
|
|
29085
29174
|
}
|
|
29175
|
+
initializeVolumeModifiedRenderDispatcher() {
|
|
29176
|
+
const handleVolumeModified = (evt) => {
|
|
29177
|
+
const detail = evt.detail;
|
|
29178
|
+
const volumeId = detail?.volumeId;
|
|
29179
|
+
if (!volumeId || !this.volumeIds.has(volumeId) || this.isDisabled) {
|
|
29180
|
+
return;
|
|
29181
|
+
}
|
|
29182
|
+
if (_cache_cache_js__rspack_import_2/* ["default"] */.Ay.getVolume(volumeId)?.loadStatus?.loading) {
|
|
29183
|
+
return;
|
|
29184
|
+
}
|
|
29185
|
+
this.renderVolumeModified(volumeId);
|
|
29186
|
+
};
|
|
29187
|
+
_eventTarget_js__rspack_import_7/* ["default"].addEventListener */.A.addEventListener(_enums_index_js__rspack_import_5.Events.IMAGE_VOLUME_MODIFIED, handleVolumeModified);
|
|
29188
|
+
const cleanUp = (evt) => {
|
|
29189
|
+
if (evt.detail?.element !==
|
|
29190
|
+
this.element) {
|
|
29191
|
+
return;
|
|
29192
|
+
}
|
|
29193
|
+
_eventTarget_js__rspack_import_7/* ["default"].removeEventListener */.A.removeEventListener(_enums_index_js__rspack_import_5.Events.IMAGE_VOLUME_MODIFIED, handleVolumeModified);
|
|
29194
|
+
_eventTarget_js__rspack_import_7/* ["default"].removeEventListener */.A.removeEventListener(_enums_index_js__rspack_import_5.Events.ELEMENT_DISABLED, cleanUp);
|
|
29195
|
+
};
|
|
29196
|
+
_eventTarget_js__rspack_import_7/* ["default"].addEventListener */.A.addEventListener(_enums_index_js__rspack_import_5.Events.ELEMENT_DISABLED, cleanUp);
|
|
29197
|
+
}
|
|
29198
|
+
renderVolumeModified(volumeId) {
|
|
29199
|
+
if (this.isDisabled) {
|
|
29200
|
+
return;
|
|
29201
|
+
}
|
|
29202
|
+
const actors = this.getActors();
|
|
29203
|
+
for (const entry of actors) {
|
|
29204
|
+
const referencedId = entry.referencedId ?? entry.uid;
|
|
29205
|
+
if (referencedId !== volumeId && entry.uid !== volumeId) {
|
|
29206
|
+
continue;
|
|
29207
|
+
}
|
|
29208
|
+
const mapper = entry.actor?.getMapper?.();
|
|
29209
|
+
mapper?.modified?.();
|
|
29210
|
+
}
|
|
29211
|
+
this.render();
|
|
29212
|
+
}
|
|
29086
29213
|
setVOILUTFunction(voiLUTFunction, volumeId, suppressEvents) {
|
|
29087
29214
|
if (!Object.values(_enums_index_js__rspack_import_5.VOILUTFunctionType).includes(voiLUTFunction)) {
|
|
29088
29215
|
voiLUTFunction = _enums_index_js__rspack_import_5.VOILUTFunctionType.LINEAR;
|
|
@@ -29574,7 +29701,7 @@ class BaseVolumeViewport extends _Viewport_js__rspack_import_21/* ["default"] */
|
|
|
29574
29701
|
});
|
|
29575
29702
|
}
|
|
29576
29703
|
}
|
|
29577
|
-
setSampleDistanceMultiplier(
|
|
29704
|
+
setSampleDistanceMultiplier(_multiplier) { }
|
|
29578
29705
|
async setVolumes(volumeInputArray, immediate = false, suppressEvents = false) {
|
|
29579
29706
|
this.clearDisplaySets();
|
|
29580
29707
|
const volumeId = volumeInputArray[0].volumeId;
|
|
@@ -29904,7 +30031,7 @@ class BaseVolumeViewport extends _Viewport_js__rspack_import_21/* ["default"] */
|
|
|
29904
30031
|
return found?.referencedId || found?.uid;
|
|
29905
30032
|
}
|
|
29906
30033
|
getViewReferenceId(specifier = {}) {
|
|
29907
|
-
let { volumeId, sliceIndex
|
|
30034
|
+
let { volumeId, sliceIndex } = specifier;
|
|
29908
30035
|
if (!volumeId) {
|
|
29909
30036
|
const actorEntries = this.getActors();
|
|
29910
30037
|
if (!actorEntries) {
|
|
@@ -31698,6 +31825,14 @@ const ecgProjection = (/* unused pure expression or super */ null && ({
|
|
|
31698
31825
|
/* import */ var _utilities_triggerEvent_js__rspack_import_2 = __webpack_require__(84444);
|
|
31699
31826
|
/* import */ var _renderingEngineCache_js__rspack_import_3 = __webpack_require__(91878);
|
|
31700
31827
|
/* import */ var _genericViewportReferenceCompatibility_js__rspack_import_4 = __webpack_require__(16488);
|
|
31828
|
+
/* import */ var _helpers_fidelityIndicator_buildViewportFidelityState_js__rspack_import_5 = __webpack_require__(22617);
|
|
31829
|
+
/* import */ var _helpers_fidelityIndicator_displaySpacingOfViewport_js__rspack_import_6 = __webpack_require__(42704);
|
|
31830
|
+
/* import */ var _helpers_fidelityIndicator_notifyFidelityStateChanged_js__rspack_import_7 = __webpack_require__(3508);
|
|
31831
|
+
/* import */ var _helpers_fidelityIndicator_collectFidelityLines_js__rspack_import_8 = __webpack_require__(91339);
|
|
31832
|
+
|
|
31833
|
+
|
|
31834
|
+
|
|
31835
|
+
|
|
31701
31836
|
|
|
31702
31837
|
|
|
31703
31838
|
|
|
@@ -31773,6 +31908,65 @@ class GenericViewport {
|
|
|
31773
31908
|
getCurrentMode() {
|
|
31774
31909
|
return this.getSourceBinding() ? 'unknown' : 'empty';
|
|
31775
31910
|
}
|
|
31911
|
+
canReportFidelity() {
|
|
31912
|
+
return false;
|
|
31913
|
+
}
|
|
31914
|
+
getFidelityState() {
|
|
31915
|
+
const display = this.getFidelityDisplay();
|
|
31916
|
+
return (0,_helpers_fidelityIndicator_buildViewportFidelityState_js__rspack_import_5/* .buildViewportFidelityState */.m)(this.collectFidelityLines(display), (0,_helpers_fidelityIndicator_displaySpacingOfViewport_js__rspack_import_6/* .displaySpacingOfDisplay */.Tu)(display));
|
|
31917
|
+
}
|
|
31918
|
+
getFidelityLines() {
|
|
31919
|
+
return this.collectFidelityLines(this.getFidelityDisplay());
|
|
31920
|
+
}
|
|
31921
|
+
notifyFidelityStateChanged() {
|
|
31922
|
+
if (!this.canReportFidelity()) {
|
|
31923
|
+
return;
|
|
31924
|
+
}
|
|
31925
|
+
const display = this.getFidelityDisplay();
|
|
31926
|
+
(0,_helpers_fidelityIndicator_notifyFidelityStateChanged_js__rspack_import_7/* .notifyFidelityStateChanged */.t)(this, this.collectFidelityLines(display), (0,_helpers_fidelityIndicator_displaySpacingOfViewport_js__rspack_import_6/* .displaySpacingOfDisplay */.Tu)(display));
|
|
31927
|
+
}
|
|
31928
|
+
isFidelityView3D() {
|
|
31929
|
+
return false;
|
|
31930
|
+
}
|
|
31931
|
+
getFidelityDisplay() {
|
|
31932
|
+
const view = this.getResolvedView();
|
|
31933
|
+
if (!view) {
|
|
31934
|
+
return undefined;
|
|
31935
|
+
}
|
|
31936
|
+
const pixelSpacing = (0,_helpers_fidelityIndicator_displaySpacingOfViewport_js__rspack_import_6/* .pixelSpacingOfCanvasToWorld */.KC)((canvasPos) => view.canvasToWorld(canvasPos));
|
|
31937
|
+
const camera = view.toICamera();
|
|
31938
|
+
if (!pixelSpacing || camera?.parallelProjection === false) {
|
|
31939
|
+
return undefined;
|
|
31940
|
+
}
|
|
31941
|
+
return {
|
|
31942
|
+
pixelSpacing,
|
|
31943
|
+
viewPlaneNormal: camera?.viewPlaneNormal,
|
|
31944
|
+
volume3D: this.isFidelityView3D(),
|
|
31945
|
+
averageSlabThickness: (0,_helpers_fidelityIndicator_displaySpacingOfViewport_js__rspack_import_6/* .averageSlabThicknessOf */.dH)(this),
|
|
31946
|
+
};
|
|
31947
|
+
}
|
|
31948
|
+
collectFidelityLines(display) {
|
|
31949
|
+
const sources = [];
|
|
31950
|
+
this.forEachBinding((binding) => {
|
|
31951
|
+
for (const rendering of binding.getRenderings?.() ?? [
|
|
31952
|
+
binding.rendering,
|
|
31953
|
+
]) {
|
|
31954
|
+
rendering.refreshFidelity?.();
|
|
31955
|
+
sources.push({
|
|
31956
|
+
record: rendering.voxelQuality,
|
|
31957
|
+
fullGrid: rendering.fullGrid,
|
|
31958
|
+
sampleDistanceLod: rendering.sampleDistanceLod,
|
|
31959
|
+
sampleDistanceIdle: rendering.sampleDistanceIdle,
|
|
31960
|
+
interactiveReduction: rendering.interactiveReduction,
|
|
31961
|
+
imageQualityStatus: rendering.imageQualityStatus,
|
|
31962
|
+
qualityPending: rendering.qualityPending,
|
|
31963
|
+
reductionCause: rendering.reductionCause,
|
|
31964
|
+
skip: rendering.excludeFromFidelity,
|
|
31965
|
+
});
|
|
31966
|
+
}
|
|
31967
|
+
});
|
|
31968
|
+
return (0,_helpers_fidelityIndicator_collectFidelityLines_js__rspack_import_8/* .fidelityLinesFromBindings */.e0)(display, sources);
|
|
31969
|
+
}
|
|
31776
31970
|
getViewReference(_specifier = {}) {
|
|
31777
31971
|
return {
|
|
31778
31972
|
FrameOfReferenceUID: this.getFrameOfReferenceUID(),
|
|
@@ -32209,7 +32403,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
32209
32403
|
|
|
32210
32404
|
|
|
32211
32405
|
},
|
|
32212
|
-
|
|
32406
|
+
49546(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
32213
32407
|
"use strict";
|
|
32214
32408
|
|
|
32215
32409
|
// EXPORTS
|
|
@@ -32354,9 +32548,29 @@ function resolvePlanarCpuViewportScale(args) {
|
|
|
32354
32548
|
worldToCanvasScale, EPSILON);
|
|
32355
32549
|
}
|
|
32356
32550
|
|
|
32551
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/eventTarget.js
|
|
32552
|
+
var eventTarget = __webpack_require__(45340);
|
|
32553
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/fidelityIndicator/collectFidelityLines.js
|
|
32554
|
+
var collectFidelityLines = __webpack_require__(91339);
|
|
32357
32555
|
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/GenericViewport/Planar/planarImageEvents.js
|
|
32358
32556
|
|
|
32359
32557
|
|
|
32558
|
+
|
|
32559
|
+
|
|
32560
|
+
function subscribeToBetterImageStages(rendering, shownImageId, onBetterStage) {
|
|
32561
|
+
const listener = (evt) => {
|
|
32562
|
+
const { image } = evt.detail;
|
|
32563
|
+
const { currentImageIdIndex, lastRequestedImageIdIndex } = rendering;
|
|
32564
|
+
if (image?.imageId === shownImageId() &&
|
|
32565
|
+
(lastRequestedImageIdIndex ?? currentImageIdIndex) ===
|
|
32566
|
+
currentImageIdIndex &&
|
|
32567
|
+
(0,collectFidelityLines/* .imageQualityStatusOf */.Gs)(image) > rendering.imageQualityStatus) {
|
|
32568
|
+
onBetterStage(image);
|
|
32569
|
+
}
|
|
32570
|
+
};
|
|
32571
|
+
eventTarget/* ["default"].addEventListener */.A.addEventListener(enums.Events.IMAGE_LOADED, listener);
|
|
32572
|
+
return () => eventTarget/* ["default"].removeEventListener */.A.removeEventListener(enums.Events.IMAGE_LOADED, listener);
|
|
32573
|
+
}
|
|
32360
32574
|
function triggerPlanarNewImage(ctx, args = {}) {
|
|
32361
32575
|
(0,triggerEvent/* ["default"] */.A)(ctx.viewport.element, enums.Events.STACK_NEW_IMAGE, {
|
|
32362
32576
|
image: args.image,
|
|
@@ -32395,6 +32609,8 @@ function triggerPlanarVolumeNewImage(ctx, params) {
|
|
|
32395
32609
|
|
|
32396
32610
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/GenericViewport/Planar/planarRenderPathProjection.js
|
|
32397
32611
|
var planarRenderPathProjection = __webpack_require__(519);
|
|
32612
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/GenericViewport/renderingFidelity.js
|
|
32613
|
+
var renderingFidelity = __webpack_require__(67746);
|
|
32398
32614
|
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/GenericViewport/Planar/CpuImageSliceRenderPath.js
|
|
32399
32615
|
|
|
32400
32616
|
|
|
@@ -32415,6 +32631,8 @@ var planarRenderPathProjection = __webpack_require__(519);
|
|
|
32415
32631
|
|
|
32416
32632
|
|
|
32417
32633
|
|
|
32634
|
+
|
|
32635
|
+
|
|
32418
32636
|
|
|
32419
32637
|
|
|
32420
32638
|
|
|
@@ -32444,6 +32662,8 @@ class CpuImageSliceRenderPath {
|
|
|
32444
32662
|
rendering = {
|
|
32445
32663
|
renderMode: types/* .ActorRenderMode.CPU_IMAGE */.T.CPU_IMAGE,
|
|
32446
32664
|
actorEntryUID: (0,uuidv4/* ["default"] */.A)(),
|
|
32665
|
+
excludeFromFidelity: (0,renderingFidelity/* .isSegmentationOverlayData */.VK)(payload, options),
|
|
32666
|
+
imageQualityStatus: (0,collectFidelityLines/* .imageQualityStatusOf */.Gs)(payload.image),
|
|
32447
32667
|
enabledElement,
|
|
32448
32668
|
compatibilityActor,
|
|
32449
32669
|
currentImageIdIndex: payload.initialImageIdIndex ?? 0,
|
|
@@ -32452,7 +32672,19 @@ class CpuImageSliceRenderPath {
|
|
|
32452
32672
|
fitScale: getCPUFallbackScalarScale(enabledElement.viewport.scale),
|
|
32453
32673
|
loadRequestId: 0,
|
|
32454
32674
|
renderingInvalidated: true,
|
|
32675
|
+
refreshFidelity: () => {
|
|
32676
|
+
rendering.qualityPending =
|
|
32677
|
+
rendering.enabledElement.image?.imageQualityPending;
|
|
32678
|
+
},
|
|
32455
32679
|
};
|
|
32680
|
+
const unsubscribeStages = subscribeToBetterImageStages(rendering, () => rendering.enabledElement.image?.imageId, (image) => void updateRenderedImage({
|
|
32681
|
+
ctx,
|
|
32682
|
+
dataId: data.id,
|
|
32683
|
+
image,
|
|
32684
|
+
imageIdIndex: rendering.currentImageIdIndex,
|
|
32685
|
+
props: rendering.dataPresentation,
|
|
32686
|
+
rendering,
|
|
32687
|
+
}));
|
|
32456
32688
|
triggerPlanarNewImage(ctx, {
|
|
32457
32689
|
image: payload.image,
|
|
32458
32690
|
imageIdIndex: payload.initialImageIdIndex ?? 0,
|
|
@@ -32487,6 +32719,7 @@ class CpuImageSliceRenderPath {
|
|
|
32487
32719
|
this.resize(ctx, rendering, data.id);
|
|
32488
32720
|
},
|
|
32489
32721
|
removeData: () => {
|
|
32722
|
+
unsubscribeStages();
|
|
32490
32723
|
this.removeData(ctx, rendering);
|
|
32491
32724
|
},
|
|
32492
32725
|
};
|
|
@@ -32834,6 +33067,7 @@ async function updateRenderedImage(args) {
|
|
|
32834
33067
|
const previousViewport = enabledElement.viewport;
|
|
32835
33068
|
defaultViewport.displayedArea = resolvePlanarCpuImageDisplayedArea(image);
|
|
32836
33069
|
enabledElement.image = image;
|
|
33070
|
+
rendering.imageQualityStatus = (0,collectFidelityLines/* .imageQualityStatusOf */.Gs)(image);
|
|
32837
33071
|
enabledElement.viewport = {
|
|
32838
33072
|
...defaultViewport,
|
|
32839
33073
|
hflip: previousViewport?.hflip ?? defaultViewport.hflip,
|
|
@@ -32866,8 +33100,6 @@ async function updateRenderedImage(args) {
|
|
|
32866
33100
|
ctx.display.renderNow();
|
|
32867
33101
|
}
|
|
32868
33102
|
|
|
32869
|
-
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/eventTarget.js
|
|
32870
|
-
var eventTarget = __webpack_require__(45340);
|
|
32871
33103
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/getOrCreateCanvas.js
|
|
32872
33104
|
var getOrCreateCanvas = __webpack_require__(567);
|
|
32873
33105
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/setToPixelCoordinateSystem.js
|
|
@@ -34083,12 +34315,13 @@ function resolveViewportScale(args) {
|
|
|
34083
34315
|
|
|
34084
34316
|
|
|
34085
34317
|
|
|
34318
|
+
|
|
34086
34319
|
const DEFERRED_VIEWPORT_RESAMPLE_DELAY_MS = 80;
|
|
34087
34320
|
class CpuVolumeSliceRenderPath {
|
|
34088
34321
|
constructor() {
|
|
34089
34322
|
this.sampler = new PlanarCPUVolumeSampler();
|
|
34090
34323
|
}
|
|
34091
|
-
async addData(ctx, data,
|
|
34324
|
+
async addData(ctx, data, options) {
|
|
34092
34325
|
const payload = data;
|
|
34093
34326
|
if (!payload.imageVolume) {
|
|
34094
34327
|
throw new Error('[PlanarViewport] CPU volume rendering requires a prepared image volume');
|
|
@@ -34105,6 +34338,9 @@ class CpuVolumeSliceRenderPath {
|
|
|
34105
34338
|
rendering = {
|
|
34106
34339
|
renderMode: types/* .ActorRenderMode.CPU_VOLUME */.T.CPU_VOLUME,
|
|
34107
34340
|
actorEntryUID: (0,uuidv4/* ["default"] */.A)(),
|
|
34341
|
+
excludeFromFidelity: (0,renderingFidelity/* .isSegmentationOverlayData */.VK)(payload, options),
|
|
34342
|
+
fullGrid: payload.imageVolume.voxelGrid,
|
|
34343
|
+
sampleDistanceLod: 1,
|
|
34108
34344
|
compatibilityActor,
|
|
34109
34345
|
imageVolume: payload.imageVolume,
|
|
34110
34346
|
imageIds: payload.imageIds,
|
|
@@ -34332,7 +34568,7 @@ class CpuVolumeSliceRenderPath {
|
|
|
34332
34568
|
height: ctx.cpu.canvas.height,
|
|
34333
34569
|
camera: activeSourceICamera,
|
|
34334
34570
|
dataPresentation: runtime.dataPresentation,
|
|
34335
|
-
deferViewportResample: useViewportSamplingForLinear,
|
|
34571
|
+
deferViewportResample: useViewportSamplingForLinear && (0,init/* .getLossyDownsampling */.GR)().interactive,
|
|
34336
34572
|
});
|
|
34337
34573
|
const shouldResample = resampleDecision === 'resample';
|
|
34338
34574
|
if (resampleDecision === 'defer') {
|
|
@@ -34341,6 +34577,11 @@ class CpuVolumeSliceRenderPath {
|
|
|
34341
34577
|
else {
|
|
34342
34578
|
cancelDeferredViewportResample(runtime);
|
|
34343
34579
|
}
|
|
34580
|
+
runtime.voxelQuality = runtime.imageVolume.getVoxelQuality?.();
|
|
34581
|
+
runtime.qualityPending = (0,renderingFidelity/* .isVolumeLoading */.fT)(runtime.imageVolume);
|
|
34582
|
+
runtime.fullGrid = runtime.imageVolume.voxelGrid;
|
|
34583
|
+
runtime.interactiveReduction =
|
|
34584
|
+
resampleDecision === 'defer' && !!runtime.sampledSliceState;
|
|
34344
34585
|
let sampledSliceState = runtime.sampledSliceState;
|
|
34345
34586
|
if (shouldResample) {
|
|
34346
34587
|
this.releaseSampledSliceState(runtime);
|
|
@@ -34611,6 +34852,8 @@ var planarRenderCamera = __webpack_require__(83798);
|
|
|
34611
34852
|
|
|
34612
34853
|
|
|
34613
34854
|
|
|
34855
|
+
|
|
34856
|
+
|
|
34614
34857
|
class VtkImageMapperRenderPath {
|
|
34615
34858
|
async addData(ctx, data, options) {
|
|
34616
34859
|
const payload = data;
|
|
@@ -34632,6 +34875,8 @@ class VtkImageMapperRenderPath {
|
|
|
34632
34875
|
actorEntryUID: (0,uuidv4/* ["default"] */.A)(),
|
|
34633
34876
|
actor,
|
|
34634
34877
|
currentImage: payload.image,
|
|
34878
|
+
imageQualityStatus: (0,collectFidelityLines/* .imageQualityStatusOf */.Gs)(payload.image),
|
|
34879
|
+
excludeFromFidelity: (0,renderingFidelity/* .isSegmentationOverlayData */.VK)(payload, options),
|
|
34635
34880
|
mapper,
|
|
34636
34881
|
imageData,
|
|
34637
34882
|
useWorldCoordinateImageData: payload.useWorldCoordinateImageData,
|
|
@@ -34639,7 +34884,18 @@ class VtkImageMapperRenderPath {
|
|
|
34639
34884
|
defaultVOIRange: (0,planarImageRendering/* .getDefaultImageVOIRange */.c4)(payload.image),
|
|
34640
34885
|
dataPresentation: undefined,
|
|
34641
34886
|
loadRequestId: 0,
|
|
34887
|
+
refreshFidelity: () => {
|
|
34888
|
+
rendering.qualityPending = rendering.currentImage.imageQualityPending;
|
|
34889
|
+
},
|
|
34642
34890
|
};
|
|
34891
|
+
const unsubscribeStages = subscribeToBetterImageStages(rendering, () => rendering.currentImage.imageId, (image) => void VtkImageMapperRenderPath_updateRenderedImage({
|
|
34892
|
+
ctx,
|
|
34893
|
+
dataId: data.id,
|
|
34894
|
+
image,
|
|
34895
|
+
rendering,
|
|
34896
|
+
imageIdIndex: rendering.currentImageIdIndex,
|
|
34897
|
+
dataPresentation: rendering.dataPresentation,
|
|
34898
|
+
}));
|
|
34643
34899
|
if (options.role !== 'overlay') {
|
|
34644
34900
|
triggerPlanarNewImage(ctx, {
|
|
34645
34901
|
image: payload.image,
|
|
@@ -34673,6 +34929,7 @@ class VtkImageMapperRenderPath {
|
|
|
34673
34929
|
this.resize(ctx, rendering, data.id);
|
|
34674
34930
|
},
|
|
34675
34931
|
removeData: () => {
|
|
34932
|
+
unsubscribeStages();
|
|
34676
34933
|
this.removeData(ctx, rendering);
|
|
34677
34934
|
},
|
|
34678
34935
|
};
|
|
@@ -34830,6 +35087,7 @@ async function VtkImageMapperRenderPath_updateRenderedImage(args) {
|
|
|
34830
35087
|
mapper.setInputData(imageData);
|
|
34831
35088
|
}
|
|
34832
35089
|
rendering.currentImage = image;
|
|
35090
|
+
rendering.imageQualityStatus = (0,collectFidelityLines/* .imageQualityStatusOf */.Gs)(image);
|
|
34833
35091
|
rendering.imageData = imageData;
|
|
34834
35092
|
rendering.currentImageIdIndex = imageIdIndex;
|
|
34835
35093
|
rendering.defaultVOIRange = (0,planarImageRendering/* .getDefaultImageVOIRange */.c4)(image);
|
|
@@ -34891,6 +35149,8 @@ function applyPlanarImageActorTransforms(ctx, rendering, activeSourceICamera) {
|
|
|
34891
35149
|
|
|
34892
35150
|
// EXTERNAL MODULE: ../../node_modules/@kitware/vtk.js/Common/DataModel/Plane.js
|
|
34893
35151
|
var Plane = __webpack_require__(98281);
|
|
35152
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/resolveVolumeTexture.js
|
|
35153
|
+
var resolveVolumeTexture = __webpack_require__(17565);
|
|
34894
35154
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/vtkClasses/index.js + 1 modules
|
|
34895
35155
|
var vtkClasses = __webpack_require__(44418);
|
|
34896
35156
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/loaders/volumeLoader.js
|
|
@@ -34903,23 +35163,35 @@ var volumeLoader = __webpack_require__(66441);
|
|
|
34903
35163
|
|
|
34904
35164
|
|
|
34905
35165
|
|
|
35166
|
+
|
|
34906
35167
|
async function createVolumeSliceActor(props, element, viewportId, suppressEvents = false) {
|
|
34907
35168
|
const { volumeId, callback } = props;
|
|
34908
35169
|
const imageVolume = await (0,volumeLoader.loadVolume)(volumeId);
|
|
34909
35170
|
if (!imageVolume) {
|
|
34910
35171
|
throw new Error(`imageVolume with id: ${volumeId} does not exist`);
|
|
34911
35172
|
}
|
|
34912
|
-
const { imageData
|
|
35173
|
+
const { imageData } = imageVolume;
|
|
35174
|
+
const { texture: vtkOpenGLTexture } = (0,resolveVolumeTexture/* .resolveVolumeTexture */.M)(imageVolume, {
|
|
35175
|
+
provideStrategies: props.provideStrategies,
|
|
35176
|
+
selectStrategy: props.selectStrategy,
|
|
35177
|
+
viewportId,
|
|
35178
|
+
});
|
|
35179
|
+
const usesRenderPath = props.provideStrategies !== undefined || props.selectStrategy !== undefined;
|
|
35180
|
+
if (!vtkOpenGLTexture && !usesRenderPath) {
|
|
35181
|
+
throw new Error(`no render strategy gives a texture for the volume ${volumeId}`);
|
|
35182
|
+
}
|
|
34913
35183
|
const loadStatus = imageVolume.loadStatus;
|
|
34914
35184
|
const slicePlane = Plane/* ["default"].newInstance */.Ay.newInstance();
|
|
34915
35185
|
const mapper = vtkClasses/* .vtkSharedImageResliceMapper.newInstance */.c2.newInstance();
|
|
34916
|
-
if (!loadStatus || loadStatus.loaded) {
|
|
34917
|
-
vtkOpenGLTexture.
|
|
35186
|
+
if (vtkOpenGLTexture && (!loadStatus || loadStatus.loaded)) {
|
|
35187
|
+
vtkOpenGLTexture.markAllFramesUpdated?.();
|
|
34918
35188
|
}
|
|
34919
35189
|
mapper.setInputData(imageData);
|
|
34920
35190
|
mapper.setSlicePlane(slicePlane);
|
|
34921
35191
|
mapper.setSlabThickness(0);
|
|
34922
|
-
|
|
35192
|
+
if (vtkOpenGLTexture) {
|
|
35193
|
+
mapper.setScalarTexture?.(vtkOpenGLTexture);
|
|
35194
|
+
}
|
|
34923
35195
|
mapper.modified();
|
|
34924
35196
|
const actor = ImageSlice/* ["default"].newInstance */.Ay.newInstance();
|
|
34925
35197
|
actor.setMapper(mapper);
|
|
@@ -34966,6 +35238,10 @@ function triggerVOIModified(element, viewportId, actor, volumeId) {
|
|
|
34966
35238
|
}
|
|
34967
35239
|
/* export default */ var helpers_createVolumeSliceActor = (createVolumeSliceActor);
|
|
34968
35240
|
|
|
35241
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/volumeRenderStrategy.js
|
|
35242
|
+
var volumeRenderStrategy = __webpack_require__(53703);
|
|
35243
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/volumeStrategyLifecycle.js
|
|
35244
|
+
var volumeStrategyLifecycle = __webpack_require__(81395);
|
|
34969
35245
|
// EXTERNAL MODULE: ../../node_modules/@kitware/vtk.js/Common/DataModel/PiecewiseFunction.js
|
|
34970
35246
|
var PiecewiseFunction = __webpack_require__(25837);
|
|
34971
35247
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/GenericViewport/Planar/planarVolumeSliceBlendMode.js
|
|
@@ -35222,6 +35498,199 @@ function resolveVolumeOpacityRange(actor, voiRange) {
|
|
|
35222
35498
|
};
|
|
35223
35499
|
}
|
|
35224
35500
|
|
|
35501
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/isAcquisitionPlaneNormal.js
|
|
35502
|
+
var isAcquisitionPlaneNormal = __webpack_require__(72372);
|
|
35503
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/logger.js
|
|
35504
|
+
var logger = __webpack_require__(34040);
|
|
35505
|
+
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/GenericViewport/Planar/planarAcquiredFrames.js
|
|
35506
|
+
|
|
35507
|
+
|
|
35508
|
+
|
|
35509
|
+
|
|
35510
|
+
|
|
35511
|
+
|
|
35512
|
+
|
|
35513
|
+
|
|
35514
|
+
const log = logger.coreLog.getLogger('RenderingEngine', 'planarAcquiredFrames');
|
|
35515
|
+
const acquiredFrameActors = new WeakSet();
|
|
35516
|
+
function nearestSliceIndex(imageData, point) {
|
|
35517
|
+
const index = imageData.worldToIndex([...point]);
|
|
35518
|
+
index[2] = Math.round(index[2]);
|
|
35519
|
+
return index;
|
|
35520
|
+
}
|
|
35521
|
+
function framePlaneOffset(imageVolume, focalPoint, viewPlaneNormal) {
|
|
35522
|
+
const { imageData } = imageVolume;
|
|
35523
|
+
const framePoint = imageData.indexToWorld(nearestSliceIndex(imageData, focalPoint));
|
|
35524
|
+
const distance = (focalPoint[0] - framePoint[0]) * viewPlaneNormal[0] +
|
|
35525
|
+
(focalPoint[1] - framePoint[1]) * viewPlaneNormal[1] +
|
|
35526
|
+
(focalPoint[2] - framePoint[2]) * viewPlaneNormal[2];
|
|
35527
|
+
return [
|
|
35528
|
+
distance * viewPlaneNormal[0],
|
|
35529
|
+
distance * viewPlaneNormal[1],
|
|
35530
|
+
distance * viewPlaneNormal[2],
|
|
35531
|
+
];
|
|
35532
|
+
}
|
|
35533
|
+
function acquiredFrameIndexOfVolumePoint(imageVolume, imageIds, point) {
|
|
35534
|
+
const imageData = imageVolume.imageData;
|
|
35535
|
+
if (!imageData) {
|
|
35536
|
+
return;
|
|
35537
|
+
}
|
|
35538
|
+
const k = nearestSliceIndex(imageData, point)[2];
|
|
35539
|
+
if (!(k >= 0 && k < imageData.getDimensions()[2])) {
|
|
35540
|
+
return;
|
|
35541
|
+
}
|
|
35542
|
+
const imageId = imageVolume.imageIds?.[k];
|
|
35543
|
+
if (!imageId || imageIds[k] === imageId) {
|
|
35544
|
+
return k < imageIds.length ? k : undefined;
|
|
35545
|
+
}
|
|
35546
|
+
const imageIdIndex = imageIds.indexOf(imageId);
|
|
35547
|
+
return imageIdIndex >= 0 ? imageIdIndex : undefined;
|
|
35548
|
+
}
|
|
35549
|
+
function withAcquiredFrames(ctx, data, volume) {
|
|
35550
|
+
const volumeRendering = volume.rendering;
|
|
35551
|
+
const { imageVolume, imageIds } = volumeRendering;
|
|
35552
|
+
let frame;
|
|
35553
|
+
let mounting = false;
|
|
35554
|
+
let removed = false;
|
|
35555
|
+
let wantedIndex;
|
|
35556
|
+
const frameRendering = () => frame?.rendering;
|
|
35557
|
+
const isSource = () => ctx.viewport.isCurrentDataId(data.id);
|
|
35558
|
+
const frameCtx = {
|
|
35559
|
+
...ctx,
|
|
35560
|
+
viewport: { ...ctx.viewport, isCurrentDataId: () => false },
|
|
35561
|
+
display: {
|
|
35562
|
+
...ctx.display,
|
|
35563
|
+
activateRenderMode: () => undefined,
|
|
35564
|
+
requestRender: () => {
|
|
35565
|
+
updateVisibility();
|
|
35566
|
+
ctx.display.requestRender();
|
|
35567
|
+
},
|
|
35568
|
+
},
|
|
35569
|
+
};
|
|
35570
|
+
const framePresentation = () => ({
|
|
35571
|
+
...volumeRendering.dataPresentation,
|
|
35572
|
+
voiRange: volumeRendering.dataPresentation?.voiRange ??
|
|
35573
|
+
volumeRendering.defaultVOIRange,
|
|
35574
|
+
voiLUTFunction: enums.VOILUTFunctionType.LINEAR,
|
|
35575
|
+
});
|
|
35576
|
+
function updateVisibility() {
|
|
35577
|
+
const rendering = frameRendering();
|
|
35578
|
+
const showsFrame = wantedIndex !== undefined &&
|
|
35579
|
+
rendering?.currentImageIdIndex === wantedIndex;
|
|
35580
|
+
const visible = volumeRendering.dataPresentation?.visible !== false;
|
|
35581
|
+
volumeRendering.actor.setVisibility(visible && !showsFrame);
|
|
35582
|
+
if (!volumeRendering.isSegmentationOverlay) {
|
|
35583
|
+
volumeRendering.fidelityStale ||=
|
|
35584
|
+
!showsFrame && volumeRendering.showsAcquiredFrame;
|
|
35585
|
+
volumeRendering.excludeFromFidelity = showsFrame;
|
|
35586
|
+
}
|
|
35587
|
+
volumeRendering.showsAcquiredFrame = showsFrame;
|
|
35588
|
+
if (!rendering) {
|
|
35589
|
+
return;
|
|
35590
|
+
}
|
|
35591
|
+
const camera = (0,planarRenderPathProjection/* .getPlanarRenderPathActiveSourceICamera */.X3)(ctx);
|
|
35592
|
+
rendering.actor.setVisibility(visible && showsFrame);
|
|
35593
|
+
rendering.excludeFromFidelity = !showsFrame;
|
|
35594
|
+
(0,planarRenderCamera/* .applyPlanarICameraToActor */.lW)({
|
|
35595
|
+
actor: rendering.actor,
|
|
35596
|
+
activeSourceICamera: camera,
|
|
35597
|
+
});
|
|
35598
|
+
if (showsFrame && camera) {
|
|
35599
|
+
rendering.actor.setPosition(...framePlaneOffset(imageVolume, camera.focalPoint, camera.viewPlaneNormal));
|
|
35600
|
+
}
|
|
35601
|
+
}
|
|
35602
|
+
async function mountFrame(imageIdIndex) {
|
|
35603
|
+
mounting = true;
|
|
35604
|
+
try {
|
|
35605
|
+
const image = await (0,imageLoader.loadAndCacheImage)(imageIds[imageIdIndex]);
|
|
35606
|
+
const attachment = await new VtkImageMapperRenderPath().addData(frameCtx, {
|
|
35607
|
+
...data,
|
|
35608
|
+
image,
|
|
35609
|
+
imageData: undefined,
|
|
35610
|
+
initialImageIdIndex: imageIdIndex,
|
|
35611
|
+
}, { renderMode: types/* .ActorRenderMode.VTK_IMAGE */.T.VTK_IMAGE, role: 'overlay' });
|
|
35612
|
+
if (removed) {
|
|
35613
|
+
attachment.removeData();
|
|
35614
|
+
return;
|
|
35615
|
+
}
|
|
35616
|
+
frame = attachment;
|
|
35617
|
+
acquiredFrameActors.add(frameRendering().actor);
|
|
35618
|
+
frame.updateDataPresentation(framePresentation());
|
|
35619
|
+
}
|
|
35620
|
+
catch (error) {
|
|
35621
|
+
log.warn('The acquired frame did not load', error);
|
|
35622
|
+
return;
|
|
35623
|
+
}
|
|
35624
|
+
finally {
|
|
35625
|
+
mounting = false;
|
|
35626
|
+
}
|
|
35627
|
+
sync();
|
|
35628
|
+
ctx.display.requestRender();
|
|
35629
|
+
}
|
|
35630
|
+
function sync() {
|
|
35631
|
+
if (removed) {
|
|
35632
|
+
return;
|
|
35633
|
+
}
|
|
35634
|
+
const camera = (0,planarRenderPathProjection/* .getPlanarRenderPathActiveSourceICamera */.X3)(ctx);
|
|
35635
|
+
wantedIndex =
|
|
35636
|
+
camera &&
|
|
35637
|
+
isSource() &&
|
|
35638
|
+
ctx.viewport.canDrawAcquiredFrames?.(data.id) &&
|
|
35639
|
+
(0,isAcquisitionPlaneNormal/* .isAcquisitionPlaneNormal */.z)(imageVolume, camera.viewPlaneNormal)
|
|
35640
|
+
? acquiredFrameIndexOfVolumePoint(imageVolume, imageIds, camera.focalPoint)
|
|
35641
|
+
: undefined;
|
|
35642
|
+
if (wantedIndex !== undefined) {
|
|
35643
|
+
if (frame) {
|
|
35644
|
+
frame.applyViewState({
|
|
35645
|
+
...ctx.viewport.getViewState(),
|
|
35646
|
+
slice: { kind: 'stackIndex', imageIdIndex: wantedIndex },
|
|
35647
|
+
});
|
|
35648
|
+
}
|
|
35649
|
+
else if (!mounting) {
|
|
35650
|
+
void mountFrame(wantedIndex);
|
|
35651
|
+
}
|
|
35652
|
+
}
|
|
35653
|
+
updateVisibility();
|
|
35654
|
+
}
|
|
35655
|
+
const frameActorEntry = () => {
|
|
35656
|
+
const rendering = frameRendering();
|
|
35657
|
+
return (rendering && {
|
|
35658
|
+
uid: rendering.actorEntryUID,
|
|
35659
|
+
actor: rendering.actor,
|
|
35660
|
+
actorMapper: {
|
|
35661
|
+
actor: rendering.actor,
|
|
35662
|
+
mapper: rendering.mapper,
|
|
35663
|
+
renderMode: types/* .ActorRenderMode.VTK_IMAGE */.T.VTK_IMAGE,
|
|
35664
|
+
},
|
|
35665
|
+
});
|
|
35666
|
+
};
|
|
35667
|
+
return {
|
|
35668
|
+
...volume,
|
|
35669
|
+
updateDataPresentation: (props) => {
|
|
35670
|
+
volume.updateDataPresentation(props);
|
|
35671
|
+
frame?.updateDataPresentation(framePresentation());
|
|
35672
|
+
sync();
|
|
35673
|
+
},
|
|
35674
|
+
applyViewState: (viewState) => {
|
|
35675
|
+
volume.applyViewState(viewState);
|
|
35676
|
+
sync();
|
|
35677
|
+
},
|
|
35678
|
+
resize: () => {
|
|
35679
|
+
volume.resize?.();
|
|
35680
|
+
sync();
|
|
35681
|
+
},
|
|
35682
|
+
getActorEntries: (loadedData) => [volume.getActorEntry?.(loadedData), frameActorEntry()].filter(Boolean),
|
|
35683
|
+
getRenderings: () => frame ? [volume.rendering, frame.rendering] : [volume.rendering],
|
|
35684
|
+
removeData: () => {
|
|
35685
|
+
removed = true;
|
|
35686
|
+
frame?.removeData();
|
|
35687
|
+
volume.removeData();
|
|
35688
|
+
},
|
|
35689
|
+
};
|
|
35690
|
+
}
|
|
35691
|
+
|
|
35692
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/voxelGrid/index.js + 5 modules
|
|
35693
|
+
var voxelGrid = __webpack_require__(49617);
|
|
35225
35694
|
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/GenericViewport/Planar/VtkVolumeSliceRenderPath.js
|
|
35226
35695
|
|
|
35227
35696
|
|
|
@@ -35235,19 +35704,24 @@ function resolveVolumeOpacityRange(actor, voiRange) {
|
|
|
35235
35704
|
|
|
35236
35705
|
|
|
35237
35706
|
|
|
35707
|
+
|
|
35708
|
+
|
|
35709
|
+
|
|
35710
|
+
|
|
35238
35711
|
const SLICE_OVERLAY_DEPTH_EPSILON = 1e-4;
|
|
35239
35712
|
const PROJECTING_OVERLAY_RENDER_DELAY_MS = 240;
|
|
35240
35713
|
class VtkVolumeSliceRenderPath {
|
|
35714
|
+
constructor(provideStrategies = volumeRenderStrategy/* .defaultVolumeStrategyProvider */.uy, selectStrategy = volumeRenderStrategy/* .selectFirstReadyStrategy */.zz) {
|
|
35715
|
+
this.hooks = { provideStrategies, selectStrategy };
|
|
35716
|
+
}
|
|
35241
35717
|
async addData(ctx, data, options) {
|
|
35242
35718
|
const payload = data;
|
|
35243
35719
|
const imageVolume = payload.imageVolume;
|
|
35244
|
-
const isSegmentationOverlay =
|
|
35720
|
+
const isSegmentationOverlay = (0,renderingFidelity/* .isSegmentationOverlayData */.VK)(payload, options);
|
|
35245
35721
|
if (!imageVolume) {
|
|
35246
35722
|
throw new Error('[PlanarViewport] Volume rendering requires a prepared image volume');
|
|
35247
35723
|
}
|
|
35248
|
-
const { actor } = await helpers_createVolumeSliceActor({
|
|
35249
|
-
volumeId: payload.volumeId,
|
|
35250
|
-
}, ctx.viewport.element, ctx.viewportId, true);
|
|
35724
|
+
const { actor } = await helpers_createVolumeSliceActor({ volumeId: payload.volumeId, ...this.hooks }, ctx.viewport.element, ctx.viewportId, true);
|
|
35251
35725
|
const mapper = actor.getMapper();
|
|
35252
35726
|
ctx.display.activateRenderMode(types/* .ActorRenderMode.VTK_VOLUME_SLICE */.T.VTK_VOLUME_SLICE);
|
|
35253
35727
|
ctx.vtk.renderer.addActor(actor);
|
|
@@ -35269,12 +35743,20 @@ class VtkVolumeSliceRenderPath {
|
|
|
35269
35743
|
: undefined,
|
|
35270
35744
|
dataPresentation: undefined,
|
|
35271
35745
|
isSegmentationOverlay,
|
|
35746
|
+
viewportId: ctx.viewportId,
|
|
35747
|
+
excludeFromFidelity: isSegmentationOverlay,
|
|
35748
|
+
fullGrid: imageVolume.voxelGrid,
|
|
35749
|
+
sampleDistanceLod: 1,
|
|
35272
35750
|
};
|
|
35751
|
+
rendering.refreshFidelity = () => volumeStrategyLifecycle/* .refreshFidelity */.Mi(rendering);
|
|
35752
|
+
this.provisionStrategies(rendering, 'initial');
|
|
35753
|
+
this.applyStrategy(rendering);
|
|
35273
35754
|
let deferredProjectionRenderTimer = null;
|
|
35274
|
-
const removeVolumeSubscriptions =
|
|
35755
|
+
const removeVolumeSubscriptions = volumeStrategyLifecycle/* .subscribeToVolumeEvents */.Fo(payload.volumeId, (eventType) => {
|
|
35275
35756
|
if (eventType === enums.Events.IMAGE_VOLUME_MODIFIED) {
|
|
35276
|
-
mapper.modified();
|
|
35757
|
+
rendering.mapper.modified();
|
|
35277
35758
|
}
|
|
35759
|
+
volumeStrategyLifecycle/* .onVolumeData */.Em(rendering, eventType, this.hooks);
|
|
35278
35760
|
const isProjectingOverlay = rendering.isSegmentationOverlay &&
|
|
35279
35761
|
(rendering.dataPresentation?.slabThickness ?? 0) > 0;
|
|
35280
35762
|
if (!isProjectingOverlay) {
|
|
@@ -35306,7 +35788,7 @@ class VtkVolumeSliceRenderPath {
|
|
|
35306
35788
|
imageIdIndex: rendering.currentImageIdIndex,
|
|
35307
35789
|
maxImageIdIndex: rendering.maxImageIdIndex,
|
|
35308
35790
|
});
|
|
35309
|
-
|
|
35791
|
+
const attachment = {
|
|
35310
35792
|
rendering,
|
|
35311
35793
|
updateDataPresentation: (props) => {
|
|
35312
35794
|
this.updateDataPresentation(ctx, rendering, props);
|
|
@@ -35331,7 +35813,7 @@ class VtkVolumeSliceRenderPath {
|
|
|
35331
35813
|
return this.getImageData(rendering);
|
|
35332
35814
|
},
|
|
35333
35815
|
render: () => {
|
|
35334
|
-
this.render(ctx);
|
|
35816
|
+
this.render(ctx, rendering);
|
|
35335
35817
|
},
|
|
35336
35818
|
resize: () => {
|
|
35337
35819
|
this.resize(ctx, rendering, data.id);
|
|
@@ -35340,6 +35822,9 @@ class VtkVolumeSliceRenderPath {
|
|
|
35340
35822
|
this.removeData(ctx, rendering);
|
|
35341
35823
|
},
|
|
35342
35824
|
};
|
|
35825
|
+
return isSegmentationOverlay
|
|
35826
|
+
? attachment
|
|
35827
|
+
: withAcquiredFrames(ctx, data, attachment);
|
|
35343
35828
|
}
|
|
35344
35829
|
updateDataPresentation(ctx, rendering, props) {
|
|
35345
35830
|
rendering.dataPresentation = props;
|
|
@@ -35425,18 +35910,35 @@ class VtkVolumeSliceRenderPath {
|
|
|
35425
35910
|
getImageData(rendering) {
|
|
35426
35911
|
return VtkVolumeSliceRenderPath_buildPlanarVolumeImageData(rendering.imageVolume);
|
|
35427
35912
|
}
|
|
35428
|
-
render(ctx) {
|
|
35913
|
+
render(ctx, rendering) {
|
|
35914
|
+
if (rendering) {
|
|
35915
|
+
this.applyStrategy(rendering);
|
|
35916
|
+
this.setFillHint(ctx, rendering);
|
|
35917
|
+
}
|
|
35429
35918
|
ctx.display.requestRender();
|
|
35430
35919
|
}
|
|
35920
|
+
setFillHint(ctx, rendering) {
|
|
35921
|
+
const focalPoint = (0,planarRenderPathProjection/* .getPlanarRenderPathActiveSourceICamera */.X3)(ctx)?.focalPoint;
|
|
35922
|
+
const grid = rendering.boundGrid?.grid;
|
|
35923
|
+
if (focalPoint && grid) {
|
|
35924
|
+
rendering.boundTexture?.setFillHint?.((0,voxelGrid.gridWorldToIndex)(grid, focalPoint)[2]);
|
|
35925
|
+
}
|
|
35926
|
+
}
|
|
35431
35927
|
resize(ctx, rendering, dataId) {
|
|
35432
35928
|
const camera = ctx.viewport.getViewState();
|
|
35433
35929
|
this.syncRenderCamera(ctx, rendering, dataId, camera, false);
|
|
35434
35930
|
ctx.display.requestRender();
|
|
35435
35931
|
}
|
|
35436
35932
|
removeData(ctx, rendering) {
|
|
35437
|
-
|
|
35438
|
-
removeStreamingSubscriptions?.();
|
|
35439
|
-
ctx.vtk.renderer.removeActor(actor);
|
|
35933
|
+
volumeStrategyLifecycle/* .releaseStrategies */.T4(rendering);
|
|
35934
|
+
rendering.removeStreamingSubscriptions?.();
|
|
35935
|
+
ctx.vtk.renderer.removeActor(rendering.actor);
|
|
35936
|
+
}
|
|
35937
|
+
provisionStrategies(rendering, reason) {
|
|
35938
|
+
volumeStrategyLifecycle/* .provisionStrategies */.VQ(rendering, this.hooks.provideStrategies, reason);
|
|
35939
|
+
}
|
|
35940
|
+
applyStrategy(rendering) {
|
|
35941
|
+
volumeStrategyLifecycle/* .applyStrategy */.Aq(rendering, this.hooks);
|
|
35440
35942
|
}
|
|
35441
35943
|
}
|
|
35442
35944
|
class VtkVolumeSlicePath {
|
|
@@ -35464,21 +35966,6 @@ class VtkVolumeSlicePath {
|
|
|
35464
35966
|
};
|
|
35465
35967
|
}
|
|
35466
35968
|
}
|
|
35467
|
-
function VtkVolumeSliceRenderPath_subscribeToVolumeEvents(volumeId, onProgress) {
|
|
35468
|
-
const handleProgress = (evt) => {
|
|
35469
|
-
const detail = evt.detail;
|
|
35470
|
-
if (detail?.volumeId !== volumeId) {
|
|
35471
|
-
return;
|
|
35472
|
-
}
|
|
35473
|
-
onProgress(evt.type);
|
|
35474
|
-
};
|
|
35475
|
-
eventTarget/* ["default"].addEventListener */.A.addEventListener(enums.Events.IMAGE_VOLUME_MODIFIED, handleProgress);
|
|
35476
|
-
eventTarget/* ["default"].addEventListener */.A.addEventListener(enums.Events.IMAGE_VOLUME_LOADING_COMPLETED, handleProgress);
|
|
35477
|
-
return () => {
|
|
35478
|
-
eventTarget/* ["default"].removeEventListener */.A.removeEventListener(enums.Events.IMAGE_VOLUME_MODIFIED, handleProgress);
|
|
35479
|
-
eventTarget/* ["default"].removeEventListener */.A.removeEventListener(enums.Events.IMAGE_VOLUME_LOADING_COMPLETED, handleProgress);
|
|
35480
|
-
};
|
|
35481
|
-
}
|
|
35482
35969
|
function ensureSlicePlane(mapper) {
|
|
35483
35970
|
const existingSlicePlane = mapper.getSlicePlane?.();
|
|
35484
35971
|
if (existingSlicePlane) {
|
|
@@ -35500,7 +35987,8 @@ function updateVolumeSlicePlane(mapper, activeSourceICamera) {
|
|
|
35500
35987
|
function getImageSliceOverlayOrder(renderer, actor) {
|
|
35501
35988
|
const imageSliceActors = renderer
|
|
35502
35989
|
.getActors()
|
|
35503
|
-
.filter((currentActor) => currentActor?.getClassName?.() === 'vtkImageSlice'
|
|
35990
|
+
.filter((currentActor) => currentActor?.getClassName?.() === 'vtkImageSlice' &&
|
|
35991
|
+
!acquiredFrameActors.has(currentActor));
|
|
35504
35992
|
return Math.max(0, imageSliceActors.indexOf(actor));
|
|
35505
35993
|
}
|
|
35506
35994
|
function updateVolumeSliceActorDepthOffset(actor, activeSourceICamera, overlayOrder = 0) {
|
|
@@ -35578,7 +36066,7 @@ function createPlanarRenderPathResolver(paths = createDefaultPlanarRenderPaths()
|
|
|
35578
36066
|
/* import */ var _GenericViewport_js__rspack_import_15 = __webpack_require__(13991);
|
|
35579
36067
|
/* import */ var _genericViewportDisplaySetAccess_js__rspack_import_16 = __webpack_require__(95023);
|
|
35580
36068
|
/* import */ var _DefaultPlanarDataProvider_js__rspack_import_17 = __webpack_require__(24449);
|
|
35581
|
-
/* import */ var _PlanarRenderPathResolver_js__rspack_import_18 = __webpack_require__(
|
|
36069
|
+
/* import */ var _PlanarRenderPathResolver_js__rspack_import_18 = __webpack_require__(49546);
|
|
35582
36070
|
/* import */ var _PlanarRenderPathDecisionService_js__rspack_import_19 = __webpack_require__(5409);
|
|
35583
36071
|
/* import */ var _planarRenderPathSelector_js__rspack_import_20 = __webpack_require__(31611);
|
|
35584
36072
|
/* import */ var _planarLegacyCompatibility_js__rspack_import_21 = __webpack_require__(14852);
|
|
@@ -35588,8 +36076,12 @@ function createPlanarRenderPathResolver(paths = createDefaultPlanarRenderPaths()
|
|
|
35588
36076
|
/* import */ var _planarProjectionAdapter_js__rspack_import_25 = __webpack_require__(59377);
|
|
35589
36077
|
/* import */ var _PlanarResolvedView_js__rspack_import_26 = __webpack_require__(3000);
|
|
35590
36078
|
/* import */ var _planarSliceBasis_js__rspack_import_27 = __webpack_require__(51684);
|
|
35591
|
-
/* import */ var
|
|
35592
|
-
/* import */ var
|
|
36079
|
+
/* import */ var _helpers_fidelityIndicator_collectFidelityLines_js__rspack_import_28 = __webpack_require__(91339);
|
|
36080
|
+
/* import */ var _helpers_fidelityIndicator_fidelityIndicatorState_js__rspack_import_29 = __webpack_require__(56196);
|
|
36081
|
+
/* import */ var _PlanarMountedData_js__rspack_import_30 = __webpack_require__(14709);
|
|
36082
|
+
/* import */ var _PlanarViewReferenceController_js__rspack_import_31 = __webpack_require__(65996);
|
|
36083
|
+
|
|
36084
|
+
|
|
35593
36085
|
|
|
35594
36086
|
|
|
35595
36087
|
|
|
@@ -35629,6 +36121,7 @@ class PlanarViewport extends _GenericViewport_js__rspack_import_15/* ["default"]
|
|
|
35629
36121
|
super(args);
|
|
35630
36122
|
this.type = _enums_index_js__rspack_import_0.ViewportType.PLANAR_NEXT;
|
|
35631
36123
|
this.suppressEvents = false;
|
|
36124
|
+
this.drewOutsideEngine = false;
|
|
35632
36125
|
this.resolvedViewCacheRevision = 0;
|
|
35633
36126
|
this.setDataRequestId = 0;
|
|
35634
36127
|
this.renderPipelineSwapId = 0;
|
|
@@ -35643,13 +36136,13 @@ class PlanarViewport extends _GenericViewport_js__rspack_import_15/* ["default"]
|
|
|
35643
36136
|
this.dataProvider = args.dataProvider || new _DefaultPlanarDataProvider_js__rspack_import_17/* .DefaultPlanarDataProvider */.x();
|
|
35644
36137
|
this.renderPathResolver =
|
|
35645
36138
|
args.renderPathResolver || (0,_PlanarRenderPathResolver_js__rspack_import_18/* .createPlanarRenderPathResolver */.I)();
|
|
35646
|
-
this.mountedData = new
|
|
36139
|
+
this.mountedData = new _PlanarMountedData_js__rspack_import_30/* ["default"] */.A({
|
|
35647
36140
|
getBinding: (dataId) => this.getBinding(dataId),
|
|
35648
36141
|
getFirstBinding: () => this.getFirstBinding(),
|
|
35649
36142
|
getBindings: () => this.bindings.entries(),
|
|
35650
36143
|
removeData: (dataId) => this.removeData(dataId),
|
|
35651
36144
|
});
|
|
35652
|
-
this.viewReferences = new
|
|
36145
|
+
this.viewReferences = new _PlanarViewReferenceController_js__rspack_import_31/* ["default"] */.A({
|
|
35653
36146
|
viewportId: this.id,
|
|
35654
36147
|
viewportType: this.type,
|
|
35655
36148
|
getActiveDataId: () => this.mountedData.getActiveDataId(),
|
|
@@ -35711,6 +36204,7 @@ class PlanarViewport extends _GenericViewport_js__rspack_import_15/* ["default"]
|
|
|
35711
36204
|
getViewState: () => this.getViewState(),
|
|
35712
36205
|
isCurrentDataId: (dataId) => this.getCurrentBinding()?.data.id === dataId,
|
|
35713
36206
|
getOverlayActors: () => this.mountedData.getProjectedActorEntries('overlay'),
|
|
36207
|
+
canDrawAcquiredFrames: (dataId) => this.canDrawAcquiredFrames(dataId),
|
|
35714
36208
|
},
|
|
35715
36209
|
renderPath: {
|
|
35716
36210
|
renderMode: _types_index_js__rspack_import_1/* .ActorRenderMode.VTK_IMAGE */.T.VTK_IMAGE,
|
|
@@ -35727,6 +36221,7 @@ class PlanarViewport extends _GenericViewport_js__rspack_import_15/* ["default"]
|
|
|
35727
36221
|
this.setNeedsRender();
|
|
35728
36222
|
},
|
|
35729
36223
|
markRendered: () => {
|
|
36224
|
+
this.drewOutsideEngine = true;
|
|
35730
36225
|
this.setRendered();
|
|
35731
36226
|
},
|
|
35732
36227
|
activateRenderMode: (renderMode) => {
|
|
@@ -35825,11 +36320,14 @@ class PlanarViewport extends _GenericViewport_js__rspack_import_15/* ["default"]
|
|
|
35825
36320
|
return this.mountedData.getActors();
|
|
35826
36321
|
}
|
|
35827
36322
|
getDefaultActor() {
|
|
36323
|
+
return this.getDefaultActorEntry();
|
|
36324
|
+
}
|
|
36325
|
+
getDefaultActorEntry() {
|
|
35828
36326
|
return this.mountedData.getDefaultActor();
|
|
35829
36327
|
}
|
|
35830
36328
|
getImageActor(volumeId) {
|
|
35831
36329
|
const actorEntries = this.getActors();
|
|
35832
|
-
let actorEntry =
|
|
36330
|
+
let actorEntry = this.getDefaultActorEntry();
|
|
35833
36331
|
if (volumeId) {
|
|
35834
36332
|
actorEntry =
|
|
35835
36333
|
actorEntries.find((a) => a.referencedId === volumeId) ??
|
|
@@ -35925,6 +36423,9 @@ class PlanarViewport extends _GenericViewport_js__rspack_import_15/* ["default"]
|
|
|
35925
36423
|
getSourceDataId() {
|
|
35926
36424
|
return this.mountedData.getActiveDataId();
|
|
35927
36425
|
}
|
|
36426
|
+
canReportFidelity() {
|
|
36427
|
+
return true;
|
|
36428
|
+
}
|
|
35928
36429
|
getCurrentMode() {
|
|
35929
36430
|
const binding = this.getSourceBinding();
|
|
35930
36431
|
if (!binding) {
|
|
@@ -36336,9 +36837,36 @@ class PlanarViewport extends _GenericViewport_js__rspack_import_15/* ["default"]
|
|
|
36336
36837
|
}
|
|
36337
36838
|
this.setNeedsRender();
|
|
36338
36839
|
this.renderContext.cpu.composition.renderPassId += 1;
|
|
36840
|
+
this.drewOutsideEngine = false;
|
|
36339
36841
|
if (!this.renderBindings()) {
|
|
36340
36842
|
this.requestRenderingEngineRender();
|
|
36341
36843
|
}
|
|
36844
|
+
if (this.drewOutsideEngine) {
|
|
36845
|
+
this.drewOutsideEngine = false;
|
|
36846
|
+
this.notifyFidelityStateChanged();
|
|
36847
|
+
}
|
|
36848
|
+
}
|
|
36849
|
+
collectFidelityLines(display) {
|
|
36850
|
+
const lines = super.collectFidelityLines(display);
|
|
36851
|
+
const renderings = [];
|
|
36852
|
+
this.forEachBinding((binding) => {
|
|
36853
|
+
renderings.push(...(binding.getRenderings?.() ?? [
|
|
36854
|
+
binding.rendering,
|
|
36855
|
+
]));
|
|
36856
|
+
});
|
|
36857
|
+
if (!renderings.some((rendering) => rendering.showsAcquiredFrame)) {
|
|
36858
|
+
return lines;
|
|
36859
|
+
}
|
|
36860
|
+
const labelmaps = renderings.filter(({ isSegmentationOverlay, voxelQuality, fullGrid }) => isSegmentationOverlay &&
|
|
36861
|
+
voxelQuality &&
|
|
36862
|
+
fullGrid &&
|
|
36863
|
+
(0,_helpers_fidelityIndicator_fidelityIndicatorState_js__rspack_import_29/* .isReduced */.H3)((0,_helpers_fidelityIndicator_fidelityIndicatorState_js__rspack_import_29/* .reductionFactorsOf */.JH)(voxelQuality.grid, fullGrid)));
|
|
36864
|
+
return lines.concat((0,_helpers_fidelityIndicator_collectFidelityLines_js__rspack_import_28/* .fidelityLinesFromBindings */.e0)(display, labelmaps.map((rendering) => ({
|
|
36865
|
+
record: rendering.voxelQuality,
|
|
36866
|
+
fullGrid: rendering.fullGrid,
|
|
36867
|
+
reductionCause: rendering.reductionCause,
|
|
36868
|
+
label: 'Labelmap',
|
|
36869
|
+
}))));
|
|
36342
36870
|
}
|
|
36343
36871
|
onDestroy() {
|
|
36344
36872
|
this.clearResolvedViewCache();
|
|
@@ -36452,6 +36980,31 @@ class PlanarViewport extends _GenericViewport_js__rspack_import_15/* ["default"]
|
|
|
36452
36980
|
viewportId: this.id,
|
|
36453
36981
|
});
|
|
36454
36982
|
}
|
|
36983
|
+
prefersAcquiredFrames() {
|
|
36984
|
+
return true;
|
|
36985
|
+
}
|
|
36986
|
+
canDrawAcquiredFrames(dataId) {
|
|
36987
|
+
const binding = this.bindings.get(dataId);
|
|
36988
|
+
const dataSet = this.getDataSet(dataId);
|
|
36989
|
+
if (!binding || !dataSet) {
|
|
36990
|
+
return false;
|
|
36991
|
+
}
|
|
36992
|
+
return _PlanarRenderPathDecisionService_js__rspack_import_19/* .defaultPlanarRenderPathDecisionService.canDrawAcquiredFrames */.gQ.canDrawAcquiredFrames(dataSet, this.getRenderPathDecisionOptions(dataId, {
|
|
36993
|
+
...(this.mountOptionsByDataId.get(dataId) ?? {}),
|
|
36994
|
+
role: binding.role,
|
|
36995
|
+
}, this.viewState.orientation));
|
|
36996
|
+
}
|
|
36997
|
+
getRenderPathDecisionOptions(dataId, options, orientation) {
|
|
36998
|
+
const presentation = this.getDataPresentationState(dataId);
|
|
36999
|
+
return {
|
|
37000
|
+
orientation,
|
|
37001
|
+
renderBackend: options.renderBackend ??
|
|
37002
|
+
this.getInheritedOverlayRenderBackend(options.role),
|
|
37003
|
+
preferAcquiredFrames: options.role === 'source' && this.prefersAcquiredFrames(),
|
|
37004
|
+
slabThickness: presentation?.slabThickness,
|
|
37005
|
+
blendMode: presentation?.blendMode,
|
|
37006
|
+
};
|
|
37007
|
+
}
|
|
36455
37008
|
reportRenderPathError(error, dataId) {
|
|
36456
37009
|
const message = error instanceof Error ? error.message : String(error);
|
|
36457
37010
|
const errorKey = dataId ?? '';
|
|
@@ -36616,11 +37169,7 @@ class PlanarViewport extends _GenericViewport_js__rspack_import_15/* ["default"]
|
|
|
36616
37169
|
throw new Error(`[PlanarViewport] No registered planar dataset metadata for ${dataId}`);
|
|
36617
37170
|
}
|
|
36618
37171
|
const resolvedOrientation = this.resolveRequestedOrientation(options.orientation);
|
|
36619
|
-
const selectedPath = (0,_planarRenderPathSelector_js__rspack_import_20/* .selectPlanarRenderPath */.M8)(dataSet,
|
|
36620
|
-
orientation: resolvedOrientation,
|
|
36621
|
-
renderBackend: options.renderBackend ??
|
|
36622
|
-
this.getInheritedOverlayRenderBackend(options.role),
|
|
36623
|
-
});
|
|
37172
|
+
const selectedPath = (0,_planarRenderPathSelector_js__rspack_import_20/* .selectPlanarRenderPath */.M8)(dataSet, this.getRenderPathDecisionOptions(dataId, options, resolvedOrientation));
|
|
36624
37173
|
const data = await this.dataProvider.load(dataId, {
|
|
36625
37174
|
acquisitionOrientation: selectedPath.acquisitionOrientation,
|
|
36626
37175
|
orientation: resolvedOrientation,
|
|
@@ -37051,7 +37600,7 @@ function isPlanarRegisteredDataSet(value) {
|
|
|
37051
37600
|
/* import */ var _planarProjectionAdapter_js__rspack_import_1 = __webpack_require__(59377);
|
|
37052
37601
|
/* import */ var _planarSliceBasis_js__rspack_import_2 = __webpack_require__(51684);
|
|
37053
37602
|
/* import */ var _DefaultPlanarDataProvider_js__rspack_import_3 = __webpack_require__(24449);
|
|
37054
|
-
/* import */ var _PlanarRenderPathResolver_js__rspack_import_4 = __webpack_require__(
|
|
37603
|
+
/* import */ var _PlanarRenderPathResolver_js__rspack_import_4 = __webpack_require__(49546);
|
|
37055
37604
|
/* import */ var _PlanarResolvedView_js__rspack_import_5 = __webpack_require__(3000);
|
|
37056
37605
|
/* import */ var _planarRenderPathProjection_js__rspack_import_6 = __webpack_require__(519);
|
|
37057
37606
|
/* import */ var _PlanarViewport_js__rspack_import_7 = __webpack_require__(56003);
|
|
@@ -39321,8 +39870,6 @@ function hasVisibleProps(ctx) {
|
|
|
39321
39870
|
|
|
39322
39871
|
// EXTERNAL MODULE: ../../node_modules/@kitware/vtk.js/Rendering/Profiles/Volume.js + 9 modules
|
|
39323
39872
|
var Volume = __webpack_require__(37905);
|
|
39324
|
-
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/eventTarget.js
|
|
39325
|
-
var eventTarget = __webpack_require__(45340);
|
|
39326
39873
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/createLinearRGBTransferFunction.js
|
|
39327
39874
|
var createLinearRGBTransferFunction = __webpack_require__(28385);
|
|
39328
39875
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/utilities/invertRgbTransferFunction.js
|
|
@@ -39331,6 +39878,12 @@ var invertRgbTransferFunction = __webpack_require__(42998);
|
|
|
39331
39878
|
var colormap = __webpack_require__(21155);
|
|
39332
39879
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/createVolumeActor.js
|
|
39333
39880
|
var createVolumeActor = __webpack_require__(25745);
|
|
39881
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/createVolumeMapper.js
|
|
39882
|
+
var createVolumeMapper = __webpack_require__(9891);
|
|
39883
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/volumeRenderStrategy.js
|
|
39884
|
+
var volumeRenderStrategy = __webpack_require__(53703);
|
|
39885
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/volumeStrategyLifecycle.js
|
|
39886
|
+
var volumeStrategyLifecycle = __webpack_require__(81395);
|
|
39334
39887
|
// EXTERNAL MODULE: ../../node_modules/@kitware/vtk.js/Common/Core/Math.js
|
|
39335
39888
|
var Core_Math = __webpack_require__(90655);
|
|
39336
39889
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/constants/index.js + 3 modules
|
|
@@ -39453,6 +40006,8 @@ function getBoundsRadius(bounds) {
|
|
|
39453
40006
|
return Math.sqrt(width + height + depth || 1) * 0.5;
|
|
39454
40007
|
}
|
|
39455
40008
|
|
|
40009
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/GenericViewport/renderingFidelity.js
|
|
40010
|
+
var renderingFidelity = __webpack_require__(67746);
|
|
39456
40011
|
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/GenericViewport/setVtkCameraClippingRange.js
|
|
39457
40012
|
var setVtkCameraClippingRange = __webpack_require__(50103);
|
|
39458
40013
|
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/GenericViewport/Volume3D/VtkVolume3DRenderPath.js
|
|
@@ -39468,13 +40023,21 @@ var setVtkCameraClippingRange = __webpack_require__(50103);
|
|
|
39468
40023
|
|
|
39469
40024
|
|
|
39470
40025
|
|
|
40026
|
+
|
|
40027
|
+
|
|
40028
|
+
|
|
39471
40029
|
class VtkVolume3DRenderPath {
|
|
40030
|
+
constructor(provideStrategies = volumeRenderStrategy/* .defaultVolumeStrategyProvider */.uy, selectStrategy = volumeRenderStrategy/* .selectFirstReadyStrategy */.zz) {
|
|
40031
|
+
this.hooks = {
|
|
40032
|
+
provideStrategies,
|
|
40033
|
+
selectStrategy,
|
|
40034
|
+
onBind: bindSampleDistance,
|
|
40035
|
+
};
|
|
40036
|
+
}
|
|
39472
40037
|
async addData(ctx, data, options) {
|
|
39473
40038
|
const payload = data;
|
|
39474
40039
|
const hadVolume = ctx.vtk.renderer.getVolumes().length > 0;
|
|
39475
|
-
const actor = await (0,createVolumeActor/* ["default"] */.A)({
|
|
39476
|
-
volumeId: payload.volumeId,
|
|
39477
|
-
}, ctx.viewport.element, ctx.viewportId, true);
|
|
40040
|
+
const actor = await (0,createVolumeActor/* ["default"] */.A)({ volumeId: payload.volumeId, ...this.hooks }, ctx.viewport.element, ctx.viewportId, true);
|
|
39478
40041
|
const mapper = actor.getMapper();
|
|
39479
40042
|
ctx.vtk.renderer.addVolume(actor);
|
|
39480
40043
|
if (!hadVolume) {
|
|
@@ -39497,10 +40060,16 @@ class VtkVolume3DRenderPath {
|
|
|
39497
40060
|
: undefined,
|
|
39498
40061
|
imageVolume: payload.imageVolume,
|
|
39499
40062
|
mapper,
|
|
39500
|
-
|
|
39501
|
-
|
|
39502
|
-
}),
|
|
40063
|
+
viewportId: ctx.viewportId,
|
|
40064
|
+
excludeFromFidelity: (0,renderingFidelity/* .isSegmentationOverlayData */.VK)(payload, options),
|
|
39503
40065
|
};
|
|
40066
|
+
rendering.refreshFidelity = () => volumeStrategyLifecycle/* .refreshFidelity */.Mi(rendering);
|
|
40067
|
+
this.provisionStrategies(rendering, 'initial');
|
|
40068
|
+
this.applyStrategy(rendering);
|
|
40069
|
+
rendering.removeStreamingSubscriptions = volumeStrategyLifecycle/* .subscribeToVolumeEvents */.Fo(payload.volumeId, (eventType) => {
|
|
40070
|
+
volumeStrategyLifecycle/* .onVolumeData */.Em(rendering, eventType, this.hooks);
|
|
40071
|
+
ctx.display.requestRender();
|
|
40072
|
+
});
|
|
39504
40073
|
return {
|
|
39505
40074
|
rendering,
|
|
39506
40075
|
updateDataPresentation: (props) => {
|
|
@@ -39516,7 +40085,7 @@ class VtkVolume3DRenderPath {
|
|
|
39516
40085
|
return this.getImageData(rendering);
|
|
39517
40086
|
},
|
|
39518
40087
|
render: () => {
|
|
39519
|
-
this.render(ctx);
|
|
40088
|
+
this.render(ctx, rendering);
|
|
39520
40089
|
},
|
|
39521
40090
|
resize: () => {
|
|
39522
40091
|
this.resize(ctx);
|
|
@@ -39552,17 +40121,36 @@ class VtkVolume3DRenderPath {
|
|
|
39552
40121
|
getImageData(rendering) {
|
|
39553
40122
|
return buildVolumeImageData(rendering.imageVolume);
|
|
39554
40123
|
}
|
|
39555
|
-
render(ctx) {
|
|
40124
|
+
render(ctx, rendering) {
|
|
40125
|
+
if (rendering) {
|
|
40126
|
+
this.applyStrategy(rendering);
|
|
40127
|
+
}
|
|
39556
40128
|
ctx.display.requestRender();
|
|
39557
40129
|
}
|
|
39558
40130
|
resize(ctx) {
|
|
39559
40131
|
ctx.display.requestRender();
|
|
39560
40132
|
}
|
|
39561
40133
|
removeData(ctx, rendering) {
|
|
39562
|
-
|
|
39563
|
-
removeStreamingSubscriptions?.();
|
|
39564
|
-
ctx.vtk.renderer.removeVolume(actor);
|
|
40134
|
+
volumeStrategyLifecycle/* .releaseStrategies */.T4(rendering);
|
|
40135
|
+
rendering.removeStreamingSubscriptions?.();
|
|
40136
|
+
ctx.vtk.renderer.removeVolume(rendering.actor);
|
|
40137
|
+
}
|
|
40138
|
+
provisionStrategies(rendering, reason) {
|
|
40139
|
+
volumeStrategyLifecycle/* .provisionStrategies */.VQ(rendering, this.hooks.provideStrategies, reason);
|
|
39565
40140
|
}
|
|
40141
|
+
applyStrategy(rendering) {
|
|
40142
|
+
volumeStrategyLifecycle/* .applyStrategy */.Aq(rendering, this.hooks);
|
|
40143
|
+
}
|
|
40144
|
+
}
|
|
40145
|
+
function bindSampleDistance(rendering, textureChanged) {
|
|
40146
|
+
const { mapper, boundTexture } = rendering;
|
|
40147
|
+
const imageData = textureChanged ? mapper.getInputData?.() : undefined;
|
|
40148
|
+
if (imageData) {
|
|
40149
|
+
mapper.setSampleDistance((0,createVolumeMapper/* .sampleDistanceOf */.h6)(imageData, boundTexture, (0,createVolumeMapper/* .idleSampleDistanceMultiplierOf */.Ax)(mapper)));
|
|
40150
|
+
}
|
|
40151
|
+
const ratios = (0,createVolumeMapper/* .sampleDistanceRatiosOf */.nr)(mapper, boundTexture);
|
|
40152
|
+
rendering.sampleDistanceLod = ratios.current;
|
|
40153
|
+
rendering.sampleDistanceIdle = ratios.idle;
|
|
39566
40154
|
}
|
|
39567
40155
|
class VtkVolume3DPath {
|
|
39568
40156
|
constructor() {
|
|
@@ -39579,21 +40167,6 @@ class VtkVolume3DPath {
|
|
|
39579
40167
|
return rootContext;
|
|
39580
40168
|
}
|
|
39581
40169
|
}
|
|
39582
|
-
function subscribeToVolumeEvents(volumeId, onProgress) {
|
|
39583
|
-
const handleProgress = (evt) => {
|
|
39584
|
-
const detail = evt.detail;
|
|
39585
|
-
if (detail?.volumeId !== volumeId) {
|
|
39586
|
-
return;
|
|
39587
|
-
}
|
|
39588
|
-
onProgress();
|
|
39589
|
-
};
|
|
39590
|
-
eventTarget/* ["default"].addEventListener */.A.addEventListener(enums.Events.IMAGE_VOLUME_MODIFIED, handleProgress);
|
|
39591
|
-
eventTarget/* ["default"].addEventListener */.A.addEventListener(enums.Events.IMAGE_VOLUME_LOADING_COMPLETED, handleProgress);
|
|
39592
|
-
return () => {
|
|
39593
|
-
eventTarget/* ["default"].removeEventListener */.A.removeEventListener(enums.Events.IMAGE_VOLUME_MODIFIED, handleProgress);
|
|
39594
|
-
eventTarget/* ["default"].removeEventListener */.A.removeEventListener(enums.Events.IMAGE_VOLUME_LOADING_COMPLETED, handleProgress);
|
|
39595
|
-
};
|
|
39596
|
-
}
|
|
39597
40170
|
function VtkVolume3DRenderPath_applyDataPresentation(rendering, props) {
|
|
39598
40171
|
const { actor, defaultVOIRange } = rendering;
|
|
39599
40172
|
const property = actor.getProperty();
|
|
@@ -39628,12 +40201,9 @@ function applySampleDistanceMultiplier(mapper, multiplier) {
|
|
|
39628
40201
|
if (!imageData) {
|
|
39629
40202
|
return;
|
|
39630
40203
|
}
|
|
39631
|
-
|
|
39632
|
-
const
|
|
39633
|
-
|
|
39634
|
-
? Math.max(multiplier, 0.001)
|
|
39635
|
-
: 1;
|
|
39636
|
-
mapper.setSampleDistance(defaultSampleDistance * safeMultiplier);
|
|
40204
|
+
(0,createVolumeMapper/* .setIdleSampleDistanceMultiplier */.$U)(mapper, multiplier);
|
|
40205
|
+
const texture = mapper.getScalarTexture?.();
|
|
40206
|
+
mapper.setSampleDistance((0,createVolumeMapper/* .sampleDistanceOf */.h6)(imageData, texture, (0,createVolumeMapper/* .idleSampleDistanceMultiplierOf */.Ax)(mapper)));
|
|
39637
40207
|
}
|
|
39638
40208
|
function setCameraClippingRange(ctx) {
|
|
39639
40209
|
(0,setVtkCameraClippingRange/* ["default"] */.A)(ctx.vtk.renderer.getActiveCamera());
|
|
@@ -39819,6 +40389,21 @@ class VolumeViewport3D extends _GenericViewport_js__rspack_import_3/* ["default"
|
|
|
39819
40389
|
this.element.setAttribute('data-viewport-uid', this.id);
|
|
39820
40390
|
this.element.setAttribute('data-rendering-engine-uid', this.renderingEngineId);
|
|
39821
40391
|
}
|
|
40392
|
+
canReportFidelity() {
|
|
40393
|
+
return true;
|
|
40394
|
+
}
|
|
40395
|
+
isFidelityView3D() {
|
|
40396
|
+
return true;
|
|
40397
|
+
}
|
|
40398
|
+
getCurrentMode() {
|
|
40399
|
+
const binding = this.getSourceBinding();
|
|
40400
|
+
if (!binding) {
|
|
40401
|
+
return 'empty';
|
|
40402
|
+
}
|
|
40403
|
+
return binding.rendering.renderMode === 'vtkGeometry3d'
|
|
40404
|
+
? 'unknown'
|
|
40405
|
+
: 'volume3d';
|
|
40406
|
+
}
|
|
39822
40407
|
async setDisplaySets(...entries) {
|
|
39823
40408
|
this.removeAllData();
|
|
39824
40409
|
for (const [index, { displaySetId, options = {} }] of entries.entries()) {
|
|
@@ -41418,6 +42003,33 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
41418
42003
|
});
|
|
41419
42004
|
|
|
41420
42005
|
|
|
42006
|
+
},
|
|
42007
|
+
67746(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
42008
|
+
"use strict";
|
|
42009
|
+
function isVolumeLoading(imageVolume) {
|
|
42010
|
+
return (imageVolume?.loadStatus
|
|
42011
|
+
?.loading === true);
|
|
42012
|
+
}
|
|
42013
|
+
function isBindingPending(imageVolume, texture) {
|
|
42014
|
+
return isVolumeLoading(imageVolume) || texture?.isFillPending?.() === true;
|
|
42015
|
+
}
|
|
42016
|
+
function isSegmentationOverlayData(payload, options) {
|
|
42017
|
+
return (options?.role === 'overlay' && payload.reference?.kind === 'segmentation');
|
|
42018
|
+
}
|
|
42019
|
+
function readBoundQuality(imageVolume, boundGrid) {
|
|
42020
|
+
return boundGrid
|
|
42021
|
+
? imageVolume.getGridQuality(boundGrid.grid, boundGrid.statistic)
|
|
42022
|
+
: imageVolume.getVoxelQuality();
|
|
42023
|
+
}
|
|
42024
|
+
|
|
42025
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
42026
|
+
Kc: () => (readBoundQuality),
|
|
42027
|
+
VK: () => (isSegmentationOverlayData),
|
|
42028
|
+
fT: () => (isVolumeLoading),
|
|
42029
|
+
l_: () => (isBindingPending)
|
|
42030
|
+
});
|
|
42031
|
+
|
|
42032
|
+
|
|
41421
42033
|
},
|
|
41422
42034
|
74565(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
41423
42035
|
"use strict";
|
|
@@ -42293,6 +42905,14 @@ VideoViewport.frameRangeExtractor = /(\/frames\/|[&?]frameNumber=)([^/&?]*)/i;
|
|
|
42293
42905
|
/* import */ var _utilities_getPlaneCubeIntersectionDimensions_js__rspack_import_19 = __webpack_require__(32367);
|
|
42294
42906
|
/* import */ var _utilities_getNormalizedAspectRatio_js__rspack_import_20 = __webpack_require__(47232);
|
|
42295
42907
|
/* import */ var _init_js__rspack_import_21 = __webpack_require__(90934);
|
|
42908
|
+
/* import */ var _helpers_fidelityIndicator_buildViewportFidelityState_js__rspack_import_22 = __webpack_require__(22617);
|
|
42909
|
+
/* import */ var _helpers_fidelityIndicator_displaySpacingOfViewport_js__rspack_import_23 = __webpack_require__(42704);
|
|
42910
|
+
/* import */ var _helpers_fidelityIndicator_notifyFidelityStateChanged_js__rspack_import_24 = __webpack_require__(3508);
|
|
42911
|
+
/* import */ var _helpers_legacyActorTextureSet_js__rspack_import_25 = __webpack_require__(61719);
|
|
42912
|
+
|
|
42913
|
+
|
|
42914
|
+
|
|
42915
|
+
|
|
42296
42916
|
|
|
42297
42917
|
|
|
42298
42918
|
|
|
@@ -42398,6 +43018,7 @@ class Viewport {
|
|
|
42398
43018
|
return false;
|
|
42399
43019
|
}
|
|
42400
43020
|
dispose() {
|
|
43021
|
+
this._actors?.forEach(({ actor }) => (0,_helpers_legacyActorTextureSet_js__rspack_import_25/* .holdLegacyActorTextureSet */.z)(actor, false));
|
|
42401
43022
|
}
|
|
42402
43023
|
destroy() {
|
|
42403
43024
|
this.dispose();
|
|
@@ -42450,6 +43071,24 @@ class Viewport {
|
|
|
42450
43071
|
const renderingEngine = this.getRenderingEngine();
|
|
42451
43072
|
renderingEngine.renderViewport(this.id);
|
|
42452
43073
|
}
|
|
43074
|
+
canReportFidelity() {
|
|
43075
|
+
return false;
|
|
43076
|
+
}
|
|
43077
|
+
getFidelityState() {
|
|
43078
|
+
return (0,_helpers_fidelityIndicator_buildViewportFidelityState_js__rspack_import_22/* .buildViewportFidelityState */.m)(this.collectFidelityLines(), (0,_helpers_fidelityIndicator_displaySpacingOfViewport_js__rspack_import_23/* .displaySpacingOfViewport */.dA)(this));
|
|
43079
|
+
}
|
|
43080
|
+
getFidelityLines() {
|
|
43081
|
+
return this.collectFidelityLines();
|
|
43082
|
+
}
|
|
43083
|
+
notifyFidelityStateChanged() {
|
|
43084
|
+
if (!this.canReportFidelity()) {
|
|
43085
|
+
return;
|
|
43086
|
+
}
|
|
43087
|
+
(0,_helpers_fidelityIndicator_notifyFidelityStateChanged_js__rspack_import_24/* .notifyFidelityStateChanged */.t)(this, this.collectFidelityLines(), (0,_helpers_fidelityIndicator_displaySpacingOfViewport_js__rspack_import_23/* .displaySpacingOfViewport */.dA)(this));
|
|
43088
|
+
}
|
|
43089
|
+
collectFidelityLines() {
|
|
43090
|
+
return [];
|
|
43091
|
+
}
|
|
42453
43092
|
setOptions(options, immediate = false) {
|
|
42454
43093
|
this.options = (0,_utilities_deepClone_js__rspack_import_16/* .deepClone */.G)(options);
|
|
42455
43094
|
if (this.options?.displayArea) {
|
|
@@ -42584,6 +43223,7 @@ class Viewport {
|
|
|
42584
43223
|
const renderer = this.getRenderer();
|
|
42585
43224
|
renderer.removeActor(actorEntry.actor);
|
|
42586
43225
|
this._actors.delete(actorUID);
|
|
43226
|
+
(0,_helpers_legacyActorTextureSet_js__rspack_import_25/* .holdLegacyActorTextureSet */.z)(actorEntry.actor, false);
|
|
42587
43227
|
return actorEntry;
|
|
42588
43228
|
}
|
|
42589
43229
|
removeActors(actorUIDs) {
|
|
@@ -42646,6 +43286,7 @@ class Viewport {
|
|
|
42646
43286
|
const renderer = this.getRenderer();
|
|
42647
43287
|
renderer?.addActor(actor);
|
|
42648
43288
|
this._actors.set(actorUID, Object.assign({}, actorEntry));
|
|
43289
|
+
(0,_helpers_legacyActorTextureSet_js__rspack_import_25/* .holdLegacyActorTextureSet */.z)(actor, true);
|
|
42649
43290
|
this.updateCameraClippingPlanesAndRange();
|
|
42650
43291
|
(0,_utilities_triggerEvent_js__rspack_import_10/* ["default"] */.A)(this.element, _enums_Events_js__rspack_import_4/* ["default"].ACTORS_CHANGED */.A.ACTORS_CHANGED, {
|
|
42651
43292
|
viewportId: this.id,
|
|
@@ -42658,6 +43299,7 @@ class Viewport {
|
|
|
42658
43299
|
const currentActors = this.getActors();
|
|
42659
43300
|
this.getRenderer()?.removeAllViewProps();
|
|
42660
43301
|
this._actors = new Map();
|
|
43302
|
+
currentActors.forEach(({ actor }) => (0,_helpers_legacyActorTextureSet_js__rspack_import_25/* .holdLegacyActorTextureSet */.z)(actor, false));
|
|
42661
43303
|
(0,_utilities_triggerEvent_js__rspack_import_10/* ["default"] */.A)(this.element, _enums_Events_js__rspack_import_4/* ["default"].ACTORS_CHANGED */.A.ACTORS_CHANGED, {
|
|
42662
43304
|
viewportId: this.id,
|
|
42663
43305
|
removedActors: currentActors,
|
|
@@ -44307,6 +44949,452 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
44307
44949
|
});
|
|
44308
44950
|
|
|
44309
44951
|
|
|
44952
|
+
},
|
|
44953
|
+
93348(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
44954
|
+
"use strict";
|
|
44955
|
+
|
|
44956
|
+
// EXPORTS
|
|
44957
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
44958
|
+
TB: () => (/* reexport */ detachFidelityIndicator),
|
|
44959
|
+
lO: () => (/* reexport */ maybeAttachFidelityIndicator)
|
|
44960
|
+
});
|
|
44961
|
+
|
|
44962
|
+
// UNUSED EXPORTS: attachFidelityIndicator, buildViewportFidelityState, canReportFidelity, dataKindOf, dataKindOfImageQuality, displaySpacingOfViewport, ensureFidelityIndicatorStyles, fidelityDetailsTextOf, fidelityLabelOf, fidelityLineFromStackImage, fidelityLinesFromBindings, fidelityLinesFromVolumeActors, formatFactor, formatFactors, isInteractiveLod, isLabelmapActorEntry, isReduced, lineKind, notifyFidelityStateChanged, reductionFactorsOf, shownStateOf, viewportFidelityStateKey
|
|
44963
|
+
|
|
44964
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/enums/index.js
|
|
44965
|
+
var enums = __webpack_require__(71088);
|
|
44966
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/eventTarget.js
|
|
44967
|
+
var eventTarget = __webpack_require__(45340);
|
|
44968
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/init.js + 1 modules
|
|
44969
|
+
var init = __webpack_require__(90934);
|
|
44970
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/fidelityIndicator/buildViewportFidelityState.js
|
|
44971
|
+
var buildViewportFidelityState = __webpack_require__(22617);
|
|
44972
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/fidelityIndicator/fidelityDetailsText.js
|
|
44973
|
+
var fidelityDetailsText = __webpack_require__(65429);
|
|
44974
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/fidelityIndicator/fidelityLabel.js
|
|
44975
|
+
var fidelityLabel = __webpack_require__(21130);
|
|
44976
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/fidelityIndicator/fidelityIndicatorStyles.js
|
|
44977
|
+
var fidelityIndicatorStyles = __webpack_require__(8699);
|
|
44978
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/fidelityIndicator/isLabelmapActorEntry.js
|
|
44979
|
+
var isLabelmapActorEntry = __webpack_require__(12915);
|
|
44980
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/fidelityIndicator/fidelityIndicatorState.js
|
|
44981
|
+
var fidelityIndicatorState = __webpack_require__(56196);
|
|
44982
|
+
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/fidelityIndicator/attachFidelityIndicator.js
|
|
44983
|
+
|
|
44984
|
+
|
|
44985
|
+
|
|
44986
|
+
|
|
44987
|
+
|
|
44988
|
+
|
|
44989
|
+
|
|
44990
|
+
|
|
44991
|
+
|
|
44992
|
+
|
|
44993
|
+
const COLORS = {
|
|
44994
|
+
full: '#2e9d4a',
|
|
44995
|
+
loading: '#c98a00',
|
|
44996
|
+
reduced: '#2f6fc0',
|
|
44997
|
+
decimated: '#c0392b',
|
|
44998
|
+
none: '#666',
|
|
44999
|
+
};
|
|
45000
|
+
const cleanups = new WeakMap();
|
|
45001
|
+
function attachFidelityIndicator(viewport) {
|
|
45002
|
+
detachFidelityIndicator(viewport);
|
|
45003
|
+
if ((0,init/* .getConfiguration */.D0)().dangerouslyDisableFidelityIndicator) {
|
|
45004
|
+
return () => { };
|
|
45005
|
+
}
|
|
45006
|
+
if (!hasFidelityApi(viewport)) {
|
|
45007
|
+
return () => { };
|
|
45008
|
+
}
|
|
45009
|
+
const verbose = (0,init/* .getConfiguration */.D0)().debug?.fidelityIndicatorDebug === true;
|
|
45010
|
+
(0,fidelityIndicatorStyles/* .ensureFidelityIndicatorStyles */.C)();
|
|
45011
|
+
const { host, restore: restoreHost } = overlayHostOf(viewport.element);
|
|
45012
|
+
const views = [createProductIndicator(host, () => linesOf(viewport))];
|
|
45013
|
+
if (verbose) {
|
|
45014
|
+
views.push(createTextBadge(host));
|
|
45015
|
+
}
|
|
45016
|
+
const cleanup = subscribeToFidelity(viewport, views, restoreHost, verbose);
|
|
45017
|
+
const registered = () => {
|
|
45018
|
+
if (cleanups.get(viewport) === registered) {
|
|
45019
|
+
cleanups.delete(viewport);
|
|
45020
|
+
}
|
|
45021
|
+
cleanup();
|
|
45022
|
+
};
|
|
45023
|
+
cleanups.set(viewport, registered);
|
|
45024
|
+
return registered;
|
|
45025
|
+
}
|
|
45026
|
+
function maybeAttachFidelityIndicator(viewport) {
|
|
45027
|
+
if ((0,init/* .getConfiguration */.D0)().dangerouslyDisableFidelityIndicator) {
|
|
45028
|
+
return;
|
|
45029
|
+
}
|
|
45030
|
+
if (!canReportFidelity(viewport)) {
|
|
45031
|
+
return;
|
|
45032
|
+
}
|
|
45033
|
+
attachFidelityIndicator(viewport);
|
|
45034
|
+
}
|
|
45035
|
+
function detachFidelityIndicator(viewport) {
|
|
45036
|
+
const cleanup = cleanups.get(viewport);
|
|
45037
|
+
if (!cleanup) {
|
|
45038
|
+
return;
|
|
45039
|
+
}
|
|
45040
|
+
cleanups.delete(viewport);
|
|
45041
|
+
cleanup();
|
|
45042
|
+
}
|
|
45043
|
+
function canReportFidelity(viewport) {
|
|
45044
|
+
return viewport.canReportFidelity() === true;
|
|
45045
|
+
}
|
|
45046
|
+
function hasFidelityApi(viewport) {
|
|
45047
|
+
return typeof viewport.getFidelityLines === 'function';
|
|
45048
|
+
}
|
|
45049
|
+
function linesOf(viewport) {
|
|
45050
|
+
return viewport.getFidelityLines?.() ?? [];
|
|
45051
|
+
}
|
|
45052
|
+
function subscribeToFidelity(viewport, views, restoreHost, onRender) {
|
|
45053
|
+
const { element } = viewport;
|
|
45054
|
+
let rafId = 0;
|
|
45055
|
+
let disposed = false;
|
|
45056
|
+
const updateViews = () => {
|
|
45057
|
+
const lines = linesOf(viewport);
|
|
45058
|
+
for (const view of views) {
|
|
45059
|
+
view.update(lines);
|
|
45060
|
+
}
|
|
45061
|
+
};
|
|
45062
|
+
const update = () => {
|
|
45063
|
+
rafId = 0;
|
|
45064
|
+
if (disposed) {
|
|
45065
|
+
return;
|
|
45066
|
+
}
|
|
45067
|
+
updateViews();
|
|
45068
|
+
};
|
|
45069
|
+
const schedule = () => {
|
|
45070
|
+
if (!rafId && !disposed) {
|
|
45071
|
+
rafId = requestAnimationFrame(update);
|
|
45072
|
+
}
|
|
45073
|
+
};
|
|
45074
|
+
const onVolumeModified = () => {
|
|
45075
|
+
schedule();
|
|
45076
|
+
};
|
|
45077
|
+
const onFidelityChanged = () => {
|
|
45078
|
+
if (disposed) {
|
|
45079
|
+
return;
|
|
45080
|
+
}
|
|
45081
|
+
updateViews();
|
|
45082
|
+
};
|
|
45083
|
+
const cleanUp = () => {
|
|
45084
|
+
if (disposed) {
|
|
45085
|
+
return;
|
|
45086
|
+
}
|
|
45087
|
+
disposed = true;
|
|
45088
|
+
if (rafId) {
|
|
45089
|
+
cancelAnimationFrame(rafId);
|
|
45090
|
+
rafId = 0;
|
|
45091
|
+
}
|
|
45092
|
+
if (onRender) {
|
|
45093
|
+
element.removeEventListener(enums.Events.IMAGE_RENDERED, schedule);
|
|
45094
|
+
}
|
|
45095
|
+
element.removeEventListener(enums.Events.VIEWPORT_FIDELITY_CHANGED, onFidelityChanged);
|
|
45096
|
+
for (const type of VOLUME_DATA_EVENTS) {
|
|
45097
|
+
eventTarget/* ["default"].removeEventListener */.A.removeEventListener(type, onVolumeModified);
|
|
45098
|
+
}
|
|
45099
|
+
for (const view of views) {
|
|
45100
|
+
view.remove();
|
|
45101
|
+
}
|
|
45102
|
+
restoreHost();
|
|
45103
|
+
};
|
|
45104
|
+
if (onRender) {
|
|
45105
|
+
element.addEventListener(enums.Events.IMAGE_RENDERED, schedule);
|
|
45106
|
+
}
|
|
45107
|
+
element.addEventListener(enums.Events.VIEWPORT_FIDELITY_CHANGED, onFidelityChanged);
|
|
45108
|
+
for (const type of VOLUME_DATA_EVENTS) {
|
|
45109
|
+
eventTarget/* ["default"].addEventListener */.A.addEventListener(type, onVolumeModified);
|
|
45110
|
+
}
|
|
45111
|
+
schedule();
|
|
45112
|
+
return cleanUp;
|
|
45113
|
+
}
|
|
45114
|
+
const VOLUME_DATA_EVENTS = [
|
|
45115
|
+
enums.Events.IMAGE_VOLUME_MODIFIED,
|
|
45116
|
+
enums.Events.IMAGE_VOLUME_LOADING_COMPLETED,
|
|
45117
|
+
];
|
|
45118
|
+
function overlayHostOf(element) {
|
|
45119
|
+
let previousInline;
|
|
45120
|
+
if (typeof getComputedStyle !== 'undefined') {
|
|
45121
|
+
const computed = getComputedStyle(element).position;
|
|
45122
|
+
if (computed === 'static' || computed === '') {
|
|
45123
|
+
previousInline = element.style.position;
|
|
45124
|
+
element.style.position = 'relative';
|
|
45125
|
+
}
|
|
45126
|
+
}
|
|
45127
|
+
return {
|
|
45128
|
+
host: element,
|
|
45129
|
+
restore: () => {
|
|
45130
|
+
if (previousInline === undefined) {
|
|
45131
|
+
return;
|
|
45132
|
+
}
|
|
45133
|
+
element.style.position = previousInline;
|
|
45134
|
+
},
|
|
45135
|
+
};
|
|
45136
|
+
}
|
|
45137
|
+
function createProductIndicator(host, readLines) {
|
|
45138
|
+
const root = document.createElement('div');
|
|
45139
|
+
root.className = 'fi-root';
|
|
45140
|
+
Object.assign(root.style, {
|
|
45141
|
+
position: 'absolute',
|
|
45142
|
+
top: '14px',
|
|
45143
|
+
right: '14px',
|
|
45144
|
+
zIndex: '1000',
|
|
45145
|
+
transform: 'translateZ(0)',
|
|
45146
|
+
});
|
|
45147
|
+
const label = document.createElement('div');
|
|
45148
|
+
label.className = 'fi-label';
|
|
45149
|
+
const details = document.createElement('pre');
|
|
45150
|
+
details.className = 'fi-details';
|
|
45151
|
+
root.append(label, details);
|
|
45152
|
+
host.appendChild(root);
|
|
45153
|
+
let hovered = false;
|
|
45154
|
+
let lastText;
|
|
45155
|
+
let lastState;
|
|
45156
|
+
for (const type of ['mousedown', 'pointerdown', 'wheel']) {
|
|
45157
|
+
root.addEventListener(type, (event) => event.stopPropagation());
|
|
45158
|
+
}
|
|
45159
|
+
root.addEventListener('mouseenter', () => {
|
|
45160
|
+
hovered = true;
|
|
45161
|
+
root.dataset.hover = 'true';
|
|
45162
|
+
details.textContent = clinicianHoverTextOf(readLines());
|
|
45163
|
+
});
|
|
45164
|
+
root.addEventListener('mouseleave', () => {
|
|
45165
|
+
hovered = false;
|
|
45166
|
+
delete root.dataset.hover;
|
|
45167
|
+
});
|
|
45168
|
+
return {
|
|
45169
|
+
update: (lines) => {
|
|
45170
|
+
const state = (0,fidelityIndicatorState/* .shownStateOf */.m9)(lines);
|
|
45171
|
+
const text = (0,fidelityLabel/* .fidelityLabelOf */.C)(state);
|
|
45172
|
+
if (text && hovered) {
|
|
45173
|
+
details.textContent = clinicianHoverTextOf(lines);
|
|
45174
|
+
}
|
|
45175
|
+
if (text === lastText && state === lastState) {
|
|
45176
|
+
return;
|
|
45177
|
+
}
|
|
45178
|
+
lastText = text;
|
|
45179
|
+
lastState = state;
|
|
45180
|
+
label.textContent = text ?? '';
|
|
45181
|
+
if (!text) {
|
|
45182
|
+
delete root.dataset.state;
|
|
45183
|
+
hovered = false;
|
|
45184
|
+
delete root.dataset.hover;
|
|
45185
|
+
return;
|
|
45186
|
+
}
|
|
45187
|
+
root.dataset.state = state;
|
|
45188
|
+
},
|
|
45189
|
+
remove: () => root.remove(),
|
|
45190
|
+
};
|
|
45191
|
+
}
|
|
45192
|
+
function clinicianHoverTextOf(lines) {
|
|
45193
|
+
return (0,fidelityDetailsText/* .fidelityDetailsTextOf */.X)((0,buildViewportFidelityState/* .buildViewportFidelityState */.m)(lines), lines);
|
|
45194
|
+
}
|
|
45195
|
+
function summaryOf(line) {
|
|
45196
|
+
const { record, reductionFactors, imageQualityStatus } = line;
|
|
45197
|
+
if (!(0,fidelityIndicatorState/* .lineHasData */.lM)(line)) {
|
|
45198
|
+
return { text: 'NO DATA', color: COLORS.none };
|
|
45199
|
+
}
|
|
45200
|
+
const dataKind = (0,fidelityIndicatorState/* .dataKindOf */.Sb)(line);
|
|
45201
|
+
if (dataKind === 'loading') {
|
|
45202
|
+
if (record) {
|
|
45203
|
+
const loaded = record.voxels > 0
|
|
45204
|
+
? Math.min(99, Math.floor((100 * (record.voxels - record.missing)) / record.voxels))
|
|
45205
|
+
: 0;
|
|
45206
|
+
return {
|
|
45207
|
+
text: `${record.exact ? '' : '~'}${loaded}% loaded`,
|
|
45208
|
+
color: COLORS.loading,
|
|
45209
|
+
};
|
|
45210
|
+
}
|
|
45211
|
+
return { text: 'LOADING', color: COLORS.loading };
|
|
45212
|
+
}
|
|
45213
|
+
if (dataKind === 'decimated') {
|
|
45214
|
+
return { text: 'DECIMATED', color: COLORS.decimated };
|
|
45215
|
+
}
|
|
45216
|
+
const parts = [];
|
|
45217
|
+
if (dataKind === 'reduced') {
|
|
45218
|
+
const status = imageQualityStatus ?? record?.lowest;
|
|
45219
|
+
if ((0,fidelityIndicatorState/* .isReduced */.H3)(reductionFactors)) {
|
|
45220
|
+
parts.push(`REDUCED ${(0,fidelityIndicatorState/* .formatFactors */.uB)(reductionFactors)}`);
|
|
45221
|
+
}
|
|
45222
|
+
else if (status < enums.ImageQualityStatus.FULL_RESOLUTION) {
|
|
45223
|
+
parts.push(enums.ImageQualityStatus[status] ?? 'REDUCED');
|
|
45224
|
+
}
|
|
45225
|
+
else {
|
|
45226
|
+
parts.push(`SAMPLE ${(0,fidelityIndicatorState/* .formatFactor */.H9)((0,fidelityIndicatorState/* .standingSampleRatioOf */.ZX)(line))}×`);
|
|
45227
|
+
}
|
|
45228
|
+
}
|
|
45229
|
+
const interactive = (0,fidelityIndicatorState/* .interactiveSampleRatioOf */.te)(line);
|
|
45230
|
+
if ((0,fidelityIndicatorState/* .isInteractiveLod */.kq)(interactive)) {
|
|
45231
|
+
parts.push(`LOD ${(0,fidelityIndicatorState/* .formatFactor */.H9)(interactive)}×`);
|
|
45232
|
+
}
|
|
45233
|
+
else if (line.interactiveReduction) {
|
|
45234
|
+
parts.push('LOD');
|
|
45235
|
+
}
|
|
45236
|
+
if (parts.length) {
|
|
45237
|
+
return { text: parts.join(' · '), color: COLORS.reduced };
|
|
45238
|
+
}
|
|
45239
|
+
return { text: 'FULL', color: COLORS.full };
|
|
45240
|
+
}
|
|
45241
|
+
function fidelityHoverTextOf(lines) {
|
|
45242
|
+
if (!lines.length) {
|
|
45243
|
+
return 'No image data in this viewport yet';
|
|
45244
|
+
}
|
|
45245
|
+
return lines.map(detailsOf).join('\n\n');
|
|
45246
|
+
}
|
|
45247
|
+
const DETAIL_STATUS = {
|
|
45248
|
+
loading: () => 'loading',
|
|
45249
|
+
decimated: () => 'decimated',
|
|
45250
|
+
reduced: (line) => line.record
|
|
45251
|
+
? `reduced ${(0,fidelityIndicatorState/* .formatFactors */.uB)(line.reductionFactors)}`
|
|
45252
|
+
: 'reduced',
|
|
45253
|
+
full: () => 'full resolution',
|
|
45254
|
+
};
|
|
45255
|
+
function detailsOf(line) {
|
|
45256
|
+
const { label, record, imageQualityStatus } = line;
|
|
45257
|
+
if (!record) {
|
|
45258
|
+
if (imageQualityStatus !== undefined) {
|
|
45259
|
+
const status = enums.ImageQualityStatus[imageQualityStatus] ?? String(imageQualityStatus);
|
|
45260
|
+
return [
|
|
45261
|
+
`${label}`,
|
|
45262
|
+
` status ${DETAIL_STATUS[(0,fidelityIndicatorState/* .dataKindOf */.Sb)(line)](line)}`,
|
|
45263
|
+
` delivery ${status}`,
|
|
45264
|
+
` note developer view — app indicators supply clinician text`,
|
|
45265
|
+
].join('\n');
|
|
45266
|
+
}
|
|
45267
|
+
return line.fullResolution
|
|
45268
|
+
? `${label}: no quality record`
|
|
45269
|
+
: `${label}: no quality record, reduced ${(0,fidelityIndicatorState/* .formatFactors */.uB)(line.reductionFactors)}`;
|
|
45270
|
+
}
|
|
45271
|
+
const { grid } = record;
|
|
45272
|
+
const delivery = enums.ImageQualityStatus[record.status] ?? String(record.status);
|
|
45273
|
+
const range = record.lowest === record.highest
|
|
45274
|
+
? ''
|
|
45275
|
+
: ` [${enums.ImageQualityStatus[record.lowest]}..${enums.ImageQualityStatus[record.highest]}]`;
|
|
45276
|
+
const missingPercent = record.voxels > 0 ? Math.round((100 * record.missing) / record.voxels) : 0;
|
|
45277
|
+
const status = DETAIL_STATUS[(0,fidelityIndicatorState/* .dataKindOf */.Sb)(line)](line);
|
|
45278
|
+
const interactive = (0,fidelityIndicatorState/* .interactiveSampleRatioOf */.te)(line);
|
|
45279
|
+
const standing = (0,fidelityIndicatorState/* .standingSampleRatioOf */.ZX)(line);
|
|
45280
|
+
const lodState = (0,fidelityIndicatorState/* .isInteractiveLod */.kq)(interactive)
|
|
45281
|
+
? `sample distance ×${(0,fidelityIndicatorState/* .formatFactor */.H9)(interactive)} (interactive)`
|
|
45282
|
+
: line.interactiveReduction
|
|
45283
|
+
? 'deferred resample (interactive)'
|
|
45284
|
+
: `sample distance idle ×${(0,fidelityIndicatorState/* .formatFactor */.H9)(standing)}`;
|
|
45285
|
+
return [
|
|
45286
|
+
`${label}`,
|
|
45287
|
+
` status ${status}`,
|
|
45288
|
+
` delivery ${delivery}${range}`,
|
|
45289
|
+
` grid ${grid.dimensions.join('×')} @ ${grid.spacing
|
|
45290
|
+
.map((value) => (0,fidelityIndicatorState/* .formatFactor */.H9)(value))
|
|
45291
|
+
.join('×')} mm`,
|
|
45292
|
+
` missing ${record.exact ? '' : '~'}${missingPercent}% of ${record.voxels} voxels`,
|
|
45293
|
+
` source ${record.source} · ${record.reduction} · ${record.deliveries} deliveries`,
|
|
45294
|
+
` lod ${lodState}`,
|
|
45295
|
+
` note developer view — app indicators supply clinician text`,
|
|
45296
|
+
].join('\n');
|
|
45297
|
+
}
|
|
45298
|
+
function createTextBadge(host) {
|
|
45299
|
+
const root = document.createElement('div');
|
|
45300
|
+
Object.assign(root.style, {
|
|
45301
|
+
position: 'absolute',
|
|
45302
|
+
top: '4px',
|
|
45303
|
+
left: '4px',
|
|
45304
|
+
zIndex: '1000',
|
|
45305
|
+
font: '11px/1.3 monospace',
|
|
45306
|
+
color: '#fff',
|
|
45307
|
+
textAlign: 'left',
|
|
45308
|
+
userSelect: 'none',
|
|
45309
|
+
});
|
|
45310
|
+
const pills = document.createElement('div');
|
|
45311
|
+
const details = document.createElement('pre');
|
|
45312
|
+
Object.assign(details.style, {
|
|
45313
|
+
display: 'none',
|
|
45314
|
+
margin: '4px 0 0',
|
|
45315
|
+
padding: '6px 8px',
|
|
45316
|
+
background: 'rgba(0, 0, 0, 0.85)',
|
|
45317
|
+
borderRadius: '4px',
|
|
45318
|
+
textAlign: 'left',
|
|
45319
|
+
whiteSpace: 'pre',
|
|
45320
|
+
});
|
|
45321
|
+
root.append(pills, details);
|
|
45322
|
+
let hovered = false;
|
|
45323
|
+
let lastLines = [];
|
|
45324
|
+
let lastPillsKey = '';
|
|
45325
|
+
for (const type of ['mousedown', 'pointerdown', 'wheel']) {
|
|
45326
|
+
root.addEventListener(type, (event) => event.stopPropagation());
|
|
45327
|
+
}
|
|
45328
|
+
root.addEventListener('mouseenter', () => {
|
|
45329
|
+
hovered = true;
|
|
45330
|
+
details.textContent = fidelityHoverTextOf(lastLines);
|
|
45331
|
+
details.style.display = 'block';
|
|
45332
|
+
});
|
|
45333
|
+
root.addEventListener('mouseleave', () => {
|
|
45334
|
+
hovered = false;
|
|
45335
|
+
details.style.display = 'none';
|
|
45336
|
+
});
|
|
45337
|
+
host.appendChild(root);
|
|
45338
|
+
return {
|
|
45339
|
+
update: (lines) => {
|
|
45340
|
+
lastLines = lines;
|
|
45341
|
+
renderPills(lines);
|
|
45342
|
+
if (hovered) {
|
|
45343
|
+
details.textContent = fidelityHoverTextOf(lines);
|
|
45344
|
+
}
|
|
45345
|
+
},
|
|
45346
|
+
remove: () => root.remove(),
|
|
45347
|
+
};
|
|
45348
|
+
function renderPills(lines) {
|
|
45349
|
+
const shown = lines.length
|
|
45350
|
+
? lines
|
|
45351
|
+
: [
|
|
45352
|
+
{
|
|
45353
|
+
label: 'Image',
|
|
45354
|
+
reductionFactors: [1, 1, 1],
|
|
45355
|
+
fullResolution: true,
|
|
45356
|
+
sampleDistanceLod: 1,
|
|
45357
|
+
},
|
|
45358
|
+
];
|
|
45359
|
+
const summaries = shown.map((line) => ({ line, ...summaryOf(line) }));
|
|
45360
|
+
const key = summaries.map(({ text, color }) => text + color).join('|');
|
|
45361
|
+
if (key === lastPillsKey) {
|
|
45362
|
+
return;
|
|
45363
|
+
}
|
|
45364
|
+
lastPillsKey = key;
|
|
45365
|
+
pills.replaceChildren(...summaries.map(({ line, text, color }) => {
|
|
45366
|
+
const pill = document.createElement('div');
|
|
45367
|
+
Object.assign(pill.style, {
|
|
45368
|
+
display: 'inline-block',
|
|
45369
|
+
marginRight: '4px',
|
|
45370
|
+
padding: '1px 6px',
|
|
45371
|
+
borderRadius: '8px',
|
|
45372
|
+
background: color,
|
|
45373
|
+
});
|
|
45374
|
+
pill.textContent = shown.length > 1 ? `${line.label} ${text}` : text;
|
|
45375
|
+
return pill;
|
|
45376
|
+
}));
|
|
45377
|
+
}
|
|
45378
|
+
}
|
|
45379
|
+
|
|
45380
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/fidelityIndicator/displaySpacingOfViewport.js
|
|
45381
|
+
var displaySpacingOfViewport = __webpack_require__(42704);
|
|
45382
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/fidelityIndicator/collectFidelityLines.js
|
|
45383
|
+
var collectFidelityLines = __webpack_require__(91339);
|
|
45384
|
+
// EXTERNAL MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/fidelityIndicator/notifyFidelityStateChanged.js
|
|
45385
|
+
var notifyFidelityStateChanged = __webpack_require__(3508);
|
|
45386
|
+
;// CONCATENATED MODULE: ../../node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/fidelityIndicator/index.js
|
|
45387
|
+
|
|
45388
|
+
|
|
45389
|
+
|
|
45390
|
+
|
|
45391
|
+
|
|
45392
|
+
|
|
45393
|
+
|
|
45394
|
+
|
|
45395
|
+
|
|
45396
|
+
|
|
45397
|
+
|
|
44310
45398
|
},
|
|
44311
45399
|
81184(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
44312
45400
|
"use strict";
|
|
@@ -44327,6 +45415,74 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
44327
45415
|
});
|
|
44328
45416
|
|
|
44329
45417
|
|
|
45418
|
+
},
|
|
45419
|
+
61719(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
45420
|
+
"use strict";
|
|
45421
|
+
/* import */ var _enums_Events_js__rspack_import_0 = __webpack_require__(33635);
|
|
45422
|
+
/* import */ var _eventTarget_js__rspack_import_1 = __webpack_require__(45340);
|
|
45423
|
+
/* import */ var _resolveVolumeTexture_js__rspack_import_2 = __webpack_require__(17565);
|
|
45424
|
+
/* import */ var _createVolumeMapper_js__rspack_import_3 = __webpack_require__(9891);
|
|
45425
|
+
|
|
45426
|
+
|
|
45427
|
+
|
|
45428
|
+
|
|
45429
|
+
const claims = new WeakMap();
|
|
45430
|
+
const heldActors = new Set();
|
|
45431
|
+
function claimLegacyActorTextureSet(actor, volume, name) {
|
|
45432
|
+
if (volume.claimTextureSet(name)) {
|
|
45433
|
+
claims.set(actor, { volume, name, held: true });
|
|
45434
|
+
heldActors.add(actor);
|
|
45435
|
+
}
|
|
45436
|
+
}
|
|
45437
|
+
function holdLegacyActorTextureSet(actor, held) {
|
|
45438
|
+
const claim = claims.get(actor);
|
|
45439
|
+
if (!claim || claim.held === held) {
|
|
45440
|
+
return;
|
|
45441
|
+
}
|
|
45442
|
+
if (held) {
|
|
45443
|
+
claim.held = claim.volume.claimTextureSet(claim.name);
|
|
45444
|
+
}
|
|
45445
|
+
else {
|
|
45446
|
+
claim.volume.releaseTextureSet(claim.name);
|
|
45447
|
+
claim.held = false;
|
|
45448
|
+
}
|
|
45449
|
+
if (claim.held) {
|
|
45450
|
+
heldActors.add(actor);
|
|
45451
|
+
}
|
|
45452
|
+
else {
|
|
45453
|
+
heldActors.delete(actor);
|
|
45454
|
+
}
|
|
45455
|
+
}
|
|
45456
|
+
function rebindLegacyActor(actor) {
|
|
45457
|
+
const claim = claims.get(actor);
|
|
45458
|
+
const mapper = actor.getMapper();
|
|
45459
|
+
if (!mapper?.setScalarTexture) {
|
|
45460
|
+
return;
|
|
45461
|
+
}
|
|
45462
|
+
const { strategy, texture } = (0,_resolveVolumeTexture_js__rspack_import_2/* .resolveVolumeTexture */.M)(claim.volume);
|
|
45463
|
+
if (!texture || strategy.name === claim.name) {
|
|
45464
|
+
return;
|
|
45465
|
+
}
|
|
45466
|
+
claim.volume.releaseTextureSet(claim.name);
|
|
45467
|
+
claim.name = strategy.name;
|
|
45468
|
+
claim.held = claim.volume.claimTextureSet(claim.name);
|
|
45469
|
+
if (!claim.held) {
|
|
45470
|
+
heldActors.delete(actor);
|
|
45471
|
+
}
|
|
45472
|
+
mapper.setScalarTexture(texture);
|
|
45473
|
+
mapper.setSampleDistance((0,_createVolumeMapper_js__rspack_import_3/* .sampleDistanceOf */.h6)(mapper.getInputData(), texture, (0,_createVolumeMapper_js__rspack_import_3/* .idleSampleDistanceMultiplierOf */.Ax)(mapper)));
|
|
45474
|
+
mapper.modified();
|
|
45475
|
+
}
|
|
45476
|
+
_eventTarget_js__rspack_import_1/* ["default"].addEventListener */.A.addEventListener(_enums_Events_js__rspack_import_0/* ["default"].VOLUME_TEXTURE_LIMITS_CHANGED */.A.VOLUME_TEXTURE_LIMITS_CHANGED, () => {
|
|
45477
|
+
[...heldActors].forEach(rebindLegacyActor);
|
|
45478
|
+
});
|
|
45479
|
+
|
|
45480
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
45481
|
+
G: () => (claimLegacyActorTextureSet),
|
|
45482
|
+
z: () => (holdLegacyActorTextureSet)
|
|
45483
|
+
});
|
|
45484
|
+
|
|
45485
|
+
|
|
44330
45486
|
},
|
|
44331
45487
|
44215(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
44332
45488
|
"use strict";
|
|
@@ -44662,6 +45818,39 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
44662
45818
|
});
|
|
44663
45819
|
|
|
44664
45820
|
|
|
45821
|
+
},
|
|
45822
|
+
17565(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
45823
|
+
"use strict";
|
|
45824
|
+
/* import */ var _volumeRenderStrategy_js__rspack_import_0 = __webpack_require__(53703);
|
|
45825
|
+
/* import */ var _utilities_gpuSettingsPresets_js__rspack_import_1 = __webpack_require__(701);
|
|
45826
|
+
|
|
45827
|
+
|
|
45828
|
+
function resolveVolumeTexture(volume, options = {}) {
|
|
45829
|
+
const { provideStrategies = _volumeRenderStrategy_js__rspack_import_0/* .defaultVolumeStrategyProvider */.uy, selectStrategy = _volumeRenderStrategy_js__rspack_import_0/* .selectFirstReadyStrategy */.zz, viewportId, } = options;
|
|
45830
|
+
if (!volume?.voxelGrid) {
|
|
45831
|
+
return {};
|
|
45832
|
+
}
|
|
45833
|
+
const strategies = provideStrategies({
|
|
45834
|
+
volume,
|
|
45835
|
+
gpuSettings: (0,_utilities_gpuSettingsPresets_js__rspack_import_1/* .gpuSettingsForRender */.je)(),
|
|
45836
|
+
viewportId,
|
|
45837
|
+
reason: 'initial',
|
|
45838
|
+
});
|
|
45839
|
+
const strategy = selectStrategy({
|
|
45840
|
+
strategies,
|
|
45841
|
+
volume,
|
|
45842
|
+
viewportId,
|
|
45843
|
+
});
|
|
45844
|
+
const base = strategy?.bindings().find((binding) => binding.role === 'base');
|
|
45845
|
+
return { strategy, texture: base?.texture };
|
|
45846
|
+
}
|
|
45847
|
+
/* unused export default */ var __rspack_default_export = ((/* unused pure expression or super */ null && (resolveVolumeTexture)));
|
|
45848
|
+
|
|
45849
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
45850
|
+
M: () => (resolveVolumeTexture)
|
|
45851
|
+
});
|
|
45852
|
+
|
|
45853
|
+
|
|
44665
45854
|
},
|
|
44666
45855
|
26365(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
44667
45856
|
"use strict";
|
|
@@ -44805,10 +45994,12 @@ async function getVOIFromMiddleSliceMinMax(imageVolume) {
|
|
|
44805
45994
|
if (!imageVolume.referencedImageIds?.length) {
|
|
44806
45995
|
image = await (0,_loaders_imageLoader_js__rspack_import_1.loadAndCacheImage)(imageId, { ...options, ignoreCache: true });
|
|
44807
45996
|
}
|
|
44808
|
-
|
|
44809
|
-
if (min
|
|
44810
|
-
|
|
44811
|
-
|
|
45997
|
+
const { min, max } = image.voxelManager.getMinMax();
|
|
45998
|
+
if (Array.isArray(min) && min.length > 1) {
|
|
45999
|
+
return {
|
|
46000
|
+
lower: Math.min(...min),
|
|
46001
|
+
upper: Math.max(...max),
|
|
46002
|
+
};
|
|
44812
46003
|
}
|
|
44813
46004
|
return {
|
|
44814
46005
|
lower: min,
|
|
@@ -44902,6 +46093,9 @@ class PlanarViewportLegacyAdapter extends PlanarViewport/* ["default"] */.A {
|
|
|
44902
46093
|
super(...arguments);
|
|
44903
46094
|
this.legacyCompatibility = new PlanarLegacyCompatibilityController/* ["default"] */.A(this.createLegacyCompatibilityHost());
|
|
44904
46095
|
}
|
|
46096
|
+
prefersAcquiredFrames() {
|
|
46097
|
+
return false;
|
|
46098
|
+
}
|
|
44905
46099
|
cloneTuple(tuple) {
|
|
44906
46100
|
if (!tuple) {
|
|
44907
46101
|
return undefined;
|
|
@@ -45308,6 +46502,7 @@ class VolumeViewport3DLegacyAdapter extends viewport3D/* ["default"] */.A {
|
|
|
45308
46502
|
constructor() {
|
|
45309
46503
|
super(...arguments);
|
|
45310
46504
|
this.managedDataIds = new Set();
|
|
46505
|
+
this.remountingDataIds = new Set();
|
|
45311
46506
|
this.volumeDataIds = new Map();
|
|
45312
46507
|
this.legacyProperties = new Map();
|
|
45313
46508
|
this.defaultLegacyProperties = new Map();
|
|
@@ -45442,6 +46637,7 @@ class VolumeViewport3DLegacyAdapter extends viewport3D/* ["default"] */.A {
|
|
|
45442
46637
|
};
|
|
45443
46638
|
genericViewportDisplaySetMetadataProvider/* ["default"].add */.A.add(dataId, dataSet);
|
|
45444
46639
|
this.managedDataIds.add(dataId);
|
|
46640
|
+
this.remountingDataIds.add(dataId);
|
|
45445
46641
|
this.volumeDataIds.set(volumeInput.volumeId, dataId);
|
|
45446
46642
|
dataIds.push(dataId);
|
|
45447
46643
|
}
|
|
@@ -45452,6 +46648,7 @@ class VolumeViewport3DLegacyAdapter extends viewport3D/* ["default"] */.A {
|
|
|
45452
46648
|
displaySetId: dataId,
|
|
45453
46649
|
options: { renderMode: 'vtkVolume3d' },
|
|
45454
46650
|
})));
|
|
46651
|
+
dataIds.forEach((dataId) => this.remountingDataIds.delete(dataId));
|
|
45455
46652
|
volumeInputArray.forEach((volumeInput, index) => {
|
|
45456
46653
|
const dataId = dataIds[index];
|
|
45457
46654
|
if (volumeInput.visibility !== undefined) {
|
|
@@ -45469,6 +46666,9 @@ class VolumeViewport3DLegacyAdapter extends viewport3D/* ["default"] */.A {
|
|
|
45469
46666
|
}
|
|
45470
46667
|
}
|
|
45471
46668
|
});
|
|
46669
|
+
if (replaceExisting) {
|
|
46670
|
+
this.resetCamera();
|
|
46671
|
+
}
|
|
45472
46672
|
if (!suppressEvents) {
|
|
45473
46673
|
(0,triggerEvent/* ["default"] */.A)(this.element, enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, {
|
|
45474
46674
|
viewportId: this.id,
|
|
@@ -45478,10 +46678,14 @@ class VolumeViewport3DLegacyAdapter extends viewport3D/* ["default"] */.A {
|
|
|
45478
46678
|
}
|
|
45479
46679
|
catch (error) {
|
|
45480
46680
|
dataIds.forEach((dataId) => {
|
|
46681
|
+
this.remountingDataIds.delete(dataId);
|
|
45481
46682
|
this.forgetData(dataId);
|
|
45482
46683
|
});
|
|
45483
46684
|
throw error;
|
|
45484
46685
|
}
|
|
46686
|
+
finally {
|
|
46687
|
+
dataIds.forEach((dataId) => this.remountingDataIds.delete(dataId));
|
|
46688
|
+
}
|
|
45485
46689
|
}
|
|
45486
46690
|
buildActorEntries(volumeInputArray, dataIds) {
|
|
45487
46691
|
return volumeInputArray.flatMap((volumeInput, index) => {
|
|
@@ -45563,6 +46767,9 @@ class VolumeViewport3DLegacyAdapter extends viewport3D/* ["default"] */.A {
|
|
|
45563
46767
|
return `__volume3d__:${this.id}:volume:${volumeId}`;
|
|
45564
46768
|
}
|
|
45565
46769
|
forgetData(dataId) {
|
|
46770
|
+
if (this.remountingDataIds.has(dataId)) {
|
|
46771
|
+
return;
|
|
46772
|
+
}
|
|
45566
46773
|
if (!this.managedDataIds.delete(dataId)) {
|
|
45567
46774
|
return;
|
|
45568
46775
|
}
|
|
@@ -46041,6 +47248,300 @@ function getViewportClassForInput(input) {
|
|
|
46041
47248
|
}
|
|
46042
47249
|
|
|
46043
47250
|
|
|
47251
|
+
},
|
|
47252
|
+
53703(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
47253
|
+
"use strict";
|
|
47254
|
+
/* import */ var _enums_VoxelStatistics_js__rspack_import_0 = __webpack_require__(10475);
|
|
47255
|
+
/* import */ var _utilities_voxelGrid_index_js__rspack_import_1 = __webpack_require__(49617);
|
|
47256
|
+
/* import */ var _utilities_getBufferConfiguration_js__rspack_import_2 = __webpack_require__(25752);
|
|
47257
|
+
/* import */ var _utilities_gpuSettingsPresets_js__rspack_import_3 = __webpack_require__(701);
|
|
47258
|
+
/* import */ var _init_js__rspack_import_4 = __webpack_require__(90934);
|
|
47259
|
+
/* import */ var _cache_classes_ImageVolume_js__rspack_import_5 = __webpack_require__(19564);
|
|
47260
|
+
|
|
47261
|
+
|
|
47262
|
+
|
|
47263
|
+
|
|
47264
|
+
|
|
47265
|
+
|
|
47266
|
+
class FullExtentTextureStrategy {
|
|
47267
|
+
constructor({ name, volume, grid, statistic = _enums_VoxelStatistics_js__rspack_import_0/* ["default"].Average */.A.Average, reductionCause, }) {
|
|
47268
|
+
this.active = false;
|
|
47269
|
+
this.name = name;
|
|
47270
|
+
this.volume = volume;
|
|
47271
|
+
this.grid = grid;
|
|
47272
|
+
this.statistic = statistic;
|
|
47273
|
+
this.reductionCause = reductionCause;
|
|
47274
|
+
}
|
|
47275
|
+
isReady() {
|
|
47276
|
+
return Boolean(this.volume.getTextureSet(this.name));
|
|
47277
|
+
}
|
|
47278
|
+
bindings() {
|
|
47279
|
+
const member = this.volume.getTextureSet(this.name)?.members()[0];
|
|
47280
|
+
if (!member) {
|
|
47281
|
+
return [];
|
|
47282
|
+
}
|
|
47283
|
+
return [
|
|
47284
|
+
{
|
|
47285
|
+
texture: member.texture,
|
|
47286
|
+
grid: member.grid,
|
|
47287
|
+
statistic: member.statistic,
|
|
47288
|
+
role: 'base',
|
|
47289
|
+
},
|
|
47290
|
+
];
|
|
47291
|
+
}
|
|
47292
|
+
activate() {
|
|
47293
|
+
const set = this.volume.getTextureSet(this.name);
|
|
47294
|
+
if (this.active && this.claimedSet === set) {
|
|
47295
|
+
return;
|
|
47296
|
+
}
|
|
47297
|
+
this.claimedSet =
|
|
47298
|
+
set && this.volume.claimTextureSet(this.name) ? set : undefined;
|
|
47299
|
+
this.active = true;
|
|
47300
|
+
}
|
|
47301
|
+
deactivate() {
|
|
47302
|
+
if (!this.active) {
|
|
47303
|
+
return;
|
|
47304
|
+
}
|
|
47305
|
+
if (this.claimedSet &&
|
|
47306
|
+
this.claimedSet === this.volume.getTextureSet(this.name)) {
|
|
47307
|
+
this.volume.releaseTextureSet(this.name);
|
|
47308
|
+
}
|
|
47309
|
+
this.claimedSet = undefined;
|
|
47310
|
+
this.active = false;
|
|
47311
|
+
}
|
|
47312
|
+
update() {
|
|
47313
|
+
if (this.active) {
|
|
47314
|
+
this.activate();
|
|
47315
|
+
}
|
|
47316
|
+
}
|
|
47317
|
+
}
|
|
47318
|
+
function componentsOf(volume) {
|
|
47319
|
+
return volume.voxelManager?.numberOfComponents || 1;
|
|
47320
|
+
}
|
|
47321
|
+
function bytesPerVoxelOf(volume) {
|
|
47322
|
+
return (0,_utilities_getBufferConfiguration_js__rspack_import_2/* .volumeTextureBytes */.Bw)(1, volume.dataType, componentsOf(volume));
|
|
47323
|
+
}
|
|
47324
|
+
function reducedStrategyName(factors, statistic = _enums_VoxelStatistics_js__rspack_import_0/* ["default"].Average */.A.Average) {
|
|
47325
|
+
const rounded = factors.map((factor) => Number(factor.toFixed(4)));
|
|
47326
|
+
return `reduced-${rounded.join('x')}/full-extent/${statistic}`;
|
|
47327
|
+
}
|
|
47328
|
+
function volumeTextureReductionFactors(volume, gpuSettings) {
|
|
47329
|
+
if (!gpuSettings ||
|
|
47330
|
+
!(0,_init_js__rspack_import_4/* .getLossyDownsampling */.GR)().final ||
|
|
47331
|
+
volume.isDynamicVolume?.() ||
|
|
47332
|
+
componentsOf(volume) > 1) {
|
|
47333
|
+
return [1, 1, 1];
|
|
47334
|
+
}
|
|
47335
|
+
const limits = (0,_utilities_gpuSettingsPresets_js__rspack_import_3/* .gridLimitsOfGpuSettings */.B$)(gpuSettings, bytesPerVoxelOf(volume));
|
|
47336
|
+
return (0,_utilities_voxelGrid_index_js__rspack_import_1.boxAverageReductionFactors)(volume.voxelGrid.dimensions, limits);
|
|
47337
|
+
}
|
|
47338
|
+
function reductionCauseOf(volume, gpuSettings) {
|
|
47339
|
+
if (!volumeTextureReductionFactors(volume, gpuSettings).some((f) => f > 1)) {
|
|
47340
|
+
return undefined;
|
|
47341
|
+
}
|
|
47342
|
+
const edgeFactors = (0,_utilities_voxelGrid_index_js__rspack_import_1.boxAverageReductionFactors)(volume.voxelGrid.dimensions, {
|
|
47343
|
+
maxEdge: gpuSettings.maxTextureEdge,
|
|
47344
|
+
});
|
|
47345
|
+
return edgeFactors.some((f) => f > 1) ? 'deviceTextureLimit' : 'memoryBudget';
|
|
47346
|
+
}
|
|
47347
|
+
function provisionFullResolutionStrategy({ volume, gpuSettings, }) {
|
|
47348
|
+
const grid = volume.voxelGrid;
|
|
47349
|
+
const factors = volumeTextureReductionFactors(volume, gpuSettings);
|
|
47350
|
+
if (factors.some((factor) => factor > 1)) {
|
|
47351
|
+
return undefined;
|
|
47352
|
+
}
|
|
47353
|
+
const set = volume.provisionTextureSet({
|
|
47354
|
+
name: _cache_classes_ImageVolume_js__rspack_import_5/* .FULL_RESOLUTION_TEXTURE_SET */.gl,
|
|
47355
|
+
grids: [grid],
|
|
47356
|
+
coverage: 'full-extent',
|
|
47357
|
+
backstop: true,
|
|
47358
|
+
});
|
|
47359
|
+
if (!set) {
|
|
47360
|
+
return undefined;
|
|
47361
|
+
}
|
|
47362
|
+
return new FullExtentTextureStrategy({
|
|
47363
|
+
name: _cache_classes_ImageVolume_js__rspack_import_5/* .FULL_RESOLUTION_TEXTURE_SET */.gl,
|
|
47364
|
+
volume,
|
|
47365
|
+
grid,
|
|
47366
|
+
});
|
|
47367
|
+
}
|
|
47368
|
+
function provisionReducedResolutionStrategy({ volume, gpuSettings, }) {
|
|
47369
|
+
const fullResolutionGrid = volume.voxelGrid;
|
|
47370
|
+
const factors = volumeTextureReductionFactors(volume, gpuSettings);
|
|
47371
|
+
if (!factors.some((factor) => factor > 1)) {
|
|
47372
|
+
return undefined;
|
|
47373
|
+
}
|
|
47374
|
+
const statistic = volume.reductionStatistic ?? _enums_VoxelStatistics_js__rspack_import_0/* ["default"].Average */.A.Average;
|
|
47375
|
+
const grid = (0,_utilities_voxelGrid_index_js__rspack_import_1.deriveBoxAverageGrid)(fullResolutionGrid, { factors });
|
|
47376
|
+
const name = reducedStrategyName(factors, statistic);
|
|
47377
|
+
const set = volume.provisionTextureSet({
|
|
47378
|
+
name,
|
|
47379
|
+
grids: [grid],
|
|
47380
|
+
coverage: 'full-extent',
|
|
47381
|
+
statistic,
|
|
47382
|
+
});
|
|
47383
|
+
if (!set) {
|
|
47384
|
+
return undefined;
|
|
47385
|
+
}
|
|
47386
|
+
return new FullExtentTextureStrategy({
|
|
47387
|
+
name,
|
|
47388
|
+
volume,
|
|
47389
|
+
grid,
|
|
47390
|
+
statistic,
|
|
47391
|
+
reductionCause: reductionCauseOf(volume, gpuSettings),
|
|
47392
|
+
});
|
|
47393
|
+
}
|
|
47394
|
+
const defaultVolumeStrategyProvider = (context) => {
|
|
47395
|
+
const strategies = [];
|
|
47396
|
+
const full = provisionFullResolutionStrategy(context);
|
|
47397
|
+
if (full) {
|
|
47398
|
+
strategies.push(full);
|
|
47399
|
+
return strategies;
|
|
47400
|
+
}
|
|
47401
|
+
const reduced = provisionReducedResolutionStrategy(context);
|
|
47402
|
+
if (reduced) {
|
|
47403
|
+
strategies.push(reduced);
|
|
47404
|
+
}
|
|
47405
|
+
return strategies;
|
|
47406
|
+
};
|
|
47407
|
+
const selectFirstReadyStrategy = ({ strategies, previous, }) => {
|
|
47408
|
+
if (previous?.isReady()) {
|
|
47409
|
+
return previous;
|
|
47410
|
+
}
|
|
47411
|
+
return strategies.find((strategy) => strategy.isReady());
|
|
47412
|
+
};
|
|
47413
|
+
|
|
47414
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
47415
|
+
Bs: () => (volumeTextureReductionFactors),
|
|
47416
|
+
wH: () => (reductionCauseOf)
|
|
47417
|
+
}, {
|
|
47418
|
+
uy: defaultVolumeStrategyProvider,
|
|
47419
|
+
zz: selectFirstReadyStrategy
|
|
47420
|
+
});
|
|
47421
|
+
|
|
47422
|
+
|
|
47423
|
+
},
|
|
47424
|
+
81395(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
47425
|
+
"use strict";
|
|
47426
|
+
/* import */ var _enums_index_js__rspack_import_0 = __webpack_require__(71088);
|
|
47427
|
+
/* import */ var _eventTarget_js__rspack_import_1 = __webpack_require__(45340);
|
|
47428
|
+
/* import */ var _utilities_gpuSettingsPresets_js__rspack_import_2 = __webpack_require__(701);
|
|
47429
|
+
/* import */ var _GenericViewport_renderingFidelity_js__rspack_import_3 = __webpack_require__(67746);
|
|
47430
|
+
|
|
47431
|
+
|
|
47432
|
+
|
|
47433
|
+
|
|
47434
|
+
const volumeEventTypes = [
|
|
47435
|
+
_enums_index_js__rspack_import_0.Events.IMAGE_VOLUME_MODIFIED,
|
|
47436
|
+
_enums_index_js__rspack_import_0.Events.IMAGE_VOLUME_LOADING_COMPLETED,
|
|
47437
|
+
_enums_index_js__rspack_import_0.Events.VOLUME_TEXTURE_LIMITS_CHANGED,
|
|
47438
|
+
];
|
|
47439
|
+
function provisionStrategies(rendering, provideStrategies, reason) {
|
|
47440
|
+
const held = rendering.strategies ?? [];
|
|
47441
|
+
const built = provideStrategies({
|
|
47442
|
+
volume: rendering.imageVolume,
|
|
47443
|
+
gpuSettings: (0,_utilities_gpuSettingsPresets_js__rspack_import_2/* .gpuSettingsForRender */.je)(),
|
|
47444
|
+
viewportId: rendering.viewportId,
|
|
47445
|
+
reason,
|
|
47446
|
+
});
|
|
47447
|
+
const strategies = built.map((fresh) => held.find((existing) => existing.name === fresh.name) ?? fresh);
|
|
47448
|
+
for (const existing of held) {
|
|
47449
|
+
if (!strategies.includes(existing)) {
|
|
47450
|
+
existing.deactivate();
|
|
47451
|
+
}
|
|
47452
|
+
}
|
|
47453
|
+
rendering.strategies = strategies;
|
|
47454
|
+
if (rendering.strategy && !strategies.includes(rendering.strategy)) {
|
|
47455
|
+
rendering.strategy = undefined;
|
|
47456
|
+
rendering.boundTexture = undefined;
|
|
47457
|
+
}
|
|
47458
|
+
}
|
|
47459
|
+
function applyStrategy(rendering, hooks) {
|
|
47460
|
+
const volume = rendering.imageVolume;
|
|
47461
|
+
if (!volume?.voxelGrid) {
|
|
47462
|
+
return;
|
|
47463
|
+
}
|
|
47464
|
+
const selected = hooks.selectStrategy({
|
|
47465
|
+
strategies: rendering.strategies ?? [],
|
|
47466
|
+
previous: rendering.strategy,
|
|
47467
|
+
volume,
|
|
47468
|
+
viewportId: rendering.viewportId,
|
|
47469
|
+
});
|
|
47470
|
+
if (selected !== rendering.strategy) {
|
|
47471
|
+
rendering.strategy?.deactivate();
|
|
47472
|
+
selected?.activate();
|
|
47473
|
+
rendering.strategy = selected;
|
|
47474
|
+
}
|
|
47475
|
+
selected?.update();
|
|
47476
|
+
bindStrategy(rendering, selected, hooks);
|
|
47477
|
+
}
|
|
47478
|
+
function bindStrategy(rendering, strategy, hooks) {
|
|
47479
|
+
const bindings = strategy?.bindings() ?? [];
|
|
47480
|
+
const base = bindings.find((binding) => binding.role === 'base');
|
|
47481
|
+
const textureChanged = !!base && base.texture !== rendering.boundTexture;
|
|
47482
|
+
const mapper = rendering.mapper;
|
|
47483
|
+
if (textureChanged) {
|
|
47484
|
+
mapper.setScalarTexture?.(base.texture);
|
|
47485
|
+
mapper.modified();
|
|
47486
|
+
rendering.boundTexture = base.texture;
|
|
47487
|
+
}
|
|
47488
|
+
if (base) {
|
|
47489
|
+
rendering.boundGrid = { grid: base.grid, statistic: base.statistic };
|
|
47490
|
+
rendering.reductionCause = strategy.reductionCause;
|
|
47491
|
+
}
|
|
47492
|
+
if (textureChanged || rendering.fidelityStale || !rendering.voxelQuality) {
|
|
47493
|
+
rendering.voxelQuality = (0,_GenericViewport_renderingFidelity_js__rspack_import_3/* .readBoundQuality */.Kc)(rendering.imageVolume, rendering.boundGrid);
|
|
47494
|
+
rendering.fidelityStale = false;
|
|
47495
|
+
}
|
|
47496
|
+
rendering.qualityPending = (0,_GenericViewport_renderingFidelity_js__rspack_import_3/* .isBindingPending */.l_)(rendering.imageVolume, rendering.boundTexture);
|
|
47497
|
+
rendering.fullGrid = rendering.imageVolume.voxelGrid;
|
|
47498
|
+
hooks.onBind?.(rendering, textureChanged);
|
|
47499
|
+
}
|
|
47500
|
+
function onVolumeData(rendering, eventType, hooks) {
|
|
47501
|
+
if (!rendering.excludeFromFidelity) {
|
|
47502
|
+
rendering.fidelityStale = true;
|
|
47503
|
+
}
|
|
47504
|
+
if (eventType === _enums_index_js__rspack_import_0.Events.IMAGE_VOLUME_MODIFIED) {
|
|
47505
|
+
return;
|
|
47506
|
+
}
|
|
47507
|
+
provisionStrategies(rendering, hooks.provideStrategies, eventType === _enums_index_js__rspack_import_0.Events.IMAGE_VOLUME_LOADING_COMPLETED ? 'loaded' : 'memory');
|
|
47508
|
+
applyStrategy(rendering, hooks);
|
|
47509
|
+
}
|
|
47510
|
+
function refreshFidelity(rendering) {
|
|
47511
|
+
if (rendering.fidelityStale) {
|
|
47512
|
+
rendering.fidelityStale = false;
|
|
47513
|
+
rendering.voxelQuality = (0,_GenericViewport_renderingFidelity_js__rspack_import_3/* .readBoundQuality */.Kc)(rendering.imageVolume, rendering.boundGrid);
|
|
47514
|
+
}
|
|
47515
|
+
rendering.qualityPending = (0,_GenericViewport_renderingFidelity_js__rspack_import_3/* .isBindingPending */.l_)(rendering.imageVolume, rendering.boundTexture);
|
|
47516
|
+
}
|
|
47517
|
+
function releaseStrategies(rendering) {
|
|
47518
|
+
rendering.strategy?.deactivate();
|
|
47519
|
+
rendering.strategy = undefined;
|
|
47520
|
+
rendering.strategies = undefined;
|
|
47521
|
+
}
|
|
47522
|
+
function subscribeToVolumeEvents(volumeId, onEvent) {
|
|
47523
|
+
const handle = (evt) => {
|
|
47524
|
+
const detail = evt.detail;
|
|
47525
|
+
if (evt.type !== _enums_index_js__rspack_import_0.Events.VOLUME_TEXTURE_LIMITS_CHANGED &&
|
|
47526
|
+
detail?.volumeId !== volumeId) {
|
|
47527
|
+
return;
|
|
47528
|
+
}
|
|
47529
|
+
onEvent(evt.type);
|
|
47530
|
+
};
|
|
47531
|
+
volumeEventTypes.forEach((type) => _eventTarget_js__rspack_import_1/* ["default"].addEventListener */.A.addEventListener(type, handle));
|
|
47532
|
+
return () => volumeEventTypes.forEach((type) => _eventTarget_js__rspack_import_1/* ["default"].removeEventListener */.A.removeEventListener(type, handle));
|
|
47533
|
+
}
|
|
47534
|
+
|
|
47535
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
47536
|
+
Aq: () => (applyStrategy),
|
|
47537
|
+
Em: () => (onVolumeData),
|
|
47538
|
+
Fo: () => (subscribeToVolumeEvents),
|
|
47539
|
+
Mi: () => (refreshFidelity),
|
|
47540
|
+
T4: () => (releaseStrategies),
|
|
47541
|
+
VQ: () => (provisionStrategies)
|
|
47542
|
+
});
|
|
47543
|
+
|
|
47544
|
+
|
|
46044
47545
|
},
|
|
46045
47546
|
60131(__unused_rspack___webpack_module__, __unused_rspack___webpack_exports__, __webpack_require__) {
|
|
46046
47547
|
"use strict";
|
|
@@ -46102,6 +47603,7 @@ class ContextPoolRenderingEngine_ContextPoolRenderingEngine extends BaseRenderin
|
|
|
46102
47603
|
this._animationFrameHandle = null;
|
|
46103
47604
|
return;
|
|
46104
47605
|
}
|
|
47606
|
+
const renderStart = performance.now();
|
|
46105
47607
|
const eventDetails = viewportsToRender.map((viewport) => {
|
|
46106
47608
|
const eventDetail = this.renderViewportUsingCustomOrVtkPipeline(viewport);
|
|
46107
47609
|
viewport.setRendered();
|
|
@@ -46110,11 +47612,13 @@ class ContextPoolRenderingEngine_ContextPoolRenderingEngine extends BaseRenderin
|
|
|
46110
47612
|
});
|
|
46111
47613
|
this._animationFrameSet = false;
|
|
46112
47614
|
this._animationFrameHandle = null;
|
|
46113
|
-
|
|
46114
|
-
|
|
47615
|
+
const waiting = viewportsToRender.map((vp) => this._waitsForStorage(vp, renderStart));
|
|
47616
|
+
eventDetails.forEach((eventDetail, index) => {
|
|
47617
|
+
if (eventDetail?.element && !waiting[index]) {
|
|
46115
47618
|
(0,triggerEvent/* ["default"] */.A)(eventDetail.element, Events/* ["default"].IMAGE_RENDERED */.A.IMAGE_RENDERED, eventDetail);
|
|
46116
47619
|
}
|
|
46117
47620
|
});
|
|
47621
|
+
this._notifyFidelityOfRenderedViewports(viewportsToRender.filter((_vp, index) => !waiting[index]));
|
|
46118
47622
|
};
|
|
46119
47623
|
if (!this.useCPURendering) {
|
|
46120
47624
|
this.ensureContextPool();
|
|
@@ -46828,6 +48332,10 @@ class StreamingDynamicImageVolume extends _BaseStreamingImageVolume_js__rspack_i
|
|
|
46828
48332
|
flatImageIdIndexToDimensionGroupNumber(flatImageIdIndex) {
|
|
46829
48333
|
return Math.floor(flatImageIdIndex / this._imageIdGroups[0].length) + 1;
|
|
46830
48334
|
}
|
|
48335
|
+
isInCurrentDimensionGroup(flatImageIdIndex) {
|
|
48336
|
+
return (this.flatImageIdIndexToDimensionGroupNumber(flatImageIdIndex) ===
|
|
48337
|
+
this._dimensionGroupNumber);
|
|
48338
|
+
}
|
|
46831
48339
|
flatImageIdIndexToImageIdIndex(flatImageIdIndex) {
|
|
46832
48340
|
return flatImageIdIndex % this._imageIdGroups[0].length;
|
|
46833
48341
|
}
|
|
@@ -46962,6 +48470,276 @@ class Surface {
|
|
|
46962
48470
|
}
|
|
46963
48471
|
|
|
46964
48472
|
|
|
48473
|
+
},
|
|
48474
|
+
97896(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
48475
|
+
"use strict";
|
|
48476
|
+
/* import */ var _enums_VoxelStatistics_js__rspack_import_0 = __webpack_require__(10475);
|
|
48477
|
+
/* import */ var _utilities_voxelGrid_index_js__rspack_import_1 = __webpack_require__(49617);
|
|
48478
|
+
|
|
48479
|
+
|
|
48480
|
+
class VolumeTextureSet {
|
|
48481
|
+
constructor(description) {
|
|
48482
|
+
this.references = 0;
|
|
48483
|
+
this.lastUsed = 0;
|
|
48484
|
+
this.slots = [];
|
|
48485
|
+
this.slotsById = new Map();
|
|
48486
|
+
this.name = description.name;
|
|
48487
|
+
this.volumeGrid = description.volumeGrid;
|
|
48488
|
+
this.statistic = description.statistic ?? _enums_VoxelStatistics_js__rspack_import_0/* ["default"].Average */.A.Average;
|
|
48489
|
+
this.coverage = description.coverage ?? 'full-extent';
|
|
48490
|
+
this.spacing = description.spacing;
|
|
48491
|
+
this.backstop = description.backstop ?? false;
|
|
48492
|
+
}
|
|
48493
|
+
members() {
|
|
48494
|
+
return [...this.slots];
|
|
48495
|
+
}
|
|
48496
|
+
get size() {
|
|
48497
|
+
return this.slots.length;
|
|
48498
|
+
}
|
|
48499
|
+
get bytes() {
|
|
48500
|
+
return this.slots.reduce((total, slot) => total + slot.bytes, 0);
|
|
48501
|
+
}
|
|
48502
|
+
get(id) {
|
|
48503
|
+
return this.slotsById.get(id);
|
|
48504
|
+
}
|
|
48505
|
+
add(slot) {
|
|
48506
|
+
this.slots.push(slot);
|
|
48507
|
+
this.slotsById.set(slot.id, slot);
|
|
48508
|
+
return slot;
|
|
48509
|
+
}
|
|
48510
|
+
markDirty(bounds, onSlice) {
|
|
48511
|
+
for (const slot of this.slots) {
|
|
48512
|
+
const { grid } = slot;
|
|
48513
|
+
const region = (0,_utilities_voxelGrid_index_js__rspack_import_1.intersectBounds)((0,_utilities_voxelGrid_index_js__rspack_import_1.mapBoundsBetweenGrids)(this.volumeGrid, grid, bounds), (0,_utilities_voxelGrid_index_js__rspack_import_1.boundsOfGrid)(grid));
|
|
48514
|
+
if ((0,_utilities_voxelGrid_index_js__rspack_import_1.volumeOfBounds)(region) === 0) {
|
|
48515
|
+
continue;
|
|
48516
|
+
}
|
|
48517
|
+
if (onSlice) {
|
|
48518
|
+
for (let slice = region[2][0]; slice <= region[2][1]; slice++) {
|
|
48519
|
+
onSlice(slot, slice);
|
|
48520
|
+
}
|
|
48521
|
+
}
|
|
48522
|
+
addRegion(slot, region);
|
|
48523
|
+
}
|
|
48524
|
+
}
|
|
48525
|
+
markAllDirty(onSlice) {
|
|
48526
|
+
for (const slot of this.slots) {
|
|
48527
|
+
const region = (0,_utilities_voxelGrid_index_js__rspack_import_1.boundsOfGrid)(slot.grid);
|
|
48528
|
+
if (onSlice) {
|
|
48529
|
+
for (let slice = region[2][0]; slice <= region[2][1]; slice++) {
|
|
48530
|
+
onSlice(slot, slice);
|
|
48531
|
+
}
|
|
48532
|
+
}
|
|
48533
|
+
addRegion(slot, region);
|
|
48534
|
+
}
|
|
48535
|
+
}
|
|
48536
|
+
}
|
|
48537
|
+
function addRegion(slot, region) {
|
|
48538
|
+
if (slot.dirty.some((existing) => (0,_utilities_voxelGrid_index_js__rspack_import_1.containsBounds)(existing, region))) {
|
|
48539
|
+
return;
|
|
48540
|
+
}
|
|
48541
|
+
slot.dirty = slot.dirty.filter((existing) => !(0,_utilities_voxelGrid_index_js__rspack_import_1.containsBounds)(region, existing));
|
|
48542
|
+
slot.dirty.push(region);
|
|
48543
|
+
}
|
|
48544
|
+
|
|
48545
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
48546
|
+
W: () => (VolumeTextureSet)
|
|
48547
|
+
});
|
|
48548
|
+
|
|
48549
|
+
|
|
48550
|
+
},
|
|
48551
|
+
82340(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
48552
|
+
"use strict";
|
|
48553
|
+
/* import */ var _enums_VoxelStatistics_js__rspack_import_0 = __webpack_require__(10475);
|
|
48554
|
+
/* import */ var _utilities_getBufferConfiguration_js__rspack_import_1 = __webpack_require__(25752);
|
|
48555
|
+
/* import */ var _utilities_voxelGrid_index_js__rspack_import_2 = __webpack_require__(49617);
|
|
48556
|
+
/* import */ var _classes_VolumeTextureSet_js__rspack_import_3 = __webpack_require__(97896);
|
|
48557
|
+
/* import */ var _utilities_logger_js__rspack_import_4 = __webpack_require__(34040);
|
|
48558
|
+
/* import */ var _eventTarget_js__rspack_import_5 = __webpack_require__(45340);
|
|
48559
|
+
/* import */ var _enums_Events_js__rspack_import_6 = __webpack_require__(33635);
|
|
48560
|
+
|
|
48561
|
+
|
|
48562
|
+
|
|
48563
|
+
|
|
48564
|
+
|
|
48565
|
+
|
|
48566
|
+
|
|
48567
|
+
const log = _utilities_logger_js__rspack_import_4.coreLog.getLogger('cache', 'volumeTextureStore');
|
|
48568
|
+
class VolumeTextureStore {
|
|
48569
|
+
constructor() {
|
|
48570
|
+
this.sets = new Map();
|
|
48571
|
+
this.budgetBytes = 0;
|
|
48572
|
+
this.clock = 0;
|
|
48573
|
+
}
|
|
48574
|
+
get bytesUsed() {
|
|
48575
|
+
let total = 0;
|
|
48576
|
+
for (const stored of this.sets.values()) {
|
|
48577
|
+
total += stored.set.bytes;
|
|
48578
|
+
}
|
|
48579
|
+
return total;
|
|
48580
|
+
}
|
|
48581
|
+
get budget() {
|
|
48582
|
+
return this.budgetBytes;
|
|
48583
|
+
}
|
|
48584
|
+
setBudget(bytes) {
|
|
48585
|
+
this.budgetBytes = bytes > 0 ? bytes : 0;
|
|
48586
|
+
}
|
|
48587
|
+
get bytesAvailable() {
|
|
48588
|
+
return this.budgetBytes > 0
|
|
48589
|
+
? Math.max(this.budgetBytes - this.bytesUsed, 0)
|
|
48590
|
+
: Number.POSITIVE_INFINITY;
|
|
48591
|
+
}
|
|
48592
|
+
setsOfVolume(volumeId) {
|
|
48593
|
+
const found = [];
|
|
48594
|
+
for (const stored of this.sets.values()) {
|
|
48595
|
+
if (stored.volumeId === volumeId) {
|
|
48596
|
+
found.push(stored.set);
|
|
48597
|
+
}
|
|
48598
|
+
}
|
|
48599
|
+
return found;
|
|
48600
|
+
}
|
|
48601
|
+
getSet(volumeId, name) {
|
|
48602
|
+
return this.sets.get(keyOf(volumeId, name))?.set;
|
|
48603
|
+
}
|
|
48604
|
+
costOf(grid, dataType, numberOfComponents = 1) {
|
|
48605
|
+
return (0,_utilities_getBufferConfiguration_js__rspack_import_1/* .volumeTextureBytes */.Bw)((0,_utilities_voxelGrid_index_js__rspack_import_2.voxelCountOfGrid)(grid), dataType, numberOfComponents);
|
|
48606
|
+
}
|
|
48607
|
+
provision(options) {
|
|
48608
|
+
const { volumeId, name, volumeGrid, grids, dataType, numberOfComponents = 1, statistic = _enums_VoxelStatistics_js__rspack_import_0/* ["default"].Average */.A.Average, coverage, backstop, createTexture, destroyTexture, applyGrid, limits, } = options;
|
|
48609
|
+
const key = keyOf(volumeId, name);
|
|
48610
|
+
const existing = this.sets.get(key);
|
|
48611
|
+
if (existing) {
|
|
48612
|
+
existing.set.lastUsed = ++this.clock;
|
|
48613
|
+
return existing.set;
|
|
48614
|
+
}
|
|
48615
|
+
if (grids.length === 0) {
|
|
48616
|
+
return undefined;
|
|
48617
|
+
}
|
|
48618
|
+
for (const grid of grids) {
|
|
48619
|
+
if (!(0,_utilities_voxelGrid_index_js__rspack_import_2.voxelGridWithinLimits)(grid, limits)) {
|
|
48620
|
+
log.warn(`the set ${name} of the volume ${volumeId} holds a grid of ${grid.dimensions} that exceeds the limits, so nothing is built`);
|
|
48621
|
+
return undefined;
|
|
48622
|
+
}
|
|
48623
|
+
}
|
|
48624
|
+
const perTexture = grids.map((grid) => this.costOf(grid, dataType, numberOfComponents));
|
|
48625
|
+
const bytes = perTexture.reduce((total, cost) => total + cost, 0);
|
|
48626
|
+
if (!this.makeRoomFor(bytes)) {
|
|
48627
|
+
log.warn(`the budget of ${this.budgetBytes} bytes cannot hold the set ${name} of the volume ${volumeId}, which costs ${bytes} bytes`);
|
|
48628
|
+
return undefined;
|
|
48629
|
+
}
|
|
48630
|
+
const set = new _classes_VolumeTextureSet_js__rspack_import_3/* .VolumeTextureSet */.W({
|
|
48631
|
+
name,
|
|
48632
|
+
volumeGrid,
|
|
48633
|
+
statistic,
|
|
48634
|
+
coverage: coverage ?? (grids.length === 1 ? 'full-extent' : 'partial'),
|
|
48635
|
+
spacing: grids[0].spacing,
|
|
48636
|
+
backstop,
|
|
48637
|
+
});
|
|
48638
|
+
grids.forEach((grid, index) => {
|
|
48639
|
+
const id = `${name}#${index}`;
|
|
48640
|
+
const texture = createTexture({ grid, statistic, setName: name, id });
|
|
48641
|
+
applyGrid?.(texture, grid);
|
|
48642
|
+
const slot = {
|
|
48643
|
+
id,
|
|
48644
|
+
grid,
|
|
48645
|
+
statistic,
|
|
48646
|
+
texture,
|
|
48647
|
+
bytes: perTexture[index],
|
|
48648
|
+
dirty: [],
|
|
48649
|
+
};
|
|
48650
|
+
set.add(slot);
|
|
48651
|
+
});
|
|
48652
|
+
set.markAllDirty(options.markTextureSlice);
|
|
48653
|
+
set.lastUsed = ++this.clock;
|
|
48654
|
+
this.sets.set(key, {
|
|
48655
|
+
volumeId,
|
|
48656
|
+
set: set,
|
|
48657
|
+
destroyTexture: destroyTexture,
|
|
48658
|
+
});
|
|
48659
|
+
return set;
|
|
48660
|
+
}
|
|
48661
|
+
claim(volumeId, name) {
|
|
48662
|
+
const stored = this.sets.get(keyOf(volumeId, name));
|
|
48663
|
+
if (!stored) {
|
|
48664
|
+
return false;
|
|
48665
|
+
}
|
|
48666
|
+
stored.set.references++;
|
|
48667
|
+
stored.set.lastUsed = ++this.clock;
|
|
48668
|
+
return true;
|
|
48669
|
+
}
|
|
48670
|
+
release(volumeId, name) {
|
|
48671
|
+
const stored = this.sets.get(keyOf(volumeId, name));
|
|
48672
|
+
if (!stored) {
|
|
48673
|
+
return false;
|
|
48674
|
+
}
|
|
48675
|
+
stored.set.references = Math.max(stored.set.references - 1, 0);
|
|
48676
|
+
return true;
|
|
48677
|
+
}
|
|
48678
|
+
evict(volumeId, name) {
|
|
48679
|
+
const key = keyOf(volumeId, name);
|
|
48680
|
+
const stored = this.sets.get(key);
|
|
48681
|
+
if (!stored) {
|
|
48682
|
+
return false;
|
|
48683
|
+
}
|
|
48684
|
+
this.sets.delete(key);
|
|
48685
|
+
if (stored.destroyTexture) {
|
|
48686
|
+
for (const slot of stored.set.members()) {
|
|
48687
|
+
stored.destroyTexture(slot.texture);
|
|
48688
|
+
}
|
|
48689
|
+
}
|
|
48690
|
+
return true;
|
|
48691
|
+
}
|
|
48692
|
+
evictVolume(volumeId) {
|
|
48693
|
+
for (const stored of [...this.sets.values()]) {
|
|
48694
|
+
if (stored.volumeId === volumeId) {
|
|
48695
|
+
this.evict(volumeId, stored.set.name);
|
|
48696
|
+
}
|
|
48697
|
+
}
|
|
48698
|
+
}
|
|
48699
|
+
clear() {
|
|
48700
|
+
for (const [, stored] of [...this.sets.entries()]) {
|
|
48701
|
+
this.evictVolume(stored.volumeId);
|
|
48702
|
+
}
|
|
48703
|
+
}
|
|
48704
|
+
makeRoomFor(bytes) {
|
|
48705
|
+
const used = this.bytesUsed;
|
|
48706
|
+
if (this.budgetBytes <= 0 || used + bytes <= this.budgetBytes) {
|
|
48707
|
+
return true;
|
|
48708
|
+
}
|
|
48709
|
+
const evictable = [...this.sets.values()].filter((stored) => stored.set.references === 0);
|
|
48710
|
+
const evictableBytes = evictable.reduce((total, stored) => total + stored.set.bytes, 0);
|
|
48711
|
+
if (used - evictableBytes + bytes > this.budgetBytes) {
|
|
48712
|
+
return false;
|
|
48713
|
+
}
|
|
48714
|
+
evictable.sort((a, b) => {
|
|
48715
|
+
if (a.set.backstop !== b.set.backstop) {
|
|
48716
|
+
return a.set.backstop ? 1 : -1;
|
|
48717
|
+
}
|
|
48718
|
+
return a.set.lastUsed - b.set.lastUsed;
|
|
48719
|
+
});
|
|
48720
|
+
for (const stored of evictable) {
|
|
48721
|
+
this.evict(stored.volumeId, stored.set.name);
|
|
48722
|
+
if (this.bytesUsed + bytes <= this.budgetBytes) {
|
|
48723
|
+
return true;
|
|
48724
|
+
}
|
|
48725
|
+
}
|
|
48726
|
+
return false;
|
|
48727
|
+
}
|
|
48728
|
+
}
|
|
48729
|
+
function keyOf(volumeId, name) {
|
|
48730
|
+
return JSON.stringify([volumeId, name]);
|
|
48731
|
+
}
|
|
48732
|
+
const volumeTextureStore = new VolumeTextureStore();
|
|
48733
|
+
_eventTarget_js__rspack_import_5/* ["default"].addEventListener */.A.addEventListener(_enums_Events_js__rspack_import_6/* ["default"].VOLUME_CACHE_VOLUME_REMOVED */.A.VOLUME_CACHE_VOLUME_REMOVED, (evt) => {
|
|
48734
|
+
const { volumeId } = evt.detail ?? {};
|
|
48735
|
+
if (volumeId) {
|
|
48736
|
+
volumeTextureStore.evictVolume(volumeId);
|
|
48737
|
+
}
|
|
48738
|
+
});
|
|
48739
|
+
|
|
48740
|
+
/* export default */ __webpack_exports__.Ay = (volumeTextureStore);
|
|
48741
|
+
|
|
48742
|
+
|
|
46965
48743
|
},
|
|
46966
48744
|
56581(__unused_rspack___webpack_module__, __webpack_exports__) {
|
|
46967
48745
|
"use strict";
|
|
@@ -48942,8 +50720,10 @@ var Events;
|
|
|
48942
50720
|
Events["ELEMENT_DISABLED"] = "CORNERSTONE_ELEMENT_DISABLED";
|
|
48943
50721
|
Events["ELEMENT_ENABLED"] = "CORNERSTONE_ELEMENT_ENABLED";
|
|
48944
50722
|
Events["IMAGE_RENDERED"] = "CORNERSTONE_IMAGE_RENDERED";
|
|
50723
|
+
Events["VIEWPORT_FIDELITY_CHANGED"] = "CORNERSTONE_VIEWPORT_FIDELITY_CHANGED";
|
|
48945
50724
|
Events["IMAGE_VOLUME_MODIFIED"] = "CORNERSTONE_IMAGE_VOLUME_MODIFIED";
|
|
48946
50725
|
Events["IMAGE_VOLUME_LOADING_COMPLETED"] = "CORNERSTONE_IMAGE_VOLUME_LOADING_COMPLETED";
|
|
50726
|
+
Events["IMAGE_VOLUME_LOADING_CANCELLED"] = "CORNERSTONE_IMAGE_VOLUME_LOADING_CANCELLED";
|
|
48947
50727
|
Events["IMAGE_LOADED"] = "CORNERSTONE_IMAGE_LOADED";
|
|
48948
50728
|
Events["IMAGE_RETRIEVAL_STAGE"] = "CORNERSTONE_IMAGE_RETRIEVAL_STAGE";
|
|
48949
50729
|
Events["IMAGE_LOAD_FAILED"] = "CORNERSTONE_IMAGE_LOAD_FAILED";
|
|
@@ -48954,6 +50734,7 @@ var Events;
|
|
|
48954
50734
|
Events["IMAGE_CACHE_IMAGE_REMOVED"] = "CORNERSTONE_IMAGE_CACHE_IMAGE_REMOVED";
|
|
48955
50735
|
Events["VOLUME_CACHE_VOLUME_ADDED"] = "CORNERSTONE_VOLUME_CACHE_VOLUME_ADDED";
|
|
48956
50736
|
Events["VOLUME_CACHE_VOLUME_REMOVED"] = "CORNERSTONE_VOLUME_CACHE_VOLUME_REMOVED";
|
|
50737
|
+
Events["VOLUME_TEXTURE_LIMITS_CHANGED"] = "CORNERSTONE_VOLUME_TEXTURE_LIMITS_CHANGED";
|
|
48957
50738
|
Events["STACK_NEW_IMAGE"] = "CORNERSTONE_STACK_NEW_IMAGE";
|
|
48958
50739
|
Events["VOLUME_NEW_IMAGE"] = "CORNERSTONE_VOLUME_NEW_IMAGE";
|
|
48959
50740
|
Events["PRE_STACK_NEW_IMAGE"] = "CORNERSTONE_PRE_STACK_NEW_IMAGE";
|
|
@@ -48997,20 +50778,6 @@ var GeometryType;
|
|
|
48997
50778
|
/* export default */ __webpack_exports__.A = (GeometryType);
|
|
48998
50779
|
|
|
48999
50780
|
|
|
49000
|
-
},
|
|
49001
|
-
7330(__unused_rspack___webpack_module__, __webpack_exports__) {
|
|
49002
|
-
"use strict";
|
|
49003
|
-
var ImageQualityStatus;
|
|
49004
|
-
(function (ImageQualityStatus) {
|
|
49005
|
-
ImageQualityStatus[ImageQualityStatus["FAR_REPLICATE"] = 1] = "FAR_REPLICATE";
|
|
49006
|
-
ImageQualityStatus[ImageQualityStatus["ADJACENT_REPLICATE"] = 3] = "ADJACENT_REPLICATE";
|
|
49007
|
-
ImageQualityStatus[ImageQualityStatus["SUBRESOLUTION"] = 6] = "SUBRESOLUTION";
|
|
49008
|
-
ImageQualityStatus[ImageQualityStatus["LOSSY"] = 7] = "LOSSY";
|
|
49009
|
-
ImageQualityStatus[ImageQualityStatus["FULL_RESOLUTION"] = 8] = "FULL_RESOLUTION";
|
|
49010
|
-
})(ImageQualityStatus || (ImageQualityStatus = {}));
|
|
49011
|
-
/* export default */ __webpack_exports__.A = (ImageQualityStatus);
|
|
49012
|
-
|
|
49013
|
-
|
|
49014
50781
|
},
|
|
49015
50782
|
78078(__unused_rspack___webpack_module__, __webpack_exports__) {
|
|
49016
50783
|
"use strict";
|
|
@@ -49209,16 +50976,18 @@ var VoxelManagerEnum;
|
|
|
49209
50976
|
/* import */ var _configuration_singleRetrieve_js__rspack_import_0 = __webpack_require__(67999);
|
|
49210
50977
|
/* import */ var _configuration_sequentialRetrieve_js__rspack_import_1 = __webpack_require__(20776);
|
|
49211
50978
|
/* import */ var _configuration_interleavedRetrieve_js__rspack_import_2 = __webpack_require__(93028);
|
|
49212
|
-
/* import */ var
|
|
49213
|
-
/* import */ var
|
|
49214
|
-
/* import */ var
|
|
49215
|
-
/* import */ var
|
|
49216
|
-
/* import */ var
|
|
49217
|
-
/* import */ var
|
|
49218
|
-
/* import */ var
|
|
49219
|
-
/* import */ var
|
|
49220
|
-
/* import */ var
|
|
49221
|
-
/* import */ var
|
|
50979
|
+
/* import */ var _configuration_coarseInterleavedRetrieve_js__rspack_import_3 = __webpack_require__(5519);
|
|
50980
|
+
/* import */ var _imageLoader_js__rspack_import_4 = __webpack_require__(65092);
|
|
50981
|
+
/* import */ var _utilities_triggerEvent_js__rspack_import_5 = __webpack_require__(84444);
|
|
50982
|
+
/* import */ var _utilities_ProgressiveIterator_js__rspack_import_6 = __webpack_require__(56783);
|
|
50983
|
+
/* import */ var _utilities_decimate_js__rspack_import_7 = __webpack_require__(49230);
|
|
50984
|
+
/* import */ var _requestPool_imageLoadPoolManager_js__rspack_import_8 = __webpack_require__(7799);
|
|
50985
|
+
/* import */ var _enums_index_js__rspack_import_9 = __webpack_require__(71088);
|
|
50986
|
+
/* import */ var _cache_cache_js__rspack_import_10 = __webpack_require__(73998);
|
|
50987
|
+
/* import */ var _eventTarget_js__rspack_import_11 = __webpack_require__(45340);
|
|
50988
|
+
/* import */ var _fillNearbyFrames_js__rspack_import_12 = __webpack_require__(40092);
|
|
50989
|
+
/* import */ var _utilities_logger_js__rspack_import_13 = __webpack_require__(34040);
|
|
50990
|
+
/* import */ var _init_js__rspack_import_14 = __webpack_require__(90934);
|
|
49222
50991
|
|
|
49223
50992
|
|
|
49224
50993
|
|
|
@@ -49232,7 +51001,9 @@ var VoxelManagerEnum;
|
|
|
49232
51001
|
|
|
49233
51002
|
|
|
49234
51003
|
|
|
49235
|
-
|
|
51004
|
+
|
|
51005
|
+
|
|
51006
|
+
const log = _utilities_logger_js__rspack_import_13.coreLog.getLogger('loaders', 'ProgressiveRetrieveImages');
|
|
49236
51007
|
|
|
49237
51008
|
class ProgressiveRetrieveImages {
|
|
49238
51009
|
constructor(imageRetrieveConfiguration) {
|
|
@@ -49248,6 +51019,9 @@ ProgressiveRetrieveImages.createProgressive = createProgressive;
|
|
|
49248
51019
|
ProgressiveRetrieveImages.interleavedRetrieveStages = {
|
|
49249
51020
|
stages: _configuration_interleavedRetrieve_js__rspack_import_2/* ["default"] */.A,
|
|
49250
51021
|
};
|
|
51022
|
+
ProgressiveRetrieveImages.coarseInterleavedRetrieveStages = {
|
|
51023
|
+
stages: _configuration_coarseInterleavedRetrieve_js__rspack_import_3/* ["default"] */.A,
|
|
51024
|
+
};
|
|
49251
51025
|
ProgressiveRetrieveImages.singleRetrieveStages = {
|
|
49252
51026
|
stages: _configuration_singleRetrieve_js__rspack_import_0/* ["default"] */.A,
|
|
49253
51027
|
};
|
|
@@ -49258,7 +51032,7 @@ class ProgressiveRetrieveImagesInstance {
|
|
|
49258
51032
|
constructor(configuration, imageIds, listener) {
|
|
49259
51033
|
this.outstandingRequests = 0;
|
|
49260
51034
|
this.stageStatusMap = new Map();
|
|
49261
|
-
this.displayedIterator = new
|
|
51035
|
+
this.displayedIterator = new _utilities_ProgressiveIterator_js__rspack_import_6/* ["default"] */.A('displayed');
|
|
49262
51036
|
this.stages = configuration.stages;
|
|
49263
51037
|
this.retrieveOptions = configuration.retrieveOptions;
|
|
49264
51038
|
this.imageIds = imageIds;
|
|
@@ -49278,23 +51052,26 @@ class ProgressiveRetrieveImagesInstance {
|
|
|
49278
51052
|
sendRequest(request, options) {
|
|
49279
51053
|
const { imageId, next } = request;
|
|
49280
51054
|
const errorCallback = (reason, done) => {
|
|
51055
|
+
reported = true;
|
|
49281
51056
|
this.listener.errorCallback(imageId, complete || !next, reason);
|
|
49282
51057
|
if (done) {
|
|
49283
51058
|
this.updateStageStatus(request.stage, reason);
|
|
49284
51059
|
}
|
|
49285
51060
|
};
|
|
49286
|
-
const loadedPromise = (options.loader ||
|
|
49287
|
-
const uncompressedIterator =
|
|
51061
|
+
const loadedPromise = (options.loader || _imageLoader_js__rspack_import_4.loadAndCacheImage)(imageId, options);
|
|
51062
|
+
const uncompressedIterator = _utilities_ProgressiveIterator_js__rspack_import_6/* ["default"].as */.A.as(loadedPromise);
|
|
49288
51063
|
let complete = false;
|
|
51064
|
+
let reported = false;
|
|
49289
51065
|
uncompressedIterator
|
|
49290
51066
|
.forEach(async (image, done) => {
|
|
49291
|
-
const oldStatus =
|
|
51067
|
+
const oldStatus = _cache_cache_js__rspack_import_10/* ["default"].getImageQuality */.Ay.getImageQuality(imageId);
|
|
49292
51068
|
if (!image) {
|
|
49293
51069
|
log.warn('No image retrieved', imageId);
|
|
49294
51070
|
return;
|
|
49295
51071
|
}
|
|
49296
51072
|
const { imageQualityStatus } = image;
|
|
49297
|
-
complete ||= imageQualityStatus ===
|
|
51073
|
+
complete ||= imageQualityStatus === _enums_index_js__rspack_import_9.ImageQualityStatus.FULL_RESOLUTION;
|
|
51074
|
+
image.imageQualityPending = !complete && (!done || !!next);
|
|
49298
51075
|
if (oldStatus !== undefined && oldStatus > imageQualityStatus) {
|
|
49299
51076
|
this.updateStageStatus(request.stage, null, true);
|
|
49300
51077
|
return;
|
|
@@ -49304,16 +51081,22 @@ class ProgressiveRetrieveImagesInstance {
|
|
|
49304
51081
|
if (done) {
|
|
49305
51082
|
this.updateStageStatus(request.stage);
|
|
49306
51083
|
}
|
|
49307
|
-
(0,
|
|
51084
|
+
(0,_fillNearbyFrames_js__rspack_import_12/* .fillNearbyFrames */.t)(this.listener, request, image);
|
|
49308
51085
|
}, errorCallback)
|
|
49309
51086
|
.finally(() => {
|
|
49310
51087
|
if (!complete && next) {
|
|
49311
|
-
|
|
51088
|
+
_cache_cache_js__rspack_import_10/* ["default"].setPartialImage */.Ay.setPartialImage(imageId, undefined, true);
|
|
49312
51089
|
this.addRequest(next, options.streamingData);
|
|
49313
51090
|
}
|
|
49314
51091
|
else {
|
|
49315
51092
|
if (!complete) {
|
|
49316
|
-
|
|
51093
|
+
const shown = _cache_cache_js__rspack_import_10/* ["default"].getImage */.Ay.getImage(imageId);
|
|
51094
|
+
if (shown) {
|
|
51095
|
+
shown.imageQualityPending = false;
|
|
51096
|
+
}
|
|
51097
|
+
if (!reported) {
|
|
51098
|
+
this.listener.errorCallback(imageId, true, "Couldn't decode");
|
|
51099
|
+
}
|
|
49317
51100
|
}
|
|
49318
51101
|
this.outstandingRequests--;
|
|
49319
51102
|
for (let skip = next; skip; skip = skip.next) {
|
|
@@ -49343,9 +51126,12 @@ class ProgressiveRetrieveImagesInstance {
|
|
|
49343
51126
|
streamingData,
|
|
49344
51127
|
};
|
|
49345
51128
|
const priority = stage.priority ?? -5;
|
|
49346
|
-
const requestType = stage.requestType ||
|
|
49347
|
-
const additionalDetails = {
|
|
49348
|
-
|
|
51129
|
+
const requestType = stage.requestType || _enums_index_js__rspack_import_9.RequestType.Interaction;
|
|
51130
|
+
const additionalDetails = {
|
|
51131
|
+
imageId,
|
|
51132
|
+
volumeId: this.listener.volumeId,
|
|
51133
|
+
};
|
|
51134
|
+
_requestPool_imageLoadPoolManager_js__rspack_import_8/* ["default"].addRequest */.A.addRequest(this.sendRequest.bind(this, request, options), requestType, additionalDetails, priority);
|
|
49349
51135
|
}
|
|
49350
51136
|
updateStageStatus(stage, failure, skipped = false) {
|
|
49351
51137
|
const { id } = stage;
|
|
@@ -49372,7 +51158,7 @@ class ProgressiveRetrieveImagesInstance {
|
|
|
49372
51158
|
stageDurationInMS: stageStartTime ? Date.now() - stageStartTime : null,
|
|
49373
51159
|
startDurationInMS: Date.now() - startTime,
|
|
49374
51160
|
};
|
|
49375
|
-
(0,
|
|
51161
|
+
(0,_utilities_triggerEvent_js__rspack_import_5/* ["default"] */.A)(_eventTarget_js__rspack_import_11/* ["default"] */.A, _enums_index_js__rspack_import_9.Events.IMAGE_RETRIEVAL_STAGE, detail);
|
|
49376
51162
|
this.stageStatusMap.delete(id);
|
|
49377
51163
|
}
|
|
49378
51164
|
}
|
|
@@ -49407,7 +51193,7 @@ class ProgressiveRetrieveImagesInstance {
|
|
|
49407
51193
|
};
|
|
49408
51194
|
for (const stage of this.stages) {
|
|
49409
51195
|
const indices = stage.positions ||
|
|
49410
|
-
(0,
|
|
51196
|
+
(0,_utilities_decimate_js__rspack_import_7/* ["default"] */.A)(this.imageIds, stage.decimate || 1, stage.offset ?? 0);
|
|
49411
51197
|
indices.forEach((index) => {
|
|
49412
51198
|
addStageInstance(stage, index);
|
|
49413
51199
|
});
|
|
@@ -49416,7 +51202,7 @@ class ProgressiveRetrieveImagesInstance {
|
|
|
49416
51202
|
}
|
|
49417
51203
|
findNearbyRequests(index, stage) {
|
|
49418
51204
|
const nearby = new Array();
|
|
49419
|
-
if (!stage.nearbyFrames) {
|
|
51205
|
+
if (!stage.nearbyFrames || !(0,_init_js__rspack_import_14/* .getLossyDownsampling */.GR)().interleavedLoading) {
|
|
49420
51206
|
return nearby;
|
|
49421
51207
|
}
|
|
49422
51208
|
for (const nearbyItem of stage.nearbyFrames) {
|
|
@@ -50600,6 +52386,97 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
50600
52386
|
});
|
|
50601
52387
|
|
|
50602
52388
|
|
|
52389
|
+
},
|
|
52390
|
+
701(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
52391
|
+
"use strict";
|
|
52392
|
+
/* import */ var _init_js__rspack_import_0 = __webpack_require__(90934);
|
|
52393
|
+
/* import */ var _enums_Events_js__rspack_import_1 = __webpack_require__(33635);
|
|
52394
|
+
/* import */ var _eventTarget_js__rspack_import_2 = __webpack_require__(45340);
|
|
52395
|
+
/* import */ var _triggerEvent_js__rspack_import_3 = __webpack_require__(84444);
|
|
52396
|
+
|
|
52397
|
+
|
|
52398
|
+
|
|
52399
|
+
|
|
52400
|
+
const GIGABYTE = 1024 * 1024 * 1024;
|
|
52401
|
+
const PRESETS = {
|
|
52402
|
+
'low-tablet': {
|
|
52403
|
+
id: 'low-tablet',
|
|
52404
|
+
maxTextureEdge: 256,
|
|
52405
|
+
textureMemoryBytes: 1 * GIGABYTE,
|
|
52406
|
+
speed: 10,
|
|
52407
|
+
},
|
|
52408
|
+
low: {
|
|
52409
|
+
id: 'low',
|
|
52410
|
+
maxTextureEdge: 256,
|
|
52411
|
+
textureMemoryBytes: 2 * GIGABYTE,
|
|
52412
|
+
speed: 30,
|
|
52413
|
+
},
|
|
52414
|
+
medium: {
|
|
52415
|
+
id: 'medium',
|
|
52416
|
+
maxTextureEdge: 2048,
|
|
52417
|
+
textureMemoryBytes: 8 * GIGABYTE,
|
|
52418
|
+
speed: 60,
|
|
52419
|
+
},
|
|
52420
|
+
high: {
|
|
52421
|
+
id: 'high',
|
|
52422
|
+
maxTextureEdge: 2048,
|
|
52423
|
+
textureMemoryBytes: 32 * GIGABYTE,
|
|
52424
|
+
speed: 100,
|
|
52425
|
+
},
|
|
52426
|
+
'high-texture-4096': {
|
|
52427
|
+
id: 'high-texture-4096',
|
|
52428
|
+
maxTextureEdge: 4096,
|
|
52429
|
+
textureMemoryBytes: 32 * GIGABYTE,
|
|
52430
|
+
speed: 100,
|
|
52431
|
+
internal: true,
|
|
52432
|
+
},
|
|
52433
|
+
};
|
|
52434
|
+
const DEFAULT_PRESET_ID = 'high';
|
|
52435
|
+
let activePresetId = DEFAULT_PRESET_ID;
|
|
52436
|
+
function getGpuSettingsPresets() {
|
|
52437
|
+
return Object.values(PRESETS);
|
|
52438
|
+
}
|
|
52439
|
+
function getGpuSettingsPreset(id) {
|
|
52440
|
+
const preset = Object.prototype.hasOwnProperty.call(PRESETS, id)
|
|
52441
|
+
? PRESETS[id]
|
|
52442
|
+
: undefined;
|
|
52443
|
+
if (!preset) {
|
|
52444
|
+
throw new Error(`gpuSettingsPresets: there is no preset named ${id}`);
|
|
52445
|
+
}
|
|
52446
|
+
return preset;
|
|
52447
|
+
}
|
|
52448
|
+
function setGpuSettingsPreset(id) {
|
|
52449
|
+
getGpuSettingsPreset(id);
|
|
52450
|
+
activePresetId = id;
|
|
52451
|
+
triggerEvent(eventTarget, Events.VOLUME_TEXTURE_LIMITS_CHANGED);
|
|
52452
|
+
}
|
|
52453
|
+
function getActiveGpuSettings() {
|
|
52454
|
+
return getGpuSettingsPreset(activePresetId);
|
|
52455
|
+
}
|
|
52456
|
+
function gpuSettingsForRender() {
|
|
52457
|
+
return (0,_init_js__rspack_import_0/* .getLossyDownsampling */.GR)().final && !(0,_init_js__rspack_import_0/* .getShouldUseCPURendering */.LH)()
|
|
52458
|
+
? getActiveGpuSettings()
|
|
52459
|
+
: undefined;
|
|
52460
|
+
}
|
|
52461
|
+
function resetGpuSettingsPreset() {
|
|
52462
|
+
activePresetId = DEFAULT_PRESET_ID;
|
|
52463
|
+
triggerEvent(eventTarget, Events.VOLUME_TEXTURE_LIMITS_CHANGED);
|
|
52464
|
+
}
|
|
52465
|
+
function gridLimitsOfGpuSettings(gpuSettings, bytesPerVoxel) {
|
|
52466
|
+
const limits = { maxEdge: gpuSettings.maxTextureEdge };
|
|
52467
|
+
if (bytesPerVoxel > 0 && gpuSettings.textureMemoryBytes > 0) {
|
|
52468
|
+
limits.maxVoxelCount = Math.floor(gpuSettings.textureMemoryBytes / bytesPerVoxel);
|
|
52469
|
+
}
|
|
52470
|
+
return limits;
|
|
52471
|
+
}
|
|
52472
|
+
|
|
52473
|
+
|
|
52474
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
52475
|
+
B$: () => (gridLimitsOfGpuSettings),
|
|
52476
|
+
je: () => (gpuSettingsForRender)
|
|
52477
|
+
});
|
|
52478
|
+
|
|
52479
|
+
|
|
50603
52480
|
},
|
|
50604
52481
|
91302(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
50605
52482
|
"use strict";
|
|
@@ -50775,7 +52652,6 @@ let cachedCapabilities = null;
|
|
|
50775
52652
|
function getWebGLContextInfo() {
|
|
50776
52653
|
const info = {
|
|
50777
52654
|
webgl: false,
|
|
50778
|
-
webgl2: false,
|
|
50779
52655
|
maxTextureSize: 0,
|
|
50780
52656
|
renderer: '',
|
|
50781
52657
|
};
|
|
@@ -50784,15 +52660,11 @@ function getWebGLContextInfo() {
|
|
|
50784
52660
|
}
|
|
50785
52661
|
try {
|
|
50786
52662
|
const canvas = document.createElement('canvas');
|
|
50787
|
-
const
|
|
50788
|
-
const gl = gl2 ||
|
|
50789
|
-
canvas.getContext('webgl') ||
|
|
50790
|
-
canvas.getContext('experimental-webgl');
|
|
52663
|
+
const gl = canvas.getContext('webgl2');
|
|
50791
52664
|
if (!gl) {
|
|
50792
52665
|
return info;
|
|
50793
52666
|
}
|
|
50794
52667
|
info.webgl = true;
|
|
50795
|
-
info.webgl2 = !!gl2;
|
|
50796
52668
|
info.maxTextureSize = Number(gl.getParameter(gl.MAX_TEXTURE_SIZE)) || 0;
|
|
50797
52669
|
const debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
|
|
50798
52670
|
const renderer = debugInfo
|
|
@@ -50808,7 +52680,7 @@ function getWebGLContextInfo() {
|
|
|
50808
52680
|
}
|
|
50809
52681
|
return info;
|
|
50810
52682
|
}
|
|
50811
|
-
function readCachedFormats(renderer
|
|
52683
|
+
function readCachedFormats(renderer) {
|
|
50812
52684
|
try {
|
|
50813
52685
|
const raw = window.localStorage?.getItem(STORAGE_KEY);
|
|
50814
52686
|
if (!raw) {
|
|
@@ -50817,7 +52689,6 @@ function readCachedFormats(renderer, webgl2) {
|
|
|
50817
52689
|
const parsed = JSON.parse(raw);
|
|
50818
52690
|
if (parsed?.probeVersion !== RENDERING_CAPABILITIES_PROBE_VERSION ||
|
|
50819
52691
|
parsed?.renderer !== renderer ||
|
|
50820
|
-
parsed?.webgl2 !== webgl2 ||
|
|
50821
52692
|
typeof parsed?.formats !== 'object' ||
|
|
50822
52693
|
parsed?.formats === null) {
|
|
50823
52694
|
return null;
|
|
@@ -50828,12 +52699,11 @@ function readCachedFormats(renderer, webgl2) {
|
|
|
50828
52699
|
return null;
|
|
50829
52700
|
}
|
|
50830
52701
|
}
|
|
50831
|
-
function writeCachedFormats(renderer,
|
|
52702
|
+
function writeCachedFormats(renderer, formats) {
|
|
50832
52703
|
try {
|
|
50833
52704
|
const payload = {
|
|
50834
52705
|
probeVersion: RENDERING_CAPABILITIES_PROBE_VERSION,
|
|
50835
52706
|
renderer,
|
|
50836
|
-
webgl2,
|
|
50837
52707
|
formats,
|
|
50838
52708
|
};
|
|
50839
52709
|
window.localStorage?.setItem(STORAGE_KEY, JSON.stringify(payload));
|
|
@@ -50850,13 +52720,11 @@ function detectRenderingCapabilities({ useCache = true, } = {}) {
|
|
|
50850
52720
|
softwareRasterizer: false,
|
|
50851
52721
|
};
|
|
50852
52722
|
}
|
|
50853
|
-
let formats = useCache
|
|
50854
|
-
? readCachedFormats(contextInfo.renderer, contextInfo.webgl2)
|
|
50855
|
-
: null;
|
|
52723
|
+
let formats = useCache ? readCachedFormats(contextInfo.renderer) : null;
|
|
50856
52724
|
if (!formats) {
|
|
50857
52725
|
const probed = getSupportedTextureFormats();
|
|
50858
52726
|
if (probed) {
|
|
50859
|
-
writeCachedFormats(contextInfo.renderer,
|
|
52727
|
+
writeCachedFormats(contextInfo.renderer, probed);
|
|
50860
52728
|
}
|
|
50861
52729
|
formats = probed ?? { ...NO_GPU_FORMATS };
|
|
50862
52730
|
}
|
|
@@ -50884,10 +52752,300 @@ function resetRenderingCapabilities({ clearStorage = false, } = {}) {
|
|
|
50884
52752
|
}
|
|
50885
52753
|
|
|
50886
52754
|
|
|
52755
|
+
},
|
|
52756
|
+
29678(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
52757
|
+
"use strict";
|
|
52758
|
+
/* import */ var _boxSpan_js__rspack_import_0 = __webpack_require__(9844);
|
|
52759
|
+
|
|
52760
|
+
function fillPlaneByAverage(frames, [sourceWidth, sourceHeight], [width, height], [factorI, factorJ], values, frameWeights) {
|
|
52761
|
+
if (!frames.length) {
|
|
52762
|
+
for (let index = 0; index < width * height; index++) {
|
|
52763
|
+
values[index] = 0;
|
|
52764
|
+
}
|
|
52765
|
+
return;
|
|
52766
|
+
}
|
|
52767
|
+
const columns = (0,_boxSpan_js__rspack_import_0/* .spansOfAxis */.Ac)(sourceWidth, width, factorI);
|
|
52768
|
+
const rows = (0,_boxSpan_js__rspack_import_0/* .spansOfAxis */.Ac)(sourceHeight, height, factorJ);
|
|
52769
|
+
const round = !(values instanceof Float32Array || values instanceof Float64Array);
|
|
52770
|
+
const columnSums = new Float64Array(sourceWidth);
|
|
52771
|
+
for (let j = 0; j < height; j++) {
|
|
52772
|
+
const rowSpan = rows[j];
|
|
52773
|
+
let rowWeight = 0;
|
|
52774
|
+
columnSums.fill(0);
|
|
52775
|
+
for (let f = 0; f < frames.length; f++) {
|
|
52776
|
+
const frame = frames[f];
|
|
52777
|
+
const frameWeight = frameWeights?.[f] ?? 1;
|
|
52778
|
+
for (let row = rowSpan.first; row < rowSpan.end; row++) {
|
|
52779
|
+
const weight = frameWeight * (0,_boxSpan_js__rspack_import_0/* .weightInSpan */.Oj)(rowSpan, row);
|
|
52780
|
+
const start = row * sourceWidth;
|
|
52781
|
+
rowWeight += weight;
|
|
52782
|
+
for (let i = 0; i < sourceWidth; i++) {
|
|
52783
|
+
columnSums[i] += weight * frame[start + i];
|
|
52784
|
+
}
|
|
52785
|
+
}
|
|
52786
|
+
}
|
|
52787
|
+
const targetRow = j * width;
|
|
52788
|
+
for (let i = 0; i < width; i++) {
|
|
52789
|
+
const span = columns[i];
|
|
52790
|
+
let sum = 0;
|
|
52791
|
+
let columnWeight = 0;
|
|
52792
|
+
for (let column = span.first; column < span.end; column++) {
|
|
52793
|
+
const weight = (0,_boxSpan_js__rspack_import_0/* .weightInSpan */.Oj)(span, column);
|
|
52794
|
+
sum += weight * columnSums[column];
|
|
52795
|
+
columnWeight += weight;
|
|
52796
|
+
}
|
|
52797
|
+
const count = columnWeight * rowWeight;
|
|
52798
|
+
const value = count ? sum / count : 0;
|
|
52799
|
+
values[targetRow + i] = round ? Math.round(value) : value;
|
|
52800
|
+
}
|
|
52801
|
+
}
|
|
52802
|
+
}
|
|
52803
|
+
|
|
52804
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
52805
|
+
A: () => (fillPlaneByAverage)
|
|
52806
|
+
});
|
|
52807
|
+
|
|
52808
|
+
|
|
52809
|
+
},
|
|
52810
|
+
12593(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
52811
|
+
"use strict";
|
|
52812
|
+
/* import */ var _boxSpan_js__rspack_import_0 = __webpack_require__(9844);
|
|
52813
|
+
|
|
52814
|
+
function foregroundMajorityOfBox(frames, frameWeights, sourceWidth, spanI, spanJ, labels, counts) {
|
|
52815
|
+
let majority = 0;
|
|
52816
|
+
let majorityCount = 0;
|
|
52817
|
+
labels.length = 0;
|
|
52818
|
+
counts.length = 0;
|
|
52819
|
+
for (let f = 0; f < frames.length; f++) {
|
|
52820
|
+
const frame = frames[f];
|
|
52821
|
+
const frameWeight = frameWeights?.[f] ?? 1;
|
|
52822
|
+
for (let j = spanJ.first; j < spanJ.end; j++) {
|
|
52823
|
+
const row = j * sourceWidth;
|
|
52824
|
+
const rowWeight = frameWeight * (0,_boxSpan_js__rspack_import_0/* .weightInSpan */.Oj)(spanJ, j);
|
|
52825
|
+
for (let i = spanI.first; i < spanI.end; i++) {
|
|
52826
|
+
const label = frame[row + i];
|
|
52827
|
+
if (label === 0) {
|
|
52828
|
+
continue;
|
|
52829
|
+
}
|
|
52830
|
+
let slot = labels.indexOf(label);
|
|
52831
|
+
if (slot === -1) {
|
|
52832
|
+
slot = labels.length;
|
|
52833
|
+
labels.push(label);
|
|
52834
|
+
counts.push(0);
|
|
52835
|
+
}
|
|
52836
|
+
const count = (counts[slot] += rowWeight * (0,_boxSpan_js__rspack_import_0/* .weightInSpan */.Oj)(spanI, i));
|
|
52837
|
+
if (count > majorityCount) {
|
|
52838
|
+
majorityCount = count;
|
|
52839
|
+
majority = label;
|
|
52840
|
+
}
|
|
52841
|
+
}
|
|
52842
|
+
}
|
|
52843
|
+
}
|
|
52844
|
+
return majority;
|
|
52845
|
+
}
|
|
52846
|
+
function fillPlaneByForegroundMajority(frames, [sourceWidth, sourceHeight], [width, height], [factorI, factorJ], values, frameWeights) {
|
|
52847
|
+
const labels = [];
|
|
52848
|
+
const counts = [];
|
|
52849
|
+
const columns = (0,_boxSpan_js__rspack_import_0/* .spansOfAxis */.Ac)(sourceWidth, width, factorI);
|
|
52850
|
+
const rows = (0,_boxSpan_js__rspack_import_0/* .spansOfAxis */.Ac)(sourceHeight, height, factorJ);
|
|
52851
|
+
for (let targetJ = 0; targetJ < height; targetJ++) {
|
|
52852
|
+
for (let targetI = 0; targetI < width; targetI++) {
|
|
52853
|
+
values[targetJ * width + targetI] = foregroundMajorityOfBox(frames, frameWeights, sourceWidth, columns[targetI], rows[targetJ], labels, counts);
|
|
52854
|
+
}
|
|
52855
|
+
}
|
|
52856
|
+
}
|
|
52857
|
+
|
|
52858
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
52859
|
+
A: () => (fillPlaneByForegroundMajority),
|
|
52860
|
+
D: () => (foregroundMajorityOfBox)
|
|
52861
|
+
});
|
|
52862
|
+
|
|
52863
|
+
|
|
52864
|
+
},
|
|
52865
|
+
80365(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
52866
|
+
"use strict";
|
|
52867
|
+
/* import */ var _resolveReduction_js__rspack_import_0 = __webpack_require__(37728);
|
|
52868
|
+
/* import */ var _foregroundMajorityPlane_js__rspack_import_1 = __webpack_require__(12593);
|
|
52869
|
+
/* import */ var _boxSpan_js__rspack_import_2 = __webpack_require__(9844);
|
|
52870
|
+
|
|
52871
|
+
|
|
52872
|
+
|
|
52873
|
+
function hasSeveralComponents(source) {
|
|
52874
|
+
return ((source.numberOfComponents ?? 1) > 1);
|
|
52875
|
+
}
|
|
52876
|
+
function sliceReaderOf(source, { allowPublic }) {
|
|
52877
|
+
const view = source._getSliceView?.bind(source);
|
|
52878
|
+
const direct = source._getSliceData?.bind(source);
|
|
52879
|
+
const fallback = direct ??
|
|
52880
|
+
(allowPublic
|
|
52881
|
+
? source.getSliceData?.bind(source)
|
|
52882
|
+
: undefined);
|
|
52883
|
+
if (!fallback) {
|
|
52884
|
+
return undefined;
|
|
52885
|
+
}
|
|
52886
|
+
return (sliceIndex) => view?.(sliceIndex) ?? fallback({ sliceIndex, slicePlane: 2 });
|
|
52887
|
+
}
|
|
52888
|
+
function directTargetOf(target) {
|
|
52889
|
+
const scalars = target.getWritableScalarData?.();
|
|
52890
|
+
const [width, height] = target.dimensions ?? [];
|
|
52891
|
+
return scalars && width && height && !hasSeveralComponents(target)
|
|
52892
|
+
? { scalars, width, height }
|
|
52893
|
+
: undefined;
|
|
52894
|
+
}
|
|
52895
|
+
function directIndexOf({ width, height }, i, j, k) {
|
|
52896
|
+
return (k * height + j) * width + i;
|
|
52897
|
+
}
|
|
52898
|
+
function reduceForegroundMajorityBySlices(source, reduction, target) {
|
|
52899
|
+
const readSlice = sliceReaderOf(source, { allowPublic: false });
|
|
52900
|
+
if (!readSlice || hasSeveralComponents(source)) {
|
|
52901
|
+
return undefined;
|
|
52902
|
+
}
|
|
52903
|
+
const { factors, sourceOffset, sourceEnd, dimensions } = (0,_resolveReduction_js__rspack_import_0/* ["default"] */.A)(source, reduction);
|
|
52904
|
+
const [factorI, factorJ, factorK] = factors;
|
|
52905
|
+
const [sourceWidth] = source.dimensions;
|
|
52906
|
+
const frameLength = sourceWidth * Math.ceil(sourceEnd[1]);
|
|
52907
|
+
const [targetI, targetJ, targetK] = reduction.targetOffset ?? [0, 0, 0];
|
|
52908
|
+
const labels = [];
|
|
52909
|
+
const counts = [];
|
|
52910
|
+
const frames = [];
|
|
52911
|
+
const frameWeights = [];
|
|
52912
|
+
let written = 0;
|
|
52913
|
+
const direct = directTargetOf(target);
|
|
52914
|
+
for (let k = 0; k < dimensions[2]; k++) {
|
|
52915
|
+
const spanK = (0,_boxSpan_js__rspack_import_2/* .spanOfBox */.z1)(sourceOffset[2], factorK, sourceEnd[2], k);
|
|
52916
|
+
frames.length = 0;
|
|
52917
|
+
frameWeights.length = 0;
|
|
52918
|
+
for (let sourceK = spanK.first; sourceK < spanK.end; sourceK++) {
|
|
52919
|
+
const frame = readSlice(sourceK);
|
|
52920
|
+
if (!frame) {
|
|
52921
|
+
continue;
|
|
52922
|
+
}
|
|
52923
|
+
if (frame.length < frameLength ||
|
|
52924
|
+
frame instanceof Float32Array ||
|
|
52925
|
+
frame instanceof Float64Array) {
|
|
52926
|
+
return undefined;
|
|
52927
|
+
}
|
|
52928
|
+
frames.push(frame);
|
|
52929
|
+
frameWeights.push((0,_boxSpan_js__rspack_import_2/* .weightInSpan */.Oj)(spanK, sourceK));
|
|
52930
|
+
}
|
|
52931
|
+
if (!frames.length) {
|
|
52932
|
+
continue;
|
|
52933
|
+
}
|
|
52934
|
+
for (let j = 0; j < dimensions[1]; j++) {
|
|
52935
|
+
const spanJ = (0,_boxSpan_js__rspack_import_2/* .spanOfBox */.z1)(sourceOffset[1], factorJ, sourceEnd[1], j);
|
|
52936
|
+
const base = direct
|
|
52937
|
+
? directIndexOf(direct, targetI, targetJ + j, targetK + k)
|
|
52938
|
+
: 0;
|
|
52939
|
+
for (let i = 0; i < dimensions[0]; i++) {
|
|
52940
|
+
const majority = (0,_foregroundMajorityPlane_js__rspack_import_1/* .foregroundMajorityOfBox */.D)(frames, frameWeights, sourceWidth, (0,_boxSpan_js__rspack_import_2/* .spanOfBox */.z1)(sourceOffset[0], factorI, sourceEnd[0], i), spanJ, labels, counts);
|
|
52941
|
+
if (direct) {
|
|
52942
|
+
direct.scalars[base + i] = majority;
|
|
52943
|
+
}
|
|
52944
|
+
else {
|
|
52945
|
+
target.setAtIJK(targetI + i, targetJ + j, targetK + k, majority);
|
|
52946
|
+
}
|
|
52947
|
+
written++;
|
|
52948
|
+
}
|
|
52949
|
+
}
|
|
52950
|
+
}
|
|
52951
|
+
return written;
|
|
52952
|
+
}
|
|
52953
|
+
function reduceAverageAlongKBySlices(source, reduction, target, { round }) {
|
|
52954
|
+
if ((typeof source._getSliceData !==
|
|
52955
|
+
'function' &&
|
|
52956
|
+
typeof source.getSliceData !== 'function') ||
|
|
52957
|
+
hasSeveralComponents(source)) {
|
|
52958
|
+
return undefined;
|
|
52959
|
+
}
|
|
52960
|
+
const resolved = (0,_resolveReduction_js__rspack_import_0/* ["default"] */.A)(source, reduction);
|
|
52961
|
+
const [factorI, factorJ, factorK] = resolved.factors;
|
|
52962
|
+
if (factorI !== 1 || factorJ !== 1 || factorK <= 1) {
|
|
52963
|
+
return undefined;
|
|
52964
|
+
}
|
|
52965
|
+
const { sourceOffset, sourceEnd, dimensions: reducedDims } = resolved;
|
|
52966
|
+
const [sourceWidth] = source.dimensions;
|
|
52967
|
+
const [reducedWidth, reducedHeight, reducedDepth] = reducedDims;
|
|
52968
|
+
const [targetI, targetJ, targetK] = reduction.targetOffset ?? [0, 0, 0];
|
|
52969
|
+
if (sourceEnd[0] - sourceOffset[0] !== reducedWidth ||
|
|
52970
|
+
sourceEnd[1] - sourceOffset[1] !== reducedHeight) {
|
|
52971
|
+
return undefined;
|
|
52972
|
+
}
|
|
52973
|
+
const readSlice = sliceReaderOf(source, {
|
|
52974
|
+
allowPublic: source.getWritableScalarData?.() !== undefined,
|
|
52975
|
+
});
|
|
52976
|
+
if (!readSlice) {
|
|
52977
|
+
return undefined;
|
|
52978
|
+
}
|
|
52979
|
+
let written = 0;
|
|
52980
|
+
const direct = directTargetOf(target);
|
|
52981
|
+
const frames = [];
|
|
52982
|
+
const frameWeights = [];
|
|
52983
|
+
for (let rk = 0; rk < reducedDepth; rk++) {
|
|
52984
|
+
const spanK = (0,_boxSpan_js__rspack_import_2/* .spanOfBox */.z1)(sourceOffset[2], factorK, sourceEnd[2], rk);
|
|
52985
|
+
frames.length = 0;
|
|
52986
|
+
frameWeights.length = 0;
|
|
52987
|
+
for (let k = spanK.first; k < spanK.end; k++) {
|
|
52988
|
+
let frame;
|
|
52989
|
+
try {
|
|
52990
|
+
frame = readSlice(k);
|
|
52991
|
+
}
|
|
52992
|
+
catch {
|
|
52993
|
+
frame = undefined;
|
|
52994
|
+
}
|
|
52995
|
+
if (!frame ||
|
|
52996
|
+
frame.length < sourceWidth * (sourceOffset[1] + reducedHeight)) {
|
|
52997
|
+
continue;
|
|
52998
|
+
}
|
|
52999
|
+
frames.push(frame);
|
|
53000
|
+
frameWeights.push((0,_boxSpan_js__rspack_import_2/* .weightInSpan */.Oj)(spanK, k));
|
|
53001
|
+
}
|
|
53002
|
+
if (!frames.length) {
|
|
53003
|
+
continue;
|
|
53004
|
+
}
|
|
53005
|
+
for (let j = 0; j < reducedHeight; j++) {
|
|
53006
|
+
const sourceRow = (sourceOffset[1] + j) * sourceWidth + sourceOffset[0];
|
|
53007
|
+
const base = direct
|
|
53008
|
+
? directIndexOf(direct, targetI, targetJ + j, targetK + rk)
|
|
53009
|
+
: 0;
|
|
53010
|
+
for (let i = 0; i < reducedWidth; i++) {
|
|
53011
|
+
const index = sourceRow + i;
|
|
53012
|
+
let sum = 0;
|
|
53013
|
+
let count = 0;
|
|
53014
|
+
for (let m = 0; m < frames.length; m++) {
|
|
53015
|
+
const value = frames[m][index];
|
|
53016
|
+
if (Number.isFinite(value)) {
|
|
53017
|
+
sum += value * frameWeights[m];
|
|
53018
|
+
count += frameWeights[m];
|
|
53019
|
+
}
|
|
53020
|
+
}
|
|
53021
|
+
if (!count) {
|
|
53022
|
+
continue;
|
|
53023
|
+
}
|
|
53024
|
+
const value = round ? Math.round(sum / count) : sum / count;
|
|
53025
|
+
if (direct) {
|
|
53026
|
+
direct.scalars[base + i] = value;
|
|
53027
|
+
}
|
|
53028
|
+
else {
|
|
53029
|
+
target.setAtIJK(targetI + i, targetJ + j, targetK + rk, value);
|
|
53030
|
+
}
|
|
53031
|
+
written++;
|
|
53032
|
+
}
|
|
53033
|
+
}
|
|
53034
|
+
}
|
|
53035
|
+
return written;
|
|
53036
|
+
}
|
|
53037
|
+
|
|
53038
|
+
|
|
53039
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
53040
|
+
R: () => (reduceForegroundMajorityBySlices),
|
|
53041
|
+
m: () => (reduceAverageAlongKBySlices)
|
|
53042
|
+
});
|
|
53043
|
+
|
|
53044
|
+
|
|
50887
53045
|
},
|
|
50888
53046
|
6945() {
|
|
50889
53047
|
"use strict";
|
|
50890
|
-
const version = '5.
|
|
53048
|
+
const version = '5.17.1';
|
|
50891
53049
|
|
|
50892
53050
|
|
|
50893
53051
|
},
|
|
@@ -55858,6 +58016,811 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
55858
58016
|
});
|
|
55859
58017
|
|
|
55860
58018
|
|
|
58019
|
+
},
|
|
58020
|
+
28710(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
58021
|
+
"use strict";
|
|
58022
|
+
/* import */ var _Core_Math_js__rspack_import_0 = __webpack_require__(90655);
|
|
58023
|
+
/* import */ var _Plane_js__rspack_import_1 = __webpack_require__(98281);
|
|
58024
|
+
/* import */ var gl_matrix__rspack_import_2 = __webpack_require__(50341);
|
|
58025
|
+
|
|
58026
|
+
|
|
58027
|
+
|
|
58028
|
+
//#region Sources/Common/DataModel/BoundingBox/index.js
|
|
58029
|
+
var INIT_BOUNDS = [
|
|
58030
|
+
Number.MAX_VALUE,
|
|
58031
|
+
-Number.MAX_VALUE,
|
|
58032
|
+
Number.MAX_VALUE,
|
|
58033
|
+
-Number.MAX_VALUE,
|
|
58034
|
+
Number.MAX_VALUE,
|
|
58035
|
+
-Number.MAX_VALUE
|
|
58036
|
+
];
|
|
58037
|
+
function equals(a, b) {
|
|
58038
|
+
return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];
|
|
58039
|
+
}
|
|
58040
|
+
function isValid(bounds) {
|
|
58041
|
+
return bounds?.length >= 6 && bounds[0] <= bounds[1] && bounds[2] <= bounds[3] && bounds[4] <= bounds[5];
|
|
58042
|
+
}
|
|
58043
|
+
function setBounds(bounds, otherBounds) {
|
|
58044
|
+
bounds[0] = otherBounds[0];
|
|
58045
|
+
bounds[1] = otherBounds[1];
|
|
58046
|
+
bounds[2] = otherBounds[2];
|
|
58047
|
+
bounds[3] = otherBounds[3];
|
|
58048
|
+
bounds[4] = otherBounds[4];
|
|
58049
|
+
bounds[5] = otherBounds[5];
|
|
58050
|
+
return bounds;
|
|
58051
|
+
}
|
|
58052
|
+
function reset(bounds) {
|
|
58053
|
+
return setBounds(bounds, INIT_BOUNDS);
|
|
58054
|
+
}
|
|
58055
|
+
function addPoint(bounds, xOrPoint, y, z) {
|
|
58056
|
+
const [xMin, xMax, yMin, yMax, zMin, zMax] = bounds;
|
|
58057
|
+
if (typeof xOrPoint === "number") {
|
|
58058
|
+
bounds[0] = xMin < xOrPoint ? xMin : xOrPoint;
|
|
58059
|
+
bounds[1] = xMax > xOrPoint ? xMax : xOrPoint;
|
|
58060
|
+
bounds[2] = yMin < y ? yMin : y;
|
|
58061
|
+
bounds[3] = yMax > y ? yMax : y;
|
|
58062
|
+
bounds[4] = zMin < z ? zMin : z;
|
|
58063
|
+
bounds[5] = zMax > z ? zMax : z;
|
|
58064
|
+
} else {
|
|
58065
|
+
bounds[0] = xMin < xOrPoint[0] ? xMin : xOrPoint[0];
|
|
58066
|
+
bounds[1] = xMax > xOrPoint[0] ? xMax : xOrPoint[0];
|
|
58067
|
+
bounds[2] = yMin < xOrPoint[1] ? yMin : xOrPoint[1];
|
|
58068
|
+
bounds[3] = yMax > xOrPoint[1] ? yMax : xOrPoint[1];
|
|
58069
|
+
bounds[4] = zMin < xOrPoint[2] ? zMin : xOrPoint[2];
|
|
58070
|
+
bounds[5] = zMax > xOrPoint[2] ? zMax : xOrPoint[2];
|
|
58071
|
+
}
|
|
58072
|
+
return bounds;
|
|
58073
|
+
}
|
|
58074
|
+
function addPoints(bounds, points) {
|
|
58075
|
+
if (points.length === 0) return bounds;
|
|
58076
|
+
if (Array.isArray(points[0])) for (let i = 0; i < points.length; ++i) addPoint(bounds, ...points[i]);
|
|
58077
|
+
else for (let i = 0; i < points.length; i += 3) addPoint(bounds, ...points.slice(i, i + 3));
|
|
58078
|
+
return bounds;
|
|
58079
|
+
}
|
|
58080
|
+
function addBounds(bounds, xMin, xMax, yMin, yMax, zMin, zMax) {
|
|
58081
|
+
const [_xMin, _xMax, _yMin, _yMax, _zMin, _zMax] = bounds;
|
|
58082
|
+
if (zMax === void 0) {
|
|
58083
|
+
bounds[0] = Math.min(xMin[0], _xMin);
|
|
58084
|
+
bounds[1] = Math.max(xMin[1], _xMax);
|
|
58085
|
+
bounds[2] = Math.min(xMin[2], _yMin);
|
|
58086
|
+
bounds[3] = Math.max(xMin[3], _yMax);
|
|
58087
|
+
bounds[4] = Math.min(xMin[4], _zMin);
|
|
58088
|
+
bounds[5] = Math.max(xMin[5], _zMax);
|
|
58089
|
+
} else {
|
|
58090
|
+
bounds[0] = Math.min(xMin, _xMin);
|
|
58091
|
+
bounds[1] = Math.max(xMax, _xMax);
|
|
58092
|
+
bounds[2] = Math.min(yMin, _yMin);
|
|
58093
|
+
bounds[3] = Math.max(yMax, _yMax);
|
|
58094
|
+
bounds[4] = Math.min(zMin, _zMin);
|
|
58095
|
+
bounds[5] = Math.max(zMax, _zMax);
|
|
58096
|
+
}
|
|
58097
|
+
return bounds;
|
|
58098
|
+
}
|
|
58099
|
+
function setMinPoint(bounds, x, y, z) {
|
|
58100
|
+
const [xMin, xMax, yMin, yMax, zMin, zMax] = bounds;
|
|
58101
|
+
bounds[0] = x;
|
|
58102
|
+
bounds[1] = x > xMax ? x : xMax;
|
|
58103
|
+
bounds[2] = y;
|
|
58104
|
+
bounds[3] = y > yMax ? y : yMax;
|
|
58105
|
+
bounds[4] = z;
|
|
58106
|
+
bounds[5] = z > zMax ? z : zMax;
|
|
58107
|
+
return xMin !== x || yMin !== y || zMin !== z;
|
|
58108
|
+
}
|
|
58109
|
+
function setMaxPoint(bounds, x, y, z) {
|
|
58110
|
+
const [xMin, xMax, yMin, yMax, zMin, zMax] = bounds;
|
|
58111
|
+
bounds[0] = x < xMin ? x : xMin;
|
|
58112
|
+
bounds[1] = x;
|
|
58113
|
+
bounds[2] = y < yMin ? y : yMin;
|
|
58114
|
+
bounds[3] = y;
|
|
58115
|
+
bounds[4] = z < zMin ? z : zMin;
|
|
58116
|
+
bounds[5] = z;
|
|
58117
|
+
return xMax !== x || yMax !== y || zMax !== z;
|
|
58118
|
+
}
|
|
58119
|
+
function inflate(bounds, delta) {
|
|
58120
|
+
if (delta == null) return minInflate(bounds);
|
|
58121
|
+
bounds[0] -= delta;
|
|
58122
|
+
bounds[1] += delta;
|
|
58123
|
+
bounds[2] -= delta;
|
|
58124
|
+
bounds[3] += delta;
|
|
58125
|
+
bounds[4] -= delta;
|
|
58126
|
+
bounds[5] += delta;
|
|
58127
|
+
return bounds;
|
|
58128
|
+
}
|
|
58129
|
+
function minInflate(bounds) {
|
|
58130
|
+
const nonZero = [
|
|
58131
|
+
0,
|
|
58132
|
+
0,
|
|
58133
|
+
0
|
|
58134
|
+
];
|
|
58135
|
+
let maxIdx = -1;
|
|
58136
|
+
let max = 0;
|
|
58137
|
+
let w = 0;
|
|
58138
|
+
for (let i = 0; i < 3; ++i) {
|
|
58139
|
+
w = bounds[i * 2 + 1] - bounds[i * 2];
|
|
58140
|
+
if (w > max) {
|
|
58141
|
+
max = w;
|
|
58142
|
+
maxIdx = i;
|
|
58143
|
+
}
|
|
58144
|
+
nonZero[i] = w > 0 ? 1 : 0;
|
|
58145
|
+
}
|
|
58146
|
+
if (maxIdx < 0) return inflate(bounds, .5);
|
|
58147
|
+
for (let i = 0; i < 3; ++i) if (!nonZero[i]) {
|
|
58148
|
+
const d = .005 * max;
|
|
58149
|
+
bounds[i * 2] -= d;
|
|
58150
|
+
bounds[i * 2 + 1] += d;
|
|
58151
|
+
}
|
|
58152
|
+
return bounds;
|
|
58153
|
+
}
|
|
58154
|
+
function scale(bounds, sx, sy, sz) {
|
|
58155
|
+
if (!isValid(bounds)) return false;
|
|
58156
|
+
if (sx >= 0) {
|
|
58157
|
+
bounds[0] *= sx;
|
|
58158
|
+
bounds[1] *= sx;
|
|
58159
|
+
} else {
|
|
58160
|
+
bounds[0] = sx * bounds[1];
|
|
58161
|
+
bounds[1] = sx * bounds[0];
|
|
58162
|
+
}
|
|
58163
|
+
if (sy >= 0) {
|
|
58164
|
+
bounds[2] *= sy;
|
|
58165
|
+
bounds[3] *= sy;
|
|
58166
|
+
} else {
|
|
58167
|
+
bounds[2] = sy * bounds[3];
|
|
58168
|
+
bounds[3] = sy * bounds[2];
|
|
58169
|
+
}
|
|
58170
|
+
if (sz >= 0) {
|
|
58171
|
+
bounds[4] *= sz;
|
|
58172
|
+
bounds[5] *= sz;
|
|
58173
|
+
} else {
|
|
58174
|
+
bounds[4] = sz * bounds[5];
|
|
58175
|
+
bounds[5] = sz * bounds[4];
|
|
58176
|
+
}
|
|
58177
|
+
return true;
|
|
58178
|
+
}
|
|
58179
|
+
function getCenter(bounds) {
|
|
58180
|
+
return [
|
|
58181
|
+
.5 * (bounds[0] + bounds[1]),
|
|
58182
|
+
.5 * (bounds[2] + bounds[3]),
|
|
58183
|
+
.5 * (bounds[4] + bounds[5])
|
|
58184
|
+
];
|
|
58185
|
+
}
|
|
58186
|
+
function scaleAboutCenter(bounds, sx, sy, sz) {
|
|
58187
|
+
if (!isValid(bounds)) return false;
|
|
58188
|
+
const center = getCenter(bounds);
|
|
58189
|
+
bounds[0] -= center[0];
|
|
58190
|
+
bounds[1] -= center[0];
|
|
58191
|
+
bounds[2] -= center[1];
|
|
58192
|
+
bounds[3] -= center[1];
|
|
58193
|
+
bounds[4] -= center[2];
|
|
58194
|
+
bounds[5] -= center[2];
|
|
58195
|
+
scale(bounds, sx, sy, sz);
|
|
58196
|
+
bounds[0] += center[0];
|
|
58197
|
+
bounds[1] += center[0];
|
|
58198
|
+
bounds[2] += center[1];
|
|
58199
|
+
bounds[3] += center[1];
|
|
58200
|
+
bounds[4] += center[2];
|
|
58201
|
+
bounds[5] += center[2];
|
|
58202
|
+
return true;
|
|
58203
|
+
}
|
|
58204
|
+
function getLength(bounds, index) {
|
|
58205
|
+
return bounds[index * 2 + 1] - bounds[index * 2];
|
|
58206
|
+
}
|
|
58207
|
+
function getLengths(bounds) {
|
|
58208
|
+
return [
|
|
58209
|
+
getLength(bounds, 0),
|
|
58210
|
+
getLength(bounds, 1),
|
|
58211
|
+
getLength(bounds, 2)
|
|
58212
|
+
];
|
|
58213
|
+
}
|
|
58214
|
+
function getXRange(bounds) {
|
|
58215
|
+
return bounds.slice(0, 2);
|
|
58216
|
+
}
|
|
58217
|
+
function getYRange(bounds) {
|
|
58218
|
+
return bounds.slice(2, 4);
|
|
58219
|
+
}
|
|
58220
|
+
function getZRange(bounds) {
|
|
58221
|
+
return bounds.slice(4, 6);
|
|
58222
|
+
}
|
|
58223
|
+
function getMaxLength(bounds) {
|
|
58224
|
+
const l = getLengths(bounds);
|
|
58225
|
+
if (l[0] > l[1]) {
|
|
58226
|
+
if (l[0] > l[2]) return l[0];
|
|
58227
|
+
return l[2];
|
|
58228
|
+
}
|
|
58229
|
+
if (l[1] > l[2]) return l[1];
|
|
58230
|
+
return l[2];
|
|
58231
|
+
}
|
|
58232
|
+
function getDiagonalLength2(bounds) {
|
|
58233
|
+
if (isValid(bounds)) {
|
|
58234
|
+
const l = getLengths(bounds);
|
|
58235
|
+
return l[0] * l[0] + l[1] * l[1] + l[2] * l[2];
|
|
58236
|
+
}
|
|
58237
|
+
return null;
|
|
58238
|
+
}
|
|
58239
|
+
function getDiagonalLength(bounds) {
|
|
58240
|
+
const lenght2 = getDiagonalLength2(bounds);
|
|
58241
|
+
return lenght2 !== null ? Math.sqrt(lenght2) : null;
|
|
58242
|
+
}
|
|
58243
|
+
function getMinPoint(bounds) {
|
|
58244
|
+
return [
|
|
58245
|
+
bounds[0],
|
|
58246
|
+
bounds[2],
|
|
58247
|
+
bounds[4]
|
|
58248
|
+
];
|
|
58249
|
+
}
|
|
58250
|
+
function getMaxPoint(bounds) {
|
|
58251
|
+
return [
|
|
58252
|
+
bounds[1],
|
|
58253
|
+
bounds[3],
|
|
58254
|
+
bounds[5]
|
|
58255
|
+
];
|
|
58256
|
+
}
|
|
58257
|
+
function oppositeSign(a, b) {
|
|
58258
|
+
return a <= 0 && b >= 0 || a >= 0 && b <= 0;
|
|
58259
|
+
}
|
|
58260
|
+
function getCorners(bounds, corners) {
|
|
58261
|
+
corners[0] = [
|
|
58262
|
+
bounds[0],
|
|
58263
|
+
bounds[2],
|
|
58264
|
+
bounds[4]
|
|
58265
|
+
];
|
|
58266
|
+
corners[1] = [
|
|
58267
|
+
bounds[0],
|
|
58268
|
+
bounds[2],
|
|
58269
|
+
bounds[5]
|
|
58270
|
+
];
|
|
58271
|
+
corners[2] = [
|
|
58272
|
+
bounds[0],
|
|
58273
|
+
bounds[3],
|
|
58274
|
+
bounds[4]
|
|
58275
|
+
];
|
|
58276
|
+
corners[3] = [
|
|
58277
|
+
bounds[0],
|
|
58278
|
+
bounds[3],
|
|
58279
|
+
bounds[5]
|
|
58280
|
+
];
|
|
58281
|
+
corners[4] = [
|
|
58282
|
+
bounds[1],
|
|
58283
|
+
bounds[2],
|
|
58284
|
+
bounds[4]
|
|
58285
|
+
];
|
|
58286
|
+
corners[5] = [
|
|
58287
|
+
bounds[1],
|
|
58288
|
+
bounds[2],
|
|
58289
|
+
bounds[5]
|
|
58290
|
+
];
|
|
58291
|
+
corners[6] = [
|
|
58292
|
+
bounds[1],
|
|
58293
|
+
bounds[3],
|
|
58294
|
+
bounds[4]
|
|
58295
|
+
];
|
|
58296
|
+
corners[7] = [
|
|
58297
|
+
bounds[1],
|
|
58298
|
+
bounds[3],
|
|
58299
|
+
bounds[5]
|
|
58300
|
+
];
|
|
58301
|
+
return corners;
|
|
58302
|
+
}
|
|
58303
|
+
function computeCornerPoints(bounds, point1, point2) {
|
|
58304
|
+
point1[0] = bounds[0];
|
|
58305
|
+
point1[1] = bounds[2];
|
|
58306
|
+
point1[2] = bounds[4];
|
|
58307
|
+
point2[0] = bounds[1];
|
|
58308
|
+
point2[1] = bounds[3];
|
|
58309
|
+
point2[2] = bounds[5];
|
|
58310
|
+
return point1;
|
|
58311
|
+
}
|
|
58312
|
+
function transformBounds(bounds, transform, out = []) {
|
|
58313
|
+
const corners = getCorners(bounds, []);
|
|
58314
|
+
for (let i = 0; i < corners.length; ++i) gl_matrix__rspack_import_2/* .vec3.transformMat4 */.eR.Z0(corners[i], corners[i], transform);
|
|
58315
|
+
reset(out);
|
|
58316
|
+
return addPoints(out, corners);
|
|
58317
|
+
}
|
|
58318
|
+
function computeScale3(bounds, scale3 = []) {
|
|
58319
|
+
scale3[0] = .5 * (bounds[1] - bounds[0]);
|
|
58320
|
+
scale3[1] = .5 * (bounds[3] - bounds[2]);
|
|
58321
|
+
scale3[2] = .5 * (bounds[5] - bounds[4]);
|
|
58322
|
+
return scale3;
|
|
58323
|
+
}
|
|
58324
|
+
/**
|
|
58325
|
+
* Compute local bounds.
|
|
58326
|
+
* Not as fast as vtkPoints.getBounds() if u, v, w form a natural basis.
|
|
58327
|
+
* @param {vtkPoints} points
|
|
58328
|
+
* @param {array} u first vector
|
|
58329
|
+
* @param {array} v second vector
|
|
58330
|
+
* @param {array} w third vector
|
|
58331
|
+
*/
|
|
58332
|
+
function computeLocalBounds(points, u, v, w) {
|
|
58333
|
+
const bounds = [].concat(INIT_BOUNDS);
|
|
58334
|
+
const pointsData = points.getData();
|
|
58335
|
+
for (let i = 0; i < pointsData.length; i += 3) {
|
|
58336
|
+
const point = [
|
|
58337
|
+
pointsData[i],
|
|
58338
|
+
pointsData[i + 1],
|
|
58339
|
+
pointsData[i + 2]
|
|
58340
|
+
];
|
|
58341
|
+
const du = (0,_Core_Math_js__rspack_import_0/* .dot */.Om)(point, u);
|
|
58342
|
+
bounds[0] = Math.min(du, bounds[0]);
|
|
58343
|
+
bounds[1] = Math.max(du, bounds[1]);
|
|
58344
|
+
const dv = (0,_Core_Math_js__rspack_import_0/* .dot */.Om)(point, v);
|
|
58345
|
+
bounds[2] = Math.min(dv, bounds[2]);
|
|
58346
|
+
bounds[3] = Math.max(dv, bounds[3]);
|
|
58347
|
+
const dw = (0,_Core_Math_js__rspack_import_0/* .dot */.Om)(point, w);
|
|
58348
|
+
bounds[4] = Math.min(dw, bounds[4]);
|
|
58349
|
+
bounds[5] = Math.max(dw, bounds[5]);
|
|
58350
|
+
}
|
|
58351
|
+
return bounds;
|
|
58352
|
+
}
|
|
58353
|
+
function intersectBox(bounds, origin, dir, coord, tolerance) {
|
|
58354
|
+
let inside = true;
|
|
58355
|
+
const quadrant = [];
|
|
58356
|
+
let whichPlane = 0;
|
|
58357
|
+
const maxT = [];
|
|
58358
|
+
const candidatePlane = [
|
|
58359
|
+
0,
|
|
58360
|
+
0,
|
|
58361
|
+
0
|
|
58362
|
+
];
|
|
58363
|
+
const RIGHT = 0;
|
|
58364
|
+
const LEFT = 1;
|
|
58365
|
+
const MIDDLE = 2;
|
|
58366
|
+
for (let i = 0; i < 3; i++) if (origin[i] < bounds[2 * i]) {
|
|
58367
|
+
quadrant[i] = LEFT;
|
|
58368
|
+
candidatePlane[i] = bounds[2 * i];
|
|
58369
|
+
inside = false;
|
|
58370
|
+
} else if (origin[i] > bounds[2 * i + 1]) {
|
|
58371
|
+
quadrant[i] = RIGHT;
|
|
58372
|
+
candidatePlane[i] = bounds[2 * i + 1];
|
|
58373
|
+
inside = false;
|
|
58374
|
+
} else quadrant[i] = MIDDLE;
|
|
58375
|
+
if (inside) {
|
|
58376
|
+
coord[0] = origin[0];
|
|
58377
|
+
coord[1] = origin[1];
|
|
58378
|
+
coord[2] = origin[2];
|
|
58379
|
+
tolerance[0] = 0;
|
|
58380
|
+
return 1;
|
|
58381
|
+
}
|
|
58382
|
+
for (let i = 0; i < 3; i++) if (quadrant[i] !== MIDDLE && dir[i] !== 0) maxT[i] = (candidatePlane[i] - origin[i]) / dir[i];
|
|
58383
|
+
else maxT[i] = -1;
|
|
58384
|
+
for (let i = 0; i < 3; i++) if (maxT[whichPlane] < maxT[i]) whichPlane = i;
|
|
58385
|
+
if (maxT[whichPlane] > 1 || maxT[whichPlane] < 0) return 0;
|
|
58386
|
+
tolerance[0] = maxT[whichPlane];
|
|
58387
|
+
for (let i = 0; i < 3; i++) if (whichPlane !== i) {
|
|
58388
|
+
coord[i] = origin[i] + maxT[whichPlane] * dir[i];
|
|
58389
|
+
if (coord[i] < bounds[2 * i] || coord[i] > bounds[2 * i + 1]) return 0;
|
|
58390
|
+
} else coord[i] = candidatePlane[i];
|
|
58391
|
+
return 1;
|
|
58392
|
+
}
|
|
58393
|
+
function intersectPlane(bounds, origin, normal) {
|
|
58394
|
+
const p = [];
|
|
58395
|
+
let d = 0;
|
|
58396
|
+
let sign = 1;
|
|
58397
|
+
let firstOne = 1;
|
|
58398
|
+
for (let z = 4; z <= 5; ++z) {
|
|
58399
|
+
p[2] = bounds[z];
|
|
58400
|
+
for (let y = 2; y <= 3; ++y) {
|
|
58401
|
+
p[1] = bounds[y];
|
|
58402
|
+
for (let x = 0; x <= 1; ++x) {
|
|
58403
|
+
p[0] = bounds[x];
|
|
58404
|
+
d = _Plane_js__rspack_import_1/* ["default"].evaluate */.Ay.evaluate(normal, origin, p);
|
|
58405
|
+
if (firstOne) {
|
|
58406
|
+
sign = d >= 0 ? 1 : -1;
|
|
58407
|
+
firstOne = 0;
|
|
58408
|
+
}
|
|
58409
|
+
if (d === 0 || sign > 0 && d < 0 || sign < 0 && d > 0) return 1;
|
|
58410
|
+
}
|
|
58411
|
+
}
|
|
58412
|
+
}
|
|
58413
|
+
return 0;
|
|
58414
|
+
}
|
|
58415
|
+
function intersect(bounds, bBounds) {
|
|
58416
|
+
if (!(isValid(bounds) && isValid(bBounds))) return false;
|
|
58417
|
+
const newBounds = [
|
|
58418
|
+
0,
|
|
58419
|
+
0,
|
|
58420
|
+
0,
|
|
58421
|
+
0,
|
|
58422
|
+
0,
|
|
58423
|
+
0
|
|
58424
|
+
];
|
|
58425
|
+
let intersection;
|
|
58426
|
+
for (let i = 0; i < 3; i++) {
|
|
58427
|
+
intersection = false;
|
|
58428
|
+
if (bBounds[i * 2] >= bounds[i * 2] && bBounds[i * 2] <= bounds[i * 2 + 1]) {
|
|
58429
|
+
intersection = true;
|
|
58430
|
+
newBounds[i * 2] = bBounds[i * 2];
|
|
58431
|
+
} else if (bounds[i * 2] >= bBounds[i * 2] && bounds[i * 2] <= bBounds[i * 2 + 1]) {
|
|
58432
|
+
intersection = true;
|
|
58433
|
+
newBounds[i * 2] = bounds[i * 2];
|
|
58434
|
+
}
|
|
58435
|
+
if (bBounds[i * 2 + 1] >= bounds[i * 2] && bBounds[i * 2 + 1] <= bounds[i * 2 + 1]) {
|
|
58436
|
+
intersection = true;
|
|
58437
|
+
newBounds[i * 2 + 1] = bBounds[2 * i + 1];
|
|
58438
|
+
} else if (bounds[i * 2 + 1] >= bBounds[i * 2] && bounds[i * 2 + 1] <= bBounds[i * 2 + 1]) {
|
|
58439
|
+
intersection = true;
|
|
58440
|
+
newBounds[i * 2 + 1] = bounds[i * 2 + 1];
|
|
58441
|
+
}
|
|
58442
|
+
if (!intersection) return false;
|
|
58443
|
+
}
|
|
58444
|
+
bounds[0] = newBounds[0];
|
|
58445
|
+
bounds[1] = newBounds[1];
|
|
58446
|
+
bounds[2] = newBounds[2];
|
|
58447
|
+
bounds[3] = newBounds[3];
|
|
58448
|
+
bounds[4] = newBounds[4];
|
|
58449
|
+
bounds[5] = newBounds[5];
|
|
58450
|
+
return true;
|
|
58451
|
+
}
|
|
58452
|
+
function intersects(bounds, bBounds) {
|
|
58453
|
+
if (!(isValid(bounds) && isValid(bBounds))) return false;
|
|
58454
|
+
for (let i = 0; i < 3; i++) {
|
|
58455
|
+
if (bBounds[i * 2] >= bounds[i * 2] && bBounds[i * 2] <= bounds[i * 2 + 1]) continue;
|
|
58456
|
+
else if (bounds[i * 2] >= bBounds[i * 2] && bounds[i * 2] <= bBounds[i * 2 + 1]) continue;
|
|
58457
|
+
if (bBounds[i * 2 + 1] >= bounds[i * 2] && bBounds[i * 2 + 1] <= bounds[i * 2 + 1]) continue;
|
|
58458
|
+
else if (bounds[i * 2 + 1] >= bBounds[i * 2] && bounds[i * 2 + 1] <= bBounds[i * 2 + 1]) continue;
|
|
58459
|
+
return false;
|
|
58460
|
+
}
|
|
58461
|
+
return true;
|
|
58462
|
+
}
|
|
58463
|
+
function containsPoint(bounds, x, y, z) {
|
|
58464
|
+
if (x < bounds[0] || x > bounds[1]) return false;
|
|
58465
|
+
if (y < bounds[2] || y > bounds[3]) return false;
|
|
58466
|
+
if (z < bounds[4] || z > bounds[5]) return false;
|
|
58467
|
+
return true;
|
|
58468
|
+
}
|
|
58469
|
+
function contains(bounds, otherBounds) {
|
|
58470
|
+
if (!intersects(bounds, otherBounds)) return false;
|
|
58471
|
+
if (!containsPoint(bounds, ...getMinPoint(otherBounds))) return false;
|
|
58472
|
+
if (!containsPoint(bounds, ...getMaxPoint(otherBounds))) return false;
|
|
58473
|
+
return true;
|
|
58474
|
+
}
|
|
58475
|
+
/**
|
|
58476
|
+
* Returns true if plane intersects bounding box.
|
|
58477
|
+
* If so, the box is cut by the plane
|
|
58478
|
+
* @param {array} origin
|
|
58479
|
+
* @param {array} normal
|
|
58480
|
+
*/
|
|
58481
|
+
function cutWithPlane(bounds, origin, normal) {
|
|
58482
|
+
const index = [
|
|
58483
|
+
[
|
|
58484
|
+
0,
|
|
58485
|
+
1,
|
|
58486
|
+
2,
|
|
58487
|
+
3,
|
|
58488
|
+
4,
|
|
58489
|
+
5,
|
|
58490
|
+
6,
|
|
58491
|
+
7
|
|
58492
|
+
],
|
|
58493
|
+
[
|
|
58494
|
+
0,
|
|
58495
|
+
1,
|
|
58496
|
+
4,
|
|
58497
|
+
5,
|
|
58498
|
+
2,
|
|
58499
|
+
3,
|
|
58500
|
+
6,
|
|
58501
|
+
7
|
|
58502
|
+
],
|
|
58503
|
+
[
|
|
58504
|
+
0,
|
|
58505
|
+
2,
|
|
58506
|
+
4,
|
|
58507
|
+
6,
|
|
58508
|
+
1,
|
|
58509
|
+
3,
|
|
58510
|
+
5,
|
|
58511
|
+
7
|
|
58512
|
+
]
|
|
58513
|
+
];
|
|
58514
|
+
const d = [
|
|
58515
|
+
0,
|
|
58516
|
+
0,
|
|
58517
|
+
0,
|
|
58518
|
+
0,
|
|
58519
|
+
0,
|
|
58520
|
+
0,
|
|
58521
|
+
0,
|
|
58522
|
+
0
|
|
58523
|
+
];
|
|
58524
|
+
let idx = 0;
|
|
58525
|
+
for (let ix = 0; ix < 2; ix++) for (let iy = 2; iy < 4; iy++) for (let iz = 4; iz < 6; iz++) {
|
|
58526
|
+
const x = [
|
|
58527
|
+
bounds[ix],
|
|
58528
|
+
bounds[iy],
|
|
58529
|
+
bounds[iz]
|
|
58530
|
+
];
|
|
58531
|
+
d[idx++] = _Plane_js__rspack_import_1/* ["default"].evaluate */.Ay.evaluate(normal, origin, x);
|
|
58532
|
+
}
|
|
58533
|
+
let dir = 2;
|
|
58534
|
+
while (dir--) if (oppositeSign(d[index[dir][0]], d[index[dir][4]]) && oppositeSign(d[index[dir][1]], d[index[dir][5]]) && oppositeSign(d[index[dir][2]], d[index[dir][6]]) && oppositeSign(d[index[dir][3]], d[index[dir][7]])) break;
|
|
58535
|
+
if (dir < 0) return false;
|
|
58536
|
+
const sign = Math.sign(normal[dir]);
|
|
58537
|
+
const size = Math.abs((bounds[dir * 2 + 1] - bounds[dir * 2]) * normal[dir]);
|
|
58538
|
+
let t = sign > 0 ? 1 : 0;
|
|
58539
|
+
for (let i = 0; i < 4; i++) {
|
|
58540
|
+
if (size === 0) continue;
|
|
58541
|
+
const ti = Math.abs(d[index[dir][i]]) / size;
|
|
58542
|
+
if (sign > 0 && ti < t) t = ti;
|
|
58543
|
+
if (sign < 0 && ti > t) t = ti;
|
|
58544
|
+
}
|
|
58545
|
+
const bound = (1 - t) * bounds[dir * 2] + t * bounds[dir * 2 + 1];
|
|
58546
|
+
if (sign > 0) bounds[dir * 2] = bound;
|
|
58547
|
+
else bounds[dir * 2 + 1] = bound;
|
|
58548
|
+
return true;
|
|
58549
|
+
}
|
|
58550
|
+
/**
|
|
58551
|
+
* Clamp the divisions to ensure the total number doesn't exceed targetBins
|
|
58552
|
+
* @param {Number} targetBins - Maximum number of bins allowed
|
|
58553
|
+
* @param {Array} divs - Divisions array to adjust [divX, divY, divZ]
|
|
58554
|
+
*/
|
|
58555
|
+
function clampDivisions(targetBins, divs) {
|
|
58556
|
+
for (let i = 0; i < 3; ++i) divs[i] = divs[i] < 1 ? 1 : divs[i];
|
|
58557
|
+
let numBins = divs[0] * divs[1] * divs[2];
|
|
58558
|
+
while (numBins > targetBins) {
|
|
58559
|
+
for (let i = 0; i < 3; ++i) divs[i] = divs[i] > 1 ? divs[i] - 1 : 1;
|
|
58560
|
+
numBins = divs[0] * divs[1] * divs[2];
|
|
58561
|
+
}
|
|
58562
|
+
}
|
|
58563
|
+
/**
|
|
58564
|
+
* Compute the number of divisions given the current bounding box and a
|
|
58565
|
+
* target number of buckets/bins. Handles degenerate bounding boxes properly.
|
|
58566
|
+
* @param {Bounds} bounds - The bounding box
|
|
58567
|
+
* @param {Number} totalBins - Target number of bins
|
|
58568
|
+
* @param {Array} divs - Output array to store divisions [divX, divY, divZ]
|
|
58569
|
+
* @param {Array} [adjustedBounds] - Output array to store adjusted bounds if needed
|
|
58570
|
+
* @returns {Number} The actual total number of bins
|
|
58571
|
+
*/
|
|
58572
|
+
function computeDivisions(bounds, totalBins, divs, adjustedBounds = []) {
|
|
58573
|
+
totalBins = totalBins <= 0 ? 1 : totalBins;
|
|
58574
|
+
let numNonZero = 0;
|
|
58575
|
+
const nonZero = [
|
|
58576
|
+
0,
|
|
58577
|
+
0,
|
|
58578
|
+
0
|
|
58579
|
+
];
|
|
58580
|
+
let maxIdx = -1;
|
|
58581
|
+
let max = 0;
|
|
58582
|
+
const lengths = getLengths(bounds);
|
|
58583
|
+
const totLen = lengths[0] + lengths[1] + lengths[2];
|
|
58584
|
+
const zeroDetectionTolerance = totLen * (.001 / 3);
|
|
58585
|
+
for (let i = 0; i < 3; ++i) {
|
|
58586
|
+
if (lengths[i] > max) {
|
|
58587
|
+
maxIdx = i;
|
|
58588
|
+
max = lengths[i];
|
|
58589
|
+
}
|
|
58590
|
+
if (lengths[i] > zeroDetectionTolerance) {
|
|
58591
|
+
nonZero[i] = 1;
|
|
58592
|
+
numNonZero++;
|
|
58593
|
+
} else nonZero[i] = 0;
|
|
58594
|
+
}
|
|
58595
|
+
const minPoint = getMinPoint(bounds);
|
|
58596
|
+
const maxPoint = getMaxPoint(bounds);
|
|
58597
|
+
if (numNonZero < 1) {
|
|
58598
|
+
divs[0] = 1;
|
|
58599
|
+
divs[1] = 1;
|
|
58600
|
+
divs[2] = 1;
|
|
58601
|
+
adjustedBounds[0] = minPoint[0] - .5;
|
|
58602
|
+
adjustedBounds[1] = maxPoint[0] + .5;
|
|
58603
|
+
adjustedBounds[2] = minPoint[1] - .5;
|
|
58604
|
+
adjustedBounds[3] = maxPoint[1] + .5;
|
|
58605
|
+
adjustedBounds[4] = minPoint[2] - .5;
|
|
58606
|
+
adjustedBounds[5] = maxPoint[2] + .5;
|
|
58607
|
+
return 1;
|
|
58608
|
+
}
|
|
58609
|
+
let f = totalBins;
|
|
58610
|
+
f /= nonZero[0] ? lengths[0] / totLen : 1;
|
|
58611
|
+
f /= nonZero[1] ? lengths[1] / totLen : 1;
|
|
58612
|
+
f /= nonZero[2] ? lengths[2] / totLen : 1;
|
|
58613
|
+
f **= 1 / numNonZero;
|
|
58614
|
+
for (let i = 0; i < 3; ++i) {
|
|
58615
|
+
divs[i] = nonZero[i] ? Math.floor(f * lengths[i] / totLen) : 1;
|
|
58616
|
+
divs[i] = divs[i] < 1 ? 1 : divs[i];
|
|
58617
|
+
}
|
|
58618
|
+
clampDivisions(totalBins, divs);
|
|
58619
|
+
const delta = .5 * lengths[maxIdx] / divs[maxIdx];
|
|
58620
|
+
for (let i = 0; i < 3; ++i) if (nonZero[i]) {
|
|
58621
|
+
adjustedBounds[2 * i] = minPoint[i];
|
|
58622
|
+
adjustedBounds[2 * i + 1] = maxPoint[i];
|
|
58623
|
+
} else {
|
|
58624
|
+
adjustedBounds[2 * i] = minPoint[i] - delta;
|
|
58625
|
+
adjustedBounds[2 * i + 1] = maxPoint[i] + delta;
|
|
58626
|
+
}
|
|
58627
|
+
return divs[0] * divs[1] * divs[2];
|
|
58628
|
+
}
|
|
58629
|
+
/**
|
|
58630
|
+
* Calculate the squared distance from point x to the specified bounds.
|
|
58631
|
+
* @param {Vector3} x The point coordinates
|
|
58632
|
+
* @param {Bounds} bounds The bounding box coordinates
|
|
58633
|
+
* @returns {Number} The squared distance to the bounds
|
|
58634
|
+
*/
|
|
58635
|
+
function distance2ToBounds(x, bounds) {
|
|
58636
|
+
if (x[0] >= bounds[0] && x[0] <= bounds[1] && x[1] >= bounds[2] && x[1] <= bounds[3] && x[2] >= bounds[4] && x[2] <= bounds[5]) return 0;
|
|
58637
|
+
const deltas = [
|
|
58638
|
+
0,
|
|
58639
|
+
0,
|
|
58640
|
+
0
|
|
58641
|
+
];
|
|
58642
|
+
if (x[0] < bounds[0]) deltas[0] = bounds[0] - x[0];
|
|
58643
|
+
else if (x[0] > bounds[1]) deltas[0] = x[0] - bounds[1];
|
|
58644
|
+
if (x[1] < bounds[2]) deltas[1] = bounds[2] - x[1];
|
|
58645
|
+
else if (x[1] > bounds[3]) deltas[1] = x[1] - bounds[3];
|
|
58646
|
+
if (x[2] < bounds[4]) deltas[2] = bounds[4] - x[2];
|
|
58647
|
+
else if (x[2] > bounds[5]) deltas[2] = x[2] - bounds[5];
|
|
58648
|
+
return (0,_Core_Math_js__rspack_import_0/* .dot */.Om)(deltas, deltas);
|
|
58649
|
+
}
|
|
58650
|
+
var BoundingBox = class {
|
|
58651
|
+
constructor(refBounds) {
|
|
58652
|
+
this.bounds = refBounds;
|
|
58653
|
+
if (!this.bounds) this.bounds = new Float64Array(INIT_BOUNDS);
|
|
58654
|
+
}
|
|
58655
|
+
getBounds() {
|
|
58656
|
+
return this.bounds;
|
|
58657
|
+
}
|
|
58658
|
+
equals(otherBounds) {
|
|
58659
|
+
return equals(this.bounds, otherBounds);
|
|
58660
|
+
}
|
|
58661
|
+
isValid() {
|
|
58662
|
+
return isValid(this.bounds);
|
|
58663
|
+
}
|
|
58664
|
+
setBounds(otherBounds) {
|
|
58665
|
+
return setBounds(this.bounds, otherBounds);
|
|
58666
|
+
}
|
|
58667
|
+
reset() {
|
|
58668
|
+
return reset(this.bounds);
|
|
58669
|
+
}
|
|
58670
|
+
addPoint(...xyz) {
|
|
58671
|
+
return addPoint(this.bounds, ...xyz);
|
|
58672
|
+
}
|
|
58673
|
+
addPoints(points) {
|
|
58674
|
+
return addPoints(this.bounds, points);
|
|
58675
|
+
}
|
|
58676
|
+
addBounds(xMin, xMax, yMin, yMax, zMin, zMax) {
|
|
58677
|
+
return addBounds(this.bounds, xMin, xMax, yMin, yMax, zMin, zMax);
|
|
58678
|
+
}
|
|
58679
|
+
setMinPoint(x, y, z) {
|
|
58680
|
+
return setMinPoint(this.bounds, x, y, z);
|
|
58681
|
+
}
|
|
58682
|
+
setMaxPoint(x, y, z) {
|
|
58683
|
+
return setMaxPoint(this.bounds, x, y, z);
|
|
58684
|
+
}
|
|
58685
|
+
inflate(delta) {
|
|
58686
|
+
return inflate(this.bounds, delta);
|
|
58687
|
+
}
|
|
58688
|
+
scale(sx, sy, sz) {
|
|
58689
|
+
return scale(this.bounds, sx, sy, sz);
|
|
58690
|
+
}
|
|
58691
|
+
getCenter() {
|
|
58692
|
+
return getCenter(this.bounds);
|
|
58693
|
+
}
|
|
58694
|
+
getLength(index) {
|
|
58695
|
+
return getLength(this.bounds, index);
|
|
58696
|
+
}
|
|
58697
|
+
getLengths() {
|
|
58698
|
+
return getLengths(this.bounds);
|
|
58699
|
+
}
|
|
58700
|
+
getMaxLength() {
|
|
58701
|
+
return getMaxLength(this.bounds);
|
|
58702
|
+
}
|
|
58703
|
+
getDiagonalLength() {
|
|
58704
|
+
return getDiagonalLength(this.bounds);
|
|
58705
|
+
}
|
|
58706
|
+
getDiagonalLength2() {
|
|
58707
|
+
return getDiagonalLength2(this.bounds);
|
|
58708
|
+
}
|
|
58709
|
+
getMinPoint() {
|
|
58710
|
+
return getMinPoint(this.bounds);
|
|
58711
|
+
}
|
|
58712
|
+
getMaxPoint() {
|
|
58713
|
+
return getMaxPoint(this.bounds);
|
|
58714
|
+
}
|
|
58715
|
+
getXRange() {
|
|
58716
|
+
return getXRange(this.bounds);
|
|
58717
|
+
}
|
|
58718
|
+
getYRange() {
|
|
58719
|
+
return getYRange(this.bounds);
|
|
58720
|
+
}
|
|
58721
|
+
getZRange() {
|
|
58722
|
+
return getZRange(this.bounds);
|
|
58723
|
+
}
|
|
58724
|
+
getCorners(corners) {
|
|
58725
|
+
return getCorners(this.bounds, corners);
|
|
58726
|
+
}
|
|
58727
|
+
computeCornerPoints(point1, point2) {
|
|
58728
|
+
return computeCornerPoints(this.bounds, point1, point2);
|
|
58729
|
+
}
|
|
58730
|
+
computeLocalBounds(u, v, w) {
|
|
58731
|
+
return computeLocalBounds(this.bounds, u, v, w);
|
|
58732
|
+
}
|
|
58733
|
+
transformBounds(transform, out = []) {
|
|
58734
|
+
return transformBounds(this.bounds, transform, out);
|
|
58735
|
+
}
|
|
58736
|
+
computeScale3(scale3) {
|
|
58737
|
+
return computeScale3(this.bounds, scale3);
|
|
58738
|
+
}
|
|
58739
|
+
cutWithPlane(origin, normal) {
|
|
58740
|
+
return cutWithPlane(this.bounds, origin, normal);
|
|
58741
|
+
}
|
|
58742
|
+
intersectBox(origin, dir, coord, tolerance) {
|
|
58743
|
+
return intersectBox(this.bounds, origin, dir, coord, tolerance);
|
|
58744
|
+
}
|
|
58745
|
+
intersectPlane(origin, normal) {
|
|
58746
|
+
return intersectPlane(this.bounds, origin, normal);
|
|
58747
|
+
}
|
|
58748
|
+
intersect(otherBounds) {
|
|
58749
|
+
return intersect(this.bounds, otherBounds);
|
|
58750
|
+
}
|
|
58751
|
+
intersects(otherBounds) {
|
|
58752
|
+
return intersects(this.bounds, otherBounds);
|
|
58753
|
+
}
|
|
58754
|
+
containsPoint(x, y, z) {
|
|
58755
|
+
return containsPoint(this.bounds, x, y, z);
|
|
58756
|
+
}
|
|
58757
|
+
contains(otherBounds) {
|
|
58758
|
+
return intersects(this.bounds, otherBounds);
|
|
58759
|
+
}
|
|
58760
|
+
computeDivisions(totalBins, divs, adjustedBounds = []) {
|
|
58761
|
+
return computeDivisions(this.bounds, totalBins, divs, adjustedBounds);
|
|
58762
|
+
}
|
|
58763
|
+
distance2ToBounds(x) {
|
|
58764
|
+
return distance2ToBounds(x, this.bounds);
|
|
58765
|
+
}
|
|
58766
|
+
};
|
|
58767
|
+
function newInstance(initialValues) {
|
|
58768
|
+
return new BoundingBox(initialValues && initialValues.bounds);
|
|
58769
|
+
}
|
|
58770
|
+
var STATIC = {
|
|
58771
|
+
equals,
|
|
58772
|
+
isValid,
|
|
58773
|
+
setBounds,
|
|
58774
|
+
reset,
|
|
58775
|
+
addPoint,
|
|
58776
|
+
addPoints,
|
|
58777
|
+
addBounds,
|
|
58778
|
+
setMinPoint,
|
|
58779
|
+
setMaxPoint,
|
|
58780
|
+
inflate,
|
|
58781
|
+
scale,
|
|
58782
|
+
scaleAboutCenter,
|
|
58783
|
+
getCenter,
|
|
58784
|
+
getLength,
|
|
58785
|
+
getLengths,
|
|
58786
|
+
getMaxLength,
|
|
58787
|
+
getDiagonalLength,
|
|
58788
|
+
getDiagonalLength2,
|
|
58789
|
+
getMinPoint,
|
|
58790
|
+
getMaxPoint,
|
|
58791
|
+
getXRange,
|
|
58792
|
+
getYRange,
|
|
58793
|
+
getZRange,
|
|
58794
|
+
getCorners,
|
|
58795
|
+
computeCornerPoints,
|
|
58796
|
+
computeLocalBounds,
|
|
58797
|
+
transformBounds,
|
|
58798
|
+
computeScale3,
|
|
58799
|
+
cutWithPlane,
|
|
58800
|
+
intersectBox,
|
|
58801
|
+
intersectPlane,
|
|
58802
|
+
intersect,
|
|
58803
|
+
intersects,
|
|
58804
|
+
containsPoint,
|
|
58805
|
+
contains,
|
|
58806
|
+
computeDivisions,
|
|
58807
|
+
clampDivisions,
|
|
58808
|
+
distance2ToBounds,
|
|
58809
|
+
INIT_BOUNDS
|
|
58810
|
+
};
|
|
58811
|
+
var BoundingBox_default = {
|
|
58812
|
+
newInstance,
|
|
58813
|
+
...STATIC
|
|
58814
|
+
};
|
|
58815
|
+
//#endregion
|
|
58816
|
+
|
|
58817
|
+
|
|
58818
|
+
//# sourceMappingURL=BoundingBox.js.map
|
|
58819
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
58820
|
+
Ay: () => (BoundingBox_default)
|
|
58821
|
+
});
|
|
58822
|
+
|
|
58823
|
+
|
|
55861
58824
|
},
|
|
55862
58825
|
83545(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
55863
58826
|
"use strict";
|