@niivue/niivue 0.56.0 → 0.57.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.
- package/README.md +5 -2
- package/build/index.d.ts +20 -4
- package/build/index.js +992 -332
- package/build/index.js.map +1 -1
- package/build/index.min.js +1 -1
- package/build/metafile-esm.json +1 -1
- package/dist/index.d.ts +20 -4
- package/dist/index.js +5081 -320
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/niivue.umd.js +263 -145
- package/package.json +4 -3
- package/src/index_histo.html +227 -0
- package/src/niivue/index.ts +455 -128
- package/src/nvdocument.ts +5 -1
- package/src/nvimage/VolumeUtils.ts +18 -28
- package/src/nvimage/index.ts +134 -25
- package/src/nvlabel.ts +2 -2
- package/src/nvmesh-loaders.ts +63 -57
- package/src/nvmesh.ts +190 -12
- package/src/shader-srcs.ts +85 -0
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ The command `npm run demo` will minify the project and locally host all of the [
|
|
|
23
23
|
|
|
24
24
|
[Click here for the docs web page](https://niivue.github.io/niivue/devdocs/)
|
|
25
25
|
|
|
26
|
-
#
|
|
26
|
+
# NiiVue Users
|
|
27
27
|
|
|
28
28
|
- Analysis of Functional NeuroImages (AFNI) [Scientific and Statistical Computing Core](https://afni.nimh.nih.gov/) (National Institutes of Health)
|
|
29
29
|
- [BOOSTLET.js](https://boostlet.org/) image processing plugins work with NiiVue.
|
|
@@ -35,11 +35,14 @@ The command `npm run demo` will minify the project and locally host all of the [
|
|
|
35
35
|
- [Digital Brain Bank](https://elifesciences.org/articles/73153) for navigating MRI datasets
|
|
36
36
|
- FMRIB's Software Library (FSL) [Wellcome Centre for Integrative Neuroimaging](https://www.win.ox.ac.uk/) (University of Oxford)
|
|
37
37
|
- FreeSurfer [Laboratories for Computational Neuroimaging](https://lcn.martinos.org/) (Massachusetts General Hospital) uses NiiVue for [FreeBrowse](https://github.com/freesurfer/freebrowse)
|
|
38
|
+
- [lazybids-ui](https://github.com/lazybids/lazybids-ui) is a web-based user interface for interacting with BIDS datasets.
|
|
38
39
|
- [OpenNeuro.org](https://openneuro.org) uses NiiVue to visualize datasets
|
|
39
40
|
- [neurodesk](https://www.neurodesk.org/) uses NiiVue for their [QSMxT Quantitative Susceptibility Mapping toolbox](https://github.com/QSMxT/QSMxT-UI)
|
|
41
|
+
- [neurosift](https://github.com/flatironinstitute/neurosift) provides NWB visualization and DANDI exploration
|
|
40
42
|
- [Neuroinformatics Research and Development Group](http://neuroinformatics.uw.edu/) embeds NiiVue in [tractoscope](https://github.com/nrdg/tractoscope)
|
|
41
|
-
- [
|
|
43
|
+
- [NiiVueReader](https://github.com/BrunoDG/NiiVueReader) by Bruno Dias demonstrates a full stack deployment.
|
|
42
44
|
- [niivue-vscode](https://github.com/niivue/niivue-vscode) is a VSCode extension for displaying images
|
|
45
|
+
- [nilearn](https://nilearn.github.io/stable/index.html) is extending [ipyniivue](https://github.com/niivue/ipyniivue)
|
|
43
46
|
- [QuantCo](https://www.quantco.com/) is using NiiVue in medical imaging workflows
|
|
44
47
|
- [FSL Clinical](https://fslclinical.com/) is using NiiVue in brain imaging reports
|
|
45
48
|
- [brain2print](https://brain2print.org/) (from the NiiVue team) uses NiiVue for showing both volume data and converted meshes
|
package/build/index.d.ts
CHANGED
|
@@ -152,13 +152,13 @@ declare class NVLabel3D {
|
|
|
152
152
|
style: NVLabel3DStyle;
|
|
153
153
|
points?: number[] | number[][];
|
|
154
154
|
anchor: LabelAnchorPoint;
|
|
155
|
-
onClick?: (label: NVLabel3D) => void;
|
|
155
|
+
onClick?: (label: NVLabel3D, e?: MouseEvent) => void;
|
|
156
156
|
/**
|
|
157
157
|
* @param text - The text of the label
|
|
158
158
|
* @param style - The style of the label
|
|
159
159
|
* @param points - An array of points label for label lines
|
|
160
160
|
*/
|
|
161
|
-
constructor(text: string, style: NVLabel3DStyle, points?: number[] | number[][], anchor?: LabelAnchorPoint, onClick?: (label: NVLabel3D) => void);
|
|
161
|
+
constructor(text: string, style: NVLabel3DStyle, points?: number[] | number[][], anchor?: LabelAnchorPoint, onClick?: (label: NVLabel3D, e?: MouseEvent) => void);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
/**
|
|
@@ -390,7 +390,7 @@ declare class NVImage {
|
|
|
390
390
|
*/
|
|
391
391
|
constructor(dataBuffer?: ArrayBuffer | ArrayBuffer[] | ArrayBufferLike | null, name?: string, colormap?: string, opacity?: number, pairedImgData?: ArrayBuffer | null, cal_min?: number, cal_max?: number, trustCalMinMax?: boolean, percentileFrac?: number, ignoreZeroVoxels?: boolean, useQFormNotSForm?: boolean, colormapNegative?: string, frame4D?: number, imageType?: ImageType, cal_minNeg?: number, cal_maxNeg?: number, colorbarVisible?: boolean, colormapLabel?: LUT | null, colormapType?: number);
|
|
392
392
|
init(dataBuffer?: ArrayBuffer | ArrayBuffer[] | ArrayBufferLike | null, name?: string, colormap?: string, opacity?: number, _pairedImgData?: ArrayBuffer | null, cal_min?: number, cal_max?: number, trustCalMinMax?: boolean, percentileFrac?: number, ignoreZeroVoxels?: boolean, useQFormNotSForm?: boolean, colormapNegative?: string, frame4D?: number, imageType?: ImageType, cal_minNeg?: number, cal_maxNeg?: number, colorbarVisible?: boolean, colormapLabel?: LUT | null, colormapType?: number, imgRaw?: ArrayBuffer | ArrayBufferLike | null): void;
|
|
393
|
-
static new(dataBuffer
|
|
393
|
+
static new(dataBuffer: ArrayBuffer | ArrayBuffer[] | ArrayBufferLike | null, name: string, colormap: string, opacity: number, pairedImgData: ArrayBuffer | null, cal_min: number, cal_max: number, trustCalMinMax: boolean, percentileFrac: number, ignoreZeroVoxels: boolean, useQFormNotSForm: boolean, colormapNegative: string, frame4D: number, imageType: ImageType, cal_minNeg: number, cal_maxNeg: number, colorbarVisible: boolean, colormapLabel: LUT | null, colormapType: number, zarrData: null | unknown): Promise<NVImage>;
|
|
394
394
|
computeObliqueAngle(mtx44: mat4): number;
|
|
395
395
|
float32V1asRGBA(inImg: Float32Array): Uint8Array;
|
|
396
396
|
loadImgV1(isFlipX?: boolean, isFlipY?: boolean, isFlipZ?: boolean): boolean;
|
|
@@ -403,6 +403,7 @@ declare class NVImage {
|
|
|
403
403
|
readNPZ(buffer: ArrayBuffer): Promise<ArrayBuffer>;
|
|
404
404
|
imageDataFromArrayBuffer(buffer: ArrayBuffer): Promise<ImageData>;
|
|
405
405
|
readBMP(buffer: ArrayBuffer): Promise<ArrayBuffer>;
|
|
406
|
+
readZARR(buffer: ArrayBuffer, zarrData: unknown): Promise<Uint8Array>;
|
|
406
407
|
readVMR(buffer: ArrayBuffer): ArrayBuffer;
|
|
407
408
|
readFIB(buffer: ArrayBuffer): Promise<[ArrayBuffer, Float32Array]>;
|
|
408
409
|
readSRC(buffer: ArrayBuffer): Promise<ArrayBuffer>;
|
|
@@ -775,8 +776,10 @@ type NVConfigOptions = {
|
|
|
775
776
|
isAlphaClipDark: boolean;
|
|
776
777
|
gradientOrder: number;
|
|
777
778
|
gradientOpacity: number;
|
|
779
|
+
renderSilhouette: number;
|
|
778
780
|
gradientAmount: number;
|
|
779
781
|
invertScrollDirection: boolean;
|
|
782
|
+
is2DSliceShader: boolean;
|
|
780
783
|
};
|
|
781
784
|
declare const DEFAULT_OPTIONS: NVConfigOptions;
|
|
782
785
|
type SceneData = {
|
|
@@ -1204,6 +1207,9 @@ type NVMeshLayer = {
|
|
|
1204
1207
|
colormapType?: number;
|
|
1205
1208
|
base64?: string;
|
|
1206
1209
|
colorbarVisible?: boolean;
|
|
1210
|
+
showLegend?: boolean;
|
|
1211
|
+
labels?: NVLabel3D[];
|
|
1212
|
+
atlasValues?: AnyNumberArray;
|
|
1207
1213
|
};
|
|
1208
1214
|
declare const NVMeshLayerDefaults: {
|
|
1209
1215
|
colormap: string;
|
|
@@ -1217,6 +1223,8 @@ declare const NVMeshLayerDefaults: {
|
|
|
1217
1223
|
cal_maxNeg: number;
|
|
1218
1224
|
colormapType: COLORMAP_TYPE;
|
|
1219
1225
|
values: number[];
|
|
1226
|
+
useNegativeCmap: boolean;
|
|
1227
|
+
showLegend: boolean;
|
|
1220
1228
|
};
|
|
1221
1229
|
declare class NVMeshFromUrlOptions {
|
|
1222
1230
|
url: string;
|
|
@@ -1330,6 +1338,7 @@ declare class NVMesh {
|
|
|
1330
1338
|
updateFibers(gl: WebGL2RenderingContext): void;
|
|
1331
1339
|
indexNearestXYZmm(Xmm: number, Ymm: number, Zmm: number): number[];
|
|
1332
1340
|
unloadMesh(gl: WebGL2RenderingContext): void;
|
|
1341
|
+
scalars2RGBA(rgba: Uint8ClampedArray, layer: NVMeshLayer, scalars: AnyNumberArray, isNegativeCmap?: boolean): Uint8ClampedArray;
|
|
1333
1342
|
blendColormap(u8: Uint8Array, additiveRGBA: Uint8Array, layer: NVMeshLayer, mn: number, mx: number, lut: Uint8ClampedArray, invert?: boolean): void;
|
|
1334
1343
|
updateMesh(gl: WebGL2RenderingContext): void;
|
|
1335
1344
|
reverseFaces(gl: WebGL2RenderingContext): void;
|
|
@@ -1498,6 +1507,7 @@ type Graph = {
|
|
|
1498
1507
|
lineColor?: number[];
|
|
1499
1508
|
textColor?: number[];
|
|
1500
1509
|
lineThickness?: number;
|
|
1510
|
+
gridLineThickness?: number;
|
|
1501
1511
|
lineAlpha?: number;
|
|
1502
1512
|
lines?: number[][];
|
|
1503
1513
|
selectedColumn?: number;
|
|
@@ -1565,6 +1575,8 @@ type UIData = {
|
|
|
1565
1575
|
lastTwoTouchDistance: number;
|
|
1566
1576
|
multiTouchGesture: boolean;
|
|
1567
1577
|
dpr?: number;
|
|
1578
|
+
max2D?: number;
|
|
1579
|
+
max3D?: number;
|
|
1568
1580
|
windowX: number;
|
|
1569
1581
|
windowY: number;
|
|
1570
1582
|
};
|
|
@@ -1617,6 +1629,7 @@ declare class Niivue {
|
|
|
1617
1629
|
overlayTexture: WebGLTexture | null;
|
|
1618
1630
|
overlayTextureID: WebGLTexture | null;
|
|
1619
1631
|
sliceMMShader?: Shader;
|
|
1632
|
+
slice2DShader?: Shader;
|
|
1620
1633
|
sliceV1Shader?: Shader;
|
|
1621
1634
|
orientCubeShader?: Shader;
|
|
1622
1635
|
orientCubeShaderVAO: WebGLVertexArrayObject | null;
|
|
@@ -2574,11 +2587,12 @@ declare class Niivue {
|
|
|
2574
2587
|
/**
|
|
2575
2588
|
* set volume rendering opacity influence of the gradient magnitude
|
|
2576
2589
|
* @param gradientOpacity - amount of gradient magnitude influence on opacity (0..1), default 0 (no-influence)
|
|
2590
|
+
* @param renderSilhouette - make core transparent to enhance rims (0..1), default 0 (no-influence)
|
|
2577
2591
|
* @example
|
|
2578
2592
|
* niivue.setGradientOpacity(0.6);
|
|
2579
2593
|
* @see {@link https://niivue.github.io/niivue/features/gradient.opacity.html | live demo usage}
|
|
2580
2594
|
*/
|
|
2581
|
-
setGradientOpacity(gradientOpacity?: number): Promise<void>;
|
|
2595
|
+
setGradientOpacity(gradientOpacity?: number, renderSilhouette?: number): Promise<void>;
|
|
2582
2596
|
overlayRGBA(volume: NVImage): Uint8ClampedArray;
|
|
2583
2597
|
vox2mm(XYZ: number[], mtx: mat4): vec3;
|
|
2584
2598
|
/**
|
|
@@ -2744,7 +2758,9 @@ declare class Niivue {
|
|
|
2744
2758
|
* @see {@link https://niivue.github.io/niivue/features/cactus.html | live demo usage}
|
|
2745
2759
|
*/
|
|
2746
2760
|
refreshDrawing(isForceRedraw?: boolean, useClickToSegmentBitmap?: boolean): void;
|
|
2761
|
+
r8Tex2D(texID: WebGLTexture | null, activeID: number, dims: number[], isInit?: boolean): WebGLTexture | null;
|
|
2747
2762
|
r8Tex(texID: WebGLTexture | null, activeID: number, dims: number[], isInit?: boolean): WebGLTexture | null;
|
|
2763
|
+
rgbaTex2D(texID: WebGLTexture | null, activeID: number, dims: number[], data?: Uint8Array | null, isFlipVertical?: boolean): WebGLTexture | null;
|
|
2748
2764
|
rgbaTex(texID: WebGLTexture | null, activeID: number, dims: number[], isInit?: boolean): WebGLTexture | null;
|
|
2749
2765
|
rgba16Tex(texID: WebGLTexture | null, activeID: number, dims: number[], isInit?: boolean): WebGLTexture | null;
|
|
2750
2766
|
requestCORSIfNotSameOrigin(img: HTMLImageElement, url: string): void;
|