@niivue/niivue 0.39.0 → 0.41.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 +3 -2
- package/{dist → build}/index.d.ts +62 -18
- package/build/index.js +31235 -0
- package/build/index.js.map +1 -0
- package/build/index.min.js +1 -0
- package/package.json +18 -14
- package/src/colortables.ts +11 -1
- package/src/index.html +89 -75
- package/src/niivue/index.ts +124 -97
- package/src/nvdocument.ts +10 -5
- package/src/nvimage/index.ts +93 -27
- package/src/nvimage/utils.ts +0 -8
- package/src/nvmesh-loaders.ts +225 -60
- package/src/nvmesh-types.ts +6 -2
- package/src/nvmesh.ts +324 -83
- package/src/nvutilities.ts +35 -0
- package/src/shader-srcs.ts +80 -134
- package/dist/index.js +0 -140072
- package/dist/index.js.map +0 -1
- package/dist/index.min.js +0 -1
- package/dist/niivue.umd.js +0 -1665
package/README.md
CHANGED
|
@@ -26,9 +26,10 @@ The command `npm run demo` will minify the project and locally host all of the [
|
|
|
26
26
|
# Projects and People using NiiVue
|
|
27
27
|
|
|
28
28
|
- Analysis of Functional NeuroImages (AFNI) [Scientific and Statistical Computing Core](https://afni.nimh.nih.gov/) (National Institutes of Health)
|
|
29
|
+
- [ChRIS Research Integration System (ChRIS) from Boston Children's Hospital](https://chrisproject.org/) uses [NiiVue](https://app.chrisproject.org/niivue).
|
|
29
30
|
- [Center for the Study of Aphasia Recovery](https://cstar.sc.edu/) (University of South Carolina)
|
|
30
31
|
- FMRIB's Software Library (FSL) [Wellcome Centre for Integrative Neuroimaging](https://www.win.ox.ac.uk/) (University of Oxford)
|
|
31
|
-
- FreeSurfer [Laboratories for Computational Neuroimaging](https://lcn.martinos.org/) (Massachusetts General Hospital)
|
|
32
|
+
- FreeSurfer [Laboratories for Computational Neuroimaging](https://lcn.martinos.org/) (Massachusetts General Hospital) uses NiiVue for [FreeBrowse](https://github.com/freesurfer/freebrowse)
|
|
32
33
|
- [OpenNeuro.org](https://openneuro.org) uses NiiVue to visualize datasets
|
|
33
34
|
- [BrainLife.io](https://brainlife.io/about/) integrates NiiVue into [ezbids](https://brainlife.io/ezbids/)
|
|
34
35
|
- [nilearn](https://nilearn.github.io/stable/index.html) is extending [ipyniivue](https://github.com/niivue/ipyniivue)
|
|
@@ -50,5 +51,5 @@ NiiVue supports many popular brain imaging formats:
|
|
|
50
51
|
- Voxel-based formats: [NIfTI](https://brainder.org/2012/09/23/the-nifti-file-format/), [NRRD](http://teem.sourceforge.net/nrrd/format.html), [MRtrix MIF](https://mrtrix.readthedocs.io/en/latest/getting_started/image_data.html#mrtrix-image-formats), [AFNI HEAD/BRIK](https://afni.nimh.nih.gov/pub/dist/doc/program_help/README.attributes.html), [MGH/MGZ](https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/MghFormat), [ITK MHD](https://itk.org/Wiki/ITK/MetaIO/Documentation#Reading_a_Brick-of-Bytes_.28an_N-Dimensional_volume_in_a_single_file.29), [ECAT7](https://github.com/openneuropet/PET2BIDS/tree/28aae3fab22309047d36d867c624cd629c921ca6/ecat_validation/ecat_info).
|
|
51
52
|
- Mesh-based formats: [GIfTI](https://www.nitrc.org/projects/gifti/), [ASC](http://www.grahamwideman.com/gw/brain/fs/surfacefileformats.htm), [BYU/GEO/G](http://www.grahamwideman.com/gw/brain/fs/surfacefileformats.htm), [BrainSuite DFS](http://brainsuite.org/formats/dfs/), [ICO/TRI](http://www.grahamwideman.com/gw/brain/fs/surfacefileformats.htm), [PLY](<https://en.wikipedia.org/wiki/PLY_(file_format)>), [BrainNet NV](https://www.nitrc.org/projects/bnv/), [BrainVoyager SRF](https://support.brainvoyager.com/brainvoyager/automation-development/84-file-formats/344-users-guide-2-3-the-format-of-srf-files), [FreeSurfer](http://www.grahamwideman.com/gw/brain/fs/surfacefileformats.htm), [MZ3](https://github.com/neurolabusc/surf-ice/tree/master/mz3), [OFF](<https://en.wikipedia.org/wiki/OFF_(file_format)>), [Wavefront OBJ](https://brainder.org/tag/obj/), [STL](https://medium.com/3d-printing-stories/why-stl-format-is-bad-fea9ecf5e45), [Legacy VTK](https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf), [X3D](https://3dprint.nih.gov/).
|
|
52
53
|
- Mesh overlay formats: [GIfTI](https://www.nitrc.org/projects/gifti/), [CIfTI-2](https://balsa.wustl.edu/about/fileTypes), [MZ3](https://github.com/neurolabusc/surf-ice/tree/master/mz3), [SMP](https://support.brainvoyager.com/brainvoyager/automation-development/84-file-formats/40-the-format-of-smp-files), STC, FreeSurfer (CURV/ANNOT)
|
|
53
|
-
- Tractography formats: [TCK](https://mrtrix.readthedocs.io/en/latest/getting_started/image_data.html#tracks-file-format-tck), [TRK](http://trackvis.org/docs/?subsect=fileformat), [TRX](https://github.com/frheault/tractography_file_format), VTK, AFNI .niml.tract
|
|
54
|
+
- Tractography formats: [TCK](https://mrtrix.readthedocs.io/en/latest/getting_started/image_data.html#tracks-file-format-tck), [TRK](http://trackvis.org/docs/?subsect=fileformat), [TRX](https://github.com/frheault/tractography_file_format), [TSF](https://mrtrix.readthedocs.io/en/dev/getting_started/image_data.html#track-scalar-file-format-tsf), [TT](https://dsi-studio.labsolver.org/doc/cli_data.html), VTK, AFNI .niml.tract
|
|
54
55
|
- DICOM: [DICOM](https://dicom.nema.org/medical/dicom/current/output/chtml/part10/chapter_7.html) and [DICOM Manifests](docs/development-notes/dicom-manifests.md)
|
|
@@ -248,6 +248,10 @@ type LegacyConnectome = Partial<ConnectomeOptions> & {
|
|
|
248
248
|
type ValuesArray = Array<{
|
|
249
249
|
id: string;
|
|
250
250
|
vals: number[];
|
|
251
|
+
global_min?: number;
|
|
252
|
+
global_max?: number;
|
|
253
|
+
cal_min?: number;
|
|
254
|
+
cal_max?: number;
|
|
251
255
|
}>;
|
|
252
256
|
type TypedNumberArray = Float64Array | Float32Array | Uint32Array | Uint16Array | Uint8Array | Int32Array | Int16Array | Int8Array;
|
|
253
257
|
type AnyNumberArray = number[] | TypedNumberArray;
|
|
@@ -309,7 +313,7 @@ type MGH = AnyNumberArray | {
|
|
|
309
313
|
colormapLabel: LUT;
|
|
310
314
|
};
|
|
311
315
|
type X3D = {
|
|
312
|
-
positions:
|
|
316
|
+
positions: Float32Array;
|
|
313
317
|
indices: Int32Array;
|
|
314
318
|
rgba255: number[];
|
|
315
319
|
};
|
|
@@ -342,7 +346,7 @@ type NVMeshLayer = {
|
|
|
342
346
|
frame4D: number;
|
|
343
347
|
nFrame4D: number;
|
|
344
348
|
values: number[];
|
|
345
|
-
|
|
349
|
+
outlineBorder?: number;
|
|
346
350
|
isTransparentBelowCalMin?: boolean;
|
|
347
351
|
alphaThreshold: boolean;
|
|
348
352
|
base64?: string;
|
|
@@ -397,6 +401,7 @@ declare class NVMesh {
|
|
|
397
401
|
indexBuffer: WebGLBuffer;
|
|
398
402
|
vertexBuffer: WebGLBuffer;
|
|
399
403
|
vao: WebGLVertexArrayObject;
|
|
404
|
+
vaoFiber: WebGLVertexArrayObject;
|
|
400
405
|
pts: number[] | Float32Array;
|
|
401
406
|
tris?: number[] | Uint32Array;
|
|
402
407
|
layers: NVMeshLayer[];
|
|
@@ -408,6 +413,9 @@ declare class NVMesh {
|
|
|
408
413
|
fiberDither: number;
|
|
409
414
|
fiberColor: string;
|
|
410
415
|
fiberDecimationStride: number;
|
|
416
|
+
fiberSides: number;
|
|
417
|
+
fiberRadius: number;
|
|
418
|
+
f32PerVertex: number;
|
|
411
419
|
fiberMask?: unknown[];
|
|
412
420
|
colormap?: ColorMap | LegacyConnectome | string | null;
|
|
413
421
|
dpg?: ValuesArray | null;
|
|
@@ -446,8 +454,10 @@ declare class NVMesh {
|
|
|
446
454
|
* @param anatomicalStructurePrimary - region for mesh. Default is an empty string
|
|
447
455
|
*/
|
|
448
456
|
constructor(pts: number[] | Float32Array, tris: number[] | Uint32Array, name: string | undefined, rgba255: number[] | undefined, opacity: number | undefined, visible: boolean | undefined, gl: WebGL2RenderingContext, connectome?: LegacyConnectome | string | null, dpg?: ValuesArray | null, dps?: ValuesArray | null, dpv?: ValuesArray | null, colorbarVisible?: boolean, anatomicalStructurePrimary?: string);
|
|
457
|
+
linesToCylinders(gl: WebGL2RenderingContext, posClrF32: Float32Array, indices: number[]): void;
|
|
449
458
|
updateFibers(gl: WebGL2RenderingContext): void;
|
|
450
459
|
updateConnectome(gl: WebGL2RenderingContext): void;
|
|
460
|
+
indexNearestXYZmm(Xmm: number, Ymm: number, Zmm: number): number[];
|
|
451
461
|
updateMesh(gl: WebGL2RenderingContext): void;
|
|
452
462
|
reverseFaces(gl: WebGL2RenderingContext): void;
|
|
453
463
|
setLayerProperty(id: number, key: keyof NVMeshLayer, val: number | string | boolean, gl: WebGL2RenderingContext): void;
|
|
@@ -500,6 +510,7 @@ declare class NVMesh {
|
|
|
500
510
|
static readTxtVTK(buffer: ArrayBuffer): VTK;
|
|
501
511
|
static readTRK(buffer: ArrayBuffer): TRK;
|
|
502
512
|
static readTCK(buffer: ArrayBuffer): TCK;
|
|
513
|
+
static readTSF(buffer: ArrayBuffer): Float32Array;
|
|
503
514
|
static readTT(buffer: ArrayBuffer): TT;
|
|
504
515
|
static readTRX(buffer: ArrayBuffer): TRX;
|
|
505
516
|
static readTRACT(buffer: ArrayBuffer): TRACT;
|
|
@@ -539,7 +550,6 @@ type ImageFromUrlOptions = {
|
|
|
539
550
|
cal_max?: number;
|
|
540
551
|
trustCalMinMax?: boolean;
|
|
541
552
|
percentileFrac?: number;
|
|
542
|
-
visible?: boolean;
|
|
543
553
|
useQFormNotSForm?: boolean;
|
|
544
554
|
alphaThreshold?: boolean;
|
|
545
555
|
colormapNegative?: string;
|
|
@@ -566,7 +576,6 @@ type ImageFromFileOptions = {
|
|
|
566
576
|
trustCalMinMax?: boolean;
|
|
567
577
|
percentileFrac?: number;
|
|
568
578
|
ignoreZeroVoxels?: boolean;
|
|
569
|
-
visible?: boolean;
|
|
570
579
|
useQFormNotSForm?: boolean;
|
|
571
580
|
colormapNegative?: string;
|
|
572
581
|
imageType?: ImageType;
|
|
@@ -583,7 +592,6 @@ type ImageFromBase64 = {
|
|
|
583
592
|
trustCalMinMax?: boolean;
|
|
584
593
|
percentileFrac?: number;
|
|
585
594
|
ignoreZeroVoxels?: boolean;
|
|
586
|
-
visible?: boolean;
|
|
587
595
|
};
|
|
588
596
|
type ImageMetadata = {
|
|
589
597
|
id: string;
|
|
@@ -598,7 +606,7 @@ type ImageMetadata = {
|
|
|
598
606
|
dt: number;
|
|
599
607
|
bpv: number;
|
|
600
608
|
};
|
|
601
|
-
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,
|
|
609
|
+
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?: string[]) => ImageFromUrlOptions;
|
|
602
610
|
|
|
603
611
|
/**
|
|
604
612
|
* a NVImage encapsulates some images data and provides methods to query and operate on images
|
|
@@ -622,7 +630,6 @@ declare class NVImage {
|
|
|
622
630
|
cal_minNeg: number;
|
|
623
631
|
cal_maxNeg: number;
|
|
624
632
|
colorbarVisible: boolean;
|
|
625
|
-
visible: boolean;
|
|
626
633
|
modulationImage: number | null;
|
|
627
634
|
modulateAlpha: number;
|
|
628
635
|
series: any;
|
|
@@ -697,7 +704,6 @@ declare class NVImage {
|
|
|
697
704
|
* @param trustCalMinMax - whether or not to trust cal_min and cal_max from the nifti header (trusting results in faster loading)
|
|
698
705
|
* @param percentileFrac - the percentile to use for setting the robust range of the display values (smart intensity setting for images with large ranges)
|
|
699
706
|
* @param ignoreZeroVoxels - whether or not to ignore zero voxels in setting the robust range of display values
|
|
700
|
-
* @param visible - whether or not this image is to be visible
|
|
701
707
|
* @param useQFormNotSForm - give precedence to QForm (Quaternion) or SForm (Matrix)
|
|
702
708
|
* @param colormapNegative - a color map to use for symmetrical negative intensities
|
|
703
709
|
* @param frame4D - volume displayed, 0 indexed, must be less than nFrame4D
|
|
@@ -713,7 +719,7 @@ declare class NVImage {
|
|
|
713
719
|
* @param colorbarVisible - TODO
|
|
714
720
|
* @param colormapLabel - TODO
|
|
715
721
|
*/
|
|
716
|
-
constructor(dataBuffer?: ArrayBuffer | ArrayBuffer[] | null, name?: string, colormap?: string, opacity?: number, pairedImgData?: ArrayBuffer | null, cal_min?: number, cal_max?: number, trustCalMinMax?: boolean, percentileFrac?: number, ignoreZeroVoxels?: boolean,
|
|
722
|
+
constructor(dataBuffer?: ArrayBuffer | ArrayBuffer[] | 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);
|
|
717
723
|
computeObliqueAngle(mtx44: mat4): number;
|
|
718
724
|
calculateOblique(): void;
|
|
719
725
|
THD_daxes_to_NIFTI(xyzDelta: number[], xyzOrigin: number[], orientSpecific: number[]): void;
|
|
@@ -752,7 +758,7 @@ declare class NVImage {
|
|
|
752
758
|
* factory function to load and return a new NVImage instance from a given URL
|
|
753
759
|
* @returns NVImage instance
|
|
754
760
|
*/
|
|
755
|
-
static loadFromUrl({ url, urlImgData, headers, name, colormap, opacity, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels,
|
|
761
|
+
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'>> & {
|
|
756
762
|
url?: string | Uint8Array | ArrayBuffer;
|
|
757
763
|
}): Promise<NVImage>;
|
|
758
764
|
static readFileAsync(file: File, bytesToLoad?: number): Promise<ArrayBuffer>;
|
|
@@ -760,7 +766,7 @@ declare class NVImage {
|
|
|
760
766
|
* factory function to load and return a new NVImage instance from a file in the browser
|
|
761
767
|
*/
|
|
762
768
|
static loadFromFile({ file, // file can be an array of file objects or a single file object
|
|
763
|
-
name, colormap, opacity, urlImgData, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels,
|
|
769
|
+
name, colormap, opacity, urlImgData, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels, useQFormNotSForm, colormapNegative, frame4D, limitFrames4D, imageType }: ImageFromFileOptions): Promise<NVImage>;
|
|
764
770
|
/**
|
|
765
771
|
* factory function to load and return a new NVImage instance from a base64 encoded string
|
|
766
772
|
*
|
|
@@ -768,7 +774,7 @@ declare class NVImage {
|
|
|
768
774
|
* @example
|
|
769
775
|
* myImage = NVImage.loadFromBase64('SomeBase64String')
|
|
770
776
|
*/
|
|
771
|
-
static loadFromBase64({ base64, name, colormap, opacity, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels
|
|
777
|
+
static loadFromBase64({ base64, name, colormap, opacity, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels }: ImageFromBase64): NVImage;
|
|
772
778
|
/**
|
|
773
779
|
* make a clone of a NVImage instance and return a new NVImage
|
|
774
780
|
* @returns NVImage instance
|
|
@@ -814,6 +820,10 @@ declare class NVImage {
|
|
|
814
820
|
* Converts NVImage to NIfTI compliant byte array
|
|
815
821
|
*/
|
|
816
822
|
toUint8Array(drawingBytes?: Uint8Array | null): Uint8Array;
|
|
823
|
+
convertVox2Frac(vox: vec3): vec3;
|
|
824
|
+
convertFrac2Vox(frac: vec3): vec3;
|
|
825
|
+
convertFrac2MM(frac: vec3, isForceSliceMM?: boolean): vec4;
|
|
826
|
+
convertMM2Frac(mm: vec3 | vec4, isForceSliceMM?: boolean): vec3;
|
|
817
827
|
}
|
|
818
828
|
|
|
819
829
|
type FreeSurferConnectome = {
|
|
@@ -903,7 +913,7 @@ type NVConfigOptions = {
|
|
|
903
913
|
longTouchTimeout: number;
|
|
904
914
|
keyDebounceTime: number;
|
|
905
915
|
isNearestInterpolation: boolean;
|
|
906
|
-
|
|
916
|
+
atlasOutline: number;
|
|
907
917
|
isRuler: boolean;
|
|
908
918
|
isColorbar: boolean;
|
|
909
919
|
isOrientCube: boolean;
|
|
@@ -912,13 +922,16 @@ type NVConfigOptions = {
|
|
|
912
922
|
isRadiologicalConvention: boolean;
|
|
913
923
|
meshThicknessOn2D: number | string;
|
|
914
924
|
dragMode: DRAG_MODE;
|
|
925
|
+
yoke3Dto2DZoom: boolean;
|
|
915
926
|
isDepthPickMesh: boolean;
|
|
916
927
|
isCornerOrientationText: boolean;
|
|
917
928
|
sagittalNoseLeft: boolean;
|
|
918
929
|
isSliceMM: boolean;
|
|
930
|
+
isV1SliceShader: boolean;
|
|
919
931
|
isHighResolutionCapable: boolean;
|
|
920
932
|
logLevel: 'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'silent';
|
|
921
933
|
loadingText: string;
|
|
934
|
+
isForceMouseClickToVoxelCenters: boolean;
|
|
922
935
|
dragAndDropEnabled: boolean;
|
|
923
936
|
drawingEnabled: boolean;
|
|
924
937
|
penValue: number;
|
|
@@ -1317,6 +1330,16 @@ declare class NVUtilities {
|
|
|
1317
1330
|
* @returns filled number array
|
|
1318
1331
|
*/
|
|
1319
1332
|
static range(start: number, stop: number, step: number): number[];
|
|
1333
|
+
/**
|
|
1334
|
+
* convert spherical AZIMUTH, ELEVATION to Cartesian
|
|
1335
|
+
* @param azimuth - azimuth number
|
|
1336
|
+
* @param elevation - elevation number
|
|
1337
|
+
* @returns the converted [x, y, z] coordinates
|
|
1338
|
+
* @example
|
|
1339
|
+
* xyz = NVUtilities.sph2cartDeg(42, 42)
|
|
1340
|
+
*/
|
|
1341
|
+
static sph2cartDeg(azimuth: number, elevation: number): number[];
|
|
1342
|
+
static vox2mm(XYZ: number[], mtx: mat4): vec3;
|
|
1320
1343
|
}
|
|
1321
1344
|
|
|
1322
1345
|
/**
|
|
@@ -1326,10 +1349,11 @@ declare class NVMeshLoaders {
|
|
|
1326
1349
|
static readTRACT(buffer: ArrayBuffer): TRACT;
|
|
1327
1350
|
static readTT(buffer: ArrayBuffer): TT;
|
|
1328
1351
|
static readTRX(buffer: ArrayBuffer): TRX;
|
|
1352
|
+
static readTSF(buffer: ArrayBuffer, n_vert?: number): Float32Array;
|
|
1329
1353
|
static readTCK(buffer: ArrayBuffer): TCK;
|
|
1330
1354
|
static readTRK(buffer: ArrayBuffer): TRK;
|
|
1331
1355
|
static readTxtVTK(buffer: ArrayBuffer): VTK;
|
|
1332
|
-
static readLayer(name: string, buffer: ArrayBuffer, nvmesh: NVMesh, opacity?: number, colormap?: string, colormapNegative?: string, useNegativeCmap?: boolean, cal_min?: number | null, cal_max?: number | null,
|
|
1356
|
+
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): void;
|
|
1333
1357
|
static readSMP(buffer: ArrayBuffer, n_vert: number): Float32Array;
|
|
1334
1358
|
static readSTC(buffer: ArrayBuffer, n_vert: number): Float32Array;
|
|
1335
1359
|
static readCURV(buffer: ArrayBuffer, n_vert: number): Float32Array;
|
|
@@ -1343,6 +1367,7 @@ declare class NVMeshLoaders {
|
|
|
1343
1367
|
static readICO(buffer: ArrayBuffer): DefaultMeshType;
|
|
1344
1368
|
static readGEO(buffer: ArrayBuffer, isFlipWinding?: boolean): DefaultMeshType;
|
|
1345
1369
|
static readOFF(buffer: ArrayBuffer): DefaultMeshType;
|
|
1370
|
+
static readOBJMNI(buffer: ArrayBuffer): DefaultMeshType;
|
|
1346
1371
|
static readOBJ(buffer: ArrayBuffer): DefaultMeshType;
|
|
1347
1372
|
static readFreeSurfer(buffer: ArrayBuffer): DefaultMeshType;
|
|
1348
1373
|
static readSRF(buffer: ArrayBuffer): DefaultMeshType;
|
|
@@ -1455,7 +1480,7 @@ type NiiVueOptions = {
|
|
|
1455
1480
|
loadingText?: string;
|
|
1456
1481
|
dragAndDropEnabled?: boolean;
|
|
1457
1482
|
isNearestInterpolation?: boolean;
|
|
1458
|
-
|
|
1483
|
+
atlasOutline?: number;
|
|
1459
1484
|
isRuler?: boolean;
|
|
1460
1485
|
isColorbar?: boolean;
|
|
1461
1486
|
isOrientCube?: boolean;
|
|
@@ -1467,12 +1492,15 @@ type NiiVueOptions = {
|
|
|
1467
1492
|
isCornerOrientationText?: boolean;
|
|
1468
1493
|
sagittalNoseLeft?: boolean;
|
|
1469
1494
|
isSliceMM?: boolean;
|
|
1495
|
+
isV1SliceShader?: boolean;
|
|
1470
1496
|
isHighResolutionCapable?: boolean;
|
|
1497
|
+
isForceMouseClickToVoxelCenters?: boolean;
|
|
1471
1498
|
drawingEnabled?: boolean;
|
|
1472
1499
|
penValue?: number;
|
|
1473
1500
|
floodFillNeighbors?: number;
|
|
1474
1501
|
maxDrawUndoBitmaps?: number;
|
|
1475
1502
|
thumbnail?: string;
|
|
1503
|
+
meshXRay?: number;
|
|
1476
1504
|
};
|
|
1477
1505
|
type UIData = {
|
|
1478
1506
|
mousedown: boolean;
|
|
@@ -1535,6 +1563,7 @@ declare class Niivue {
|
|
|
1535
1563
|
overlayTexture: WebGLTexture | null;
|
|
1536
1564
|
overlayTextureID: WebGLTexture | null;
|
|
1537
1565
|
sliceMMShader?: Shader;
|
|
1566
|
+
sliceV1Shader?: Shader;
|
|
1538
1567
|
orientCubeShader?: Shader;
|
|
1539
1568
|
orientCubeShaderVAO: WebGLVertexArrayObject | null;
|
|
1540
1569
|
rectShader?: Shader;
|
|
@@ -1581,6 +1610,7 @@ declare class Niivue {
|
|
|
1581
1610
|
position?: vec3;
|
|
1582
1611
|
extentsMin?: vec3;
|
|
1583
1612
|
extentsMax?: vec3;
|
|
1613
|
+
private resizeObserver;
|
|
1584
1614
|
syncOpts: Record<string, unknown>;
|
|
1585
1615
|
readyForSync: boolean;
|
|
1586
1616
|
uiData: UIData;
|
|
@@ -1812,7 +1842,7 @@ declare class Niivue {
|
|
|
1812
1842
|
longTouchTimeout: number;
|
|
1813
1843
|
keyDebounceTime: number;
|
|
1814
1844
|
isNearestInterpolation: boolean;
|
|
1815
|
-
|
|
1845
|
+
atlasOutline: number;
|
|
1816
1846
|
isRuler: boolean;
|
|
1817
1847
|
isColorbar: boolean;
|
|
1818
1848
|
isOrientCube: boolean;
|
|
@@ -1821,13 +1851,16 @@ declare class Niivue {
|
|
|
1821
1851
|
isRadiologicalConvention: boolean;
|
|
1822
1852
|
meshThicknessOn2D: string | number;
|
|
1823
1853
|
dragMode: DRAG_MODE;
|
|
1854
|
+
yoke3Dto2DZoom: boolean;
|
|
1824
1855
|
isDepthPickMesh: boolean;
|
|
1825
1856
|
isCornerOrientationText: boolean;
|
|
1826
1857
|
sagittalNoseLeft: boolean;
|
|
1827
1858
|
isSliceMM: boolean;
|
|
1859
|
+
isV1SliceShader: boolean;
|
|
1828
1860
|
isHighResolutionCapable: boolean;
|
|
1829
1861
|
logLevel: "debug" | "info" | "warn" | "error" | "fatal" | "silent";
|
|
1830
1862
|
loadingText: string;
|
|
1863
|
+
isForceMouseClickToVoxelCenters: boolean;
|
|
1831
1864
|
dragAndDropEnabled: boolean;
|
|
1832
1865
|
drawingEnabled: boolean;
|
|
1833
1866
|
penValue: number;
|
|
@@ -2209,6 +2242,17 @@ declare class Niivue {
|
|
|
2209
2242
|
* @see {@link https://niivue.github.io/niivue/features/meshes.html|live demo usage}
|
|
2210
2243
|
*/
|
|
2211
2244
|
setMeshProperty(id: number, key: keyof NVMesh, val: number): void;
|
|
2245
|
+
/**
|
|
2246
|
+
* returns the index of the mesh vertex that is closest to the provided coordinates
|
|
2247
|
+
* @param id - identity of mesh to change
|
|
2248
|
+
* @param Xmm - location in left/right dimension
|
|
2249
|
+
* @param Ymm - location in posterior/anterior dimension
|
|
2250
|
+
* @param Zmm - location in foot/head dimension
|
|
2251
|
+
* @returns the an array where ret[0] is the mesh index and ret[1] is distance from vertex to coordinates
|
|
2252
|
+
* @example niivue.indexNearestXYZmm(niivue.meshes[0].id, -22, 42, 13)
|
|
2253
|
+
* @see {@link https://niivue.github.io/niivue/features/clipplanes.html | live demo usage}
|
|
2254
|
+
*/
|
|
2255
|
+
indexNearestXYZmm(mesh: number, Xmm: number, Ymm: number, Zmm: number): number[];
|
|
2212
2256
|
/**
|
|
2213
2257
|
* reverse triangle winding of mesh (swap front and back faces)
|
|
2214
2258
|
* @param id - identity of mesh to change
|
|
@@ -2348,7 +2392,7 @@ declare class Niivue {
|
|
|
2348
2392
|
* niivue.setCrosshairColor([0, 1, 0, 0.5]) // set crosshair to transparent green
|
|
2349
2393
|
* @see {@link https://niivue.github.io/niivue/features/colormaps.html|live demo usage}
|
|
2350
2394
|
*/
|
|
2351
|
-
setCrosshairColor(color: number[]):
|
|
2395
|
+
setCrosshairColor(color: number[]): void;
|
|
2352
2396
|
/**
|
|
2353
2397
|
* set thickness of crosshair
|
|
2354
2398
|
* @example niivue.crosshairWidth(2)
|
|
@@ -2826,7 +2870,7 @@ declare class Niivue {
|
|
|
2826
2870
|
drawTextBetween(startXYendXY: number[], str: string, scale?: number, color?: number[] | null): void;
|
|
2827
2871
|
drawTextBelow(xy: number[], str: string, scale?: number, color?: number[] | null): void;
|
|
2828
2872
|
updateInterpolation(layer: number, isForceLinear?: boolean): void;
|
|
2829
|
-
setAtlasOutline(isOutline:
|
|
2873
|
+
setAtlasOutline(isOutline: number): void;
|
|
2830
2874
|
/**
|
|
2831
2875
|
* select between nearest and linear interpolation for voxel based images
|
|
2832
2876
|
* @param isNearest - whether nearest neighbor interpolation is used, else linear interpolation
|