options object to set modifiable Niivue properties
callback function to run when the user changes the rotation of the 3D rendering
callback function when clickToSegment is enabled and the user clicks on the image. data contains the volume of the segmented region in mm3 and mL
callback function to run when the user changes the clip plane
callback function to run when niivue reports a debug message
callback function to run when the user loads a new NiiVue document
callback function to run when the right mouse button is released after dragging
callback function to run when niivue reports an error
callback function to run when the user changes the volume when a 4D image is loaded
callback function to run when a new volume is loaded
callback function to run when niivue reports detailed info
callback function to run when the user changes the intensity range with the selection box action (right click)
callback function to run when the crosshair location changes
callback function to run when a mesh is added from a url
callback function to run when a new mesh is loaded
callback function to run when the left mouse button is released
callback function to run when a volume is added from a url
callback function to run when updateGLVolume is called (most users will not need to use
callback function to run when niivue reports a warning
Add a 3D Label
text of the label
label style
Optional
points: number[] | number[][]Optional
anchor: LabelAnchorPointOptional
onClick: ((label: NVLabel3D) => void)add a new mesh to the canvas
the new mesh to add to the canvas
add a new volume to the canvas
the new volume to add to the canvas
FreeSurfer-style conform reslices any image to a 256x256x256 volume with 1mm voxels
input volume to be re-oriented, intensity-scaled and resliced
reslice to row, column slices to right-anterior-superior not left-inferior-anterior (default false).
reslice with linear rather than nearest-neighbor interpolation (default true).
use Float32 datatype rather than Uint8 (default false).
clamp intensity with robust min max (~2%..98%) instead of FreeSurfer (0%..99.99%) (default false).
custom fragment shader.
title for new shader.
created custom mesh shader
Performs a 1-voxel binary dilation on a connected cluster within the drawing mask using the drawFloodFillCore function.
voxel index of the seed voxel in the mask array.
Number of neighbors to consider for connectivity and dilation (6, 18, or 26).
basic statistics for selected voxel-based image
an object containing the following properties:
Optional
drawingOptional
endOptional
layer?: numberOptional
masks?: number[]Optional
roiOptional
startnumeric values to describe image or regions of images
get the index of an overlay by its unique id. unique ids are assigned to the NVImage.id property when a new NVImage is created.
the id string to search for
get the index of a volume by its unique id. unique ids are assigned to the NVImage.id property when a new NVImage is created.
the id string to search for
returns the index of the mesh vertex that is closest to the provided coordinates
location in left/right dimension
location in posterior/anterior dimension
location in foot/head dimension
the an array where ret[0] is the mesh index and ret[1] is distance from vertex to coordinates
Load typeface for colorbars, measurements and orientation text.
Move a volume down one index position in the stack of loaded volumes. This moves it down one layer
the volume to move
Move a volume to the bottom of the stack of loaded volumes. The volume will become the background
the volume to move
Move a volume to the top position in the stack of loaded volumes. This will be the top layer
the volume to move
Move a volume up one index position in the stack of loaded volumes. This moves it up one layer
the volume to move
Remove a triangulated mesh, connectome or tractogram
mesh to delete
Remove a volume
volume to delete
Reset scene to default settings.
also reset contrast (default false).
change property of mesh, tractogram or connectome
identity of mesh to change
attribute to change
select new shader for triangulated meshes and connectomes. Note that this function requires the mesh is fully loaded: you may want use await
with loadMeshes (as seen in live demo).
id of mesh to change
identify shader for usage
modulate intensity of one image based on intensity of another
the ID of the NVImage to be biased
the ID of the NVImage that controls bias (empty string to disable modulation)
does the modulation influence alpha transparency (values greater than 1).
set the index of a volume. This will change it's ordering and appearance if there are multiple volumes loaded.
the volume to update
the index to move the volume to. The default is the background (0 index)
Niivue can be attached to a canvas. An instance of Niivue contains methods for loading and rendering NIFTI image data in a WebGL 2.0 context.
Example