Skip to main content

niivue

Classes

ClassDescription
NiivueNiivue 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.
NiivueEventType-safe event class for Niivue events. Extends CustomEvent with typed detail property.

Interfaces

InterfaceDescription
AffineTransformRepresents an affine transformation in decomposed form.
CustomLoaderCustom file loader configuration. The loader function can return either: - ArrayBuffer for volume data - MeshLoaderResult for mesh data with positions and indices
GetFileExtOptionsOptions for getFileExt function
LoaderRegistryCollection of registered custom loaders by file extension
MeshLoaderResultMesh data returned by custom mesh loaders
NiivueEventMapType-safe event map for all Niivue events. Maps event names to their detail types.
RegisterLoaderParamsParameters for registerLoader

Type Aliases

Type AliasDescription
DicomLoader-
DicomLoaderInput-
NiivueEventListenerType-safe event listener for Niivue events. Listeners can be synchronous or asynchronous.
NiivueEventListenerOptionsOptions for addEventListener/removeEventListener. Supports all standard EventTarget options including: - capture: boolean - Use capture phase - once: boolean - Remove listener after first invocation - passive: boolean - Listener will never call preventDefault() - signal: AbortSignal - Remove listener when signal is aborted

Variables

VariableDescription
identityTransformIdentity transform with no translation, rotation, or scale change.
MESH_EXTENSIONSMesh file extensions supported by Niivue

Functions

FunctionDescription
arrayToMat4Convert a 2D array (row-major, as used by NIfTI) to gl-matrix mat4 (column-major).
copyAffineDeep copy a 2D affine matrix array.
createTransformMatrixCreate a 4x4 transformation matrix from decomposed transform components. Order: Scale -> Rotate -> Translate
degToRadConvert degrees to radians.
eulerToRotationMatrixCreate a rotation matrix from Euler angles (XYZ order). Angles are in degrees.
getFileExtExtracts and normalizes the file extension, handling special cases like .gz and .cbor.
getLoaderGet a loader for a specific file extension
getMediaByUrlGet media (volume or mesh) by URL from a media URL map
handleDragEnterSimple drag enter event handler that prevents default behavior
handleDragOverSimple drag over event handler that prevents default behavior
isDicomExtensionCheck if a DICOM loader error should be thrown
isMeshExtCheck if a URL/filename has a mesh file extension
mat4ToArrayConvert gl-matrix mat4 (column-major) to 2D array (row-major, as used by NIfTI).
multiplyAffineMultiply a transformation matrix by an affine matrix (as 2D array). Returns the result as a 2D array.
readDirectoryRead all entries from a directory
readFileAsDataURLRead a file as a data URL
registerLoaderRegister a custom loader for a specific file extension
transformsEqualCheck if two transforms are approximately equal.
traverseFileTreeRecursively traverse a file tree and collect all files

References

cmapper

Re-exports cmapper


ColormapListEntry

Re-exports ColormapListEntry


colortables

Renames and re-exports ColorTables


CompletedAngle

Re-exports CompletedAngle


CompletedMeasurement

Re-exports CompletedMeasurement


Connectome

Re-exports Connectome


ConnectomeOptions

Re-exports ConnectomeOptions


DEFAULT_OPTIONS

Re-exports DEFAULT_OPTIONS


DEFAULT_SCENE_DATA

Re-exports DEFAULT_SCENE_DATA


Descriptive

Re-exports Descriptive


DocumentData

Re-exports DocumentData


DragReleaseParams

Re-exports DragReleaseParams


ExportDocumentData

Re-exports ExportDocumentData


FontMetrics

Re-exports FontMetrics


Graph

Re-exports Graph


INITIAL_SCENE_DATA

Re-exports INITIAL_SCENE_DATA


LabelAnchorPoint

Re-exports LabelAnchorPoint


LabelLineTerminator

Re-exports LabelLineTerminator


LabelTextAlignment

Re-exports LabelTextAlignment


LegacyConnectome

Re-exports LegacyConnectome


LegacyNodes

Re-exports LegacyNodes


MM

Re-exports MM


MouseEventConfig

Re-exports MouseEventConfig


MvpMatrix2D

Re-exports MvpMatrix2D


NiftiHeader

Re-exports NiftiHeader


NiiVueLocation

Re-exports NiiVueLocation


NiiVueLocationValue

Re-exports NiiVueLocationValue


NVConfigOptions

Re-exports NVConfigOptions


NVDocument

Re-exports NVDocument


NVImage

Re-exports NVImage


NVImageFromUrlOptions

Re-exports NVImageFromUrlOptions


NVMesh

Re-exports NVMesh


NVMeshFromUrlOptions

Re-exports NVMeshFromUrlOptions


NVMeshLayerDefaults

Re-exports NVMeshLayerDefaults


NVMeshUtilities

Re-exports NVMeshUtilities


NVUtilities

Re-exports NVUtilities


PEN_TYPE

Re-exports PEN_TYPE


Point

Re-exports Point


SaveImageOptions

Re-exports SaveImageOptions


Scene

Re-exports Scene


SHOW_RENDER

Re-exports SHOW_RENDER


SliceScale

Re-exports SliceScale


SyncOpts

Re-exports SyncOpts


TouchEventConfig

Re-exports TouchEventConfig


UIData

Re-exports UIData


Volume

Re-exports Volume