@vitessce/comparative 4.0.3 → 4.0.4
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/{GeometryAndMeshXR-BHrmC4cr.js → GeometryAndMeshXR-DnEggDH1.js} +1 -1
- package/dist/{ReactNeuroglancer-BBCwblqh.js → ReactNeuroglancer-DUC_w4Bb.js} +1 -1
- package/dist/{XREnterButton-a9dBPVyT.js → XREnterButton-Cyof791n.js} +1 -1
- package/dist/{XRSceneComponents-BwYYzNAC.js → XRSceneComponents-C4ONlZoX.js} +1 -1
- package/dist/{XRWrapper-wqMkk4za.js → XRWrapper-BO-Jnk8o.js} +2 -2
- package/dist/{deflate-COhnYD7M.js → deflate-5UI_dWhV.js} +1 -1
- package/dist/{higlass-vYvKq4h0.js → higlass-27J4aDaE.js} +1 -1
- package/dist/{index-mAwKp-BM.js → index-B5sy32t8.js} +284 -284
- package/dist/{index-B0HjR6Tv.js → index-CeBUAoRh.js} +51657 -51581
- package/dist/{index-5tyz_v9K.js → index-Ckzw1hkl.js} +273 -273
- package/dist/index.min.js +1 -1
- package/dist/{jpeg-F4t150gA.js → jpeg-DHJ5CptT.js} +1 -1
- package/dist/{lerc-DQ5JWtPx.js → lerc-DpgX7gPN.js} +1 -1
- package/dist/{lzw-CdCk8kWv.js → lzw-BKCZ97Xn.js} +1 -1
- package/dist/{packbits-Dphwu5tY.js → packbits-BbqppHHf.js} +1 -1
- package/dist/{raw-s-pLRFQJ.js → raw-DT39g9B4.js} +1 -1
- package/dist/{webimage-CRaAk8or.js → webimage-DGOMv-v_.js} +1 -1
- package/dist/{xrStore-Ikvx6LLB.js → xrStore-BnMUEZkm.js} +1 -1
- package/package.json +11 -11
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var xe = Object.defineProperty;
|
|
2
2
|
var ye = (t, e, a) => e in t ? xe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
|
|
3
|
-
var
|
|
4
|
-
import { jsxs as
|
|
5
|
-
import ae, { useRef as Q, useState as
|
|
3
|
+
var O = (t, e, a) => ye(t, typeof e != "symbol" ? e + "" : e, a);
|
|
4
|
+
import { jsxs as H, jsx as _, Fragment as be } from "react/jsx-runtime";
|
|
5
|
+
import ae, { useRef as Q, useState as X, useEffect as q, Suspense as ee, forwardRef as Se } from "react";
|
|
6
6
|
import { Canvas as Ce } from "@react-three/fiber";
|
|
7
7
|
import { Center as ze, Text as ve, Line as Te, Bvh as we, OrbitControls as Me } from "@react-three/drei";
|
|
8
|
-
import { Matrix3 as Le, Matrix4 as ie, Vector3 as
|
|
9
|
-
import { C as
|
|
8
|
+
import { Matrix3 as Le, Matrix4 as ie, Vector3 as P, Vector2 as G, UniformsUtils as Pe, Data3DTexture as Ae, RedFormat as De, FloatType as Ie, LinearFilter as ge, FrontSide as _e, Scene as Fe, Group as Ee, MeshPhysicalMaterial as Re, MeshBasicMaterial as Ve, MeshStandardMaterial as Oe, BackSide as ke } from "three";
|
|
9
|
+
import { C as j, g as Ue } from "./index-CeBUAoRh.js";
|
|
10
10
|
function Ne({ currentLine: t, scale: e }) {
|
|
11
11
|
const a = Q(null);
|
|
12
|
-
return
|
|
12
|
+
return H("group", { children: [_(ze, { bottom: !0, right: !0, position: [t.midPoint.x, t.midPoint.y, t.midPoint.z], rotation: [0, 0, 0], children: _(ve, { color: "gray", scale: 0.05, ref: a, children: `${(t.startPoint.distanceTo(t.endPoint) * e).toFixed(2)} µm` }) }), _(Te, {
|
|
13
13
|
points: [t.startPoint, t.endPoint],
|
|
14
14
|
color: "white",
|
|
15
15
|
lineWidth: 2,
|
|
@@ -26,39 +26,39 @@ class je {
|
|
|
26
26
|
* @param {ArrayBuffer} arrayBuffer The buffer with volume data
|
|
27
27
|
*/
|
|
28
28
|
constructor(e, a, o, i, l) {
|
|
29
|
-
|
|
29
|
+
O(this, "spacing", [1, 1, 1]);
|
|
30
30
|
// Offset of the volume in the RAS coordinate system
|
|
31
|
-
|
|
31
|
+
O(this, "offset", [0, 0, 0]);
|
|
32
32
|
// The IJK to RAS matrix
|
|
33
|
-
|
|
33
|
+
O(this, "matrix", new Le().identity());
|
|
34
34
|
// The list of all the slices associated to this volume
|
|
35
|
-
|
|
35
|
+
O(this, "sliceList", []);
|
|
36
36
|
/**
|
|
37
37
|
* The voxels with values under this
|
|
38
38
|
* threshold won't appear in the slices.
|
|
39
39
|
* If changed, geometryNeedsUpdate is automatically set to true on all
|
|
40
40
|
* the slices associated to this volume
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
O(this, "lowerThresholdValue", -1 / 0);
|
|
43
43
|
/**
|
|
44
44
|
* The voxels with values over this
|
|
45
45
|
* threshold won't appear in the slices.
|
|
46
46
|
* If changed, geometryNeedsUpdate is automatically set to true on all
|
|
47
47
|
* the slices associated to this volume
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
O(this, "upperThresholdValue", 1 / 0);
|
|
50
50
|
// Width of the volume in the IJK coordinate system
|
|
51
|
-
|
|
51
|
+
O(this, "xLength", 1);
|
|
52
52
|
// Height of the volume in the IJK coordinate system
|
|
53
|
-
|
|
53
|
+
O(this, "yLength", 1);
|
|
54
54
|
// Depth of the volume in the IJK coordinate system
|
|
55
|
-
|
|
55
|
+
O(this, "zLength", 1);
|
|
56
56
|
// Data of the volume
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
O(this, "data");
|
|
58
|
+
O(this, "RASDimensions");
|
|
59
|
+
O(this, "inverseMatrix");
|
|
60
|
+
O(this, "min");
|
|
61
|
+
O(this, "max");
|
|
62
62
|
if (e !== void 0) {
|
|
63
63
|
switch (this.xLength = Number(e) || 1, this.yLength = Number(a) || 1, this.zLength = Number(o) || 1, i) {
|
|
64
64
|
case "Uint8":
|
|
@@ -192,35 +192,35 @@ class je {
|
|
|
192
192
|
*/
|
|
193
193
|
extractPerpendicularPlane(e, a) {
|
|
194
194
|
const o = new ie().identity(), i = this;
|
|
195
|
-
let l, n,
|
|
196
|
-
const
|
|
195
|
+
let l, n, g, p;
|
|
196
|
+
const m = new P(), c = new P(), s = new P(), w = new P(this.xLength, this.yLength, this.zLength);
|
|
197
197
|
switch (e) {
|
|
198
198
|
case "x":
|
|
199
|
-
|
|
199
|
+
m.set(1, 0, 0), c.set(0, 0, -1), s.set(0, -1, 0), l = this.spacing[2], n = this.spacing[1], p = new P(a, 0, 0), o.multiply(new ie().makeRotationY(Math.PI / 2)), g = (i.RASDimensions[0] - 1) / 2, o.setPosition(new P(a - g, 0, 0));
|
|
200
200
|
break;
|
|
201
201
|
case "y":
|
|
202
|
-
|
|
202
|
+
m.set(0, 1, 0), c.set(1, 0, 0), s.set(0, 0, 1), l = this.spacing[0], n = this.spacing[2], p = new P(0, a, 0), o.multiply(new ie().makeRotationX(-Math.PI / 2)), g = (i.RASDimensions[1] - 1) / 2, o.setPosition(new P(0, a - g, 0));
|
|
203
203
|
break;
|
|
204
204
|
case "z":
|
|
205
205
|
default:
|
|
206
|
-
|
|
206
|
+
m.set(0, 0, 1), c.set(1, 0, 0), s.set(0, -1, 0), l = this.spacing[0], n = this.spacing[1], p = new P(0, 0, a), g = (i.RASDimensions[2] - 1) / 2, o.setPosition(new P(0, 0, a - g));
|
|
207
207
|
break;
|
|
208
208
|
}
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
const
|
|
213
|
-
function
|
|
214
|
-
const
|
|
215
|
-
return i.access(
|
|
209
|
+
c.applyMatrix4(i.inverseMatrix).normalize(), c.argVar = "i", s.applyMatrix4(i.inverseMatrix).normalize(), s.argVar = "j", m.applyMatrix4(i.inverseMatrix).normalize();
|
|
210
|
+
const x = Math.floor(Math.abs(c.dot(w))), z = Math.floor(Math.abs(s.dot(w))), f = Math.abs(x * l), M = Math.abs(z * n);
|
|
211
|
+
p = Math.abs(Math.round(p.applyMatrix4(i.inverseMatrix).dot(m)));
|
|
212
|
+
const v = [new P(1, 0, 0), new P(0, 1, 0), new P(0, 0, 1)], h = [c, s, m].find((A) => Math.abs(A.dot(v[0])) > 0.9), C = [c, s, m].find((A) => Math.abs(A.dot(v[1])) > 0.9), d = [c, s, m].find((A) => Math.abs(A.dot(v[2])) > 0.9);
|
|
213
|
+
function F(A, y) {
|
|
214
|
+
const T = h === m ? p : h.argVar === "i" ? A : y, k = C === m ? p : C.argVar === "i" ? A : y, U = d === m ? p : d.argVar === "i" ? A : y, N = h.dot(v[0]) > 0 ? T : i.xLength - 1 - T, W = C.dot(v[1]) > 0 ? k : i.yLength - 1 - k, Z = d.dot(v[2]) > 0 ? U : i.zLength - 1 - U;
|
|
215
|
+
return i.access(N, W, Z);
|
|
216
216
|
}
|
|
217
217
|
return {
|
|
218
|
-
iLength:
|
|
219
|
-
jLength:
|
|
220
|
-
sliceAccess:
|
|
218
|
+
iLength: x,
|
|
219
|
+
jLength: z,
|
|
220
|
+
sliceAccess: F,
|
|
221
221
|
matrix: o,
|
|
222
|
-
planeWidth:
|
|
223
|
-
planeHeight:
|
|
222
|
+
planeWidth: f,
|
|
223
|
+
planeHeight: M
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
226
|
/**
|
|
@@ -242,24 +242,24 @@ class je {
|
|
|
242
242
|
}
|
|
243
243
|
const Ge = {
|
|
244
244
|
uniforms: {
|
|
245
|
-
u_size: { value: new
|
|
245
|
+
u_size: { value: new P(1, 1, 1) },
|
|
246
246
|
u_renderstyle: { value: 0 },
|
|
247
247
|
u_renderthreshold: { value: 0.5 },
|
|
248
248
|
u_opacity: { value: 0.5 },
|
|
249
|
-
u_clim: { value: new
|
|
250
|
-
u_clim2: { value: new
|
|
251
|
-
u_clim3: { value: new
|
|
252
|
-
u_clim4: { value: new
|
|
253
|
-
u_clim5: { value: new
|
|
254
|
-
u_clim6: { value: new
|
|
255
|
-
u_xClip: { value: new
|
|
256
|
-
u_yClip: { value: new
|
|
257
|
-
u_zClip: { value: new
|
|
249
|
+
u_clim: { value: new G(0.2, 0.8) },
|
|
250
|
+
u_clim2: { value: new G(0.2, 0.8) },
|
|
251
|
+
u_clim3: { value: new G(0.2, 0.8) },
|
|
252
|
+
u_clim4: { value: new G(0.2, 0.8) },
|
|
253
|
+
u_clim5: { value: new G(0.2, 0.8) },
|
|
254
|
+
u_clim6: { value: new G(0.2, 0.8) },
|
|
255
|
+
u_xClip: { value: new G(-1, 1e6) },
|
|
256
|
+
u_yClip: { value: new G(-1, 1e6) },
|
|
257
|
+
u_zClip: { value: new G(-1, 1e6) },
|
|
258
258
|
u_data: { value: null },
|
|
259
259
|
u_stop_geom: { value: null },
|
|
260
260
|
u_geo_color: { value: null },
|
|
261
|
-
u_window_size: { value: new
|
|
262
|
-
u_vol_scale: { value: new
|
|
261
|
+
u_window_size: { value: new G(1, 1) },
|
|
262
|
+
u_vol_scale: { value: new P(1, 1, 1) },
|
|
263
263
|
u_physical_Pixel: { value: 0.5 },
|
|
264
264
|
volumeTex: { value: null },
|
|
265
265
|
volumeTex2: { value: null },
|
|
@@ -267,12 +267,12 @@ const Ge = {
|
|
|
267
267
|
volumeTex4: { value: null },
|
|
268
268
|
volumeTex5: { value: null },
|
|
269
269
|
volumeTex6: { value: null },
|
|
270
|
-
u_color: { value: new
|
|
271
|
-
u_color2: { value: new
|
|
272
|
-
u_color3: { value: new
|
|
273
|
-
u_color4: { value: new
|
|
274
|
-
u_color5: { value: new
|
|
275
|
-
u_color6: { value: new
|
|
270
|
+
u_color: { value: new P(0, 0, 0) },
|
|
271
|
+
u_color2: { value: new P(0, 0, 0) },
|
|
272
|
+
u_color3: { value: new P(0, 0, 0) },
|
|
273
|
+
u_color4: { value: new P(0, 0, 0) },
|
|
274
|
+
u_color5: { value: new P(0, 0, 0) },
|
|
275
|
+
u_color6: { value: new P(0, 0, 0) },
|
|
276
276
|
u_cmdata: { value: null },
|
|
277
277
|
near: { value: 0.1 },
|
|
278
278
|
far: { value: 1e4 },
|
|
@@ -280,7 +280,7 @@ const Ge = {
|
|
|
280
280
|
dtScale: { value: 1 },
|
|
281
281
|
volumeCount: { value: 0 },
|
|
282
282
|
finalGamma: { value: 0 },
|
|
283
|
-
boxSize: { value: new
|
|
283
|
+
boxSize: { value: new P(1, 1, 1) }
|
|
284
284
|
},
|
|
285
285
|
vertexShader: [
|
|
286
286
|
"out vec3 rayDirUnnorm;",
|
|
@@ -524,8 +524,8 @@ const Ge = {
|
|
|
524
524
|
additive: 2
|
|
525
525
|
};
|
|
526
526
|
function $e(t, e, a, o, i, l) {
|
|
527
|
-
const { spatialRenderingMode: n } = l,
|
|
528
|
-
if (!
|
|
527
|
+
const { spatialRenderingMode: n } = l, p = i?.image?.instance?.getData(!1);
|
|
528
|
+
if (!p)
|
|
529
529
|
return {
|
|
530
530
|
channelsVisible: null,
|
|
531
531
|
resolution: null,
|
|
@@ -541,122 +541,122 @@ function $e(t, e, a, o, i, l) {
|
|
|
541
541
|
ySlice: null,
|
|
542
542
|
zSlice: null
|
|
543
543
|
};
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
const
|
|
544
|
+
const m = i.image.instance, c = n === "3D", s = e[j.PHOTOMETRIC_INTERPRETATION] === "RGB", w = e[j.VOLUMETRIC_RENDERING_ALGORITHM], x = Xe[w], z = e[j.SPATIAL_LAYER_VISIBLE], f = e[j.SPATIAL_LAYER_OPACITY];
|
|
545
|
+
m.isInterleaved();
|
|
546
|
+
const M = s ? [
|
|
547
547
|
[255, 0, 0],
|
|
548
548
|
[0, 255, 0],
|
|
549
549
|
[0, 0, 255]
|
|
550
|
-
] : a.map((
|
|
550
|
+
] : a.map((N) => o[N][j.SPATIAL_CHANNEL_COLOR]), v = s ? [
|
|
551
551
|
[0, 255],
|
|
552
552
|
[0, 255],
|
|
553
553
|
[0, 255]
|
|
554
|
-
] : a.map((
|
|
554
|
+
] : a.map((N) => o[N][j.SPATIAL_CHANNEL_WINDOW] || [0, 255]), h = s ? [
|
|
555
555
|
// Layer visible AND channel visible
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
] : a.map((
|
|
556
|
+
z && !0,
|
|
557
|
+
z && !0,
|
|
558
|
+
z && !0
|
|
559
|
+
] : a.map((N) => (
|
|
560
560
|
// Layer visible AND channel visible
|
|
561
|
-
|
|
562
|
-
)),
|
|
561
|
+
z && o[N][j.SPATIAL_CHANNEL_VISIBLE]
|
|
562
|
+
)), C = s ? [
|
|
563
563
|
// Layer visible AND channel visible
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
] : a.map((
|
|
564
|
+
z && !0,
|
|
565
|
+
z && !0,
|
|
566
|
+
z && !0
|
|
567
|
+
] : a.map((N) => (
|
|
568
568
|
// Layer visible AND channel visible
|
|
569
|
-
|
|
570
|
-
)),
|
|
571
|
-
let
|
|
572
|
-
return
|
|
573
|
-
channelsVisible:
|
|
574
|
-
allChannels:
|
|
575
|
-
channelTargetC:
|
|
576
|
-
resolution:
|
|
577
|
-
data:
|
|
578
|
-
colors:
|
|
579
|
-
contrastLimits:
|
|
580
|
-
is3dMode:
|
|
581
|
-
renderingMode:
|
|
582
|
-
layerTransparency:
|
|
583
|
-
xSlice:
|
|
584
|
-
ySlice:
|
|
569
|
+
z && m.getChannelIndex(o[N][j.SPATIAL_TARGET_C])
|
|
570
|
+
)), d = m.getAutoTargetResolution(), F = e[j.SPATIAL_TARGET_RESOLUTION], A = F === null || Number.isNaN(F) ? d : F, y = i.image.loaders[0].channels ?? [];
|
|
571
|
+
let T = e[j.SPATIAL_SLICE_X], k = e[j.SPATIAL_SLICE_Y], U = e[j.SPATIAL_SLICE_Z];
|
|
572
|
+
return T = T !== null ? T : [-1, 1e5], k = k !== null ? k : [-1, 1e5], U = U !== null ? U : [-1, 1e5], {
|
|
573
|
+
channelsVisible: h,
|
|
574
|
+
allChannels: y,
|
|
575
|
+
channelTargetC: C,
|
|
576
|
+
resolution: A,
|
|
577
|
+
data: p,
|
|
578
|
+
colors: M,
|
|
579
|
+
contrastLimits: v,
|
|
580
|
+
is3dMode: c,
|
|
581
|
+
renderingMode: x,
|
|
582
|
+
layerTransparency: f,
|
|
583
|
+
xSlice: T,
|
|
584
|
+
ySlice: k,
|
|
585
585
|
zSlice: U
|
|
586
586
|
};
|
|
587
587
|
}
|
|
588
588
|
function He(t, e, a, o, i) {
|
|
589
|
-
const { images: l = {}, imageLayerScopes: n, imageLayerCoordination:
|
|
590
|
-
return
|
|
591
|
-
channelsVisible:
|
|
592
|
-
allChannels:
|
|
593
|
-
channelTargetC:
|
|
594
|
-
resolution:
|
|
595
|
-
data:
|
|
589
|
+
const { images: l = {}, imageLayerScopes: n, imageLayerCoordination: g, imageChannelScopesByLayer: p, imageChannelCoordination: m } = t, c = n[0], s = p[c], w = g[0][c], x = m[0][c], { channelsVisible: z, allChannels: f, channelTargetC: M, resolution: v, data: h, colors: C, contrastLimits: d, is3dMode: F, renderingMode: A, layerTransparency: y, xSlice: T, ySlice: k, zSlice: U } = $e(c, w, s, x, l[c], t);
|
|
590
|
+
return M !== null && (e.channelTargetC?.length !== 0 && (e.channelTargetC?.toString() !== M.toString() || e.resolution?.toString() !== v.toString()) ? o || i(!0) : (e.channelsVisible?.toString() !== z?.toString() || e.colors?.toString() !== C?.toString() || e.is3dMode !== F || e.contrastLimits?.toString() !== d?.toString() || e.renderingMode?.toString() !== A.toString() || e.layerTransparency.toString() !== y.toString() || e.xSlice?.toString() !== T.toString() || e.ySlice?.toString() !== k.toString() || e.zSlice?.toString() !== U.toString()) && (a({
|
|
591
|
+
channelsVisible: z,
|
|
592
|
+
allChannels: f,
|
|
593
|
+
channelTargetC: M,
|
|
594
|
+
resolution: v,
|
|
595
|
+
data: h,
|
|
596
596
|
colors: C,
|
|
597
|
-
contrastLimits:
|
|
598
|
-
is3dMode:
|
|
599
|
-
renderingMode:
|
|
600
|
-
layerTransparency:
|
|
601
|
-
xSlice:
|
|
602
|
-
ySlice:
|
|
603
|
-
zSlice:
|
|
597
|
+
contrastLimits: d,
|
|
598
|
+
is3dMode: F,
|
|
599
|
+
renderingMode: A,
|
|
600
|
+
layerTransparency: y,
|
|
601
|
+
xSlice: T,
|
|
602
|
+
ySlice: k,
|
|
603
|
+
zSlice: U
|
|
604
604
|
}), i(!1))), {
|
|
605
605
|
images: l,
|
|
606
|
-
layerScope:
|
|
606
|
+
layerScope: c,
|
|
607
607
|
imageLayerScopes: n,
|
|
608
|
-
imageLayerCoordination:
|
|
609
|
-
imageChannelScopesByLayer:
|
|
610
|
-
imageChannelCoordination:
|
|
611
|
-
channelsVisible:
|
|
612
|
-
allChannels:
|
|
613
|
-
channelTargetC:
|
|
614
|
-
resolution:
|
|
615
|
-
data:
|
|
608
|
+
imageLayerCoordination: g,
|
|
609
|
+
imageChannelScopesByLayer: p,
|
|
610
|
+
imageChannelCoordination: m,
|
|
611
|
+
channelsVisible: z,
|
|
612
|
+
allChannels: f,
|
|
613
|
+
channelTargetC: M,
|
|
614
|
+
resolution: v,
|
|
615
|
+
data: h,
|
|
616
616
|
colors: C,
|
|
617
|
-
contrastLimits:
|
|
618
|
-
is3dMode:
|
|
619
|
-
renderingMode:
|
|
620
|
-
layerTransparency:
|
|
621
|
-
xSlice:
|
|
622
|
-
ySlice:
|
|
623
|
-
zSlice:
|
|
617
|
+
contrastLimits: d,
|
|
618
|
+
is3dMode: F,
|
|
619
|
+
renderingMode: A,
|
|
620
|
+
layerTransparency: y,
|
|
621
|
+
xSlice: T,
|
|
622
|
+
ySlice: k,
|
|
623
|
+
zSlice: U
|
|
624
624
|
};
|
|
625
625
|
}
|
|
626
626
|
function K(t, e) {
|
|
627
627
|
const [a, o] = e;
|
|
628
628
|
return (t - a) / Math.sqrt(o ** 2 - a ** 2);
|
|
629
629
|
}
|
|
630
|
-
function Ye(t, e, a, o, i, l, n,
|
|
631
|
-
t.boxSize.value.set(a.xLength, a.yLength, a.zLength), t.volumeTex.value = e.length > 0 ? e[0] : null, t.volumeTex2.value = e.length > 1 ? e[1] : null, t.volumeTex3.value = e.length > 2 ? e[2] : null, t.volumeTex4.value = e.length > 3 ? e[3] : null, t.volumeTex5.value = e.length > 4 ? e[4] : null, t.volumeTex6.value = e.length > 5 ? e[5] : null, t.near.value = 0.1, t.far.value = 3e3, t.alphaScale.value = 1, t.dtScale.value =
|
|
630
|
+
function Ye(t, e, a, o, i, l, n, g, p, m, c, s, w) {
|
|
631
|
+
t.boxSize.value.set(a.xLength, a.yLength, a.zLength), t.volumeTex.value = e.length > 0 ? e[0] : null, t.volumeTex2.value = e.length > 1 ? e[1] : null, t.volumeTex3.value = e.length > 2 ? e[2] : null, t.volumeTex4.value = e.length > 3 ? e[3] : null, t.volumeTex5.value = e.length > 4 ? e[4] : null, t.volumeTex6.value = e.length > 5 ? e[5] : null, t.near.value = 0.1, t.far.value = 3e3, t.alphaScale.value = 1, t.dtScale.value = g, t.finalGamma.value = 4.5, t.volumeCount.value = e.length, t.u_size.value.set(a.xLength, a.yLength, a.zLength), t.u_stop_geom.value = null, t.u_window_size.value.set(0, 0), t.u_vol_scale.value.set(1 / a.xLength, 1 / a.yLength, 1 / a.zLength * 2), t.u_renderstyle.value = i, t.u_clim.value.set(l.length > 0 ? l[0][0] : null, l.length > 0 ? l[0][1] : null), t.u_clim2.value.set(l.length > 1 ? l[1][0] : null, l.length > 1 ? l[1][1] : null), t.u_clim3.value.set(l.length > 2 ? l[2][0] : null, l.length > 2 ? l[2][1] : null), t.u_clim4.value.set(l.length > 3 ? l[3][0] : null, l.length > 3 ? l[3][1] : null), t.u_clim5.value.set(l.length > 4 ? l[4][0] : null, l.length > 4 ? l[4][1] : null), t.u_clim6.value.set(l.length > 5 ? l[5][0] : null, l.length > 5 ? l[5][1] : null), t.u_xClip.value.set(p[0] * (1 / s[0]) / w[0] * a.xLength, p[1] * (1 / s[0]) / w[0] * a.xLength), t.u_yClip.value.set(m[0] * (1 / s[1]) / w[1] * a.yLength, m[1] * (1 / s[1]) / w[1] * a.yLength), t.u_zClip.value.set(c[0] * (1 / s[2]) / w[2] * a.zLength, c[1] * (1 / s[1]) / w[2] * a.zLength), t.u_color.value.set(n.length > 0 ? n[0][0] : null, n.length > 0 ? n[0][1] : null, n.length > 0 ? n[0][2] : null), t.u_color2.value.set(n.length > 1 ? n[1][0] : null, n.length > 1 ? n[1][1] : null, n.length > 1 ? n[1][2] : null), t.u_color3.value.set(n.length > 2 ? n[2][0] : null, n.length > 2 ? n[2][1] : null, n.length > 2 ? n[2][2] : null), t.u_color4.value.set(n.length > 3 ? n[3][0] : null, n.length > 3 ? n[3][1] : null, n.length > 3 ? n[3][2] : null), t.u_color5.value.set(n.length > 4 ? n[4][0] : null, n.length > 4 ? n[4][1] : null, n.length > 4 ? n[4][2] : null), t.u_color6.value.set(n.length > 5 ? n[5][0] : null, n.length > 5 ? n[5][1] : null, n.length > 5 ? n[5][2] : null);
|
|
632
632
|
}
|
|
633
|
-
function de(t, e, a, o, i, l, n,
|
|
634
|
-
const
|
|
635
|
-
let
|
|
636
|
-
if (
|
|
637
|
-
|
|
638
|
-
{ size:
|
|
639
|
-
{ size:
|
|
640
|
-
{ size:
|
|
633
|
+
function de(t, e, a, o, i, l, n, g, p, m, c, s, w, x) {
|
|
634
|
+
const z = [], f = [], M = [];
|
|
635
|
+
let v = null, h = g;
|
|
636
|
+
if (h == null || !Array.isArray(h) || h.length < 3)
|
|
637
|
+
h = [
|
|
638
|
+
{ size: h?.[0]?.size ?? 1 },
|
|
639
|
+
{ size: h?.[1]?.size ?? 1 },
|
|
640
|
+
{ size: h?.[2]?.size ?? 1 }
|
|
641
641
|
];
|
|
642
642
|
else
|
|
643
|
-
for (let
|
|
644
|
-
(!
|
|
645
|
-
if (e.forEach((
|
|
646
|
-
a[
|
|
647
|
-
K(n.get(
|
|
648
|
-
K(n.get(
|
|
649
|
-
]) :
|
|
650
|
-
K(l[
|
|
651
|
-
K(l[
|
|
643
|
+
for (let y = 0; y < h.length; y++)
|
|
644
|
+
(!h[y] || h[y].size === void 0 || h[y].size === null) && (h[y] = { size: 1 });
|
|
645
|
+
if (e.forEach((y, T) => {
|
|
646
|
+
a[T] && (v = t.get(y), z.push(i.get(y)), f.push([o[T][0] / 255, o[T][1] / 255, o[T][2] / 255]), l[T][0] === 0 && l[T][1] === 255 ? M.push([
|
|
647
|
+
K(n.get(y)[0], n.get(y)),
|
|
648
|
+
K(n.get(y)[1], n.get(y))
|
|
649
|
+
]) : M.push([
|
|
650
|
+
K(l[T][0], n.get(y)),
|
|
651
|
+
K(l[T][1], n.get(y))
|
|
652
652
|
]));
|
|
653
|
-
}),
|
|
653
|
+
}), v === null)
|
|
654
654
|
return null;
|
|
655
|
-
const C =
|
|
656
|
-
return Ye(
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
[1,
|
|
655
|
+
const C = v, d = {}, F = Ge, A = Pe.clone(F.uniforms);
|
|
656
|
+
return Ye(A, z, C, d, p, M, f, m, c, s, w, [h[0].size, h[1].size, h[2] ? h[2].size : 1], x), [
|
|
657
|
+
A,
|
|
658
|
+
F,
|
|
659
|
+
[1, h[1].size / h[0].size, h[2] ? h[2].size / h[0].size : 1],
|
|
660
660
|
[C.xLength, C.yLength, C.zLength],
|
|
661
661
|
[1, C.yLength / C.xLength, C.zLength / C.xLength]
|
|
662
662
|
];
|
|
@@ -680,26 +680,26 @@ async function Ze({
|
|
|
680
680
|
downsampleDepth: o = 1,
|
|
681
681
|
signal: i
|
|
682
682
|
}) {
|
|
683
|
-
const { shape: l, labels: n, dtype:
|
|
684
|
-
return await Promise.all(new Array(
|
|
685
|
-
const
|
|
683
|
+
const { shape: l, labels: n, dtype: g } = t, { height: p, width: m } = Ue(t), c = l[n.indexOf("z")], s = Math.max(1, Math.floor(c / o)), w = p * m, x = We[g], z = new x(w * s);
|
|
684
|
+
return await Promise.all(new Array(s).fill(0).map(async (f, M) => {
|
|
685
|
+
const v = {
|
|
686
686
|
...e,
|
|
687
|
-
z:
|
|
688
|
-
}, { data:
|
|
689
|
-
selection:
|
|
687
|
+
z: M * o
|
|
688
|
+
}, { data: h } = await t.getRaster({
|
|
689
|
+
selection: v,
|
|
690
690
|
signal: i
|
|
691
691
|
});
|
|
692
692
|
let C = 0;
|
|
693
|
-
for (a({ z:
|
|
694
|
-
const
|
|
695
|
-
|
|
693
|
+
for (a({ z: M, total: s, progress: 0.5 }); C < w; ) {
|
|
694
|
+
const d = M * w + (w - C - 1), F = (m - C - 1) % m + m * Math.floor(C / m);
|
|
695
|
+
z[d] = h[F], C += 1;
|
|
696
696
|
}
|
|
697
|
-
a({ z:
|
|
697
|
+
a({ z: M, total: s, progress: 1 });
|
|
698
698
|
})), {
|
|
699
|
-
data:
|
|
700
|
-
height:
|
|
701
|
-
width:
|
|
702
|
-
depth:
|
|
699
|
+
data: z,
|
|
700
|
+
height: p,
|
|
701
|
+
width: m,
|
|
702
|
+
depth: s
|
|
703
703
|
};
|
|
704
704
|
}
|
|
705
705
|
function Be(t, e, a) {
|
|
@@ -733,19 +733,19 @@ function Qe(t) {
|
|
|
733
733
|
return o;
|
|
734
734
|
}
|
|
735
735
|
async function et(t, e, a, o, i, l, n) {
|
|
736
|
-
let
|
|
737
|
-
const { shape:
|
|
738
|
-
return
|
|
739
|
-
const
|
|
740
|
-
|
|
741
|
-
const
|
|
742
|
-
|
|
736
|
+
let g = null, p = null;
|
|
737
|
+
const { shape: m, labels: c } = a[0], s = t.filter((x) => !o.has(x) || e !== n), w = await Promise.all(s.map((x) => Be(x, e, a)));
|
|
738
|
+
return s.forEach((x, z) => {
|
|
739
|
+
const f = w[z];
|
|
740
|
+
g = Je(f);
|
|
741
|
+
const M = g.computeMinMax();
|
|
742
|
+
g.data = Qe(g), o.set(x, g), i.set(x, Ke(g)), l.set(x, M), p = qe(a[e]);
|
|
743
743
|
}), [
|
|
744
744
|
o,
|
|
745
745
|
i,
|
|
746
746
|
l,
|
|
747
|
-
|
|
748
|
-
[
|
|
747
|
+
p,
|
|
748
|
+
[m[c.indexOf("x")], m[c.indexOf("y")], m[c.indexOf("z")]]
|
|
749
749
|
];
|
|
750
750
|
}
|
|
751
751
|
function tt(t) {
|
|
@@ -755,29 +755,29 @@ function ft(t) {
|
|
|
755
755
|
return !Array.isArray(t) || t.length !== 3 ? !1 : t.every((e) => typeof e == "number" && Number.isFinite(e));
|
|
756
756
|
}
|
|
757
757
|
function re(t) {
|
|
758
|
-
const { segmentationGroup: e, segmentationSettings: a, segmentationSceneScale: o, renderingSettings: i, materialRef: l, highlightEntity: n, setObsHighlight:
|
|
759
|
-
return
|
|
760
|
-
|
|
761
|
-
}, onPointerOver: (
|
|
762
|
-
|
|
763
|
-
}, onPointerOut: () =>
|
|
758
|
+
const { segmentationGroup: e, segmentationSettings: a, segmentationSceneScale: o, renderingSettings: i, materialRef: l, highlightEntity: n, setObsHighlight: g } = t, p = Q(null), [m] = X([]);
|
|
759
|
+
return H("group", { children: [H("group", { children: [e?.visible ? H("group", { children: [_("hemisphereLight", { color: 8421504, groundColor: 6316128 }), _("directionalLight", { color: 16777215, position: [0, -800, 0] }), _("directionalLight", { color: 16777215, position: [0, 800, 0] }), _(we, { firstHitOnly: !0, children: _("primitive", { ref: p, object: e, position: [0, 0, 0], onClick: (c) => {
|
|
760
|
+
c.object.parent?.userData.name === "finalPass" && n(c.object.name, c.object.userData.layerScope, c.object.userData.channelScope);
|
|
761
|
+
}, onPointerOver: (c) => {
|
|
762
|
+
g(c.object.name);
|
|
763
|
+
}, onPointerOut: () => g(null) }) })] }) : null, i.uniforms && i.shader && i.meshScale && i.geometrySize ? _("group", { children: H("mesh", { scale: i.meshScale, ref: l, children: [_("boxGeometry", { args: i.geometrySize }), _("shaderMaterial", { customProgramCacheKey: () => "1", side: _e, uniforms: i.uniforms, needsUpdate: !0, transparent: !0, vertexShader: i.shader.vertexShader, fragmentShader: i.shader.fragmentShader })] }) }) : null] }), _("group", { name: "lines", children: m.map((c) => _(Ne, { currentLine: c, scale: 1 }, tt(c))) })] });
|
|
764
764
|
}
|
|
765
|
-
const at = ae.lazy(() => import("./GeometryAndMeshXR-
|
|
765
|
+
const at = ae.lazy(() => import("./GeometryAndMeshXR-DnEggDH1.js").catch(() => ({ default: re }))), lt = ae.lazy(() => import("./XRSceneComponents-C4ONlZoX.js").catch(() => ({ default: () => null })));
|
|
766
766
|
function oe(t) {
|
|
767
|
-
const e = Q(null), a = Q(null), [o, i] =
|
|
767
|
+
const e = Q(null), a = Q(null), [o, i] = X(!1), [l, n] = X(!1), [g, p] = X(null), [m, c] = X([1, 1, 1]), [s, w] = X({
|
|
768
768
|
uniforms: null,
|
|
769
769
|
shader: null,
|
|
770
770
|
meshScale: null,
|
|
771
771
|
geometrySize: null,
|
|
772
772
|
boxSize: null
|
|
773
|
-
}), [
|
|
773
|
+
}), [x, z] = X({
|
|
774
774
|
volumes: /* @__PURE__ */ new Map(),
|
|
775
775
|
textures: /* @__PURE__ */ new Map(),
|
|
776
776
|
volumeMinMax: /* @__PURE__ */ new Map(),
|
|
777
777
|
scale: null,
|
|
778
778
|
resolution: null,
|
|
779
779
|
originalScale: null
|
|
780
|
-
}), [
|
|
780
|
+
}), [f, M] = X({
|
|
781
781
|
channelsVisible: [],
|
|
782
782
|
allChannels: [],
|
|
783
783
|
channelTargetC: [],
|
|
@@ -788,7 +788,7 @@ function oe(t) {
|
|
|
788
788
|
is3dMode: !1,
|
|
789
789
|
renderingMode: null,
|
|
790
790
|
layerTransparency: 1
|
|
791
|
-
}), [
|
|
791
|
+
}), [v, h] = X({
|
|
792
792
|
visible: !0,
|
|
793
793
|
color: [1, 1, 1],
|
|
794
794
|
opacity: 1,
|
|
@@ -797,77 +797,77 @@ function oe(t) {
|
|
|
797
797
|
multiColor: "",
|
|
798
798
|
data: null,
|
|
799
799
|
obsSets: []
|
|
800
|
-
}), { images: C, layerScope:
|
|
800
|
+
}), { images: C, layerScope: d, channelsVisible: F, allChannels: A, channelTargetC: y, resolution: T, data: k, colors: U, contrastLimits: N, is3dMode: W, renderingMode: Z, layerTransparency: se, xSlice: ue, ySlice: ce, zSlice: me } = He(t, f, M, l, n), { obsSegmentations: B, onEntitySelected: fe, segmentationLayerCoordination: st, segmentationChannelCoordination: $, segmentationChannelScopesByLayer: J } = t;
|
|
801
801
|
let he = () => {
|
|
802
802
|
};
|
|
803
803
|
const Y = [];
|
|
804
|
-
if (
|
|
805
|
-
const
|
|
806
|
-
he =
|
|
807
|
-
const { additionalObsSets: b } =
|
|
808
|
-
b !== null &&
|
|
809
|
-
const S =
|
|
810
|
-
b.tree[0].children.forEach((
|
|
811
|
-
|
|
812
|
-
const
|
|
813
|
-
|
|
814
|
-
E.path[1] === S && (
|
|
815
|
-
}), Y.push(
|
|
804
|
+
if ($[0][d] !== void 0) {
|
|
805
|
+
const r = $[0][d][d];
|
|
806
|
+
he = $[1][d][d].setObsHighlight;
|
|
807
|
+
const { additionalObsSets: b } = r;
|
|
808
|
+
b !== null && r.obsSetSelection.forEach((I) => {
|
|
809
|
+
const S = I[1];
|
|
810
|
+
b.tree[0].children.forEach((R) => {
|
|
811
|
+
R.name === S && R.set.forEach(([D]) => {
|
|
812
|
+
const L = { name: "", id: "", color: [255, 255, 255] };
|
|
813
|
+
L.name = S, L.id = D, r.obsSetColor.forEach((E) => {
|
|
814
|
+
E.path[1] === S && (L.color = E.color);
|
|
815
|
+
}), Y.push(L);
|
|
816
816
|
});
|
|
817
817
|
});
|
|
818
|
-
}),
|
|
818
|
+
}), r.obsHighlight !== null && Y.push({ name: "", id: r.obsHighlight, color: [255, 34, 0] });
|
|
819
819
|
}
|
|
820
|
-
if (B?.[
|
|
821
|
-
const { scene:
|
|
822
|
-
if (
|
|
823
|
-
const b = new Fe(),
|
|
824
|
-
|
|
825
|
-
const
|
|
826
|
-
(
|
|
827
|
-
const
|
|
828
|
-
let E =
|
|
829
|
-
E.includes("_") && (E = E.split("_")[0]),
|
|
830
|
-
const
|
|
831
|
-
|
|
832
|
-
const ne =
|
|
833
|
-
ne.material =
|
|
834
|
-
}), b.add(
|
|
820
|
+
if (B?.[d]?.obsSegmentations && g == null) {
|
|
821
|
+
const { scene: r, sceneOptions: u } = B[d].obsSegmentations;
|
|
822
|
+
if (r?.children) {
|
|
823
|
+
const b = new Fe(), I = new Ee();
|
|
824
|
+
I.userData.name = "finalPass", r.children.forEach((R) => {
|
|
825
|
+
const D = "material" in R ? R : R.children[0];
|
|
826
|
+
(D.material instanceof Re || D.material instanceof Ve) && (D.material = new Oe());
|
|
827
|
+
const L = D.material;
|
|
828
|
+
let E = D.name.replace("mesh_", "").replace("mesh", "").replace("glb", "").replace("_dec", "").replace("_Decobj", "").replace("obj", "").replace("_DEc", "").replace(".", "").replace("_Dec", "");
|
|
829
|
+
E.includes("_") && (E = E.split("_")[0]), D.name = E, D.userData.name = E, D.userData.layerScope = d, L.transparent = !0, L.depthTest = !0, L.depthWrite = !0, L.needsUpdate = !0, L.side = u?.materialSide === "back" ? ke : _e;
|
|
830
|
+
const V = D.clone();
|
|
831
|
+
V.geometry = D.geometry.clone(), V.geometry.translate(u?.targetX ?? 0, u?.targetY ?? 0, u?.targetZ ?? 0), V.geometry.scale(u?.scaleX ?? 1, u?.scaleY ?? 1, u?.scaleZ ?? 1), V.geometry.rotateX(u?.rotationX ?? 0), V.geometry.rotateY(u?.rotationY ?? 0), V.geometry.rotateZ(u?.rotationZ ?? 0);
|
|
832
|
+
const ne = D.clone();
|
|
833
|
+
ne.material = L.clone(), ne.geometry = V.geometry.clone(), I.add(ne);
|
|
834
|
+
}), b.add(I), b.scale.set(u?.sceneScaleX ?? 1, u?.sceneScaleY ?? 1, u?.sceneScaleZ ?? 1);
|
|
835
835
|
const S = [
|
|
836
836
|
u?.sceneScaleX ?? 1,
|
|
837
837
|
u?.sceneScaleY ?? 1,
|
|
838
838
|
u?.sceneScaleZ ?? 1
|
|
839
839
|
];
|
|
840
|
-
|
|
840
|
+
c(S), b.rotateX(u?.sceneRotationX ?? 0), b.rotateY(u?.sceneRotationY ?? 0), b.rotateZ(u?.sceneRotationZ ?? 0), p(b);
|
|
841
841
|
}
|
|
842
842
|
}
|
|
843
|
-
if (
|
|
844
|
-
const
|
|
843
|
+
if ($[0] !== void 0 && $[0][d] !== void 0) {
|
|
844
|
+
const r = $[0][d][d];
|
|
845
845
|
let u = "";
|
|
846
|
-
Y.forEach((
|
|
847
|
-
u += `${
|
|
846
|
+
Y.forEach((I) => {
|
|
847
|
+
u += `${I.id};${I.color.toString()};${I.name}`;
|
|
848
848
|
});
|
|
849
849
|
let b = "";
|
|
850
|
-
if (
|
|
851
|
-
b += `${
|
|
852
|
-
}), J[
|
|
853
|
-
let
|
|
854
|
-
J[
|
|
855
|
-
const
|
|
856
|
-
|
|
857
|
-
}), (
|
|
858
|
-
color:
|
|
859
|
-
opacity:
|
|
860
|
-
visible:
|
|
861
|
-
multiColor:
|
|
862
|
-
multiVisible:
|
|
850
|
+
if (v.obsSets.forEach((I) => {
|
|
851
|
+
b += `${I.id};${I.color.toString()};${I.name}`;
|
|
852
|
+
}), J[d].length > 1) {
|
|
853
|
+
let I = "", S = "", R = "", D = !1, L = 0;
|
|
854
|
+
J[d].forEach((E) => {
|
|
855
|
+
const V = $[0][d][E];
|
|
856
|
+
I += `${V.spatialChannelColor.toString()};`, S += `${V.spatialChannelOpacity};`, R += `${V.spatialChannelVisible};`, D = D || V.spatialChannelVisible, L += V.spatialChannelOpacity;
|
|
857
|
+
}), (I !== v.multiColor || S !== v.multiOpacity || R !== v.multiVisible) && h({
|
|
858
|
+
color: r.spatialChannelColor,
|
|
859
|
+
opacity: L,
|
|
860
|
+
visible: D,
|
|
861
|
+
multiColor: I,
|
|
862
|
+
multiVisible: R,
|
|
863
863
|
multiOpacity: S,
|
|
864
864
|
data: B ?? null,
|
|
865
865
|
obsSets: Y
|
|
866
866
|
});
|
|
867
|
-
} else (
|
|
868
|
-
color:
|
|
869
|
-
opacity:
|
|
870
|
-
visible:
|
|
867
|
+
} else (r.spatialChannelColor.toString() !== v.color.toString() || r.spatialChannelVisible !== v.visible || r.spatialChannelOpacity !== v.opacity || u !== b) && h({
|
|
868
|
+
color: r.spatialChannelColor,
|
|
869
|
+
opacity: r.spatialChannelOpacity,
|
|
870
|
+
visible: r.spatialChannelVisible,
|
|
871
871
|
multiColor: "",
|
|
872
872
|
multiVisible: "",
|
|
873
873
|
multiOpacity: "",
|
|
@@ -876,46 +876,46 @@ function oe(t) {
|
|
|
876
876
|
});
|
|
877
877
|
}
|
|
878
878
|
if (q(() => {
|
|
879
|
-
if (
|
|
880
|
-
let
|
|
881
|
-
for (let b = 0; b <
|
|
882
|
-
|
|
883
|
-
|
|
879
|
+
if (g !== null) {
|
|
880
|
+
let r = 0, u = 0;
|
|
881
|
+
for (let b = 0; b < g.children.length; b++)
|
|
882
|
+
g.children[b].userData.name === "finalPass" ? u = b : r = b;
|
|
883
|
+
g.children[u].children.forEach((b, I) => {
|
|
884
884
|
const S = b;
|
|
885
|
-
let { color:
|
|
886
|
-
const
|
|
887
|
-
if (
|
|
888
|
-
|
|
889
|
-
}), J[
|
|
890
|
-
J[
|
|
891
|
-
const E =
|
|
892
|
-
if (E.spatialTargetC ===
|
|
893
|
-
S.material.color.r = E.spatialChannelColor[0] / 255, S.material.color.g = E.spatialChannelColor[1] / 255, S.material.color.b = E.spatialChannelColor[2] / 255, S.material.opacity = E.spatialChannelOpacity, S.visible = E.spatialChannelVisible, S.material.needsUpdate = !0, S.userData.layerScope =
|
|
894
|
-
const
|
|
895
|
-
|
|
885
|
+
let { color: R } = v;
|
|
886
|
+
const D = S.userData.name;
|
|
887
|
+
if (v.obsSets.forEach((L) => {
|
|
888
|
+
L.id === D && (R = L.color);
|
|
889
|
+
}), J[d].length > 1)
|
|
890
|
+
J[d].forEach((L) => {
|
|
891
|
+
const E = $[0][d][L];
|
|
892
|
+
if (E.spatialTargetC === D) {
|
|
893
|
+
S.material.color.r = E.spatialChannelColor[0] / 255, S.material.color.g = E.spatialChannelColor[1] / 255, S.material.color.b = E.spatialChannelColor[2] / 255, S.material.opacity = E.spatialChannelOpacity, S.visible = E.spatialChannelVisible, S.material.needsUpdate = !0, S.userData.layerScope = d, S.userData.channelScope = L;
|
|
894
|
+
const V = g.children[r].children[I];
|
|
895
|
+
V.material.needsUpdate = !0;
|
|
896
896
|
}
|
|
897
897
|
});
|
|
898
898
|
else {
|
|
899
|
-
S.material.color.r =
|
|
900
|
-
const
|
|
901
|
-
S.userData.channelScope =
|
|
899
|
+
S.material.color.r = R[0] / 255, S.material.color.g = R[1] / 255, S.material.color.b = R[2] / 255, S.material.opacity = v.opacity, S.material.visible = v.visible, S.material.needsUpdate = !0, S.userData.layerScope = d;
|
|
900
|
+
const L = Object.keys($[0][d])?.[0];
|
|
901
|
+
S.userData.channelScope = L;
|
|
902
902
|
}
|
|
903
903
|
});
|
|
904
904
|
}
|
|
905
|
-
}, [
|
|
906
|
-
const
|
|
907
|
-
const u = await et(
|
|
905
|
+
}, [v, g]), C[d]?.image?.instance?.getData() !== void 0 && !l && !o && N !== null && N[0][1] !== 255 && W && (n(!0), i(!0)), q(() => {
|
|
906
|
+
const r = async () => {
|
|
907
|
+
const u = await et(y, T, k, x.volumes, x.textures, x.volumeMinMax, x.resolution);
|
|
908
908
|
if (u[0] !== null)
|
|
909
|
-
if (
|
|
910
|
-
resolution:
|
|
909
|
+
if (z({
|
|
910
|
+
resolution: T,
|
|
911
911
|
volumes: u[0],
|
|
912
912
|
textures: u[1],
|
|
913
913
|
volumeMinMax: u[2],
|
|
914
|
-
scale: u[3] !== null ? u[3] :
|
|
914
|
+
scale: u[3] !== null ? u[3] : x.scale,
|
|
915
915
|
originalScale: u[4]
|
|
916
|
-
}), !
|
|
917
|
-
const b = de(u[0],
|
|
918
|
-
b !== null &&
|
|
916
|
+
}), !s.uniforms || !s.shader) {
|
|
917
|
+
const b = de(u[0], y, F, U, u[1], N, u[2], u[3], Z, se, ue, ce, me, u[4]);
|
|
918
|
+
b !== null && w({
|
|
919
919
|
uniforms: b[0],
|
|
920
920
|
shader: b[1],
|
|
921
921
|
meshScale: b[2],
|
|
@@ -923,14 +923,14 @@ function oe(t) {
|
|
|
923
923
|
boxSize: b[4]
|
|
924
924
|
});
|
|
925
925
|
} else
|
|
926
|
-
|
|
927
|
-
channelsVisible:
|
|
928
|
-
allChannels:
|
|
929
|
-
channelTargetC:
|
|
930
|
-
resolution:
|
|
931
|
-
data:
|
|
932
|
-
colors:
|
|
933
|
-
contrastLimits:
|
|
926
|
+
M({
|
|
927
|
+
channelsVisible: F,
|
|
928
|
+
allChannels: A,
|
|
929
|
+
channelTargetC: y,
|
|
930
|
+
resolution: T,
|
|
931
|
+
data: k,
|
|
932
|
+
colors: U,
|
|
933
|
+
contrastLimits: N,
|
|
934
934
|
is3dMode: W,
|
|
935
935
|
renderingMode: Z,
|
|
936
936
|
layerTransparency: se,
|
|
@@ -939,31 +939,31 @@ function oe(t) {
|
|
|
939
939
|
zSlice: me
|
|
940
940
|
});
|
|
941
941
|
};
|
|
942
|
-
l && (
|
|
942
|
+
l && (T !== f.resolution && e.current && (e.current.material.uniforms.volumeCount.value = 0, e.current.material.uniforms.volumeTex.value = null), r(), n(!1));
|
|
943
943
|
}, [l]), q(() => {
|
|
944
|
-
if (
|
|
945
|
-
const
|
|
946
|
-
if (
|
|
944
|
+
if (s.uniforms && s.shader) {
|
|
945
|
+
const r = de(x.volumes, f.channelTargetC, f.channelsVisible, f.colors, x.textures, f.contrastLimits, x.volumeMinMax, x.scale, f.renderingMode, f.layerTransparency, f.xSlice, f.ySlice, f.zSlice, x.originalScale);
|
|
946
|
+
if (r !== null) {
|
|
947
947
|
let u = 0;
|
|
948
|
-
|
|
948
|
+
f.channelsVisible?.forEach((b) => {
|
|
949
949
|
b && u++;
|
|
950
|
-
}), n(!1), e?.current?.material?.uniforms && (e.current.material.uniforms.u_clim.value =
|
|
950
|
+
}), n(!1), e?.current?.material?.uniforms && (e.current.material.uniforms.u_clim.value = r[0].u_clim.value, e.current.material.uniforms.u_clim2.value = r[0].u_clim2.value, e.current.material.uniforms.u_clim3.value = r[0].u_clim3.value, e.current.material.uniforms.u_clim4.value = r[0].u_clim4.value, e.current.material.uniforms.u_clim5.value = r[0].u_clim5.value, e.current.material.uniforms.u_clim6.value = r[0].u_clim6.value, e.current.material.uniforms.u_xClip.value = r[0].u_xClip.value, e.current.material.uniforms.u_yClip.value = r[0].u_yClip.value, e.current.material.uniforms.u_zClip.value = r[0].u_zClip.value, e.current.material.uniforms.u_color.value = r[0].u_color.value, e.current.material.uniforms.u_color2.value = r[0].u_color2.value, e.current.material.uniforms.u_color3.value = r[0].u_color3.value, e.current.material.uniforms.u_color4.value = r[0].u_color4.value, e.current.material.uniforms.u_color5.value = r[0].u_color5.value, e.current.material.uniforms.u_color6.value = r[0].u_color6.value, e.current.material.uniforms.volumeTex.value = r[0].volumeTex.value, e.current.material.uniforms.volumeTex2.value = r[0].volumeTex2.value, e.current.material.uniforms.volumeTex3.value = r[0].volumeTex3.value, e.current.material.uniforms.volumeTex4.value = r[0].volumeTex4.value, e.current.material.uniforms.volumeTex5.value = r[0].volumeTex5.value, e.current.material.uniforms.volumeTex6.value = r[0].volumeTex6.value, e.current.material.uniforms.volumeCount.value = u, e.current.material.uniforms.u_renderstyle.value = f.renderingMode, e.current.material.uniforms.dtScale.value = f.layerTransparency);
|
|
951
951
|
} else e?.current?.material?.uniforms && (e.current.material.uniforms.volumeCount.value = 0, e.current.material.uniforms.volumeTex.value = null);
|
|
952
952
|
}
|
|
953
|
-
}, [
|
|
953
|
+
}, [f]), !f.is3dMode)
|
|
954
954
|
return null;
|
|
955
|
-
if (
|
|
956
|
-
return
|
|
955
|
+
if (f.is3dMode && (!s.uniforms || !s.shader))
|
|
956
|
+
return H("group", { children: [_("ambientLight", {}), _("pointLight", { position: [10, 10, 10] }), _(ve, { color: "white", scale: 20, fontWeight: 1e3, children: "Loading ..." })] });
|
|
957
957
|
const le = {
|
|
958
|
-
segmentationGroup:
|
|
959
|
-
segmentationSettings:
|
|
960
|
-
segmentationSceneScale:
|
|
961
|
-
renderingSettings:
|
|
958
|
+
segmentationGroup: g,
|
|
959
|
+
segmentationSettings: v,
|
|
960
|
+
segmentationSceneScale: m,
|
|
961
|
+
renderingSettings: s,
|
|
962
962
|
materialRef: e,
|
|
963
963
|
highlightEntity: fe,
|
|
964
964
|
setObsHighlight: he
|
|
965
965
|
}, { xrEnabled: pe } = t;
|
|
966
|
-
return
|
|
966
|
+
return H("group", { children: [pe ? H(be, { children: [_(ee, { fallback: null, children: _(lt, {}) }), _(ee, { fallback: _(re, { ...le }), children: _(at, { ...le }) })] }) : _(re, { ...le }), _(Me, { ref: a, enableDamping: !1, dampingFactor: 0 })] });
|
|
967
967
|
}
|
|
968
968
|
let te = null;
|
|
969
969
|
async function nt() {
|
|
@@ -976,26 +976,26 @@ function pt() {
|
|
|
976
976
|
}
|
|
977
977
|
const it = ae.lazy(
|
|
978
978
|
// eslint-disable-next-line implicit-arrow-linebreak, function-paren-newline
|
|
979
|
-
() => import("./XRWrapper-
|
|
979
|
+
() => import("./XRWrapper-BO-Jnk8o.js").catch(() => ({
|
|
980
980
|
default: ({ children: t }) => t
|
|
981
981
|
}))
|
|
982
982
|
), ot = ae.lazy(
|
|
983
983
|
// eslint-disable-next-line implicit-arrow-linebreak, function-paren-newline
|
|
984
|
-
() => import("./XREnterButton-
|
|
984
|
+
() => import("./XREnterButton-Cyof791n.js").catch(() => ({
|
|
985
985
|
default: () => null
|
|
986
986
|
}))
|
|
987
987
|
), rt = Se((t, e) => {
|
|
988
|
-
const [a, o] =
|
|
988
|
+
const [a, o] = X(!1);
|
|
989
989
|
return q(() => {
|
|
990
990
|
nt().then(() => o(!0)).catch(() => {
|
|
991
991
|
});
|
|
992
|
-
}, []),
|
|
992
|
+
}, []), H("div", { style: { width: "100%", height: "100%" }, children: [a && _(ee, { fallback: null, children: _(ot, {}) }), _(Ce, { style: { position: "absolute", top: 0, left: 0 }, camera: {
|
|
993
993
|
fov: 50,
|
|
994
994
|
up: [0, 1, 0],
|
|
995
995
|
position: [0, 0, 800],
|
|
996
996
|
near: 0.1,
|
|
997
997
|
far: 3e3
|
|
998
|
-
}, gl: { antialias: !0, logarithmicDepthBuffer: !1 }, ref: e, children: a ?
|
|
998
|
+
}, gl: { antialias: !0, logarithmicDepthBuffer: !1 }, ref: e, children: a ? _(ee, { fallback: _(oe, { ...t }), children: _(it, { children: _(oe, { ...t, xrEnabled: !0 }) }) }) : _(oe, { ...t }) })] });
|
|
999
999
|
}), xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1000
1000
|
__proto__: null,
|
|
1001
1001
|
SpatialWrapper: rt
|