@niivue/niivue 0.63.0 → 0.65.0

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.
@@ -30,8 +30,8 @@ declare class ColorTables {
30
30
  colorMaps(): Array<keyof typeof this.cluts>;
31
31
  colormapFromKey(name: string): ColorMap;
32
32
  colormap(key?: string, isInvert?: boolean): Uint8ClampedArray;
33
- makeLabelLut(cm: ColorMap, alphaFill?: number): LUT;
34
- makeLabelLutFromUrl(name: string): Promise<LUT>;
33
+ makeLabelLut(cm: ColorMap, alphaFill?: number, maxIdx?: number): LUT;
34
+ makeLabelLutFromUrl(name: string, alphaFill?: number, maxIdx?: number): Promise<LUT>;
35
35
  makeDrawLut(name: string | ColorMap): LUT;
36
36
  makeLut(Rsi: number[], Gsi: number[], Bsi: number[], Asi: number[], Isi: number[], isInvert: boolean): Uint8ClampedArray;
37
37
  }
@@ -294,7 +294,8 @@ declare enum ImageType {
294
294
  BMP = 19,
295
295
  ZARR = 20,
296
296
  NPY = 21,
297
- NPZ = 22
297
+ NPZ = 22,
298
+ HDR = 23
298
299
  }
299
300
  type ImageFromUrlOptions = {
300
301
  url: string;
@@ -638,6 +639,7 @@ type TRX = {
638
639
  dpg: ValuesArray;
639
640
  dps: ValuesArray;
640
641
  dpv: ValuesArray;
642
+ groups: ValuesArray;
641
643
  header: unknown;
642
644
  };
643
645
  type TRK = {
@@ -820,6 +822,7 @@ declare class NVMesh {
820
822
  dpg?: ValuesArray | null;
821
823
  dps?: ValuesArray | null;
822
824
  dpv?: ValuesArray | null;
825
+ groups?: ValuesArray | null;
823
826
  hasConnectome: boolean;
824
827
  connectome?: LegacyConnectome | string;
825
828
  indexCount?: number;
@@ -851,10 +854,11 @@ declare class NVMesh {
851
854
  * @param dpg - Data per group for tractography, see TRK format. Default is null (not tractograpgy)
852
855
  * @param dps - Data per streamline for tractography, see TRK format. Default is null (not tractograpgy)
853
856
  * @param dpv - Data per vertex for tractography, see TRK format. Default is null (not tractograpgy)
857
+ * @param groups - Groups for tractography, see TRK format. Default is null (not tractograpgy)
854
858
  * @param colorbarVisible - does this mesh display a colorbar
855
859
  * @param anatomicalStructurePrimary - region for mesh. Default is an empty string
856
860
  */
857
- constructor(pts: Float32Array, tris: Uint32Array, name: string, rgba255: Uint8Array, opacity: number, visible: boolean, gl: WebGL2RenderingContext, connectome?: LegacyConnectome | string | null, dpg?: ValuesArray | null, dps?: ValuesArray | null, dpv?: ValuesArray | null, colorbarVisible?: boolean, anatomicalStructurePrimary?: string);
861
+ constructor(pts: Float32Array, tris: Uint32Array, name: string, rgba255: Uint8Array, opacity: number, visible: boolean, gl: WebGL2RenderingContext, connectome?: LegacyConnectome | string | null, dpg?: ValuesArray | null, dps?: ValuesArray | null, dpv?: ValuesArray | null, groups?: ValuesArray | null, colorbarVisible?: boolean, anatomicalStructurePrimary?: string);
858
862
  initValuesArray(va: ValuesArray): ValuesArray;
859
863
  linesToCylinders(gl: WebGL2RenderingContext, posClrF32: Float32Array, indices: number[]): void;
860
864
  createFiberDensityMap(): void;
@@ -1042,14 +1046,13 @@ type NVConfigOptions = {
1042
1046
  fontColor: Float32List;
1043
1047
  selectionBoxColor: number[];
1044
1048
  clipPlaneColor: number[];
1049
+ isClipPlanesCutaway: boolean;
1045
1050
  paqdUniforms: number[];
1046
- clipThick: number;
1047
- clipVolumeLow: number[];
1048
- clipVolumeHigh: number[];
1049
1051
  rulerColor: number[];
1050
1052
  colorbarMargin: number;
1051
1053
  trustCalMinMax: boolean;
1052
1054
  clipPlaneHotKey: string;
1055
+ cycleClipPlaneHotKey: string;
1053
1056
  viewModeHotKey: string;
1054
1057
  doubleTouchTimeout: number;
1055
1058
  longTouchTimeout: number;
@@ -1142,26 +1145,20 @@ type SceneData = {
1142
1145
  azimuth: number;
1143
1146
  elevation: number;
1144
1147
  crosshairPos: vec3;
1145
- clipPlane: number[];
1146
- clipPlaneDepthAziElev: number[];
1148
+ clipPlanes: number[][];
1149
+ clipPlaneDepthAziElevs: number[][];
1147
1150
  volScaleMultiplier: number;
1148
1151
  pan2Dxyzmm: vec4;
1149
- clipThick: number;
1150
- clipVolumeLow: number[];
1151
- clipVolumeHigh: number[];
1152
1152
  };
1153
1153
  declare const INITIAL_SCENE_DATA: {
1154
1154
  gamma: number;
1155
1155
  azimuth: number;
1156
1156
  elevation: number;
1157
1157
  crosshairPos: vec3;
1158
- clipPlane: number[];
1159
- clipPlaneDepthAziElev: number[];
1158
+ clipPlanes: number[][];
1159
+ clipPlaneDepthAziElevs: number[][];
1160
1160
  volScaleMultiplier: number;
1161
1161
  pan2Dxyzmm: vec4;
1162
- clipThick: number;
1163
- clipVolumeLow: number[];
1164
- clipVolumeHigh: number[];
1165
1162
  };
1166
1163
  type Scene = {
1167
1164
  onAzimuthElevationChange: (azimuth: number, elevation: number) => void;
@@ -1172,7 +1169,8 @@ type Scene = {
1172
1169
  volScaleMultiplier: number;
1173
1170
  crosshairPos: vec3;
1174
1171
  clipPlane: number[];
1175
- clipPlaneDepthAziElev: number[];
1172
+ clipPlanes: number[][];
1173
+ clipPlaneDepthAziElevs: number[][];
1176
1174
  pan2Dxyzmm: vec4;
1177
1175
  _elevation?: number;
1178
1176
  _azimuth?: number;
@@ -1351,4 +1349,4 @@ declare class NVDocument {
1351
1349
  private _createOptsProxy;
1352
1350
  }
1353
1351
 
1354
- export { INITIAL_SCENE_DATA as $, type ANNOT as A, NVMeshLayerDefaults as B, type ColorMap as C, type DefaultMeshType as D, type ExportDocumentData as E, type FreeSurferConnectome as F, type GII as G, ColorTables as H, type ImageFromUrlOptions as I, cmapper as J, NVImageFromUrlOptions as K, type LUT as L, type MZ3 as M, NVMesh as N, LabelTextAlignment as O, LabelLineTerminator as P, type CompletedMeasurement as Q, type CompletedAngle as R, SLICE_TYPE as S, type TypedVoxelArray as T, PEN_TYPE as U, type VTK as V, SHOW_RENDER as W, type X3D as X, MULTIPLANAR_TYPE as Y, COLORMAP_TYPE as Z, DEFAULT_OPTIONS as _, type TRACT as a, type DocumentData as a0, type Volume as a1, type Point as a2, type NVConnectomeEdge as a3, type ConnectomeOptions as a4, type LegacyNodes as a5, type NiiVueLocationValue as a6, type NiiVueLocation as a7, type TT as b, type TRX as c, type TCK as d, type TRK as e, type NVMeshLayer as f, type MGH as g, type SyncOpts as h, DRAG_MODE as i, NVImage as j, type LoadFromUrlParams as k, type DragReleaseParams as l, NVDocument as m, type NVConfigOptions as n, type Scene as o, type LegacyConnectome as p, type NVConnectomeNode as q, type Connectome as r, type NiftiHeader as s, NiiDataType as t, type MouseEventConfig as u, type TouchEventConfig as v, NVLabel3D as w, NVLabel3DStyle as x, LabelAnchorPoint as y, NVMeshFromUrlOptions as z };
1352
+ export { DEFAULT_OPTIONS as $, type ANNOT as A, NVMeshFromUrlOptions as B, type ColorMap as C, type DefaultMeshType as D, type ExportDocumentData as E, type FreeSurferConnectome as F, type GII as G, NVMeshLayerDefaults as H, type ImageFromUrlOptions as I, ColorTables as J, cmapper as K, type LUT as L, type MZ3 as M, NVMesh as N, NVImageFromUrlOptions as O, LabelTextAlignment as P, LabelLineTerminator as Q, type CompletedMeasurement as R, SLICE_TYPE as S, type TypedVoxelArray as T, type CompletedAngle as U, type ValuesArray as V, PEN_TYPE as W, type X3D as X, SHOW_RENDER as Y, MULTIPLANAR_TYPE as Z, COLORMAP_TYPE as _, type TRACT as a, INITIAL_SCENE_DATA as a0, type DocumentData as a1, type Volume as a2, type Point as a3, type NVConnectomeEdge as a4, type ConnectomeOptions as a5, type LegacyNodes as a6, type NiiVueLocationValue as a7, type NiiVueLocation as a8, type TT as b, type TRX as c, type TCK as d, type TRK as e, type VTK as f, type NVMeshLayer as g, type MGH as h, type SyncOpts as i, DRAG_MODE as j, NVImage as k, type LoadFromUrlParams as l, type DragReleaseParams as m, NVDocument as n, type NVConfigOptions as o, type Scene as p, type LegacyConnectome as q, type NVConnectomeNode as r, type Connectome as s, type NiftiHeader as t, NiiDataType as u, type MouseEventConfig as v, type TouchEventConfig as w, NVLabel3D as x, NVLabel3DStyle as y, LabelAnchorPoint as z };
@@ -1,4 +1,4 @@
1
- import { a1 as Volume, s as NiftiHeader } from '../nvdocument-5GNlbB1d.js';
1
+ import { a2 as Volume, t as NiftiHeader } from '../nvdocument-Bma8slLJ.js';
2
2
  import { vec3, mat4, vec4 } from 'gl-matrix';
3
3
  import 'nifti-reader-js';
4
4
 
package/dist/index.d.ts CHANGED
@@ -30,8 +30,8 @@ declare class ColorTables {
30
30
  colorMaps(): Array<keyof typeof this.cluts>;
31
31
  colormapFromKey(name: string): ColorMap;
32
32
  colormap(key?: string, isInvert?: boolean): Uint8ClampedArray;
33
- makeLabelLut(cm: ColorMap, alphaFill?: number): LUT;
34
- makeLabelLutFromUrl(name: string): Promise<LUT>;
33
+ makeLabelLut(cm: ColorMap, alphaFill?: number, maxIdx?: number): LUT;
34
+ makeLabelLutFromUrl(name: string, alphaFill?: number, maxIdx?: number): Promise<LUT>;
35
35
  makeDrawLut(name: string | ColorMap): LUT;
36
36
  makeLut(Rsi: number[], Gsi: number[], Bsi: number[], Asi: number[], Isi: number[], isInvert: boolean): Uint8ClampedArray;
37
37
  }
@@ -204,7 +204,8 @@ declare enum ImageType {
204
204
  BMP = 19,
205
205
  ZARR = 20,
206
206
  NPY = 21,
207
- NPZ = 22
207
+ NPZ = 22,
208
+ HDR = 23
208
209
  }
209
210
  type ImageFromUrlOptions = {
210
211
  url: string;
@@ -671,14 +672,13 @@ type NVConfigOptions = {
671
672
  fontColor: Float32List;
672
673
  selectionBoxColor: number[];
673
674
  clipPlaneColor: number[];
675
+ isClipPlanesCutaway: boolean;
674
676
  paqdUniforms: number[];
675
- clipThick: number;
676
- clipVolumeLow: number[];
677
- clipVolumeHigh: number[];
678
677
  rulerColor: number[];
679
678
  colorbarMargin: number;
680
679
  trustCalMinMax: boolean;
681
680
  clipPlaneHotKey: string;
681
+ cycleClipPlaneHotKey: string;
682
682
  viewModeHotKey: string;
683
683
  doubleTouchTimeout: number;
684
684
  longTouchTimeout: number;
@@ -771,26 +771,20 @@ type SceneData = {
771
771
  azimuth: number;
772
772
  elevation: number;
773
773
  crosshairPos: vec3;
774
- clipPlane: number[];
775
- clipPlaneDepthAziElev: number[];
774
+ clipPlanes: number[][];
775
+ clipPlaneDepthAziElevs: number[][];
776
776
  volScaleMultiplier: number;
777
777
  pan2Dxyzmm: vec4;
778
- clipThick: number;
779
- clipVolumeLow: number[];
780
- clipVolumeHigh: number[];
781
778
  };
782
779
  declare const INITIAL_SCENE_DATA: {
783
780
  gamma: number;
784
781
  azimuth: number;
785
782
  elevation: number;
786
783
  crosshairPos: vec3;
787
- clipPlane: number[];
788
- clipPlaneDepthAziElev: number[];
784
+ clipPlanes: number[][];
785
+ clipPlaneDepthAziElevs: number[][];
789
786
  volScaleMultiplier: number;
790
787
  pan2Dxyzmm: vec4;
791
- clipThick: number;
792
- clipVolumeLow: number[];
793
- clipVolumeHigh: number[];
794
788
  };
795
789
  type Scene = {
796
790
  onAzimuthElevationChange: (azimuth: number, elevation: number) => void;
@@ -801,7 +795,8 @@ type Scene = {
801
795
  volScaleMultiplier: number;
802
796
  crosshairPos: vec3;
803
797
  clipPlane: number[];
804
- clipPlaneDepthAziElev: number[];
798
+ clipPlanes: number[][];
799
+ clipPlaneDepthAziElevs: number[][];
805
800
  pan2Dxyzmm: vec4;
806
801
  _elevation?: number;
807
802
  _azimuth?: number;
@@ -1151,6 +1146,7 @@ type TRX = {
1151
1146
  dpg: ValuesArray;
1152
1147
  dps: ValuesArray;
1153
1148
  dpv: ValuesArray;
1149
+ groups: ValuesArray;
1154
1150
  header: unknown;
1155
1151
  };
1156
1152
  type TRK = {
@@ -1333,6 +1329,7 @@ declare class NVMesh {
1333
1329
  dpg?: ValuesArray | null;
1334
1330
  dps?: ValuesArray | null;
1335
1331
  dpv?: ValuesArray | null;
1332
+ groups?: ValuesArray | null;
1336
1333
  hasConnectome: boolean;
1337
1334
  connectome?: LegacyConnectome | string;
1338
1335
  indexCount?: number;
@@ -1364,10 +1361,11 @@ declare class NVMesh {
1364
1361
  * @param dpg - Data per group for tractography, see TRK format. Default is null (not tractograpgy)
1365
1362
  * @param dps - Data per streamline for tractography, see TRK format. Default is null (not tractograpgy)
1366
1363
  * @param dpv - Data per vertex for tractography, see TRK format. Default is null (not tractograpgy)
1364
+ * @param groups - Groups for tractography, see TRK format. Default is null (not tractograpgy)
1367
1365
  * @param colorbarVisible - does this mesh display a colorbar
1368
1366
  * @param anatomicalStructurePrimary - region for mesh. Default is an empty string
1369
1367
  */
1370
- constructor(pts: Float32Array, tris: Uint32Array, name: string, rgba255: Uint8Array, opacity: number, visible: boolean, gl: WebGL2RenderingContext, connectome?: LegacyConnectome | string | null, dpg?: ValuesArray | null, dps?: ValuesArray | null, dpv?: ValuesArray | null, colorbarVisible?: boolean, anatomicalStructurePrimary?: string);
1368
+ constructor(pts: Float32Array, tris: Uint32Array, name: string, rgba255: Uint8Array, opacity: number, visible: boolean, gl: WebGL2RenderingContext, connectome?: LegacyConnectome | string | null, dpg?: ValuesArray | null, dps?: ValuesArray | null, dpv?: ValuesArray | null, groups?: ValuesArray | null, colorbarVisible?: boolean, anatomicalStructurePrimary?: string);
1371
1369
  initValuesArray(va: ValuesArray): ValuesArray;
1372
1370
  linesToCylinders(gl: WebGL2RenderingContext, posClrF32: Float32Array, indices: number[]): void;
1373
1371
  createFiberDensityMap(): void;
@@ -1474,6 +1472,21 @@ declare class NVUtilities {
1474
1472
  declare class NVMeshLoaders {
1475
1473
  static readTRACT(buffer: ArrayBuffer): TRACT;
1476
1474
  static readTT(buffer: ArrayBuffer): Promise<TT>;
1475
+ /**
1476
+ * Assemble dpg from a map-of-groups into a ValuesArray ordered by groups[].
1477
+ *
1478
+ * @param dpgMap - map from groupId -> ValuesArray (entries for that group)
1479
+ * @param groups - ValuesArray describing groups; groups[i].id defines the ordering
1480
+ * @returns ValuesArray - one entry per tag where vals is the concatenation of each group's vals in groups[] order
1481
+ *
1482
+ * @throws Error when:
1483
+ * - groups is empty or missing
1484
+ * - any group in groups is missing from dpgMap
1485
+ * - any group contains duplicate entries for a tag
1486
+ * - tag coverage differs between groups (missing tag in any group)
1487
+ * - any entry has invalid/unconvertible vals
1488
+ */
1489
+ static assembleDpgFromMap(dpgMap: Record<string, ValuesArray>, groups: ValuesArray): ValuesArray;
1477
1490
  static readTRX(buffer: ArrayBuffer): Promise<TRX>;
1478
1491
  static readTXT(buffer: ArrayBuffer, n_count?: number): Float32Array;
1479
1492
  static readTSF(buffer: ArrayBuffer, n_vert?: number): Float32Array;
@@ -1504,7 +1517,7 @@ declare class NVMeshLoaders {
1504
1517
  static readSTL(buffer: ArrayBuffer): DefaultMeshType;
1505
1518
  static decimateLayerVertices(nVertLayer: number, nVertMesh: number): number;
1506
1519
  static readNII2(buffer: ArrayBuffer, n_vert?: number, anatomicalStructurePrimary?: string): Promise<Int32Array | Float32Array | Int16Array | Uint8Array>;
1507
- static readNII(buffer: ArrayBuffer, n_vert?: number, anatomicalStructurePrimary?: string): Promise<Float32Array | Uint8Array | Int32Array | Int16Array>;
1520
+ static readNII(buffer: ArrayBuffer, pts: Float32Array, anatomicalStructurePrimary?: string): Promise<Float32Array | Uint8Array | Int32Array | Int16Array>;
1508
1521
  static readMGH(buffer: ArrayBuffer, n_vert?: number, isReadColortables?: boolean): Promise<MGH>;
1509
1522
  static readX3D(buffer: ArrayBuffer): X3D;
1510
1523
  static readGII(buffer: ArrayBuffer, n_vert?: number): Promise<GII>;
@@ -1632,6 +1645,7 @@ type UIData = {
1632
1645
  activeDragButton: number | null;
1633
1646
  angleFirstLine: number[];
1634
1647
  angleState: 'none' | 'drawing_first_line' | 'drawing_second_line' | 'complete';
1648
+ activeClipPlaneIndex: number;
1635
1649
  };
1636
1650
  type SaveImageOptions = {
1637
1651
  filename: string;
@@ -2291,6 +2305,12 @@ declare class Niivue {
2291
2305
  * @internal
2292
2306
  */
2293
2307
  handlePinchZoom(e: TouchEvent): void;
2308
+ /**
2309
+ * Cycles active clip plane
2310
+ * @internal
2311
+ * @returns active clip plane index
2312
+ */
2313
+ cycleActiveClipPlane(): number;
2294
2314
  /**
2295
2315
  * Handles keyboard shortcuts for toggling clip planes and slice view modes with debounce logic.
2296
2316
  * @internal
@@ -2860,8 +2880,25 @@ declare class Niivue {
2860
2880
  * @example
2861
2881
  * niivue = new Niivue()
2862
2882
  * xyz = niivue.sph2cartDeg(42, 42)
2883
+ * @internal
2863
2884
  */
2864
2885
  sph2cartDeg(azimuth: number, elevation: number): number[];
2886
+ /**
2887
+ * Set multiple clip planes from their depth/azimuth/elevation definitions.
2888
+ *
2889
+ * depth: distance of clip plane from center of volume, range 0..~1.73
2890
+ * (e.g. 2.0 for no clip plane)
2891
+ * azimuth: camera position in degrees around object, typically 0..360
2892
+ * (or -180..+180)
2893
+ * elevation: camera height in degrees, range -90..90
2894
+ *
2895
+ * This replaces the entire `clipPlanes` and `clipPlaneDepthAziElevs` arrays,
2896
+ * ensuring they always have the same length.
2897
+ *
2898
+ * @param depthAziElevs - array of `[depth, azimuthDeg, elevationDeg]` values
2899
+ * @see {@link https://niivue.com/demos/features/clipplanesmulti.html | live demo usage}
2900
+ */
2901
+ setClipPlanes(depthAziElevs: number[][]): void;
2865
2902
  /**
2866
2903
  * Update the clip plane orientation in 3D view mode.
2867
2904
  * @param depthAzimuthElevation - a 3-component array:
@@ -2964,30 +3001,31 @@ declare class Niivue {
2964
3001
  */
2965
3002
  setScale(scale: number): void;
2966
3003
  /**
2967
- * set the color of the 3D clip plane
2968
- * @param color - the new color. expects an array of RGBA values. values can range from 0 to 1
3004
+ * Set the color of the 3D clip plane.
3005
+ * @param {number[]} color - An array of RGBA values.
3006
+ * - **R**, **G**, **B** components range from `0.0` to `1.0`.
3007
+ * - **A** (alpha) component ranges from `-1.0` to `1.0`, where:
3008
+ * - `0.0–1.0` → controls background translucency.
3009
+ * - `-1.0–0.0` → applies translucent shading to the volume instead of the background.
3010
+ *
2969
3011
  * @example
2970
- * niivue.setClipPlaneColor([1, 1, 1, 0.5]) // white, transparent
2971
- * @see {@link https://niivue.com/demos/features/clipplanes.html | live demo usage}
3012
+ * niivue.setClipPlaneColor([1, 1, 1, 0.5]); // white, translucent background
3013
+ * niivue.setClipPlaneColor([1, 1, 1, -0.5]); // white, translucent shading
3014
+ * @see {@link https://niivue.com/demos/features/clipplanes.html | Live demo usage}
2972
3015
  */
2973
3016
  setClipPlaneColor(color: number[]): void;
2974
3017
  /**
2975
- * adjust thickness of the 3D clip plane
2976
- * @param thick - thickness of slab. Value 0..1.73 (cube opposite corner length is sqrt(3)).
2977
- * @example
2978
- * niivue.setClipPlaneThick(0.3) // thin slab
2979
- * @see {@link https://niivue.com/demos/features/clipplanes.html | live demo usage}
3018
+ * @deprecated This method has been removed.
3019
+ * Use {@link setClipPlanes} instead, which generalizes clip plane configuration
3020
+ * @see {@link https://niivue.com/demos/features/clipplanesmulti.html | Multiple clip plane demo}
2980
3021
  */
2981
- setClipPlaneThick(thick: number): void;
3022
+ setClipPlaneThick(_thick: number): void;
2982
3023
  /**
2983
- * set the clipping region for volume rendering
2984
- * @param low - 3-component array specifying the lower bound of the clipping region along the X, Y, and Z axes. Values range from 0 (start) to 1 (end of volume).
2985
- * @param high - 3-component array specifying the upper bound of the clipping region along the X, Y, and Z axes. Values range from 0 to 1.
2986
- * @example
2987
- * niivue.setClipPlaneColor([0.0, 0.0, 0.2], [1.0, 1.0, 0.7]) // remove inferior 20% and superior 30%
2988
- * @see {@link https://niivue.com/demos/features/clipplanes.html | live demo usage}
3024
+ * @deprecated This method has been removed.
3025
+ * Use {@link setClipPlanes} instead, which generalizes clip plane configuration
3026
+ * @see {@link https://niivue.com/demos/features/clipplanesmulti.html | Multiple clip plane demo}
2989
3027
  */
2990
- setClipVolume(low: number[], high: number[]): void;
3028
+ setClipVolume(_low: number[], _high: number[]): void;
2991
3029
  /**
2992
3030
  * set proportion of volume rendering influenced by selected matcap.
2993
3031
  * @param gradientAmount - amount of matcap (NaN or 0..1), default 0 (matte, surface normal does not influence color). NaN renders the gradients.
@@ -3765,11 +3803,6 @@ declare class Niivue {
3765
3803
  * @internal
3766
3804
  */
3767
3805
  sliceScroll3D(posChange?: number): void;
3768
- /**
3769
- * Deletes loaded thumbnail texture and frees memory.
3770
- * @internal
3771
- */
3772
- deleteThumbnail(): void;
3773
3806
  /**
3774
3807
  * Checks if (x,y) is within the visible graph plotting area.
3775
3808
  * @internal
@@ -4102,7 +4135,7 @@ declare class Niivue {
4102
4135
  * Configures viewport and accounts for radiological orientation, depth clipping, and camera rotation.
4103
4136
  * @internal
4104
4137
  */
4105
- calculateMvpMatrix2D(leftTopWidthHeight: number[], mn: vec3, mx: vec3, clipTolerance: number, clipDepth: number, azimuth: number, elevation: number, isRadiolgical: boolean): MvpMatrix2D;
4138
+ calculateMvpMatrix2D(leftTopWidthHeight: number[], mn: vec3, mx: vec3, clipTolerance?: number, clipDepth?: number, azimuth?: number, elevation?: number, isRadiolgical?: boolean): MvpMatrix2D;
4106
4139
  /**
4107
4140
  * Reorders the components of a 3D vector based on the slice orientation (axial, coronal, or sagittal).
4108
4141
  * @internal
@@ -4150,13 +4183,14 @@ declare class Niivue {
4150
4183
  draw2D(leftTopWidthHeight: number[], axCorSag: SLICE_TYPE, customMM?: number, imageWidthHeight?: number[]): void;
4151
4184
  /**
4152
4185
  * Build MVP, Model, and Normal matrices for rendering.
4153
- * @param _unused - reserved
4154
- * @param leftTopWidthHeight - viewport rectangle [x, y, w, h] in device pixels
4155
- * @param azimuth - azimuth rotation in degrees
4156
- * @param elevation - elevation rotation in degrees
4157
- * @param flipX - whether to mirror the X axis (default true for radiological convention)
4186
+ * Note: 3D MVP is identical for radiological and neurological conventions.
4187
+ * @param _unused - Reserved for future use.
4188
+ * @param leftTopWidthHeight - Viewport rectangle [x, y, w, h] in device pixels.
4189
+ * @param azimuth - Azimuth rotation in degrees.
4190
+ * @param elevation - Elevation rotation in degrees.
4191
+ * @internal
4158
4192
  */
4159
- calculateMvpMatrix(_unused: unknown, leftTopWidthHeight: number[], azimuth: number, elevation: number, flipX?: boolean): mat4[];
4193
+ calculateMvpMatrix(_unused: unknown, leftTopWidthHeight: number[], azimuth: number, elevation: number): mat4[];
4160
4194
  /**
4161
4195
  * Computes the model transformation matrix for the given azimuth and elevation.
4162
4196
  * Applies optional oblique RAS rotation if available.
@@ -4166,6 +4200,7 @@ declare class Niivue {
4166
4200
  /**
4167
4201
  * Returns the normalized near-to-far ray direction for the given view angles.
4168
4202
  * Ensures components are nonzero to avoid divide-by-zero errors.
4203
+ * n.b. volumes can have shear (see shear.html), so invert instead of transpose
4169
4204
  * @internal
4170
4205
  */
4171
4206
  calculateRayDirection(azimuth: number, elevation: number): vec3;
@@ -4269,7 +4304,7 @@ declare class Niivue {
4269
4304
  * Render all visible 3D meshes with proper blending, depth, and shader settings.
4270
4305
  * @internal
4271
4306
  */
4272
- drawMesh3D(isDepthTest?: boolean, alpha?: number, m?: mat4, modelMtx?: mat4, normMtx?: mat4): void;
4307
+ drawMesh3D(isDepthTest?: boolean, alpha?: number, m?: mat4, modelMtx?: mat4, normMtx?: mat4, is2D?: boolean): void;
4273
4308
  /**
4274
4309
  * Render 3D crosshairs at the current crosshair position with optional depth testing and transparency.
4275
4310
  * @internal