@niivue/niivue 0.69.0 → 1.0.0-rc.10
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/LICENSE +34 -0
- package/LICENSE.fsleyes-plugin-mrs +29 -0
- package/PORTING.md +49 -0
- package/README.md +204 -8
- package/dist/NVConstants.d.ts +87 -0
- package/dist/NVControl.d.ts +4 -0
- package/dist/NVControlBase-D2fQpaBn.js +37707 -0
- package/dist/NVControlBase.d.ts +1024 -0
- package/dist/NVControlWebGL2.d.ts +4 -0
- package/dist/NVControlWebGPU.d.ts +4 -0
- package/dist/NVDocument.d.ts +167 -0
- package/dist/NVEvents.d.ts +169 -0
- package/dist/NVLoader.d.ts +21 -0
- package/dist/NVModel.d.ts +252 -0
- package/dist/NVTypes.d.ts +1239 -0
- package/dist/annotation/clipper.d.ts +24 -0
- package/dist/annotation/index.d.ts +38 -0
- package/dist/annotation/pointInRing.d.ts +2 -0
- package/dist/annotation/selection.d.ts +38 -0
- package/dist/annotation/shapes.d.ts +8 -0
- package/dist/annotation/sliceProjection.d.ts +25 -0
- package/dist/annotation/stats.d.ts +4 -0
- package/dist/annotation/triangulate.d.ts +5 -0
- package/dist/annotation/undoRedo.d.ts +13 -0
- package/{src/fonts/Ubuntu.json → dist/assets/fonts/Ubuntu.json.d.ts} +473 -470
- package/dist/assets/fonts/index.d.ts +1 -0
- package/dist/assets/fonts/index.js +4 -0
- package/dist/assets/fonts/ubuntu.d.ts +2 -0
- package/dist/assets/matcaps/cortex.d.ts +1 -0
- package/dist/assets/matcaps/index.d.ts +2 -0
- package/dist/assets/matcaps/index.js +6 -0
- package/dist/assets/matcaps/shiny.d.ts +1 -0
- package/dist/cmap/NVCmaps.d.ts +25 -0
- package/dist/codecs/NVGz.d.ts +4 -0
- package/dist/codecs/NVGzStream.d.ts +42 -0
- package/dist/codecs/NVMatlab.d.ts +2 -0
- package/dist/codecs/NVZip.d.ts +30 -0
- package/dist/control/NVCanvasViewportController.d.ts +88 -0
- package/dist/control/canvasMessage.d.ts +11 -0
- package/dist/control/dragModes.d.ts +29 -0
- package/dist/control/interactions.d.ts +7 -0
- package/dist/control/locationTracking.d.ts +27 -0
- package/dist/control/viewBoth.d.ts +38 -0
- package/dist/control/viewLifecycle.d.ts +15 -0
- package/dist/control/viewWebGL2.d.ts +11 -0
- package/dist/control/viewWebGPU.d.ts +11 -0
- package/dist/cortex-CBhDullr.js +4 -0
- package/dist/drawing/drawingManager.d.ts +43 -0
- package/dist/drawing/penTool.d.ts +72 -0
- package/dist/drawing/rle.d.ts +9 -0
- package/dist/drawing/undo.d.ts +10 -0
- package/dist/extension/context.d.ts +63 -0
- package/dist/extension/types.d.ts +143 -0
- package/dist/gl/NVViewGL.d.ts +101 -0
- package/dist/gl/bench.d.ts +43 -0
- package/dist/gl/colorbar.d.ts +31 -0
- package/dist/gl/colorbarShader.d.ts +2 -0
- package/dist/gl/crosshair.d.ts +16 -0
- package/dist/gl/depthPickShader.d.ts +4 -0
- package/dist/gl/font.d.ts +27 -0
- package/dist/gl/fontShader.d.ts +2 -0
- package/dist/gl/gradient.d.ts +14 -0
- package/dist/gl/line.d.ts +14 -0
- package/dist/gl/lineShader.d.ts +2 -0
- package/dist/gl/mesh.d.ts +21 -0
- package/dist/gl/meshShader.d.ts +24 -0
- package/dist/gl/orientChunked.d.ts +40 -0
- package/dist/gl/orientOverlay.d.ts +135 -0
- package/dist/gl/panelShader.d.ts +2 -0
- package/dist/gl/polygon.d.ts +15 -0
- package/dist/gl/polygon3d.d.ts +16 -0
- package/dist/gl/polygon3dShader.d.ts +2 -0
- package/dist/gl/polygonShader.d.ts +2 -0
- package/dist/gl/render.d.ts +320 -0
- package/dist/gl/renderShader.d.ts +2 -0
- package/dist/gl/shader.d.ts +8 -0
- package/dist/gl/slice.d.ts +39 -0
- package/dist/gl/sliceShader.d.ts +2 -0
- package/dist/gl/thumbnail.d.ts +16 -0
- package/dist/gl/volumeShaderLib.d.ts +2 -0
- package/dist/index-Cbb_IM7q.js +148 -0
- package/dist/index.d.ts +23 -5454
- package/dist/index.webgl2.d.ts +19 -0
- package/dist/index.webgpu.d.ts +19 -0
- package/dist/logger.d.ts +34 -0
- package/dist/math/NVTransforms.d.ts +69 -0
- package/dist/mesh/NVMesh.d.ts +24 -0
- package/dist/mesh/NVShapes.d.ts +19 -0
- package/dist/mesh/connectome/index.d.ts +44 -0
- package/dist/mesh/connectome/readers/jcon.d.ts +7 -0
- package/dist/mesh/layers/index.d.ts +44 -0
- package/dist/mesh/layers/readers/curv.d.ts +18 -0
- package/dist/mesh/layers/readers/smp.d.ts +12 -0
- package/dist/mesh/layers/readers/stc.d.ts +13 -0
- package/dist/mesh/readers/asc.d.ts +4 -0
- package/dist/mesh/readers/dfs.d.ts +4 -0
- package/dist/mesh/readers/fs.d.ts +4 -0
- package/dist/mesh/readers/geo.d.ts +4 -0
- package/dist/mesh/readers/gii.d.ts +4 -0
- package/dist/mesh/readers/ico.d.ts +4 -0
- package/dist/mesh/readers/iwm.d.ts +6 -0
- package/dist/mesh/readers/mz3.d.ts +4 -0
- package/dist/mesh/readers/nv.d.ts +4 -0
- package/dist/mesh/readers/obj.d.ts +4 -0
- package/dist/mesh/readers/off.d.ts +4 -0
- package/dist/mesh/readers/ply.d.ts +4 -0
- package/dist/mesh/readers/srf.d.ts +4 -0
- package/dist/mesh/readers/stl.d.ts +4 -0
- package/dist/mesh/readers/vtk.d.ts +14 -0
- package/dist/mesh/readers/wrl.d.ts +4 -0
- package/dist/mesh/readers/x3d.d.ts +4 -0
- package/dist/mesh/tracts/index.d.ts +24 -0
- package/dist/mesh/tracts/readers/tck.d.ts +10 -0
- package/dist/mesh/tracts/readers/trk.d.ts +10 -0
- package/dist/mesh/tracts/readers/trx.d.ts +11 -0
- package/dist/mesh/tracts/readers/tt.d.ts +17 -0
- package/dist/mesh/tracts/scalars.d.ts +8 -0
- package/dist/mesh/writers/index.d.ts +13 -0
- package/dist/mesh/writers/iwm.d.ts +2 -0
- package/dist/mesh/writers/mz3.d.ts +5 -0
- package/dist/mesh/writers/obj.d.ts +2 -0
- package/dist/mesh/writers/stl.d.ts +2 -0
- package/dist/mrs/MrsScene.d.ts +211 -0
- package/dist/niivuegpu.js +41 -0
- package/dist/niivuegpu.webgl2.js +90 -0
- package/dist/niivuegpu.webgpu.js +88 -0
- package/dist/signal/NVSignal.d.ts +39 -0
- package/dist/signal/detect.d.ts +13 -0
- package/dist/signal/mrs.d.ts +42 -0
- package/dist/signal/persistence.d.ts +26 -0
- package/dist/signal/processing.d.ts +84 -0
- package/dist/signal/readers/nii.d.ts +15 -0
- package/dist/signal/readers/tsv.d.ts +13 -0
- package/dist/signal/sidecar.d.ts +32 -0
- package/dist/view/NVAnnotation.d.ts +17 -0
- package/dist/view/NVColorbar.d.ts +35 -0
- package/dist/view/NVCrosscut.d.ts +7 -0
- package/dist/view/NVCrosshair.d.ts +20 -0
- package/dist/view/NVDrawingTexture.d.ts +10 -0
- package/dist/view/NVFont.d.ts +58 -0
- package/dist/view/NVGraph.d.ts +187 -0
- package/dist/view/NVLegend.d.ts +37 -0
- package/dist/view/NVLine.d.ts +6 -0
- package/dist/view/NVMeasurement.d.ts +14 -0
- package/dist/view/NVMeshView.d.ts +17 -0
- package/dist/view/NVOrient.d.ts +25 -0
- package/dist/view/NVPerfMarks.d.ts +80 -0
- package/dist/view/NVRenderVolumeData.d.ts +6 -0
- package/dist/view/NVRenderer.d.ts +9 -0
- package/dist/view/NVRuler.d.ts +12 -0
- package/dist/view/NVSliceLayout.d.ts +97 -0
- package/dist/view/NVUILayout.d.ts +13 -0
- package/dist/view/sliceUtils.d.ts +3 -0
- package/dist/viewport.js +162 -0
- package/dist/volume/ChunkExplode.d.ts +45 -0
- package/dist/volume/ChunkResidency.d.ts +167 -0
- package/dist/volume/ChunkVisibility.d.ts +95 -0
- package/dist/volume/NVVolume.d.ts +24 -0
- package/dist/volume/TensorProcessing.d.ts +16 -0
- package/dist/volume/chunkBudget.d.ts +20 -0
- package/dist/volume/chunking.d.ts +208 -0
- package/dist/volume/loadBridge.d.ts +10 -0
- package/dist/volume/modulation.d.ts +46 -0
- package/dist/volume/mrsi.d.ts +49 -0
- package/dist/volume/orientChunked.d.ts +77 -0
- package/dist/volume/readers/afni.d.ts +7 -0
- package/dist/volume/readers/bmp.d.ts +7 -0
- package/dist/volume/readers/ecat.d.ts +7 -0
- package/dist/volume/readers/fib.d.ts +7 -0
- package/dist/volume/readers/iwi.d.ts +7 -0
- package/dist/volume/readers/mgh.d.ts +7 -0
- package/dist/volume/readers/mha.d.ts +7 -0
- package/dist/volume/readers/mif.d.ts +7 -0
- package/dist/volume/readers/nii.d.ts +7 -0
- package/dist/volume/readers/npy.d.ts +7 -0
- package/dist/volume/readers/nrrd.d.ts +7 -0
- package/dist/volume/readers/src.d.ts +7 -0
- package/dist/volume/readers/vmr.d.ts +7 -0
- package/dist/volume/transforms/index.d.ts +90 -0
- package/dist/volume/utils.d.ts +183 -0
- package/dist/volume/writers/index.d.ts +6 -0
- package/dist/volume/writers/iwi.d.ts +3 -0
- package/dist/volume/writers/nii.d.ts +3 -0
- package/dist/wgpu/NVViewGPU.d.ts +119 -0
- package/dist/wgpu/bench.d.ts +33 -0
- package/dist/wgpu/colorbar.d.ts +40 -0
- package/dist/wgpu/crosshair.d.ts +21 -0
- package/dist/wgpu/depthPick.d.ts +27 -0
- package/dist/wgpu/font.d.ts +24 -0
- package/dist/wgpu/line.d.ts +13 -0
- package/dist/wgpu/mesh.d.ts +13 -0
- package/dist/wgpu/orient.d.ts +77 -0
- package/dist/wgpu/orientChunked.d.ts +44 -0
- package/dist/wgpu/polygon.d.ts +16 -0
- package/dist/wgpu/polygon3d.d.ts +22 -0
- package/dist/wgpu/render.d.ts +354 -0
- package/dist/wgpu/slice.d.ts +81 -0
- package/dist/wgpu/thumbnail.d.ts +17 -0
- package/dist/wgpu/volumeShaderLib.d.ts +1 -0
- package/dist/wgpu/webgpu.d.ts +3 -0
- package/dist/wgpu/wgpu.d.ts +6 -0
- package/dist/workers/NVWorker.d.ts +41 -0
- package/dist/workers/transform.worker.d.ts +12 -0
- package/dist/workers/volumeLoad.worker.d.ts +14 -0
- package/package.json +92 -106
- package/build/drawing/index.d.ts +0 -128
- package/build/drawing/index.js +0 -8919
- package/build/drawing/index.js.map +0 -1
- package/build/index.min.js +0 -1
- package/build/metafile-esm.json +0 -1
- package/build/niivue/index.d.ts +0 -3524
- package/build/niivue/index.js +0 -45515
- package/build/niivue/index.js.map +0 -1
- package/build/nvdocument-Bc0slj3Z.d.ts +0 -1938
- package/build/utils/index.d.ts +0 -29
- package/build/utils/index.js +0 -597
- package/build/utils/index.js.map +0 -1
- package/dist/index.js +0 -54270
- package/dist/index.js.map +0 -1
- package/dist/index.min.js +0 -1
- package/dist/metafile-esm.json +0 -1
- package/dist/niivue.umd.js +0 -2499
- package/src/cmaps/_itksnap.json +0 -55
- package/src/cmaps/_slicer3d.json +0 -355
- package/src/cmaps/actc.json +0 -7
- package/src/cmaps/afni_blues_inv.json +0 -9
- package/src/cmaps/afni_reds_inv.json +0 -7
- package/src/cmaps/batlow.json +0 -7
- package/src/cmaps/bcgwhw.json +0 -32
- package/src/cmaps/bcgwhw_dark.json +0 -32
- package/src/cmaps/blue.json +0 -7
- package/src/cmaps/blue2cyan.json +0 -7
- package/src/cmaps/blue2magenta.json +0 -7
- package/src/cmaps/blue2red.json +0 -7
- package/src/cmaps/bluegrn.json +0 -7
- package/src/cmaps/bone.json +0 -7
- package/src/cmaps/bronze.json +0 -7
- package/src/cmaps/cet_l17.json +0 -93
- package/src/cmaps/cividis.json +0 -7
- package/src/cmaps/cool.json +0 -7
- package/src/cmaps/copper.json +0 -7
- package/src/cmaps/copper2.json +0 -7
- package/src/cmaps/ct_airways.json +0 -9
- package/src/cmaps/ct_artery.json +0 -9
- package/src/cmaps/ct_bones.json +0 -9
- package/src/cmaps/ct_brain.json +0 -9
- package/src/cmaps/ct_brain_gray.json +0 -9
- package/src/cmaps/ct_cardiac.json +0 -9
- package/src/cmaps/ct_head.json +0 -9
- package/src/cmaps/ct_kidneys.json +0 -9
- package/src/cmaps/ct_liver.json +0 -9
- package/src/cmaps/ct_muscles.json +0 -9
- package/src/cmaps/ct_scalp.json +0 -9
- package/src/cmaps/ct_skull.json +0 -9
- package/src/cmaps/ct_soft.json +0 -9
- package/src/cmaps/ct_soft_tissue.json +0 -9
- package/src/cmaps/ct_surface.json +0 -9
- package/src/cmaps/ct_vessels.json +0 -9
- package/src/cmaps/ct_w_contrast.json +0 -9
- package/src/cmaps/cubehelix.json +0 -22
- package/src/cmaps/electric_blue.json +0 -7
- package/src/cmaps/freesurfer.json +0 -27
- package/src/cmaps/ge_color.json +0 -7
- package/src/cmaps/gold.json +0 -7
- package/src/cmaps/gray.json +0 -7
- package/src/cmaps/green.json +0 -7
- package/src/cmaps/green2cyan.json +0 -7
- package/src/cmaps/green2orange.json +0 -7
- package/src/cmaps/hot.json +0 -7
- package/src/cmaps/hotiron.json +0 -7
- package/src/cmaps/hsv.json +0 -7
- package/src/cmaps/index.ts +0 -72
- package/src/cmaps/inferno.json +0 -7
- package/src/cmaps/jet.json +0 -7
- package/src/cmaps/kry.json +0 -7
- package/src/cmaps/linspecer.json +0 -7
- package/src/cmaps/lipari.json +0 -7
- package/src/cmaps/magma.json +0 -7
- package/src/cmaps/mako.json +0 -7
- package/src/cmaps/navia.json +0 -7
- package/src/cmaps/nih.json +0 -7
- package/src/cmaps/plasma.json +0 -7
- package/src/cmaps/random.json +0 -90
- package/src/cmaps/red.json +0 -7
- package/src/cmaps/redyell.json +0 -7
- package/src/cmaps/rocket.json +0 -7
- package/src/cmaps/roi_i256.json +0 -92
- package/src/cmaps/surface.json +0 -7
- package/src/cmaps/thermal.json +0 -7
- package/src/cmaps/turbo.json +0 -7
- package/src/cmaps/violet.json +0 -7
- package/src/cmaps/viridis.json +0 -7
- package/src/cmaps/warm.json +0 -7
- package/src/cmaps/winter.json +0 -7
- package/src/cmaps/x_rain.json +0 -7
- package/src/colortables.ts +0 -289
- package/src/drawing/index.ts +0 -13
- package/src/drawing/masks.ts +0 -500
- package/src/drawing/rle.ts +0 -97
- package/src/drawing/undo.ts +0 -28
- package/src/events.ts +0 -144
- package/src/fonts/Garamond.json +0 -1491
- package/src/fonts/Garamond.png +0 -0
- package/src/fonts/GaramondBold.json +0 -1506
- package/src/fonts/GaramondBold.png +0 -0
- package/src/fonts/Roboto-Regular.json +0 -1496
- package/src/fonts/Roboto-Regular.png +0 -0
- package/src/fonts/Ubuntu.png +0 -0
- package/src/fonts/UbuntuBold.json +0 -1506
- package/src/fonts/UbuntuBold.png +0 -0
- package/src/index.html +0 -152
- package/src/index_histo.html +0 -233
- package/src/index_magic.html +0 -223
- package/src/index_zarr_viewer.html +0 -785
- package/src/logger.ts +0 -74
- package/src/matcaps/Cortex.jpg +0 -0
- package/src/matcaps/Cream.jpg +0 -0
- package/src/matcaps/Fuzzy.jpg +0 -0
- package/src/matcaps/Gold.jpg +0 -0
- package/src/matcaps/Peach.jpg +0 -0
- package/src/matcaps/Plastic.jpg +0 -0
- package/src/matcaps/Shiny.jpg +0 -0
- package/src/niivue/core/CoordinateTransform.ts +0 -700
- package/src/niivue/core/README.md +0 -122
- package/src/niivue/core/ShaderManager.ts +0 -623
- package/src/niivue/core/gl.ts +0 -358
- package/src/niivue/data/ConnectomeManager.ts +0 -178
- package/src/niivue/data/FileLoader.ts +0 -324
- package/src/niivue/data/MeshManager.ts +0 -305
- package/src/niivue/data/VolumeColormap.ts +0 -87
- package/src/niivue/data/VolumeLayerRenderer.ts +0 -590
- package/src/niivue/data/VolumeManager.ts +0 -292
- package/src/niivue/data/VolumeModulation.ts +0 -135
- package/src/niivue/data/VolumeTexture.ts +0 -203
- package/src/niivue/descriptives.ts +0 -252
- package/src/niivue/drawing/DrawingManager.ts +0 -462
- package/src/niivue/drawing/FloodFillTool.ts +0 -749
- package/src/niivue/drawing/PenTool.ts +0 -647
- package/src/niivue/drawing/ShapeTool.ts +0 -298
- package/src/niivue/index.ts +0 -12516
- package/src/niivue/interaction/DragModeManager.ts +0 -565
- package/src/niivue/interaction/DropHandler.ts +0 -255
- package/src/niivue/interaction/EventController.ts +0 -298
- package/src/niivue/interaction/KeyboardController.ts +0 -240
- package/src/niivue/interaction/MouseController.ts +0 -410
- package/src/niivue/interaction/TouchController.ts +0 -434
- package/src/niivue/interaction/WheelController.ts +0 -274
- package/src/niivue/interaction/index.ts +0 -11
- package/src/niivue/navigation/CameraController.ts +0 -129
- package/src/niivue/navigation/ClipPlaneManager.ts +0 -294
- package/src/niivue/navigation/LayoutManager.ts +0 -709
- package/src/niivue/navigation/SliceNavigation.ts +0 -482
- package/src/niivue/processing/ImageProcessing.ts +0 -1159
- package/src/niivue/rendering/MeshRenderer.ts +0 -521
- package/src/niivue/rendering/SceneRenderer.ts +0 -405
- package/src/niivue/rendering/SliceRenderer.ts +0 -450
- package/src/niivue/rendering/UIElementRenderer.ts +0 -772
- package/src/niivue/rendering/VolumeRenderer.ts +0 -554
- package/src/niivue/texture-constants.ts +0 -23
- package/src/niivue-object3D.ts +0 -382
- package/src/niivue.css +0 -105
- package/src/nvconnectome.ts +0 -454
- package/src/nvdocument.ts +0 -857
- package/src/nvimage/AffineProcessor.ts +0 -163
- package/src/nvimage/ColormapManager.ts +0 -84
- package/src/nvimage/CoordinateTransform.ts +0 -178
- package/src/nvimage/ImageDataProcessor.ts +0 -207
- package/src/nvimage/ImageFactory.ts +0 -354
- package/src/nvimage/ImageMetadata.ts +0 -82
- package/src/nvimage/ImageOrientation.ts +0 -391
- package/src/nvimage/ImageReaders/afni.ts +0 -260
- package/src/nvimage/ImageReaders/brainvoyager.ts +0 -138
- package/src/nvimage/ImageReaders/dsistudio.ts +0 -184
- package/src/nvimage/ImageReaders/ecat.ts +0 -119
- package/src/nvimage/ImageReaders/image.ts +0 -78
- package/src/nvimage/ImageReaders/index.ts +0 -22
- package/src/nvimage/ImageReaders/itk.ts +0 -163
- package/src/nvimage/ImageReaders/mgh.ts +0 -394
- package/src/nvimage/ImageReaders/mrtrix.ts +0 -323
- package/src/nvimage/ImageReaders/nii.ts +0 -56
- package/src/nvimage/ImageReaders/nrrd.ts +0 -318
- package/src/nvimage/ImageReaders/numpy.ts +0 -222
- package/src/nvimage/ImageReaders/zarr.ts +0 -93
- package/src/nvimage/ImageWriter.ts +0 -317
- package/src/nvimage/IntensityCalibration.ts +0 -280
- package/src/nvimage/RenderingUtils.ts +0 -158
- package/src/nvimage/StreamingLoader.ts +0 -143
- package/src/nvimage/TensorProcessing.ts +0 -108
- package/src/nvimage/VolumeUtils.ts +0 -331
- package/src/nvimage/ZarrProcessor.ts +0 -114
- package/src/nvimage/affineUtils.ts +0 -144
- package/src/nvimage/index.ts +0 -1399
- package/src/nvimage/utils.ts +0 -677
- package/src/nvimage/zarr/NVZarrHelper.ts +0 -1041
- package/src/nvimage/zarr/ZarrChunkCache.ts +0 -133
- package/src/nvimage/zarr/ZarrChunkClient.ts +0 -544
- package/src/nvimage/zarr/index.ts +0 -17
- package/src/nvlabel.ts +0 -106
- package/src/nvmesh-loaders.ts +0 -4043
- package/src/nvmesh-types.ts +0 -161
- package/src/nvmesh-utilities.ts +0 -454
- package/src/nvmesh.ts +0 -2084
- package/src/nvserializer.ts +0 -809
- package/src/nvutilities.ts +0 -680
- package/src/orientCube.ts +0 -32
- package/src/shader-srcs.ts +0 -2489
- package/src/shader.ts +0 -77
- package/src/types.ts +0 -294
- package/src/utils/file-utils.ts +0 -33
- package/src/utils/image-utils.ts +0 -91
- package/src/utils/index.ts +0 -5
- package/src/utils/legacy-migrate.ts +0 -408
- package/src/utils/math-utils.ts +0 -52
- package/src/utils/nice.ts +0 -27
- package/src/utils/webgl-utils.ts +0 -40
package/LICENSE
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
BSD 2-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, NiiVue
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
16
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
17
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
18
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
19
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
20
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
21
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
22
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
23
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
24
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
25
|
+
|
|
26
|
+
-------------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
Third-party acknowledgment
|
|
29
|
+
|
|
30
|
+
The magnetic resonance spectroscopy (MRS/MRSI) features in this package port
|
|
31
|
+
algorithms from fsleyes-plugin-mrs, distributed under the BSD 3-Clause License
|
|
32
|
+
(Copyright (c) 2021, William Clarke, University of Oxford. All rights reserved).
|
|
33
|
+
The upstream license is reproduced verbatim in LICENSE.fsleyes-plugin-mrs and the
|
|
34
|
+
porting provenance is documented in PORTING.md (both shipped in this package).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-2021, William Clarke, University of Oxford
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/PORTING.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Porting provenance: fsleyes-plugin-mrs -> NiiVue
|
|
2
|
+
|
|
3
|
+
NiiVue's MRS support — the core spectral math and the `MrsScene` controller —
|
|
4
|
+
ports algorithms from **fsleyes-plugin-mrs** (BSD-3-Clause, (c) 2021 William
|
|
5
|
+
Clarke, University of Oxford; co-author Vasilis Karlaftis; acks Paul McCarthy).
|
|
6
|
+
The upstream license is shipped verbatim as `LICENSE.fsleyes-plugin-mrs`.
|
|
7
|
+
|
|
8
|
+
The spectral math lives in NiiVue **core** (`packages/niivue/src/signal/processing.ts`
|
|
9
|
+
and `packages/niivue/src/volume/mrsi.ts`) so it can be shared with single-voxel
|
|
10
|
+
spectroscopy (`svs.html`); this package supplies the FSL-MRS display defaults,
|
|
11
|
+
the range-to-map tool, and the scene controller.
|
|
12
|
+
|
|
13
|
+
NiiVue follows camelCase / `NV*` naming; where it does not conflict, function
|
|
14
|
+
and constant names mirror the upstream so the port is auditable.
|
|
15
|
+
|
|
16
|
+
## Function-by-function map
|
|
17
|
+
|
|
18
|
+
| NiiVue (TypeScript) | Upstream (Python) | Notes |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `GYRO_MAG_RATIO`, `PPM_SHIFT`, `PPM_RANGE` (core `processing.ts`) | `constants.py` (`GYRO_MAG_RATIO`, `PPM_SHIFT`, `PPM_RANGE`) | dict literals ported verbatim |
|
|
21
|
+
| `ppmRefForNucleus()` (core) | `PPM_SHIFT[nucleus]` lookup | the additive ppm offset (1H = 4.65) |
|
|
22
|
+
| `halveFirstPoint()` (core) | `calcSpectrum`: `data[..., 0] *= 0.5` (`utils.py`) | first-FID-point scaling |
|
|
23
|
+
| `deriveSpectroscopySeries()` FFT+fftshift (core) | `calcSpectrum`: `np.fft.fft` then `np.fft.fftshift` (`utils.py`) | no conjugation |
|
|
24
|
+
| Hz axis `(i-half)/(nFFT*dwell)` (core) | `calcFrequencies`: `fftfreq(n, dwell)` + `fftshift` (`powerspectrumseries.py`) | dwell = `pixdim[4]` |
|
|
25
|
+
| Hz->ppm `-hz/specFreq + shift` (core) | `_set_mrs_plot_scale`: `xScale = -1/spec_freq`, `xOffset = PPM_SHIFT` (`views.py`) | display-only transform |
|
|
26
|
+
| `apodize()` (core) | `apodize`: `exp(-t/(1/broadening))`, `t = linspace(0, dwell*(N-1), N)` (`utils.py`) | exponential line-broadening |
|
|
27
|
+
| `phaseCorrection()` (core) | `phaseCorrection`: `exp(1j*2*pi*(p0/360 + freqs*p1))` (`powerspectrumseries.py`) | p0 degrees, p1 seconds (UI ms /1000) |
|
|
28
|
+
| `integratePpmBandMap()` (core) | `range_tool.draw_overlay`: apodize -> `calcSpectrum` -> `phaseCorrection` -> `sum(abs|real(spectrum[..., band]), axis=-1)` (`range_tool.py`) | per-voxel band integral |
|
|
29
|
+
| `makeMetaboliteMap()` naming `SpecSum_{lo}_{hi}` | `range_tool.draw_overlay`: `f'SpecSum_{lo:0.1f}_{hi:0.1f}'` | overlay name |
|
|
30
|
+
| transient averaging in `deriveSpectroscopySeries` / `integratePpmBandMap` | `apply_higher_dim_operations` mean branch (`utils.py`) | dims 5-7 mean reduction (index/diff deferred) |
|
|
31
|
+
|
|
32
|
+
## Reference parity values
|
|
33
|
+
|
|
34
|
+
`packages/niivue/src/signal/processing.test.ts` mirrors the upstream
|
|
35
|
+
`tests/test_utils.py` cases:
|
|
36
|
+
|
|
37
|
+
- `calcSpectrum([1,2,3,4])` -> `fftshift(fft([0.5,2,3,4]))` = `[-2.5, -2.5-2j, 9.5, -2.5+2j]`
|
|
38
|
+
- `apodize([1,2,3,4], dwell=0.1, broadening=1)` -> `[1,2,3,4] * exp(-[0,0.1,0.2,0.3])`
|
|
39
|
+
- `phaseCorrection` zero-order rotation (p0 in degrees).
|
|
40
|
+
|
|
41
|
+
## Deferred / not yet ported
|
|
42
|
+
|
|
43
|
+
- `apply_higher_dim_operations` index/difference branches and DIM_COIL SVD coil
|
|
44
|
+
combination (the demo dataset has no higher dims; only the mean branch is used).
|
|
45
|
+
- MRSI fit-results loading (`tools.py`: tree + colourscheme -> fit/baseline/
|
|
46
|
+
residual spectra and concentration/QC maps). Deferred — the demo dataset has
|
|
47
|
+
no `fsl_mrsi` results directory. When ported, the upstream restricted-`eval`
|
|
48
|
+
colourscheme heuristic will be replaced with a safe expression evaluator.
|
|
49
|
+
- Interactive Ctrl/Shift-drag phasing (`profiles.py`): the demo uses sliders.
|
package/README.md
CHANGED
|
@@ -1,14 +1,210 @@
|
|
|
1
|
-
#
|
|
1
|
+
# NiiVueGPU
|
|
2
2
|
|
|
3
|
-
NiiVue is
|
|
3
|
+
NiiVue is a tool for visualizing volumes, meshes, and tractography streamlines commonly used in neuroimaging. The original NiiVue project evolved organically, resulting in tightly coupled model, view, and controller components. This repository refactors the codebase to improve maintainability and to support emerging technologies such as WebGPU.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Getting Started
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Prerequisites
|
|
8
8
|
|
|
9
|
+
- [Bun](https://bun.sh/)
|
|
10
|
+
- A browser with WebGPU support (Chrome, Firefox). Safari works if you have a recent MacOS (version 26) or iOS. Older browsers will fall back to the WebGL2 renderer.
|
|
11
|
+
|
|
12
|
+
### Build Commands
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
bun install # Install dependencies
|
|
16
|
+
bun run dev # Hot-reload dev server
|
|
17
|
+
bun run build # Library build to ./dist (published npm package)
|
|
18
|
+
bun run deploy # Production examples-site build to ./dist (GitHub Pages)
|
|
19
|
+
bun run demo # Build examples site and serve locally
|
|
20
|
+
bun run lint # Biome check
|
|
21
|
+
bun run lint:fix # Biome auto-fix
|
|
22
|
+
bun run typecheck # TypeScript type checking (tsc --noEmit)
|
|
9
23
|
```
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
24
|
+
|
|
25
|
+
### Perf instrumentation
|
|
26
|
+
|
|
27
|
+
The renderer carries `performance.mark`/`measure` instrumentation
|
|
28
|
+
(`src/view/NVPerfMarks.ts`) gated on a single runtime flag. Consumers:
|
|
29
|
+
|
|
30
|
+
- **App code:** `nv.perf.enabled = true`, then listen for the
|
|
31
|
+
`perfFrame` event to receive `{ tag, cpuMs, submitMs, totalMs, phases }`
|
|
32
|
+
per render. Tag user-driven frames via `nv.perf.tagFrame('myAction')`
|
|
33
|
+
before mutating state.
|
|
34
|
+
- **Benchmark harness** at `examples/benchmark.html` flips the same
|
|
35
|
+
flag and reads `consumeFrameStats()` plus the `niivue:render-*`
|
|
36
|
+
PerformanceObserver entries.
|
|
37
|
+
|
|
38
|
+
When `enabled` is `false` every helper bails on its first line; cost
|
|
39
|
+
in production is one well-predicted branch per call site. See
|
|
40
|
+
`benchmarks/README.md` for the harness workflow.
|
|
41
|
+
|
|
42
|
+
### Development Workflows
|
|
43
|
+
|
|
44
|
+
- **`bun run dev`** — Runs the `demos/` pages with hot reloading. A Vite plugin intercepts `import '../dist/niivuegpu.mjs'` and redirects it to source, so demo scripts stay identical to the deployed versions but get full HMR. Asset directories in `demos/` are symlinked to `public/` on first run.
|
|
45
|
+
- **`bun run demo`** — Builds the library to `demos/dist/`, copies assets, and serves with `http-server`. Use this to test the actual built output or before deploying to GitHub Pages.
|
|
46
|
+
|
|
47
|
+
## Usage
|
|
48
|
+
|
|
49
|
+
Add a `<canvas>` to your page and attach NiiVueGPU to it:
|
|
50
|
+
|
|
51
|
+
```html
|
|
52
|
+
<canvas id="gl1"></canvas>
|
|
53
|
+
<script type="module">
|
|
54
|
+
import NiiVue from '@niivue/niivue'
|
|
55
|
+
|
|
56
|
+
const nv = new NiiVue()
|
|
57
|
+
await nv.attachToCanvas(document.getElementById('gl1'))
|
|
58
|
+
await nv.loadVolumes([{ url: '/volumes/mni152.nii.gz' }])
|
|
59
|
+
</script>
|
|
14
60
|
```
|
|
61
|
+
|
|
62
|
+
### Backend-specific distributions
|
|
63
|
+
|
|
64
|
+
By default, `@niivue/niivue` includes both backends (WebGPU + WebGL2 fallback):
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
import NiiVue from '@niivue/niivue'
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
You can also import backend-only builds to reduce package size:
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
import NiiVueWebGPU from '@niivue/niivue/webgpu' // WebGPU-only
|
|
74
|
+
import NiiVueWebGL2 from '@niivue/niivue/webgl2' // WebGL2-only
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
In backend-only builds, selecting the missing backend throws an explicit error.
|
|
78
|
+
|
|
79
|
+
### Load a mesh
|
|
80
|
+
|
|
81
|
+
```js
|
|
82
|
+
await nv.loadMeshes([{ url: '/meshes/brain.mz3' }])
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Signals (physio and spectroscopy)
|
|
86
|
+
|
|
87
|
+
Alongside spatial volumes and meshes, NiiVue can load **signals** — a third,
|
|
88
|
+
non-spatial data class shown as 2-D line plots rather than slices. Two kinds are
|
|
89
|
+
supported: `physio` (BIDS time-series TSV) and `spectroscopy` (NIfTI-MRS complex
|
|
90
|
+
FID). Sibling `.json` sidecars are fetched automatically for axis metadata
|
|
91
|
+
(sampling rate / StartTime for physio, SpectrometerFrequency / ResonantNucleus
|
|
92
|
+
for spectroscopy).
|
|
93
|
+
|
|
94
|
+
```js
|
|
95
|
+
// BIDS physio (auto-fetches the sibling .json sidecar)
|
|
96
|
+
await nv.loadSignals([{ url: '/signals/recording_physio.tsv.gz' }])
|
|
97
|
+
|
|
98
|
+
// NIfTI-MRS spectroscopy; setSignal drives the on-demand FFT + ppm windowing
|
|
99
|
+
await nv.loadSignals([{ url: '/signals/svs_se_30.nii.gz' }])
|
|
100
|
+
nv.setSignal(0, { display: { average: true, mode: 'real', ppmRange: [1.9, 3.3] } })
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
NIfTI files are routed to the signal loader when they have no spatial extent
|
|
104
|
+
(dim1-3 == 1, dim4 > 1); pass `asSignal` to override. MRS sidecar/header fields do
|
|
105
|
+
**not** affect routing — a spatial spectroscopic image (MRSI/CSI) carries them too,
|
|
106
|
+
so it stays on the volume path.
|
|
107
|
+
|
|
108
|
+
A physio signal can be associated with a 4D volume by passing `attachToId` (the
|
|
109
|
+
volume's id). The graph then shows the crosshair BOLD time-course together with
|
|
110
|
+
each physio trace at its native sampling rate on a shared time axis, clamped to
|
|
111
|
+
the imaging window; clicking the graph scrubs the volume to the nearest frame.
|
|
112
|
+
|
|
113
|
+
A dense signal graph can be panned and zoomed via on-graph buttons (the view
|
|
114
|
+
follows the cursor on wheel/frame steps) or the controller API (`graphZoom`,
|
|
115
|
+
`graphPan`); `graphLineWidth` / `graphLineAlpha` tune trace thickness and opacity
|
|
116
|
+
for overlapping series, and `graphShowVolumeTimecourse` toggles the BOLD trace.
|
|
117
|
+
Missing physio samples are left as gaps and marked with a short tick along the
|
|
118
|
+
bottom axis (the "missing-data rug").
|
|
119
|
+
|
|
120
|
+
Signals can carry **annotations** — text labels anchored to a position in the
|
|
121
|
+
graph's own data units (e.g. ppm for spectroscopy). They translate as the x-axis
|
|
122
|
+
window is panned/zoomed and are hidden when out of range. A `y` of `-Infinity` or
|
|
123
|
+
`+Infinity` pins the label to the bottom or top of the plot. Annotations render on
|
|
124
|
+
the signal graph (spectrum / physio plot); they are not currently drawn on the
|
|
125
|
+
volume+physio association time-course view.
|
|
126
|
+
|
|
127
|
+
```js
|
|
128
|
+
// Label metabolite peaks pinned to the bottom of the spectrum
|
|
129
|
+
await nv.loadSignals([{
|
|
130
|
+
url: '/signals/svs_se_30.nii.gz',
|
|
131
|
+
annotations: [
|
|
132
|
+
{ text: 'NAA', x: 2.0, y: -Infinity },
|
|
133
|
+
{ text: 'Cr', x: 3.0, y: -Infinity },
|
|
134
|
+
{ text: 'Cho', x: 3.2, y: -Infinity },
|
|
135
|
+
],
|
|
136
|
+
}])
|
|
137
|
+
nv.setSignal(0, { annotations: [/* replace the full set */] })
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
See `examples/svs.html` (spectroscopy, with NAA/Cr/Cho annotations and a scene
|
|
141
|
+
selector pairing the spectrum with the participant's T2w and an outline-shaded
|
|
142
|
+
"voxel" marker at the sampling location), `examples/physio.html` (physio), and
|
|
143
|
+
`examples/physio.bold.html` (a task-fMRI run with per-trace fMRI/respiratory/
|
|
144
|
+
cardiac toggles, on-graph pan/zoom, and a volume+physio association graph) for
|
|
145
|
+
interactive demos.
|
|
146
|
+
|
|
147
|
+
#### Spatial spectroscopic imaging (MRSI/CSI)
|
|
148
|
+
|
|
149
|
+
A complex 4-D NIfTI-MRS volume (dim1-3 = space, dim4 = FID) stays on the volume
|
|
150
|
+
path and is driven by the core `MrsScene` controller: it loads an anatomy
|
|
151
|
+
reference plus the MRSI grid, shows the crosshair-voxel spectrum (which tracks
|
|
152
|
+
the crosshair like the FSLeyes MRS plugin), and generates ppm-band metabolite
|
|
153
|
+
maps. See `examples/mrsi.html`. The spectral transforms and the `MrsScene`
|
|
154
|
+
controller are ported from
|
|
155
|
+
[fsleyes-plugin-mrs](https://git.fmrib.ox.ac.uk/fsl/fsleyes/fsleyes-plugin-mrs)
|
|
156
|
+
(BSD-3-Clause); see `PORTING.md` for the function-by-function provenance map.
|
|
157
|
+
|
|
158
|
+
### Change slice type and colormap
|
|
159
|
+
|
|
160
|
+
```js
|
|
161
|
+
nv.sliceType = 3 // 0=Axial, 1=Coronal, 2=Sagittal, 3=Multi, 4=Render
|
|
162
|
+
nv.setVolume(0, { colormap: 'hot' }) // apply colormap to first volume
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Configuration options
|
|
166
|
+
|
|
167
|
+
Pass options to the constructor to customize the viewer:
|
|
168
|
+
|
|
169
|
+
```js
|
|
170
|
+
const nv = new NiiVue({
|
|
171
|
+
isColorbarVisible: true,
|
|
172
|
+
backgroundColor: [0, 0, 0, 1],
|
|
173
|
+
clipPlaneColor: [1, 1, 1, 0.5],
|
|
174
|
+
})
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Testing
|
|
178
|
+
|
|
179
|
+
The package includes a unit test suite for non-rendering (server-side) logic using the [Bun test runner](https://bun.sh/docs/cli/test). Tests are co-located with source files as `*.test.ts`.
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
bun test # Run all tests with coverage
|
|
183
|
+
bun test src/drawing/ # Run tests in a specific directory
|
|
184
|
+
bun test --watch # Watch mode
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Coverage is enabled by default (configured in `bunfig.toml`) and outputs both a console summary and an `lcov` report to `coverage/`. Tested modules include:
|
|
188
|
+
|
|
189
|
+
- **Drawing tools** — RLE codec, pen/line/flood-fill, undo stack
|
|
190
|
+
- **Annotations** — undo/redo, point-in-polygon, slice projection, shape selection
|
|
191
|
+
- **Math/transforms** — vox↔mm conversions, spherical coordinates, slice plane equations
|
|
192
|
+
- **Volume utilities** — intensity range calculation, NIfTI header creation, voxel lookup, reorientation
|
|
193
|
+
- **Colormaps** — LUT generation, label colormap construction
|
|
194
|
+
- **Mesh I/O** — STL/OBJ writers, STL/OFF readers (roundtrip tests)
|
|
195
|
+
|
|
196
|
+
To run tests via Nx from the monorepo root:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
bunx nx test niivue
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Architecture
|
|
203
|
+
|
|
204
|
+
The codebase is written in **TypeScript** and follows an MVC pattern with dual rendering backends (WebGPU and WebGL2). See [CLAUDE.md](CLAUDE.md) for detailed architecture documentation, directory structure, code style, and module naming conventions.
|
|
205
|
+
|
|
206
|
+
### Dependencies
|
|
207
|
+
|
|
208
|
+
- [nifti-reader-js](https://github.com/rii-mango/NIFTI-Reader-JS) — NIfTI file parsing
|
|
209
|
+
- [gl-matrix](https://glmatrix.net/) — Vector/matrix math (vec3, vec4, mat3, mat4)
|
|
210
|
+
- [cbor-x](https://github.com/nicolo-ribaudo/cbor-x) — CBOR encoding/decoding for document save/load and ITK-Wasm (.iwi.cbor) format support
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { AnnotationConfig, DrawConfig, InteractionConfig, LayoutConfig, MeshRenderConfig, UIConfig, VolumeRenderConfig } from './NVTypes';
|
|
2
|
+
export declare const NUM_CLIP_PLANE = 6;
|
|
3
|
+
export declare const DEFAULT_CLIP_PLANE: readonly [0, 0, 0, 2];
|
|
4
|
+
export declare enum COLORMAP_TYPE {
|
|
5
|
+
MIN_TO_MAX = 0,
|
|
6
|
+
ZERO_TO_MAX_TRANSPARENT_BELOW_MIN = 1,
|
|
7
|
+
ZERO_TO_MAX_TRANSLUCENT_BELOW_MIN = 2
|
|
8
|
+
}
|
|
9
|
+
export declare enum DRAG_MODE {
|
|
10
|
+
none = 0,
|
|
11
|
+
contrast = 1,
|
|
12
|
+
measurement = 2,
|
|
13
|
+
pan = 3,
|
|
14
|
+
slicer3D = 4,
|
|
15
|
+
callbackOnly = 5,
|
|
16
|
+
roiSelection = 6,
|
|
17
|
+
angle = 7,
|
|
18
|
+
crosshair = 8,
|
|
19
|
+
windowing = 9
|
|
20
|
+
}
|
|
21
|
+
export declare enum SHOW_RENDER {
|
|
22
|
+
NEVER = 0,
|
|
23
|
+
ALWAYS = 1,
|
|
24
|
+
AUTO = 2
|
|
25
|
+
}
|
|
26
|
+
export declare const NiiIntentCode: Readonly<{
|
|
27
|
+
readonly NIFTI_INTENT_NONE: 0;
|
|
28
|
+
readonly NIFTI_INTENT_CORREL: 2;
|
|
29
|
+
readonly NIFTI_INTENT_TTEST: 3;
|
|
30
|
+
readonly NIFTI_INTENT_FTEST: 4;
|
|
31
|
+
readonly NIFTI_INTENT_ZSCORE: 5;
|
|
32
|
+
readonly NIFTI_INTENT_LABEL: 1002;
|
|
33
|
+
readonly NIFTI_INTENT_NEURONAMES: 1005;
|
|
34
|
+
readonly NIFTI_INTENT_RGB_VECTOR: 2003;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const NiiDataType: Readonly<{
|
|
37
|
+
readonly DT_NONE: 0;
|
|
38
|
+
readonly DT_BINARY: 1;
|
|
39
|
+
readonly DT_UINT8: 2;
|
|
40
|
+
readonly DT_INT16: 4;
|
|
41
|
+
readonly DT_INT32: 8;
|
|
42
|
+
readonly DT_FLOAT32: 16;
|
|
43
|
+
readonly DT_COMPLEX64: 32;
|
|
44
|
+
readonly DT_FLOAT64: 64;
|
|
45
|
+
readonly DT_RGB24: 128;
|
|
46
|
+
readonly DT_INT8: 256;
|
|
47
|
+
readonly DT_UINT16: 512;
|
|
48
|
+
readonly DT_UINT32: 768;
|
|
49
|
+
readonly DT_INT64: 1024;
|
|
50
|
+
readonly DT_UINT64: 1280;
|
|
51
|
+
readonly DT_FLOAT128: 1536;
|
|
52
|
+
readonly DT_COMPLEX128: 1792;
|
|
53
|
+
readonly DT_COMPLEX256: 2048;
|
|
54
|
+
readonly DT_RGBA32: 2304;
|
|
55
|
+
}>;
|
|
56
|
+
/** Check whether a volume is PAQD (Probabilistic Atlas Quad Datatype) */
|
|
57
|
+
export declare function isPaqd(hdr: {
|
|
58
|
+
intent_code: number;
|
|
59
|
+
datatypeCode: number;
|
|
60
|
+
}): boolean;
|
|
61
|
+
export declare const MULTIPLANAR_TYPE: {
|
|
62
|
+
readonly 0: "AUTO";
|
|
63
|
+
readonly 1: "COLUMN";
|
|
64
|
+
readonly 2: "GRID";
|
|
65
|
+
readonly 3: "ROW";
|
|
66
|
+
readonly AUTO: 0;
|
|
67
|
+
readonly COLUMN: 1;
|
|
68
|
+
readonly GRID: 2;
|
|
69
|
+
readonly ROW: 3;
|
|
70
|
+
};
|
|
71
|
+
export declare const SLICE_TYPE: Readonly<{
|
|
72
|
+
readonly AXIAL: 0;
|
|
73
|
+
readonly CORONAL: 1;
|
|
74
|
+
readonly SAGITTAL: 2;
|
|
75
|
+
readonly MULTIPLANAR: 3;
|
|
76
|
+
readonly RENDER: 4;
|
|
77
|
+
readonly NONE: 5;
|
|
78
|
+
}>;
|
|
79
|
+
/** Maps AXIAL→2, CORONAL→1, SAGITTAL→0 (the RAS dimension perpendicular to the slice). */
|
|
80
|
+
export declare function sliceTypeDim(sliceType: number): number;
|
|
81
|
+
export declare const LAYOUT_DEFAULTS: LayoutConfig;
|
|
82
|
+
export declare const UI_DEFAULTS: UIConfig;
|
|
83
|
+
export declare const VOLUME_DEFAULTS: VolumeRenderConfig;
|
|
84
|
+
export declare const MESH_DEFAULTS: MeshRenderConfig;
|
|
85
|
+
export declare const DRAW_DEFAULTS: DrawConfig;
|
|
86
|
+
export declare const INTERACTION_DEFAULTS: InteractionConfig;
|
|
87
|
+
export declare const ANNOTATION_DEFAULTS: AnnotationConfig;
|