Skip to content

Commit 954053a

Browse files
authored
Merge pull request #12 from hsellik/feat/update-configuration
Feat/update configuration
2 parents 7f85b94 + ee654e6 commit 954053a

File tree

5 files changed

+22
-77
lines changed

5 files changed

+22
-77
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"devDependencies": {
1414
"@biomejs/biome": "^1.9.4",
15-
"@niivue/niivue": "^0.48.1",
15+
"@niivue/niivue": "^0.52.0",
1616
"@playwright/test": "^1.49.1",
1717
"@types/node": "^22.10.5",
1818
"@types/react": "^19.0.3",

pnpm-lock.yaml

Lines changed: 9 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/NiivueCanvas.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const NiivueCanvas: React.FC<NiivueCanvasProps> = ({
4141
}
4242

4343
const canvasRef = React.useRef<HTMLCanvasElement>(null);
44-
const nvRef = React.useRef(new Niivue());
44+
const nvRef = React.useRef(new Niivue(options));
4545
const [ready, setReady] = React.useState(false);
4646

4747
const prevVolumesRef = useRef<NVRVolume[]>([]);

src/reexport.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Type definitions copy-pasted from `niivue` since they are not public.
33
*/
44

5-
import { DRAG_MODE, SHOW_RENDER, SLICE_TYPE } from "@niivue/niivue";
5+
import {DRAG_MODE, MULTIPLANAR_TYPE, SHOW_RENDER, SLICE_TYPE} from "@niivue/niivue";
66

77
/**
88
* Niivue options.
@@ -75,6 +75,8 @@ type NiiVueOptions = {
7575
multiplanarForceRender?: boolean;
7676
// behavior for 3D render when in multiplanar view
7777
multiplanarShowRender?: SHOW_RENDER;
78+
// Control how the layout panels are positioned in multiplanar mode
79+
multiplanarLayout?: MULTIPLANAR_TYPE;
7880
// 2D slice views can show meshes within this range. Meshes only visible in sliceMM (world space) mode
7981
meshThicknessOn2D?: number;
8082
// behavior for dragging (none, contrast, measurement, pan)
@@ -87,8 +89,11 @@ type NiiVueOptions = {
8789
sagittalNoseLeft?: boolean;
8890
// are images aligned to voxel space (false) or world space (true)
8991
isSliceMM?: boolean;
90-
// demand that high-dot-per-inch displays use native voxel size
92+
// @deprecated - use forceDevicePixelRatio instead. Demand that high-dot-per-inch displays use native voxel size
9193
isHighResolutionCapable?: boolean;
94+
// The default is zero (high resolution capable), a negative value disables high resolution
95+
// (to device pixel ratio is 1), and a positive value enforces the requested device pixel ratio
96+
forceDevicePixelRatio?: number;
9297
// allow user to create and edit voxel-based drawings
9398
drawingEnabled?: boolean;
9499
// color of drawing when user drags mouse (if drawingEnabled)
@@ -132,15 +137,15 @@ type NiiVueOptions = {
132137
// Default is false
133138
selectionBoxIsOutline?: boolean,
134139
// determines if the cavas need to be focused to scroll. Default is false
135-
scrollRequiresFocus: boolean,
140+
scrollRequiresFocus?: boolean,
136141
// controls whether measuring tool shows units. e.g. 20.2 vs 20.2 mm. Default is true
137142
showMeasureUnits?: boolean,
138143
// control where the measuring tool text is shown. Default is "center"
139144
measureTextJustify?: "start" | "center" | "end";
140145
// control measuring tool text color. Default is [1, 0, 0, 1] (red)
141-
measureTextColor: number[],
146+
measureTextColor?: number[],
142147
// control measuring tool line color. Default is [1, 0, 0, 1] (red)
143-
measureLineColor: number[],
148+
measureLineColor?: number[],
144149
// control measuring tool text height (fractional height, separate from main textHeight property for orientation labels). Default is 0.03
145150
measureTextHeight?: number
146151

src/setters.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function optionUpdateFunctionMap(nv: Niivue): OptionUpdateFunctionMap {
1717
crosshairColor: nv.setCrosshairColor,
1818
sliceType: nv.setSliceType,
1919
isSliceMM: nv.setSliceMM,
20+
// forceDevicePixelRatio: nv.setHighResolutionCapable,
2021
};
2122
return bindAllValues(nv, mapping);
2223
}

0 commit comments

Comments
 (0)