cloudmr-ux 4.3.6 → 4.3.8
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/CmrComponents/niivue-contrast-adjustments/NiivueContrastAdjustments.js +4 -4
- package/dist/CmrComponents/niivue-slice-position/NiivueSlicePosition.js +2 -2
- package/dist/CmrComponents/niivue-viewer/CloudMrNiivuePanel.d.ts +38 -0
- package/dist/CmrComponents/niivue-viewer/CloudMrNiivuePanel.js +197 -0
- package/dist/CmrComponents/niivue-viewer/CloudMrNiivueViewer.d.ts +41 -0
- package/dist/CmrComponents/niivue-viewer/CloudMrNiivueViewer.js +1239 -0
- package/dist/CmrComponents/niivue-viewer/ColorPicker.d.ts +1 -0
- package/dist/CmrComponents/niivue-viewer/ColorPicker.js +65 -0
- package/dist/CmrComponents/niivue-viewer/Layer.d.ts +1 -0
- package/dist/CmrComponents/niivue-viewer/Layer.js +122 -0
- package/dist/CmrComponents/niivue-viewer/LayersPanel.d.ts +1 -0
- package/dist/CmrComponents/niivue-viewer/LayersPanel.js +107 -0
- package/dist/CmrComponents/niivue-viewer/Niivue.css +8 -0
- package/dist/CmrComponents/niivue-viewer/NiivuePatcher.d.ts +2 -0
- package/dist/CmrComponents/niivue-viewer/NiivuePatcher.js +1402 -0
- package/dist/CmrComponents/niivue-viewer/NumberPicker.d.ts +1 -0
- package/dist/CmrComponents/niivue-viewer/NumberPicker.js +40 -0
- package/dist/CmrComponents/niivue-viewer/SettingsPanel.d.ts +1 -0
- package/dist/CmrComponents/niivue-viewer/SettingsPanel.js +30 -0
- package/dist/CmrComponents/niivue-viewer/Switch.d.ts +1 -0
- package/dist/CmrComponents/niivue-viewer/Switch.js +27 -0
- package/dist/CmrComponents/niivue-viewer/Toolbar.d.ts +48 -0
- package/dist/CmrComponents/niivue-viewer/Toolbar.js +276 -0
- package/dist/CmrComponents/niivue-viewer/Toolbar.scss +40 -0
- package/dist/CmrComponents/niivue-viewer/mro-draw-toolkit/DrawColorPlatte.d.ts +2 -0
- package/dist/CmrComponents/niivue-viewer/mro-draw-toolkit/DrawColorPlatte.js +61 -0
- package/dist/CmrComponents/niivue-viewer/mro-draw-toolkit/EraserPlatte.d.ts +2 -0
- package/dist/CmrComponents/niivue-viewer/mro-draw-toolkit/EraserPlatte.js +56 -0
- package/dist/CmrComponents/niivue-viewer/mro-draw-toolkit/MaskPlatte.d.ts +2 -0
- package/dist/CmrComponents/niivue-viewer/mro-draw-toolkit/MaskPlatte.js +148 -0
- package/dist/CmrComponents/niivue-viewer/mro-draw-toolkit/MroDrawToolkit.d.ts +1 -0
- package/dist/CmrComponents/niivue-viewer/mro-draw-toolkit/MroDrawToolkit.js +177 -0
- package/dist/CmrComponents/niivue-viewer/niivuePenType.d.ts +10 -0
- package/dist/CmrComponents/niivue-viewer/niivuePenType.js +10 -0
- package/dist/CmrTable/CmrTable.css +31 -7
- package/dist/CmrTable/CmrTable.d.ts +19 -0
- package/dist/CmrTable/CmrTable.js +39 -26
- package/dist/core/common/components/NiivueTools/NiivuePatcher.d.ts +2 -0
- package/dist/core/common/components/NiivueTools/components/ControlThemes.d.ts +1 -0
- package/dist/core/common/components/NiivueTools/components/ControlThemes.js +123 -0
- package/dist/core/common/components/NiivueTools/components/Example.d.ts +10 -0
- package/dist/core/common/components/NiivueTools/components/Example.js +326 -0
- package/dist/core/common/components/NiivueTools/components/ImageList.d.ts +1 -0
- package/dist/core/common/components/NiivueTools/components/ImageList.js +22 -0
- package/dist/core/common/components/NiivueTools/components/ImageListItem.d.ts +1 -0
- package/dist/core/common/components/NiivueTools/components/ImageListItem.js +103 -0
- package/dist/core/common/components/NiivueTools/main.d.ts +1 -0
- package/dist/core/common/components/NiivueTools/main.js +16 -0
- package/dist/core/common/components/NiivueTools/util.d.ts +21 -0
- package/dist/core/features/rois/resultSlice.js +3 -3
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -1
- package/package.json +3 -3
|
@@ -49,12 +49,12 @@ export function NiivueContrastAdjustments(_a) {
|
|
|
49
49
|
var _b, _c, _d, _e;
|
|
50
50
|
var nv = _a.nv, min = _a.min, max = _a.max, setMin = _a.setMin, setMax = _a.setMax, transformFactors = _a.transformFactors, gamma = _a.gamma, gammaKey = _a.gammaKey, setGamma = _a.setGamma, _f = _a.layerList, layerList = _f === void 0 ? [] : _f, _g = _a.title, title = _g === void 0 ? "Contrast Adjustments" : _g, _h = _a.accentColor, accentColor = _h === void 0 ? "#580f8b" : _h, style = _a.style, className = _a.className;
|
|
51
51
|
var a = transformFactors.a, b = transformFactors.b;
|
|
52
|
-
return (_jsxs("div", __assign({ style: style, className: className }, { children: [title !== "" && (_jsx("div", __assign({ className: "title", style: { width: "100%" } }, { children: title }))), _jsx(Card, __assign({ variant: "outlined", sx: { mb: 2, borderTopLeftRadius: 0, borderTopRightRadius: 0 } }, { children: _jsx(CardContent, { children: _jsxs(Box, __assign({ style: { display: "flex", flex: 1, minWidth: "245px", flexDirection: "column" } }, { children: [_jsx(TKDualRange, { name: "Values:", minDomain: (_c = (_b = nv.volumes[0]) === null || _b === void 0 ? void 0 : _b.robust_min) !== null && _c !== void 0 ? _c : 0, maxDomain: (_e = (_d = nv.volumes[0]) === null || _d === void 0 ? void 0 : _d.robust_max) !== null && _e !== void 0 ? _e : 1, valueLow: min, valueHigh: max, onChangeLow: function (newMin) {
|
|
52
|
+
return (_jsxs("div", __assign({ style: style, className: className }, { children: [title !== "" && (_jsx("div", __assign({ className: "title", style: { width: "100%" } }, { children: title }))), _jsx(Card, __assign({ variant: "outlined", sx: { mb: 2, borderTopLeftRadius: 0, borderTopRightRadius: 0 } }, { children: _jsx(CardContent, __assign({ sx: { "&:last-child": { paddingBottom: 2 } } }, { children: _jsxs(Box, __assign({ style: { display: "flex", flex: 1, minWidth: "245px", flexDirection: "column" } }, { children: [_jsx(TKDualRange, { name: "Values:", minDomain: (_c = (_b = nv.volumes[0]) === null || _b === void 0 ? void 0 : _b.robust_min) !== null && _c !== void 0 ? _c : 0, maxDomain: (_e = (_d = nv.volumes[0]) === null || _d === void 0 ? void 0 : _d.robust_max) !== null && _e !== void 0 ? _e : 1, valueLow: min, valueHigh: max, onChangeLow: function (newMin) {
|
|
53
53
|
var v = nv.volumes[0];
|
|
54
54
|
if (!v)
|
|
55
55
|
return;
|
|
56
56
|
v.cal_min = newMin;
|
|
57
|
-
nv.refreshLayers(v, 0
|
|
57
|
+
nv.refreshLayers(v, 0);
|
|
58
58
|
nv.drawScene();
|
|
59
59
|
setMin(newMin);
|
|
60
60
|
}, onChangeHigh: function (newMax) {
|
|
@@ -62,13 +62,13 @@ export function NiivueContrastAdjustments(_a) {
|
|
|
62
62
|
if (!v)
|
|
63
63
|
return;
|
|
64
64
|
v.cal_max = newMax;
|
|
65
|
-
nv.refreshLayers(v, 0
|
|
65
|
+
nv.refreshLayers(v, 0);
|
|
66
66
|
nv.drawScene();
|
|
67
67
|
setMax(newMax);
|
|
68
68
|
}, transform: function (x) { return a * x - a * b; }, inverse: function (y) { return y / a + b; }, step: 0.001, precision: 3, accentColor: accentColor }), _jsxs("div", __assign({ style: { marginTop: 20, marginBottom: 15 } }, { children: [_jsxs(CmrLabel, __assign({ style: { display: "block", marginBottom: 6 } }, { children: ["Gamma: ", gamma.toFixed(2)] })), _jsx("input", { id: "gamma", type: "range", min: 0.1, max: 3.0, step: 0.05, value: gamma, onChange: function (e) {
|
|
69
69
|
var val = Number(e.target.value);
|
|
70
70
|
setGamma(val);
|
|
71
71
|
nv.setGamma(val);
|
|
72
|
-
}, style: { width: "100%", accentColor: accentColor } }, gammaKey)] })), layerList.length > 0 && (_jsx(Box, __assign({ style: { height: "100%" } }, { children: layerList })))] })) }) }))] })));
|
|
72
|
+
}, style: { width: "100%", accentColor: accentColor } }, gammaKey)] })), layerList.length > 0 && (_jsx(Box, __assign({ style: { height: "100%" } }, { children: layerList })))] })) })) }))] })));
|
|
73
73
|
}
|
|
74
74
|
export default NiivueContrastAdjustments;
|
|
@@ -232,7 +232,7 @@ export function NiivueSlicePosition(_a) {
|
|
|
232
232
|
accentColor: accentColor
|
|
233
233
|
};
|
|
234
234
|
// ── Render ────────────────────────────────────────────────────────────────
|
|
235
|
-
return (_jsxs("div", __assign({ style: style, className: className }, { children: [title !== "" && (_jsx("div", __assign({ className: "title", style: { width: "100%" } }, { children: title }))), _jsx(Card, __assign({ variant: "outlined", sx: { mb: 2, borderTopLeftRadius: 0, borderTopRightRadius: 0 } }, { children: _jsx(CardContent, { children: _jsxs("div", __assign({ style: { display: "flex", flexDirection: "column" } }, { children: [_jsxs("div", __assign({ style: { marginBottom: 20 } }, { children: [_jsxs("div", __assign({ style: rowStyle }, { children: [_jsx(CmrLabel, { children: "X:" }), _jsx("input", { type: "number", value: xVal.toFixed(3), min: sliderMinX, max: sliderMaxX, step: stepX, style: inputStyle, onChange: function (e) {
|
|
235
|
+
return (_jsxs("div", __assign({ style: style, className: className }, { children: [title !== "" && (_jsx("div", __assign({ className: "title", style: { width: "100%" } }, { children: title }))), _jsx(Card, __assign({ variant: "outlined", sx: { mb: 2, borderTopLeftRadius: 0, borderTopRightRadius: 0 } }, { children: _jsx(CardContent, __assign({ sx: { "&:last-child": { paddingBottom: 2 } } }, { children: _jsxs("div", __assign({ style: { display: "flex", flexDirection: "column" } }, { children: [_jsxs("div", __assign({ style: { marginBottom: 20 } }, { children: [_jsxs("div", __assign({ style: rowStyle }, { children: [_jsx(CmrLabel, { children: "X:" }), _jsx("input", { type: "number", value: xVal.toFixed(3), min: sliderMinX, max: sliderMaxX, step: stepX, style: inputStyle, onChange: function (e) {
|
|
236
236
|
var next = Number(e.target.value);
|
|
237
237
|
if (Number.isFinite(next))
|
|
238
238
|
applyX(next);
|
|
@@ -250,6 +250,6 @@ export function NiivueSlicePosition(_a) {
|
|
|
250
250
|
applyZ(next);
|
|
251
251
|
}, onBlur: function (e) {
|
|
252
252
|
applyZ(clamp(Number(e.target.value), sliderMinZ, sliderMaxZ));
|
|
253
|
-
} })] })), _jsx("input", { id: "zSlice", type: "range", min: 0, max: Math.max(0, nz - 1), step: 1, value: zSliceIndex, style: sliderStyle, onChange: function (e) { return applyZBySliceIndex(Number(e.target.value)); } })] })] })) }) }))] })));
|
|
253
|
+
} })] })), _jsx("input", { id: "zSlice", type: "range", min: 0, max: Math.max(0, nz - 1), step: 1, value: zSliceIndex, style: sliderStyle, onChange: function (e) { return applyZBySliceIndex(Number(e.target.value)); } })] })] })) })) }))] })));
|
|
254
254
|
}
|
|
255
255
|
export default NiivueSlicePosition;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Toolbar.scss";
|
|
3
|
+
import type { DrawToolkitProps } from "../draw-toolkit/DrawToolkit";
|
|
4
|
+
/** Props for {@link DrawToolkit} minus brush controls when using {@link MroDrawToolkit}. */
|
|
5
|
+
export type CloudMrDrawToolkitProps = Omit<DrawToolkitProps, "brushSize" | "updateBrushSize">;
|
|
6
|
+
export interface CloudMrNiivuePanelProps {
|
|
7
|
+
nv: any;
|
|
8
|
+
pipelineID: string;
|
|
9
|
+
locationTableVisible: boolean;
|
|
10
|
+
locationData: any[];
|
|
11
|
+
decimalPrecision: number;
|
|
12
|
+
drawToolkitProps: CloudMrDrawToolkitProps;
|
|
13
|
+
drawShapeTool: "pen" | "rectangle" | "ellipse" | null;
|
|
14
|
+
setDrawShapeTool: (t: "pen" | "rectangle" | "ellipse" | null) => void;
|
|
15
|
+
resampleImage: () => void;
|
|
16
|
+
layerList: React.ComponentProps<any>[];
|
|
17
|
+
mins: number[];
|
|
18
|
+
maxs: number[];
|
|
19
|
+
mms: number[];
|
|
20
|
+
rois: {}[];
|
|
21
|
+
min: number;
|
|
22
|
+
max: number;
|
|
23
|
+
setMin: (min: number) => void;
|
|
24
|
+
setMax: (max: number) => void;
|
|
25
|
+
zipAndSendROI: (url: string, filename: string, blob: Blob) => Promise<void>;
|
|
26
|
+
unzipAndRenderROI: (url: string) => Promise<void>;
|
|
27
|
+
setLabelAlias: (label: string | number, alias: string) => void;
|
|
28
|
+
onAfterRoiUpload?: () => void | Promise<void>;
|
|
29
|
+
transformFactors: {
|
|
30
|
+
a: number;
|
|
31
|
+
b: number;
|
|
32
|
+
};
|
|
33
|
+
rangeKey: number;
|
|
34
|
+
gamma: number;
|
|
35
|
+
gammaKey: number;
|
|
36
|
+
setGamma: (val: number) => void;
|
|
37
|
+
}
|
|
38
|
+
export declare function CloudMrNiivuePanel(props: CloudMrNiivuePanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
49
|
+
import React from "react";
|
|
50
|
+
import { Box } from "@mui/material";
|
|
51
|
+
import { NI_PEN_TYPE } from "./niivuePenType";
|
|
52
|
+
import LocationTable from "../../core/common/components/NiivueTools/components/LocationTable";
|
|
53
|
+
import "./Toolbar.scss";
|
|
54
|
+
import { NiivueSlicePosition } from "../niivue-slice-position/NiivueSlicePosition";
|
|
55
|
+
import { NiivueContrastAdjustments } from "../niivue-contrast-adjustments/NiivueContrastAdjustments";
|
|
56
|
+
import { NiivueRoiTable } from "../niivue-roi-table/NiivueRoiTable";
|
|
57
|
+
import { MroDrawToolkit } from "./mro-draw-toolkit/MroDrawToolkit";
|
|
58
|
+
export function CloudMrNiivuePanel(props) {
|
|
59
|
+
var _this = this;
|
|
60
|
+
var canvas = React.useRef(null);
|
|
61
|
+
var histogram = React.useRef(null);
|
|
62
|
+
var mins = props.mins, maxs = props.maxs, mms = props.mms;
|
|
63
|
+
React.useEffect(function () {
|
|
64
|
+
var cancelled = false;
|
|
65
|
+
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
66
|
+
var e_1;
|
|
67
|
+
return __generator(this, function (_a) {
|
|
68
|
+
switch (_a.label) {
|
|
69
|
+
case 0:
|
|
70
|
+
_a.trys.push([0, 2, , 3]);
|
|
71
|
+
return [4 /*yield*/, props.nv.attachTo("niiCanvas")];
|
|
72
|
+
case 1:
|
|
73
|
+
_a.sent();
|
|
74
|
+
if (!cancelled) {
|
|
75
|
+
props.nv.opts.dragMode = props.nv.dragModes.pan;
|
|
76
|
+
}
|
|
77
|
+
return [3 /*break*/, 3];
|
|
78
|
+
case 2:
|
|
79
|
+
e_1 = _a.sent();
|
|
80
|
+
console.error("Niivue attachTo failed", e_1);
|
|
81
|
+
return [3 /*break*/, 3];
|
|
82
|
+
case 3: return [2 /*return*/];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}); })();
|
|
86
|
+
return function () {
|
|
87
|
+
cancelled = true;
|
|
88
|
+
};
|
|
89
|
+
}, [canvas]);
|
|
90
|
+
React.useEffect(function () {
|
|
91
|
+
props.nv.resizeListener();
|
|
92
|
+
props.nv.setMultiplanarLayout(2);
|
|
93
|
+
props.nv.setMultiplanarPadPixels(10);
|
|
94
|
+
props.resampleImage();
|
|
95
|
+
}, [window.innerWidth, window.innerHeight]);
|
|
96
|
+
React.useEffect(function () {
|
|
97
|
+
setTimeout(function () {
|
|
98
|
+
props.nv.resizeListener();
|
|
99
|
+
props.nv.setMultiplanarLayout(2);
|
|
100
|
+
props.nv.setMultiplanarPadPixels(10);
|
|
101
|
+
props.resampleImage();
|
|
102
|
+
}, 300);
|
|
103
|
+
}, []);
|
|
104
|
+
React.useEffect(function () {
|
|
105
|
+
props.resampleImage();
|
|
106
|
+
}, [histogram]);
|
|
107
|
+
function applyDrawShapeTool(tool) {
|
|
108
|
+
props.setDrawShapeTool(tool);
|
|
109
|
+
var nv = props.nv;
|
|
110
|
+
nv.opts.penType =
|
|
111
|
+
tool === "rectangle"
|
|
112
|
+
? NI_PEN_TYPE.RECTANGLE
|
|
113
|
+
: tool === "ellipse"
|
|
114
|
+
? NI_PEN_TYPE.ELLIPSE
|
|
115
|
+
: NI_PEN_TYPE.PEN;
|
|
116
|
+
nv.drawScene();
|
|
117
|
+
if ((tool === "rectangle" || tool === "ellipse") && !props.drawToolkitProps.drawingEnabled) {
|
|
118
|
+
props.drawToolkitProps.setDrawingEnabled(true);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return (_jsxs(Box, __assign({ sx: {
|
|
122
|
+
width: "100%",
|
|
123
|
+
display: "flex",
|
|
124
|
+
flexDirection: {
|
|
125
|
+
xs: "column",
|
|
126
|
+
md: "row"
|
|
127
|
+
},
|
|
128
|
+
flexWrap: "nowrap"
|
|
129
|
+
} }, { children: [_jsxs(Box, __assign({ sx: {
|
|
130
|
+
width: {
|
|
131
|
+
xs: "100%",
|
|
132
|
+
md: "63%"
|
|
133
|
+
},
|
|
134
|
+
display: "flex",
|
|
135
|
+
flexDirection: "column",
|
|
136
|
+
minHeight: 0,
|
|
137
|
+
alignItems: "stretch",
|
|
138
|
+
justifyContent: "flex-start",
|
|
139
|
+
mb: { xs: 2, md: 0 }
|
|
140
|
+
} }, { children: [_jsx(MroDrawToolkit, __assign({}, props.drawToolkitProps, { drawShapeTool: props.drawShapeTool, onDrawShapeToolChange: applyDrawShapeTool, onExitDrawMode: function () { return props.setDrawShapeTool(null); }, style: {
|
|
141
|
+
marginBottom: 0,
|
|
142
|
+
width: "100%",
|
|
143
|
+
flexShrink: 0
|
|
144
|
+
} })), _jsx(LocationTable, { tableData: props.locationData, isVisible: true, decimalPrecision: props.decimalPrecision, style: {
|
|
145
|
+
width: "100%",
|
|
146
|
+
height: "30pt",
|
|
147
|
+
paddingTop: "10px",
|
|
148
|
+
color: "white",
|
|
149
|
+
background: "black",
|
|
150
|
+
flexShrink: 0
|
|
151
|
+
} }), _jsx(Box, __assign({ sx: {
|
|
152
|
+
position: "relative",
|
|
153
|
+
width: "100%",
|
|
154
|
+
flexShrink: 0,
|
|
155
|
+
minHeight: {
|
|
156
|
+
xs: 300,
|
|
157
|
+
sm: 400,
|
|
158
|
+
md: 1035
|
|
159
|
+
},
|
|
160
|
+
height: {
|
|
161
|
+
xs: 300,
|
|
162
|
+
sm: 400,
|
|
163
|
+
md: 1035
|
|
164
|
+
}
|
|
165
|
+
} }, { children: _jsx("canvas", { id: "niiCanvas", ref: canvas, style: {
|
|
166
|
+
position: "absolute",
|
|
167
|
+
top: 0,
|
|
168
|
+
left: 0,
|
|
169
|
+
width: "100%",
|
|
170
|
+
height: "100%"
|
|
171
|
+
} }) }))] })), _jsxs(Box, __assign({ sx: {
|
|
172
|
+
width: {
|
|
173
|
+
xs: "100%",
|
|
174
|
+
md: "35%"
|
|
175
|
+
},
|
|
176
|
+
display: "flex",
|
|
177
|
+
flexDirection: "column",
|
|
178
|
+
ml: {
|
|
179
|
+
xs: 0,
|
|
180
|
+
md: 1
|
|
181
|
+
},
|
|
182
|
+
minHeight: 0,
|
|
183
|
+
height: "100%",
|
|
184
|
+
overflow: "visible",
|
|
185
|
+
position: "relative",
|
|
186
|
+
zIndex: 1
|
|
187
|
+
} }, { children: [_jsx(NiivueSlicePosition, { nv: props.nv, mins: mins, maxs: maxs, mms: mms, style: { minWidth: 245 } }), _jsx(NiivueContrastAdjustments, { nv: props.nv, min: props.min, max: props.max, setMin: props.setMin, setMax: props.setMax, transformFactors: props.transformFactors, gamma: props.gamma, gammaKey: props.gammaKey, setGamma: props.setGamma, layerList: props.layerList, style: { minWidth: 245 } }), _jsxs(Box, __assign({ sx: { width: "100%", height: 600 } }, { children: [_jsx(Box, { ref: histogram, id: "histoplot", sx: {
|
|
188
|
+
width: "100%",
|
|
189
|
+
height: 250,
|
|
190
|
+
mb: 2
|
|
191
|
+
} }), _jsx(Box, __assign({ sx: { width: "100%", height: 350 } }, { children: _jsx(NiivueRoiTable, { pipelineID: props.pipelineID, rois: props.rois, style: {
|
|
192
|
+
width: "100%",
|
|
193
|
+
height: "100%",
|
|
194
|
+
display: "flex",
|
|
195
|
+
flexDirection: "column"
|
|
196
|
+
}, nv: props.nv, resampleImage: props.resampleImage, unpackROI: props.unzipAndRenderROI, zipAndSendROI: props.zipAndSendROI, setLabelAlias: props.setLabelAlias, onAfterRoiUpload: props.onAfterRoiUpload }) }))] }))] }))] })));
|
|
197
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export default function CloudMrNiivueViewer(props: any): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {Object} CloudMrNiivueViewerProps
|
|
4
|
+
* @property {any[]} niis
|
|
5
|
+
* @property {number} selectedVolume
|
|
6
|
+
* @property {(i: number) => void} setSelectedVolume
|
|
7
|
+
* @property {any[]} rois
|
|
8
|
+
* @property {string} pipelineID
|
|
9
|
+
* @property {string} [accessToken]
|
|
10
|
+
* @property {(msg: string) => void} [setWarning]
|
|
11
|
+
* @property {(open: boolean) => void} [setWarningOpen]
|
|
12
|
+
* @property {(fn: () => void) => void} [saveROICallback]
|
|
13
|
+
* @property {string} roiDeleteUrl — full URL for `ROI_DELETE` (app resolves from env)
|
|
14
|
+
* @property {() => Promise<void>} refreshPipelineRois — e.g. dispatch getPipelineROI
|
|
15
|
+
* @property {() => any[]} getPipelineRois — returns current ROI list for pipeline (e.g. from Redux)
|
|
16
|
+
*/
|
|
17
|
+
export const nv: Niivue;
|
|
18
|
+
export type CloudMrNiivueViewerProps = {
|
|
19
|
+
niis: any[];
|
|
20
|
+
selectedVolume: number;
|
|
21
|
+
setSelectedVolume: (i: number) => void;
|
|
22
|
+
rois: any[];
|
|
23
|
+
pipelineID: string;
|
|
24
|
+
accessToken?: string | undefined;
|
|
25
|
+
setWarning?: ((msg: string) => void) | undefined;
|
|
26
|
+
setWarningOpen?: ((open: boolean) => void) | undefined;
|
|
27
|
+
saveROICallback?: ((fn: () => void) => void) | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* — full URL for `ROI_DELETE` (app resolves from env)
|
|
30
|
+
*/
|
|
31
|
+
roiDeleteUrl: string;
|
|
32
|
+
/**
|
|
33
|
+
* — e.g. dispatch getPipelineROI
|
|
34
|
+
*/
|
|
35
|
+
refreshPipelineRois: () => Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* — returns current ROI list for pipeline (e.g. from Redux)
|
|
38
|
+
*/
|
|
39
|
+
getPipelineRois: () => any[];
|
|
40
|
+
};
|
|
41
|
+
import { Niivue } from "./NiivuePatcher";
|