@niivue/niivue 0.44.2-dev.1 → 0.45.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/build/index.d.ts +15 -71
- package/build/index.js +197 -459
- package/build/index.js.map +1 -1
- package/build/index.min.js +1 -1
- package/dist/index.d.ts +15 -71
- package/dist/index.js +198 -460
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/niivue.umd.js +27 -66
- package/package.json +1 -1
- package/src/cow.iwm.cbor +0 -0
- package/src/fslmean.iwi.cbor +0 -0
- package/src/index.html +1 -1
- package/src/niivue/index.ts +266 -532
- package/src/nvdocument.ts +5 -25
- package/src/shader-srcs.ts +0 -41
- package/src/types.ts +0 -13
- package/src/index_segment.html +0 -165
- package/src/index_sync.html +0 -289
package/build/index.d.ts
CHANGED
|
@@ -598,8 +598,7 @@ declare enum DRAG_MODE {
|
|
|
598
598
|
measurement = 2,
|
|
599
599
|
pan = 3,
|
|
600
600
|
slicer3D = 4,
|
|
601
|
-
callbackOnly = 5
|
|
602
|
-
roiSelection = 6
|
|
601
|
+
callbackOnly = 5
|
|
603
602
|
}
|
|
604
603
|
/**
|
|
605
604
|
* NVConfigOptions
|
|
@@ -669,17 +668,10 @@ type NVConfigOptions = {
|
|
|
669
668
|
renderOverlayBlend: number;
|
|
670
669
|
sliceMosaicString: string;
|
|
671
670
|
centerMosaic: boolean;
|
|
672
|
-
penSize: number;
|
|
673
671
|
clickToSegment: boolean;
|
|
674
672
|
clickToSegmentRadius: number;
|
|
673
|
+
clickToSegmentSteps: number;
|
|
675
674
|
clickToSegmentBright: boolean;
|
|
676
|
-
clickToSegmentAutoIntensity: boolean;
|
|
677
|
-
clickToSegmentIntensityMax: number;
|
|
678
|
-
clickToSegmentIntensityMin: number;
|
|
679
|
-
clickToSegmentPercent: number;
|
|
680
|
-
clickToSegmentMaxDistanceMM: number;
|
|
681
|
-
selectionBoxLineThickness: number;
|
|
682
|
-
selectionBoxIsOutline: boolean;
|
|
683
675
|
};
|
|
684
676
|
declare const DEFAULT_OPTIONS: NVConfigOptions;
|
|
685
677
|
type SceneData = {
|
|
@@ -984,18 +976,6 @@ type NiiVueLocation = {
|
|
|
984
976
|
vox: vec3;
|
|
985
977
|
xy: [number, number];
|
|
986
978
|
};
|
|
987
|
-
type SyncOpts = {
|
|
988
|
-
'3d'?: boolean;
|
|
989
|
-
'2d'?: boolean;
|
|
990
|
-
zoomPan?: boolean;
|
|
991
|
-
cal_min?: boolean;
|
|
992
|
-
cal_max?: boolean;
|
|
993
|
-
gamma?: boolean;
|
|
994
|
-
useSliceOffset?: boolean;
|
|
995
|
-
sliceType?: boolean;
|
|
996
|
-
crosshair?: boolean;
|
|
997
|
-
clipPlane?: boolean;
|
|
998
|
-
};
|
|
999
979
|
|
|
1000
980
|
type ValuesArray = Array<{
|
|
1001
981
|
id: string;
|
|
@@ -1632,7 +1612,6 @@ type Descriptive = {
|
|
|
1632
1612
|
cal_max: number;
|
|
1633
1613
|
robust_min: number;
|
|
1634
1614
|
robust_max: number;
|
|
1635
|
-
area: number | null;
|
|
1636
1615
|
};
|
|
1637
1616
|
type SliceScale = {
|
|
1638
1617
|
volScale: number[];
|
|
@@ -1691,6 +1670,7 @@ type SaveImageOptions = {
|
|
|
1691
1670
|
* let niivue = new Niivue({crosshairColor: [0,1,0,0.5], textHeight: 0.5}) // a see-through green crosshair, and larger text labels
|
|
1692
1671
|
*/
|
|
1693
1672
|
declare class Niivue {
|
|
1673
|
+
loaders: {};
|
|
1694
1674
|
canvas: HTMLCanvasElement | null;
|
|
1695
1675
|
_gl: WebGL2RenderingContext | null;
|
|
1696
1676
|
isBusy: boolean;
|
|
@@ -1717,7 +1697,6 @@ declare class Niivue {
|
|
|
1717
1697
|
orientCubeShader?: Shader;
|
|
1718
1698
|
orientCubeShaderVAO: WebGLVertexArrayObject | null;
|
|
1719
1699
|
rectShader?: Shader;
|
|
1720
|
-
rectOutlineShader?: Shader;
|
|
1721
1700
|
renderShader?: Shader;
|
|
1722
1701
|
lineShader?: Shader;
|
|
1723
1702
|
line3DShader?: Shader;
|
|
@@ -1762,7 +1741,7 @@ declare class Niivue {
|
|
|
1762
1741
|
extentsMin?: vec3;
|
|
1763
1742
|
extentsMax?: vec3;
|
|
1764
1743
|
private resizeObserver;
|
|
1765
|
-
syncOpts:
|
|
1744
|
+
syncOpts: Record<string, unknown>;
|
|
1766
1745
|
readyForSync: boolean;
|
|
1767
1746
|
uiData: UIData;
|
|
1768
1747
|
back: NVImage | null;
|
|
@@ -1783,7 +1762,7 @@ declare class Niivue {
|
|
|
1783
1762
|
screen2frac?: number[];
|
|
1784
1763
|
}>;
|
|
1785
1764
|
cuboidVertexBuffer?: WebGLBuffer;
|
|
1786
|
-
otherNV: Niivue[] | null;
|
|
1765
|
+
otherNV: Niivue | Niivue[] | null;
|
|
1787
1766
|
volumeObject3D: NiivueObject3D | null;
|
|
1788
1767
|
pivot3D: number[];
|
|
1789
1768
|
furthestFromPivot: number;
|
|
@@ -2038,7 +2017,7 @@ declare class Niivue {
|
|
|
2038
2017
|
* @deprecated use broadcastTo instead
|
|
2039
2018
|
* @see {@link https://niivue.github.io/niivue/features/sync.mesh.html | live demo usage}
|
|
2040
2019
|
*/
|
|
2041
|
-
syncWith(otherNV: Niivue
|
|
2020
|
+
syncWith(otherNV: Niivue, syncOpts?: {
|
|
2042
2021
|
'2d': boolean;
|
|
2043
2022
|
'3d': boolean;
|
|
2044
2023
|
}): void;
|
|
@@ -2057,15 +2036,6 @@ declare class Niivue {
|
|
|
2057
2036
|
'2d': boolean;
|
|
2058
2037
|
'3d': boolean;
|
|
2059
2038
|
}): void;
|
|
2060
|
-
doSync3d(otherNV: Niivue): void;
|
|
2061
|
-
doSync2d(otherNV: Niivue): void;
|
|
2062
|
-
doSyncGamma(otherNV: Niivue): void;
|
|
2063
|
-
doSyncZoomPan(otherNV: Niivue): void;
|
|
2064
|
-
doSyncCrosshair(otherNV: Niivue): void;
|
|
2065
|
-
doSyncCalMin(otherNV: Niivue): void;
|
|
2066
|
-
doSyncCalMax(otherNV: Niivue): void;
|
|
2067
|
-
doSyncSliceType(otherNV: Niivue): void;
|
|
2068
|
-
doSyncClipPlane(otherNV: Niivue): void;
|
|
2069
2039
|
/**
|
|
2070
2040
|
* Sync the scene controls (orientation, crosshair location, etc.) from one Niivue instance to another. useful for using one canvas to drive another.
|
|
2071
2041
|
* @internal
|
|
@@ -2169,6 +2139,7 @@ declare class Niivue {
|
|
|
2169
2139
|
* @param file - File object
|
|
2170
2140
|
*/
|
|
2171
2141
|
loadFromFile(file: File): Promise<void>;
|
|
2142
|
+
useLoader(loader: unknown, fileExt: string, toExt: string): void;
|
|
2172
2143
|
dropListener(e: DragEvent): void;
|
|
2173
2144
|
/**
|
|
2174
2145
|
* insert a gap between slices of a mutliplanar view.
|
|
@@ -2648,6 +2619,7 @@ declare class Niivue {
|
|
|
2648
2619
|
* @see {@link https://niivue.github.io/niivue/features/document.3d.html | live demo usage}
|
|
2649
2620
|
*/
|
|
2650
2621
|
saveDocument(fileName?: string, compress?: boolean): Promise<void>;
|
|
2622
|
+
loadImages(images: Array<ImageFromUrlOptions | LoadFromUrlParams>): Promise<this>;
|
|
2651
2623
|
/**
|
|
2652
2624
|
* load an array of volume objects
|
|
2653
2625
|
* @param volumeList - the array of objects to load. each object must have a resolvable "url" property at a minimum
|
|
@@ -2726,17 +2698,9 @@ declare class Niivue {
|
|
|
2726
2698
|
drawGrowCut(): void;
|
|
2727
2699
|
drawPt(x: number, y: number, z: number, penValue: number): void;
|
|
2728
2700
|
drawPenLine(ptA: number[], ptB: number[], penValue: number): void;
|
|
2729
|
-
/**
|
|
2730
|
-
* Performs a 1-voxel binary dilation on a connected cluster within the drawing mask using the drawFloodFillCore function.
|
|
2731
|
-
*
|
|
2732
|
-
* @param seedXYZ - voxel index of the seed voxel in the mask array.
|
|
2733
|
-
* @param neighbors - Number of neighbors to consider for connectivity and dilation (6, 18, or 26).
|
|
2734
|
-
*/
|
|
2735
|
-
drawingBinaryDilationWithSeed(seedXYZ: number[], // seed voxel x,y,z
|
|
2736
|
-
neighbors?: 6 | 18 | 26): void;
|
|
2737
2701
|
drawFloodFillCore(img: Uint8Array, seedVx: number, neighbors?: number): void;
|
|
2738
2702
|
drawFloodFill(seedXYZ: number[], newColor?: number, growSelectedCluster?: number, // if non-zero, growth based on background intensity POSITIVE_INFINITY for selected or bright, NEGATIVE_INFINITY for selected or darker
|
|
2739
|
-
forceMin?: number, forceMax?: number, neighbors?: number
|
|
2703
|
+
forceMin?: number, forceMax?: number, neighbors?: number): void;
|
|
2740
2704
|
drawPenFilled(): void;
|
|
2741
2705
|
/**
|
|
2742
2706
|
* close drawing: make sure you have saved any changes before calling this!
|
|
@@ -2865,33 +2829,13 @@ declare class Niivue {
|
|
|
2865
2829
|
updateGLVolume(): void;
|
|
2866
2830
|
/**
|
|
2867
2831
|
* basic statistics for selected voxel-based image
|
|
2868
|
-
* @param
|
|
2869
|
-
*
|
|
2870
|
-
*
|
|
2871
|
-
*
|
|
2872
|
-
* - roiIsMask: a boolean indicating if the ROI is used as a mask
|
|
2873
|
-
* - startVox: the starting voxel coordinates
|
|
2874
|
-
* - endVox: the ending voxel coordinates
|
|
2875
|
-
* @returns numeric values to describe image or regions of images
|
|
2876
|
-
* @example
|
|
2877
|
-
* niivue.getDescriptives({
|
|
2878
|
-
* layer: 0,
|
|
2879
|
-
* masks: [],
|
|
2880
|
-
* drawingIsMask: true, // drawingIsMask and roiIsMask are mutually exclusive
|
|
2881
|
-
* roiIsMask: false,
|
|
2882
|
-
* startVox: [10, 20, 30], // ignored if roiIsMask is false
|
|
2883
|
-
* endVox: [40, 50, 60] // ignored if roiIsMask is false
|
|
2884
|
-
* });
|
|
2832
|
+
* @param layer - selects image to describe
|
|
2833
|
+
* @param masks - are optional binary images to filter voxles
|
|
2834
|
+
* @returns numeric values to describe image
|
|
2835
|
+
* @example niivue.getDescriptives(0);
|
|
2885
2836
|
* @see {@link https://niivue.github.io/niivue/features/draw2.html | live demo usage}
|
|
2886
2837
|
*/
|
|
2887
|
-
getDescriptives(
|
|
2888
|
-
layer?: number;
|
|
2889
|
-
masks?: number[];
|
|
2890
|
-
drawingIsMask?: boolean;
|
|
2891
|
-
roiIsMask?: boolean;
|
|
2892
|
-
startVox?: number[];
|
|
2893
|
-
endVox?: number[];
|
|
2894
|
-
}): Descriptive;
|
|
2838
|
+
getDescriptives(layer?: number, masks?: any[], drawingIsMask?: boolean): Descriptive;
|
|
2895
2839
|
refreshLayers(overlayItem: NVImage, layer: number): void;
|
|
2896
2840
|
/**
|
|
2897
2841
|
* query all available color maps that can be applied to volumes
|
|
@@ -3123,4 +3067,4 @@ declare class Niivue {
|
|
|
3123
3067
|
set gl(gl: WebGL2RenderingContext | null);
|
|
3124
3068
|
}
|
|
3125
3069
|
|
|
3126
|
-
export { type Connectome, type ConnectomeOptions, DEFAULT_OPTIONS, DRAG_MODE, type DocumentData, type DragReleaseParams, type ExportDocumentData, INITIAL_SCENE_DATA, LabelAnchorPoint, LabelLineTerminator, LabelTextAlignment, type LegacyConnectome, type LegacyNodes, MULTIPLANAR_TYPE, type NVConfigOptions, type NVConnectomeEdge, type NVConnectomeNode, NVController, NVDocument, NVImage, NVImageFromUrlOptions, NVLabel3D, NVLabel3DStyle, NVMesh, NVMeshFromUrlOptions, NVMeshLayerDefaults, NVMeshLoaders, NVMeshUtilities, NVUtilities, type NiftiHeader, type NiiVueLocation, type NiiVueLocationValue, Niivue, type Point, SHOW_RENDER, SLICE_TYPE, type Scene, type
|
|
3070
|
+
export { type Connectome, type ConnectomeOptions, DEFAULT_OPTIONS, DRAG_MODE, type DocumentData, type DragReleaseParams, type ExportDocumentData, INITIAL_SCENE_DATA, LabelAnchorPoint, LabelLineTerminator, LabelTextAlignment, type LegacyConnectome, type LegacyNodes, MULTIPLANAR_TYPE, type NVConfigOptions, type NVConnectomeEdge, type NVConnectomeNode, NVController, NVDocument, NVImage, NVImageFromUrlOptions, NVLabel3D, NVLabel3DStyle, NVMesh, NVMeshFromUrlOptions, NVMeshLayerDefaults, NVMeshLoaders, NVMeshUtilities, NVUtilities, type NiftiHeader, type NiiVueLocation, type NiiVueLocationValue, Niivue, type Point, SHOW_RENDER, SLICE_TYPE, type Scene, type Volume, cmapper, ColorTables as colortables };
|