@niivue/niivue 0.43.1 → 0.43.3
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/build/index.d.ts +55 -16
- package/build/index.js +164 -42
- package/build/index.js.map +1 -1
- package/build/index.min.js +1 -1
- package/dist/index.d.ts +55 -16
- package/dist/index.js +164 -42
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/niivue.umd.js +24 -24
- package/package.json +1 -1
- package/src/index.html +17 -1
- package/src/niivue/index.ts +96 -12
- package/src/niivue.css +2 -2
- package/src/nvdocument.ts +21 -3
- package/src/nvimage/index.ts +32 -9
- package/src/nvimage/utils.ts +13 -2
- package/src/nvmesh-loaders.ts +12 -9
- package/src/nvmesh.ts +47 -24
package/build/index.d.ts
CHANGED
|
@@ -215,11 +215,12 @@ type ImageFromUrlOptions = {
|
|
|
215
215
|
ignoreZeroVoxels?: boolean;
|
|
216
216
|
imageType?: ImageType;
|
|
217
217
|
frame4D?: number;
|
|
218
|
-
colormapLabel?:
|
|
218
|
+
colormapLabel?: LUT | null;
|
|
219
219
|
pairedImgData?: null;
|
|
220
220
|
limitFrames4D?: number;
|
|
221
221
|
isManifest?: boolean;
|
|
222
222
|
urlImgData?: string;
|
|
223
|
+
buffer?: ArrayBuffer;
|
|
223
224
|
};
|
|
224
225
|
type ImageFromFileOptions = {
|
|
225
226
|
file: File | File[];
|
|
@@ -248,6 +249,14 @@ type ImageFromBase64 = {
|
|
|
248
249
|
trustCalMinMax?: boolean;
|
|
249
250
|
percentileFrac?: number;
|
|
250
251
|
ignoreZeroVoxels?: boolean;
|
|
252
|
+
useQFormNotSForm?: boolean;
|
|
253
|
+
colormapNegative?: string;
|
|
254
|
+
frame4D?: number;
|
|
255
|
+
imageType?: ImageType;
|
|
256
|
+
cal_minNeg?: number;
|
|
257
|
+
cal_maxNeg?: number;
|
|
258
|
+
colorbarVisible?: boolean;
|
|
259
|
+
colormapLabel?: LUT | null;
|
|
251
260
|
};
|
|
252
261
|
type ImageMetadata = {
|
|
253
262
|
id: string;
|
|
@@ -262,7 +271,7 @@ type ImageMetadata = {
|
|
|
262
271
|
dt: number;
|
|
263
272
|
bpv: number;
|
|
264
273
|
};
|
|
265
|
-
declare const NVImageFromUrlOptions: (url: string, urlImageData?: string, name?: string, colormap?: string, opacity?: number, 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, alphaThreshold?: boolean, colormapLabel?:
|
|
274
|
+
declare const NVImageFromUrlOptions: (url: string, urlImageData?: string, name?: string, colormap?: string, opacity?: number, 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, alphaThreshold?: boolean, colormapLabel?: null) => ImageFromUrlOptions;
|
|
266
275
|
|
|
267
276
|
type TypedVoxelArray = Float32Array | Uint8Array | Int16Array | Float64Array | Uint16Array;
|
|
268
277
|
/**
|
|
@@ -397,7 +406,7 @@ declare class NVImage {
|
|
|
397
406
|
* factory function to load and return a new NVImage instance from a given URL
|
|
398
407
|
* @returns NVImage instance
|
|
399
408
|
*/
|
|
400
|
-
static loadFromUrl({ url, urlImgData, headers, name, colormap, opacity, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels, useQFormNotSForm, colormapNegative, frame4D, isManifest, limitFrames4D, imageType, colorbarVisible }?: Partial<Omit<ImageFromUrlOptions, 'url'>> & {
|
|
409
|
+
static loadFromUrl({ url, urlImgData, headers, name, colormap, opacity, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels, useQFormNotSForm, colormapNegative, frame4D, isManifest, limitFrames4D, imageType, colorbarVisible, buffer }?: Partial<Omit<ImageFromUrlOptions, 'url'>> & {
|
|
401
410
|
url?: string | Uint8Array | ArrayBuffer;
|
|
402
411
|
}): Promise<NVImage>;
|
|
403
412
|
static readFileAsync(file: File, bytesToLoad?: number): Promise<ArrayBuffer>;
|
|
@@ -440,7 +449,7 @@ declare class NVImage {
|
|
|
440
449
|
* @example
|
|
441
450
|
* myImage = NVImage.loadFromBase64('SomeBase64String')
|
|
442
451
|
*/
|
|
443
|
-
static loadFromBase64({ base64, name, colormap, opacity, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels }: ImageFromBase64): NVImage;
|
|
452
|
+
static loadFromBase64({ base64, name, colormap, opacity, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels, useQFormNotSForm, colormapNegative, frame4D, imageType, cal_minNeg, cal_maxNeg, colorbarVisible, colormapLabel }: ImageFromBase64): NVImage;
|
|
444
453
|
/**
|
|
445
454
|
* make a clone of a NVImage instance and return a new NVImage
|
|
446
455
|
* @returns NVImage instance
|
|
@@ -672,6 +681,7 @@ type DocumentData = {
|
|
|
672
681
|
meshesString?: string;
|
|
673
682
|
sceneData?: SceneData;
|
|
674
683
|
connectomes?: string[];
|
|
684
|
+
customData?: string;
|
|
675
685
|
};
|
|
676
686
|
type ExportDocumentData = {
|
|
677
687
|
encodedImageBlobs: string[];
|
|
@@ -684,6 +694,7 @@ type ExportDocumentData = {
|
|
|
684
694
|
meshesString: string;
|
|
685
695
|
labels: NVLabel3D[];
|
|
686
696
|
connectomes: string[];
|
|
697
|
+
customData: string;
|
|
687
698
|
};
|
|
688
699
|
/**
|
|
689
700
|
* Creates and instance of NVDocument
|
|
@@ -743,6 +754,8 @@ declare class NVDocument {
|
|
|
743
754
|
* Sets the 3D labels of the {@link Niivue} instance
|
|
744
755
|
*/
|
|
745
756
|
set labels(labels: NVLabel3D[]);
|
|
757
|
+
get customData(): string | undefined;
|
|
758
|
+
set customData(data: string);
|
|
746
759
|
/**
|
|
747
760
|
* Checks if document has an image by id
|
|
748
761
|
*/
|
|
@@ -989,26 +1002,38 @@ type NVMeshLayer = {
|
|
|
989
1002
|
headers?: Record<string, string>;
|
|
990
1003
|
opacity: number;
|
|
991
1004
|
colormap: string;
|
|
992
|
-
colormapNegative
|
|
993
|
-
colormapInvert
|
|
1005
|
+
colormapNegative?: string;
|
|
1006
|
+
colormapInvert?: boolean;
|
|
994
1007
|
colormapLabel?: ColorMap | LUT;
|
|
995
|
-
useNegativeCmap
|
|
996
|
-
global_min
|
|
997
|
-
global_max
|
|
1008
|
+
useNegativeCmap?: boolean;
|
|
1009
|
+
global_min?: number;
|
|
1010
|
+
global_max?: number;
|
|
998
1011
|
cal_min: number;
|
|
999
1012
|
cal_max: number;
|
|
1000
1013
|
cal_minNeg: number;
|
|
1001
1014
|
cal_maxNeg: number;
|
|
1002
|
-
isAdditiveBlend
|
|
1015
|
+
isAdditiveBlend?: boolean;
|
|
1003
1016
|
frame4D: number;
|
|
1004
1017
|
nFrame4D: number;
|
|
1005
|
-
values:
|
|
1018
|
+
values: AnyNumberArray;
|
|
1006
1019
|
outlineBorder?: number;
|
|
1007
1020
|
isTransparentBelowCalMin?: boolean;
|
|
1008
|
-
alphaThreshold
|
|
1021
|
+
alphaThreshold?: boolean;
|
|
1009
1022
|
base64?: string;
|
|
1010
1023
|
colorbarVisible?: boolean;
|
|
1011
1024
|
};
|
|
1025
|
+
declare const NVMeshLayerDefaults: {
|
|
1026
|
+
colormap: string;
|
|
1027
|
+
opacity: number;
|
|
1028
|
+
nFrame4D: number;
|
|
1029
|
+
frame4D: number;
|
|
1030
|
+
outlineBorder: number;
|
|
1031
|
+
cal_min: number;
|
|
1032
|
+
cal_max: number;
|
|
1033
|
+
cal_minNeg: number;
|
|
1034
|
+
cal_maxNeg: number;
|
|
1035
|
+
values: number[];
|
|
1036
|
+
};
|
|
1012
1037
|
declare class NVMeshFromUrlOptions {
|
|
1013
1038
|
url: string;
|
|
1014
1039
|
gl: WebGL2RenderingContext | null;
|
|
@@ -1031,6 +1056,7 @@ type BaseLoadParams = {
|
|
|
1031
1056
|
type LoadFromUrlParams = Partial<BaseLoadParams> & {
|
|
1032
1057
|
url: string;
|
|
1033
1058
|
headers?: Record<string, string>;
|
|
1059
|
+
buffer?: ArrayBuffer;
|
|
1034
1060
|
};
|
|
1035
1061
|
type LoadFromFileParams = BaseLoadParams & {
|
|
1036
1062
|
file: Blob;
|
|
@@ -1126,7 +1152,7 @@ declare class NVMesh {
|
|
|
1126
1152
|
/**
|
|
1127
1153
|
* factory function to load and return a new NVMesh instance from a given URL
|
|
1128
1154
|
*/
|
|
1129
|
-
static loadFromUrl({ url, headers, gl, name, opacity, rgba255, visible, layers }?: Partial<LoadFromUrlParams>): Promise<NVMesh>;
|
|
1155
|
+
static loadFromUrl({ url, headers, gl, name, opacity, rgba255, visible, layers, buffer }?: Partial<LoadFromUrlParams>): Promise<NVMesh>;
|
|
1130
1156
|
static readFileAsync(file: Blob): Promise<ArrayBuffer>;
|
|
1131
1157
|
/**
|
|
1132
1158
|
* factory function to load and return a new NVMesh instance from a file in the browser
|
|
@@ -1422,7 +1448,7 @@ declare class NVMeshLoaders {
|
|
|
1422
1448
|
static readTCK(buffer: ArrayBuffer): TCK;
|
|
1423
1449
|
static readTRK(buffer: ArrayBuffer): TRK;
|
|
1424
1450
|
static readTxtVTK(buffer: ArrayBuffer): VTK;
|
|
1425
|
-
static readLayer(name: string | undefined, buffer: ArrayBuffer, nvmesh: NVMesh, opacity?: number, colormap?: string, colormapNegative?: string, useNegativeCmap?: boolean, cal_min?: number | null, cal_max?: number | null, outlineBorder?: number):
|
|
1451
|
+
static readLayer(name: string | undefined, buffer: ArrayBuffer, nvmesh: NVMesh, opacity?: number, colormap?: string, colormapNegative?: string, useNegativeCmap?: boolean, cal_min?: number | null, cal_max?: number | null, outlineBorder?: number): NVMeshLayer | undefined;
|
|
1426
1452
|
static readSMP(buffer: ArrayBuffer, n_vert: number): Float32Array;
|
|
1427
1453
|
static readSTC(buffer: ArrayBuffer, n_vert: number): Float32Array;
|
|
1428
1454
|
static readCURV(buffer: ArrayBuffer, n_vert: number): Float32Array;
|
|
@@ -1991,6 +2017,18 @@ declare class Niivue {
|
|
|
1991
2017
|
* @param url - filename
|
|
1992
2018
|
*/
|
|
1993
2019
|
isMeshExt(url: string): boolean;
|
|
2020
|
+
/**
|
|
2021
|
+
* Load an image or mesh from an array buffer
|
|
2022
|
+
* @param buffer - ArrayBuffer with the entire contents of a mesh or volume
|
|
2023
|
+
* @param name - string of filename, extension used to infer type (NIfTI, MGH, MZ3, etc)
|
|
2024
|
+
* @see {@link http://192.168.0.150:8080/features/draganddrop.html | live demo usage}
|
|
2025
|
+
*/
|
|
2026
|
+
loadFromArrayBuffer(buffer: ArrayBuffer, name: string): Promise<void>;
|
|
2027
|
+
/**
|
|
2028
|
+
* Load a mesh or image from a file object
|
|
2029
|
+
* @param file - File object
|
|
2030
|
+
*/
|
|
2031
|
+
loadFromFile(file: File): Promise<void>;
|
|
1994
2032
|
dropListener(e: DragEvent): void;
|
|
1995
2033
|
/**
|
|
1996
2034
|
* insert a gap between slices of a mutliplanar view.
|
|
@@ -2703,9 +2741,10 @@ declare class Niivue {
|
|
|
2703
2741
|
* @param toRAS - reslice to row, column slices to right-anterior-superior not left-inferior-anterior (default false).
|
|
2704
2742
|
* @param isLinear - reslice with linear rather than nearest-neighbor interpolation (default true).
|
|
2705
2743
|
* @param asFloat32 - use Float32 datatype rather than Uint8 (default false).
|
|
2744
|
+
* @param isRobustMinMax - clamp intensity with robust min max (~2%..98%) instead of FreeSurfer (0%..99.99%) (default false).
|
|
2706
2745
|
* @see {@link https://niivue.github.io/niivue/features/torso.html | live demo usage}
|
|
2707
2746
|
*/
|
|
2708
|
-
conform(volume: NVImage, toRAS?: boolean, isLinear?: boolean, asFloat32?: boolean): Promise<NVImage>;
|
|
2747
|
+
conform(volume: NVImage, toRAS?: boolean, isLinear?: boolean, asFloat32?: boolean, isRobustMinMax?: boolean): Promise<NVImage>;
|
|
2709
2748
|
/**
|
|
2710
2749
|
* darken crevices and brighten corners when 3D rendering drawings.
|
|
2711
2750
|
* @param amount - amount of ambient occlusion (default 0.4)
|
|
@@ -2882,4 +2921,4 @@ declare class Niivue {
|
|
|
2882
2921
|
set gl(gl: WebGL2RenderingContext | null);
|
|
2883
2922
|
}
|
|
2884
2923
|
|
|
2885
|
-
export { type Connectome, type ConnectomeOptions, DEFAULT_OPTIONS, DRAG_MODE, type DocumentData, type DragReleaseParams, type ExportDocumentData, INITIAL_SCENE_DATA, LabelLineTerminator, LabelTextAlignment, type LegacyConnectome, type LegacyNodes, MULTIPLANAR_TYPE, type NVConfigOptions, type NVConnectomeEdge, type NVConnectomeNode, NVController, NVDocument, NVImage, NVImageFromUrlOptions, NVLabel3D, NVLabel3DStyle, NVMesh, NVMeshFromUrlOptions, NVMeshLoaders, NVUtilities, type NiftiHeader, Niivue, type Point, SLICE_TYPE, type Scene, type Volume, cmapper, ColorTables as colortables };
|
|
2924
|
+
export { type Connectome, type ConnectomeOptions, DEFAULT_OPTIONS, DRAG_MODE, type DocumentData, type DragReleaseParams, type ExportDocumentData, INITIAL_SCENE_DATA, LabelLineTerminator, LabelTextAlignment, type LegacyConnectome, type LegacyNodes, MULTIPLANAR_TYPE, type NVConfigOptions, type NVConnectomeEdge, type NVConnectomeNode, NVController, NVDocument, NVImage, NVImageFromUrlOptions, NVLabel3D, NVLabel3DStyle, NVMesh, NVMeshFromUrlOptions, NVMeshLayerDefaults, NVMeshLoaders, NVUtilities, type NiftiHeader, Niivue, type Point, SLICE_TYPE, type Scene, type Volume, cmapper, ColorTables as colortables };
|