@imfusion/web-ui 0.11.1-dev.72.g7dc184e8 → 0.11.1-dev.74.g7422f7b2
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/CHANGELOG.md +13 -1
- package/dist/components/input/input.d.ts +2 -1
- package/dist/index.js +2528 -2781
- package/dist/integrations/frame-selection.js +3 -4
- package/dist/integrations/image-display-options/image-display-options-view.d.ts +8 -2
- package/dist/integrations/image-display-options/image-display-options-view.utils.d.ts +7 -3
- package/dist/integrations/image-display-options/image-display-options.d.ts +5 -1
- package/dist/integrations/image-display-options.js +267 -153
- package/dist/integrations/view-tools.js +1 -2
- package/dist/{icon-button-kVghav2z.js → row-CaeE5pqs.js} +133 -2
- package/dist/separator-BxUMVvFE.js +137 -0
- package/dist/style.css +1 -1
- package/dist/tabs-Bl3YlG5t.js +429 -0
- package/package.json +1 -1
- package/src/docgen/doc.gen.json +8 -1
- package/src/llms/llms.gen.txt +1 -1
- package/dist/row-CImu8yXV.js +0 -136
- package/dist/separator-BV2TR8U0.js +0 -34
- package/dist/slider-CpIZMAFl.js +0 -107
- package/dist/tabs-BqgyMmo6.js +0 -173
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import { t as
|
|
5
|
-
import { a as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
1
|
+
import { sy as e, vM as t, yC as n } from "../icons-CMetKl2x.js";
|
|
2
|
+
import { t as r } from "../meta-V_KyLeGn.js";
|
|
3
|
+
import { n as i, t as a } from "../toggle-group-CVQzM3lQ.js";
|
|
4
|
+
import { i as o, n as s, o as c, t as l } from "../row-CaeE5pqs.js";
|
|
5
|
+
import { C as u, E as d, S as f, T as p, _ as m, a as h, b as g, d as _, f as v, g as y, h as b, i as x, n as S, o as C, r as w, t as T, v as E, w as D, x as ee, y as O } from "../tabs-Bl3YlG5t.js";
|
|
6
|
+
import { t as k } from "../scroll-area-CXQ_SxPX.js";
|
|
7
|
+
import { a as A, c as j, i as M, n as te, o as ne, r as re, s as ie, t as N } from "../separator-BxUMVvFE.js";
|
|
8
|
+
import { cva as ae } from "class-variance-authority";
|
|
9
|
+
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
10
|
+
import { useId as L, useMemo as R, useState as z } from "react";
|
|
11
|
+
import { useDisplayOptions2d as B, useDisplayOptions3d as V } from "@imfusion/sdk-react";
|
|
12
|
+
var H = {
|
|
12
13
|
horizontalPanel: "imf-ui-image-display-options-module-horizontalPanel",
|
|
13
14
|
horizontalTabs: "imf-ui-image-display-options-module-horizontalTabs",
|
|
14
15
|
invertLabel: "imf-ui-image-display-options-module-invertLabel",
|
|
@@ -17,7 +18,7 @@ var A = {
|
|
|
17
18
|
rowField: "imf-ui-image-display-options-module-rowField",
|
|
18
19
|
segment: "imf-ui-image-display-options-module-segment",
|
|
19
20
|
strip: "imf-ui-image-display-options-module-strip"
|
|
20
|
-
},
|
|
21
|
+
}, U = {
|
|
21
22
|
key: "gamma",
|
|
22
23
|
label: "Gamma",
|
|
23
24
|
min: .1,
|
|
@@ -25,14 +26,14 @@ var A = {
|
|
|
25
26
|
step: .1,
|
|
26
27
|
format: { maximumFractionDigits: 1 }
|
|
27
28
|
};
|
|
28
|
-
function
|
|
29
|
+
function W(e) {
|
|
29
30
|
return e > 0 ? 10 ** Math.floor(Math.log10(e / 1e3)) : 1;
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
+
function G(e) {
|
|
32
33
|
return !(e > 0) || e >= 1 ? 0 : Math.ceil(-Math.log10(e));
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
let r = t - e, i =
|
|
35
|
+
function K([e, t], n) {
|
|
36
|
+
let r = t - e, i = W(r), a = { maximumFractionDigits: G(i) }, o = (e) => {
|
|
36
37
|
let t = n?.[e.key];
|
|
37
38
|
if (!t) return e;
|
|
38
39
|
let r = t.step ?? e.step;
|
|
@@ -41,7 +42,7 @@ function P([e, t], n) {
|
|
|
41
42
|
min: t.min ?? e.min,
|
|
42
43
|
max: t.max ?? e.max,
|
|
43
44
|
step: r,
|
|
44
|
-
format: t.step === void 0 ? e.format : { maximumFractionDigits:
|
|
45
|
+
format: t.step === void 0 ? e.format : { maximumFractionDigits: G(r) }
|
|
45
46
|
};
|
|
46
47
|
}, s = o({
|
|
47
48
|
key: "window",
|
|
@@ -62,22 +63,22 @@ function P([e, t], n) {
|
|
|
62
63
|
"2d": [
|
|
63
64
|
s,
|
|
64
65
|
c,
|
|
65
|
-
o(
|
|
66
|
+
o(U)
|
|
66
67
|
],
|
|
67
68
|
"3d": [s, c]
|
|
68
69
|
};
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
+
function q(e, t) {
|
|
71
72
|
return e === "window" ? { window: t } : e === "level" ? { level: t } : { gamma: t };
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
+
function oe(e, t) {
|
|
74
75
|
return t === "window" ? e.window : t === "level" ? e.level : "gamma" in e ? e.gamma : 0;
|
|
75
76
|
}
|
|
76
77
|
//#endregion
|
|
77
78
|
//#region src/integrations/image-display-options/image-display-options-view.tsx
|
|
78
|
-
var
|
|
79
|
-
function
|
|
80
|
-
let
|
|
79
|
+
var se = ae(H.root);
|
|
80
|
+
function ce({ spec: e, value: t, row: n, onChange: r }) {
|
|
81
|
+
let i = /* @__PURE__ */ I(A, {
|
|
81
82
|
value: t,
|
|
82
83
|
min: e.min,
|
|
83
84
|
max: e.max,
|
|
@@ -86,230 +87,338 @@ function R({ spec: e, value: t, row: n, onChange: r }) {
|
|
|
86
87
|
onValueChange: (e) => {
|
|
87
88
|
r(typeof e == "number" ? e : e[0]);
|
|
88
89
|
},
|
|
89
|
-
children: [/* @__PURE__ */
|
|
90
|
+
children: [/* @__PURE__ */ I(l, {
|
|
90
91
|
justify: "between",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
92
|
-
}), /* @__PURE__ */
|
|
92
|
+
children: [/* @__PURE__ */ F(M, { children: e.label }), /* @__PURE__ */ F(j, {})]
|
|
93
|
+
}), /* @__PURE__ */ F(te, { children: /* @__PURE__ */ I(ie, { children: [/* @__PURE__ */ F(re, {}), /* @__PURE__ */ F(ne, { "aria-label": e.label })] }) })]
|
|
93
94
|
});
|
|
94
|
-
return n ? /* @__PURE__ */
|
|
95
|
-
className:
|
|
96
|
-
children:
|
|
97
|
-
}) :
|
|
95
|
+
return n ? /* @__PURE__ */ F("div", {
|
|
96
|
+
className: H.rowField,
|
|
97
|
+
children: i
|
|
98
|
+
}) : i;
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
-
let r =
|
|
101
|
-
return /* @__PURE__ */
|
|
100
|
+
function J({ checked: e, row: t, onChange: n }) {
|
|
101
|
+
let r = L();
|
|
102
|
+
return /* @__PURE__ */ I(l, {
|
|
102
103
|
align: "center",
|
|
103
104
|
justify: t ? "start" : "between",
|
|
104
105
|
gap: "2",
|
|
105
|
-
className:
|
|
106
|
-
children: [/* @__PURE__ */
|
|
106
|
+
className: H.invertRow,
|
|
107
|
+
children: [/* @__PURE__ */ F("span", {
|
|
107
108
|
id: r,
|
|
108
|
-
className:
|
|
109
|
+
className: H.invertLabel,
|
|
109
110
|
children: "Invert"
|
|
110
|
-
}), /* @__PURE__ */
|
|
111
|
+
}), /* @__PURE__ */ F(_, {
|
|
111
112
|
"aria-labelledby": r,
|
|
112
113
|
checked: e,
|
|
113
114
|
onCheckedChange: (e) => {
|
|
114
115
|
n(e);
|
|
115
116
|
},
|
|
116
|
-
children: /* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ F(v, {})
|
|
117
118
|
})]
|
|
118
119
|
});
|
|
119
120
|
}
|
|
120
|
-
function
|
|
121
|
-
return /* @__PURE__ */
|
|
122
|
-
className:
|
|
121
|
+
function le({ active: e, onChange: t }) {
|
|
122
|
+
return /* @__PURE__ */ I(a, {
|
|
123
|
+
className: H.segment,
|
|
123
124
|
"aria-label": "Display dimension",
|
|
124
125
|
value: [e],
|
|
125
126
|
onValueChange: (e) => {
|
|
126
|
-
let
|
|
127
|
-
(
|
|
127
|
+
let n = e[0];
|
|
128
|
+
(n === "2d" || n === "3d") && t(n);
|
|
128
129
|
},
|
|
129
|
-
children: [/* @__PURE__ */
|
|
130
|
+
children: [/* @__PURE__ */ F(i, {
|
|
130
131
|
value: "2d",
|
|
131
132
|
children: "2D"
|
|
132
|
-
}), /* @__PURE__ */
|
|
133
|
+
}), /* @__PURE__ */ F(i, {
|
|
133
134
|
value: "3d",
|
|
134
135
|
children: "3D"
|
|
135
136
|
})]
|
|
136
137
|
});
|
|
137
138
|
}
|
|
138
|
-
function
|
|
139
|
+
function Y({ dimension: e, fields: t, options: n, row: r, onChange: i }) {
|
|
139
140
|
let a = n[e];
|
|
140
|
-
return /* @__PURE__ */
|
|
141
|
+
return /* @__PURE__ */ F(P, { children: t.map((t) => /* @__PURE__ */ F(ce, {
|
|
141
142
|
spec: t,
|
|
142
|
-
value:
|
|
143
|
+
value: oe(a, t.key),
|
|
143
144
|
row: r,
|
|
144
145
|
onChange: (n) => {
|
|
145
|
-
i(e,
|
|
146
|
+
i(e, q(t.key, n));
|
|
146
147
|
}
|
|
147
|
-
}, t.key))
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
148
|
+
}, t.key)) });
|
|
149
|
+
}
|
|
150
|
+
function X({ dimension: n, options: r, onPresetSelected: i }) {
|
|
151
|
+
let a = r[n].currentPreset, o = r[n].presetNames;
|
|
152
|
+
if (o.length !== 0) return /* @__PURE__ */ I(D, {
|
|
153
|
+
width: "full",
|
|
154
|
+
value: a,
|
|
155
|
+
onValueChange: (e) => {
|
|
156
|
+
e !== null && i(n, e);
|
|
157
|
+
},
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ F(O, { children: "Preset" }),
|
|
160
|
+
/* @__PURE__ */ I(p, { children: [/* @__PURE__ */ F(d, {
|
|
161
|
+
placeholder: "Choose a preset",
|
|
162
|
+
children: a
|
|
163
|
+
}), /* @__PURE__ */ F(b, { children: /* @__PURE__ */ F(t, { glyph: e }) })] }),
|
|
164
|
+
/* @__PURE__ */ F(f, { children: /* @__PURE__ */ F(u, {
|
|
165
|
+
alignItemWithTrigger: !0,
|
|
166
|
+
side: "bottom",
|
|
167
|
+
sideOffset: 4,
|
|
168
|
+
children: /* @__PURE__ */ F(ee, { children: /* @__PURE__ */ F(g, { children: o.map((e) => /* @__PURE__ */ I(y, {
|
|
169
|
+
value: e,
|
|
170
|
+
children: [/* @__PURE__ */ F(m, { children: "✓" }), /* @__PURE__ */ F(E, { children: e })]
|
|
171
|
+
}, e)) }) })
|
|
172
|
+
}) })
|
|
173
|
+
]
|
|
174
|
+
});
|
|
154
175
|
}
|
|
155
|
-
function
|
|
156
|
-
let [
|
|
157
|
-
|
|
176
|
+
function Z({ variant: e = "default", options: r, intensityRange: i, ranges: a, withGamma: u = !1, onOptionsChange: d, onAutoWindow: f, onTransferFunctionPresetChanged: p, className: m, ...g }) {
|
|
177
|
+
let [_, v] = z("2d"), y = K(i, a), b = u ? y : {
|
|
178
|
+
...y,
|
|
179
|
+
"2d": y["2d"].filter((e) => e.key !== "gamma")
|
|
180
|
+
}, E = (e) => {
|
|
181
|
+
v(e === "3d" ? "3d" : "2d");
|
|
158
182
|
};
|
|
159
|
-
return /* @__PURE__ */
|
|
160
|
-
...
|
|
183
|
+
return /* @__PURE__ */ F("div", {
|
|
184
|
+
...g,
|
|
161
185
|
"data-imf-ui-component": "ImageDisplayOptions",
|
|
162
|
-
className:
|
|
163
|
-
children: e === "default" ? /* @__PURE__ */
|
|
164
|
-
value:
|
|
165
|
-
onValueChange:
|
|
166
|
-
children: [/* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */ C
|
|
186
|
+
className: se({ className: m }),
|
|
187
|
+
children: e === "default" ? /* @__PURE__ */ I(h, {
|
|
188
|
+
value: _,
|
|
189
|
+
onValueChange: E,
|
|
190
|
+
children: [/* @__PURE__ */ I(S, { children: [
|
|
191
|
+
/* @__PURE__ */ F(C, {
|
|
168
192
|
value: "2d",
|
|
169
193
|
children: "2D Slices"
|
|
170
194
|
}),
|
|
171
|
-
/* @__PURE__ */ C
|
|
195
|
+
/* @__PURE__ */ F(C, {
|
|
172
196
|
value: "3d",
|
|
173
197
|
children: "3D Volume"
|
|
174
198
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
] }), /* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ F(T, {})
|
|
200
|
+
] }), /* @__PURE__ */ I(x, { children: [/* @__PURE__ */ F(w, {
|
|
177
201
|
value: "2d",
|
|
178
|
-
children: /* @__PURE__ */
|
|
202
|
+
children: /* @__PURE__ */ I(s, {
|
|
179
203
|
gap: "3",
|
|
180
|
-
children:
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
204
|
+
children: [
|
|
205
|
+
/* @__PURE__ */ F(Y, {
|
|
206
|
+
dimension: "2d",
|
|
207
|
+
fields: b["2d"],
|
|
208
|
+
options: r,
|
|
209
|
+
row: !1,
|
|
210
|
+
onChange: d
|
|
211
|
+
}),
|
|
212
|
+
/* @__PURE__ */ F(c, {
|
|
213
|
+
onClick: f,
|
|
214
|
+
variant: "outline",
|
|
215
|
+
children: "Auto Window"
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ F(J, {
|
|
218
|
+
checked: r["2d"].invert,
|
|
219
|
+
row: !1,
|
|
220
|
+
onChange: (e) => {
|
|
221
|
+
d("2d", { invert: e });
|
|
222
|
+
}
|
|
223
|
+
}),
|
|
224
|
+
r["2d"].presetNames.length > 0 && /* @__PURE__ */ F(N, {}),
|
|
225
|
+
/* @__PURE__ */ F(X, {
|
|
226
|
+
dimension: "2d",
|
|
227
|
+
options: r,
|
|
228
|
+
onPresetSelected: p
|
|
229
|
+
})
|
|
230
|
+
]
|
|
187
231
|
})
|
|
188
|
-
}), /* @__PURE__ */
|
|
232
|
+
}), /* @__PURE__ */ F(w, {
|
|
189
233
|
value: "3d",
|
|
190
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ I(s, {
|
|
191
235
|
gap: "3",
|
|
192
|
-
children:
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
236
|
+
children: [
|
|
237
|
+
/* @__PURE__ */ F(Y, {
|
|
238
|
+
dimension: "3d",
|
|
239
|
+
fields: b["3d"],
|
|
240
|
+
options: r,
|
|
241
|
+
row: !1,
|
|
242
|
+
onChange: d
|
|
243
|
+
}),
|
|
244
|
+
r["3d"].presetNames.length > 0 && /* @__PURE__ */ F(N, {}),
|
|
245
|
+
/* @__PURE__ */ F(X, {
|
|
246
|
+
dimension: "3d",
|
|
247
|
+
options: r,
|
|
248
|
+
onPresetSelected: p
|
|
249
|
+
})
|
|
250
|
+
]
|
|
199
251
|
})
|
|
200
252
|
})] })]
|
|
201
|
-
}) : e === "horizontal" ? /* @__PURE__ */
|
|
202
|
-
className:
|
|
253
|
+
}) : e === "horizontal" ? /* @__PURE__ */ I(h, {
|
|
254
|
+
className: H.horizontalTabs,
|
|
203
255
|
orientation: "vertical",
|
|
204
|
-
value:
|
|
205
|
-
onValueChange:
|
|
206
|
-
children: [/* @__PURE__ */
|
|
256
|
+
value: _,
|
|
257
|
+
onValueChange: E,
|
|
258
|
+
children: [/* @__PURE__ */ I(S, {
|
|
207
259
|
fill: !0,
|
|
208
260
|
children: [
|
|
209
|
-
/* @__PURE__ */ C
|
|
261
|
+
/* @__PURE__ */ F(C, {
|
|
210
262
|
value: "2d",
|
|
211
263
|
children: "2D"
|
|
212
264
|
}),
|
|
213
|
-
/* @__PURE__ */ C
|
|
265
|
+
/* @__PURE__ */ F(C, {
|
|
214
266
|
value: "3d",
|
|
215
267
|
children: "3D"
|
|
216
268
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ F(T, {})
|
|
218
270
|
]
|
|
219
|
-
}), /* @__PURE__ */
|
|
220
|
-
className:
|
|
221
|
-
children: [/* @__PURE__ */
|
|
271
|
+
}), /* @__PURE__ */ I(x, {
|
|
272
|
+
className: H.horizontalPanel,
|
|
273
|
+
children: [/* @__PURE__ */ F(w, {
|
|
222
274
|
value: "2d",
|
|
223
|
-
children: /* @__PURE__ */
|
|
275
|
+
children: /* @__PURE__ */ F(k, {
|
|
224
276
|
orientation: "horizontal",
|
|
225
|
-
className:
|
|
226
|
-
children: /* @__PURE__ */
|
|
277
|
+
className: H.strip,
|
|
278
|
+
children: /* @__PURE__ */ I(l, {
|
|
227
279
|
align: "center",
|
|
228
|
-
gap: "
|
|
229
|
-
children: /* @__PURE__ */
|
|
280
|
+
gap: "4",
|
|
281
|
+
children: [/* @__PURE__ */ F(s, {
|
|
282
|
+
gap: "2",
|
|
283
|
+
className: H.rowField,
|
|
284
|
+
children: /* @__PURE__ */ F(Y, {
|
|
285
|
+
dimension: "2d",
|
|
286
|
+
fields: b["2d"],
|
|
287
|
+
options: r,
|
|
288
|
+
row: !1,
|
|
289
|
+
onChange: d
|
|
290
|
+
})
|
|
291
|
+
}), /* @__PURE__ */ I(s, { children: [/* @__PURE__ */ F(X, {
|
|
230
292
|
dimension: "2d",
|
|
231
|
-
|
|
232
|
-
|
|
293
|
+
options: r,
|
|
294
|
+
onPresetSelected: p
|
|
295
|
+
}), /* @__PURE__ */ I(l, { children: [/* @__PURE__ */ F(c, {
|
|
296
|
+
size: "sm",
|
|
297
|
+
onClick: f,
|
|
298
|
+
variant: "outline",
|
|
299
|
+
startIcon: /* @__PURE__ */ F(t, { glyph: n }),
|
|
300
|
+
children: "Auto Window"
|
|
301
|
+
}), /* @__PURE__ */ F(J, {
|
|
302
|
+
checked: r["2d"].invert,
|
|
233
303
|
row: !0,
|
|
234
|
-
onChange:
|
|
235
|
-
|
|
304
|
+
onChange: (e) => {
|
|
305
|
+
d("2d", { invert: e });
|
|
306
|
+
}
|
|
307
|
+
})] })] })]
|
|
236
308
|
})
|
|
237
309
|
})
|
|
238
|
-
}), /* @__PURE__ */
|
|
310
|
+
}), /* @__PURE__ */ F(w, {
|
|
239
311
|
value: "3d",
|
|
240
|
-
children: /* @__PURE__ */
|
|
312
|
+
children: /* @__PURE__ */ F(k, {
|
|
241
313
|
orientation: "horizontal",
|
|
242
|
-
className:
|
|
243
|
-
children: /* @__PURE__ */
|
|
314
|
+
className: H.strip,
|
|
315
|
+
children: /* @__PURE__ */ I(l, {
|
|
244
316
|
align: "center",
|
|
245
|
-
gap: "
|
|
246
|
-
children: /* @__PURE__ */
|
|
317
|
+
gap: "4",
|
|
318
|
+
children: [/* @__PURE__ */ F(s, {
|
|
319
|
+
className: H.rowField,
|
|
320
|
+
align: "center",
|
|
321
|
+
gap: "2",
|
|
322
|
+
children: /* @__PURE__ */ F(Y, {
|
|
323
|
+
dimension: "3d",
|
|
324
|
+
fields: b["3d"],
|
|
325
|
+
options: r,
|
|
326
|
+
row: !1,
|
|
327
|
+
onChange: d
|
|
328
|
+
})
|
|
329
|
+
}), /* @__PURE__ */ F(s, { children: /* @__PURE__ */ F(X, {
|
|
247
330
|
dimension: "3d",
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
onChange: s
|
|
252
|
-
})
|
|
331
|
+
options: r,
|
|
332
|
+
onPresetSelected: p
|
|
333
|
+
}) })]
|
|
253
334
|
})
|
|
254
335
|
})
|
|
255
336
|
})]
|
|
256
337
|
})]
|
|
257
|
-
}) : /* @__PURE__ */
|
|
338
|
+
}) : /* @__PURE__ */ F(k, {
|
|
258
339
|
orientation: "horizontal",
|
|
259
|
-
className:
|
|
260
|
-
children: /* @__PURE__ */
|
|
340
|
+
className: H.strip,
|
|
341
|
+
children: /* @__PURE__ */ I(l, {
|
|
261
342
|
align: "center",
|
|
262
343
|
gap: "3",
|
|
263
|
-
children: [
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
344
|
+
children: [
|
|
345
|
+
/* @__PURE__ */ F(le, {
|
|
346
|
+
active: _,
|
|
347
|
+
onChange: v
|
|
348
|
+
}),
|
|
349
|
+
/* @__PURE__ */ F(Y, {
|
|
350
|
+
dimension: _,
|
|
351
|
+
fields: b[_],
|
|
352
|
+
options: r,
|
|
353
|
+
row: !0,
|
|
354
|
+
onChange: d
|
|
355
|
+
}),
|
|
356
|
+
_ === "2d" && /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(o, {
|
|
357
|
+
onClick: f,
|
|
358
|
+
size: "sm",
|
|
359
|
+
variant: "outline",
|
|
360
|
+
glyph: n,
|
|
361
|
+
label: "Auto Window"
|
|
362
|
+
}), /* @__PURE__ */ F(J, {
|
|
363
|
+
checked: r["2d"].invert,
|
|
364
|
+
row: !0,
|
|
365
|
+
onChange: (e) => {
|
|
366
|
+
d("2d", { invert: e });
|
|
367
|
+
}
|
|
368
|
+
})] })
|
|
369
|
+
]
|
|
273
370
|
})
|
|
274
371
|
})
|
|
275
372
|
});
|
|
276
373
|
}
|
|
277
|
-
|
|
374
|
+
Z.displayName = "ImageDisplayOptionsView";
|
|
278
375
|
//#endregion
|
|
279
376
|
//#region src/integrations/image-display-options/image-display-options.tsx
|
|
280
|
-
function
|
|
281
|
-
let
|
|
377
|
+
function Q({ data: e, variant: t = "default", ranges: n, withGamma: r = !1, ...i }) {
|
|
378
|
+
let a = B(e), o = V(e), s = a.transferFunctionPresetNames(), c = a.transferFunction().presetName;
|
|
379
|
+
c ||= null;
|
|
380
|
+
let l = o.transferFunctionPresetNames(), u = o.transferFunction().presetName;
|
|
381
|
+
u ||= null;
|
|
382
|
+
let d = {
|
|
282
383
|
"2d": {
|
|
283
|
-
window: i.window,
|
|
284
|
-
level: i.level,
|
|
285
|
-
gamma: i.gamma,
|
|
286
|
-
invert: i.invert
|
|
287
|
-
},
|
|
288
|
-
"3d": {
|
|
289
384
|
window: a.window,
|
|
290
385
|
level: a.level,
|
|
291
|
-
|
|
386
|
+
gamma: a.gamma,
|
|
387
|
+
invert: a.invert,
|
|
388
|
+
currentPreset: c,
|
|
389
|
+
presetNames: s
|
|
390
|
+
},
|
|
391
|
+
"3d": {
|
|
392
|
+
window: o.window,
|
|
393
|
+
level: o.level,
|
|
394
|
+
currentPreset: u,
|
|
395
|
+
presetNames: l
|
|
292
396
|
}
|
|
293
|
-
},
|
|
294
|
-
return /* @__PURE__ */
|
|
295
|
-
...
|
|
397
|
+
}, f = R(() => e.minmaxIntensityOriginal(), [e]);
|
|
398
|
+
return /* @__PURE__ */ F(Z, {
|
|
399
|
+
...i,
|
|
296
400
|
variant: t,
|
|
297
|
-
options:
|
|
298
|
-
intensityRange:
|
|
401
|
+
options: d,
|
|
402
|
+
intensityRange: f,
|
|
299
403
|
ranges: n,
|
|
404
|
+
withGamma: r,
|
|
300
405
|
onOptionsChange: (e, t) => {
|
|
301
|
-
Object.assign(e === "2d" ?
|
|
406
|
+
Object.assign(e === "2d" ? a : o, t);
|
|
407
|
+
},
|
|
408
|
+
onAutoWindow: () => e.autoWindow(),
|
|
409
|
+
onTransferFunctionPresetChanged: (t, n) => {
|
|
410
|
+
(t === "2d" ? a : o).applyTransferFunctionPreset(n, e);
|
|
302
411
|
}
|
|
303
412
|
});
|
|
304
413
|
}
|
|
305
|
-
|
|
414
|
+
Q.displayName = "ImageDisplayOptions";
|
|
306
415
|
//#endregion
|
|
307
416
|
//#region src/integrations/image-display-options/image-display-options.meta.ts
|
|
308
|
-
var
|
|
417
|
+
var $ = {
|
|
309
418
|
name: "ImageDisplayOptions",
|
|
310
|
-
category:
|
|
419
|
+
category: r.inputs,
|
|
311
420
|
status: "experimental",
|
|
312
|
-
description: "Panel and toolbar controls for an image dataset's display options
|
|
421
|
+
description: "Panel and toolbar controls for an image dataset's display options: window, level, optional gamma, invert, auto window, and transfer-function presets.",
|
|
313
422
|
origin: "adapted",
|
|
314
423
|
internalDependencies: [
|
|
315
424
|
"Tabs",
|
|
@@ -319,7 +428,12 @@ var W = {
|
|
|
319
428
|
"Toggle",
|
|
320
429
|
"Row",
|
|
321
430
|
"Stack",
|
|
322
|
-
"ScrollArea"
|
|
431
|
+
"ScrollArea",
|
|
432
|
+
"Select",
|
|
433
|
+
"Button",
|
|
434
|
+
"IconButton",
|
|
435
|
+
"Separator",
|
|
436
|
+
"Icon"
|
|
323
437
|
],
|
|
324
438
|
upstream: {
|
|
325
439
|
name: "ImFusion Web SDK",
|
|
@@ -330,4 +444,4 @@ var W = {
|
|
|
330
444
|
}
|
|
331
445
|
};
|
|
332
446
|
//#endregion
|
|
333
|
-
export {
|
|
447
|
+
export { Q as ImageDisplayOptions, $ as imageDisplayOptionsMeta };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { hl as e, pM as t, tk as n, vM as r, yC as i } from "../icons-CMetKl2x.js";
|
|
2
2
|
import { t as a } from "../meta-V_KyLeGn.js";
|
|
3
3
|
import { n as o, t as s } from "../toggle-group-CVQzM3lQ.js";
|
|
4
|
-
import {
|
|
5
|
-
import { n as l, t as u } from "../row-CImu8yXV.js";
|
|
4
|
+
import { i as c, n as l, t as u } from "../row-CaeE5pqs.js";
|
|
6
5
|
import { cva as d } from "class-variance-authority";
|
|
7
6
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
7
|
import { useSyncExternalStore as m } from "react";
|