All Projects → niivue → niivue

niivue / niivue

Licence: BSD-2-Clause license
a WebGL2 based NIFTI volume viewer

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to niivue

Jquery Viewer
A jQuery plugin wrapper for Viewer.js.
Stars: ✭ 235 (+179.76%)
Mutual labels:  viewer
sahti
Write a WebGL 2 command, use it like a component.
Stars: ✭ 12 (-85.71%)
Mutual labels:  webgl2
3D-GuidedGradCAM-for-Medical-Imaging
This Repo containes the implemnetation of generating Guided-GradCAM for 3D medical Imaging using Nifti file in tensorflow 2.0. Different input files can be used in that case need to edit the input to the Guided-gradCAM model.
Stars: ✭ 60 (-28.57%)
Mutual labels:  nifti
Quick Picture Viewer
🖼️ Lightweight, versatile desktop image viewer for Windows. The best replacement for the default Windows photo viewer.
Stars: ✭ 237 (+182.14%)
Mutual labels:  viewer
viewer
🖼 Simple file viewer with slideshow for media
Stars: ✭ 68 (-19.05%)
Mutual labels:  viewer
rPBR
Physically based rendering (PBR) for raylib
Stars: ✭ 72 (-14.29%)
Mutual labels:  viewer
Edi
Edi - The open source text editor IDE based on AvalonDock and AvalonEdit
Stars: ✭ 220 (+161.9%)
Mutual labels:  viewer
pointcloud viewer
No description or website provided.
Stars: ✭ 16 (-80.95%)
Mutual labels:  viewer
viewer-javascript-extract.spreadsheet
Extract Revit Properties into Excel: This sample uses Model Derivative API endpoints to read a Revit project properties and create a XLSX Excel file with one sheet for each type/category with all objects on it
Stars: ✭ 35 (-58.33%)
Mutual labels:  viewer
fluid-earth
Fluid Earth is a WebGL-powered visualization of Earth's atmosphere and oceans
Stars: ✭ 75 (-10.71%)
Mutual labels:  webgl2
Vscode Data Preview
Data Preview 🈸 extension for importing 📤 viewing 🔎 slicing 🔪 dicing 🎲 charting 📊 & exporting 📥 large JSON array/config, YAML, Apache Arrow, Avro, Parquet & Excel data files
Stars: ✭ 245 (+191.67%)
Mutual labels:  viewer
vim-webgl-viewer
An easy to use online 3D model viewer based on Three.JS.
Stars: ✭ 41 (-51.19%)
Mutual labels:  viewer
Light-Propagation-Volumes
Implementation of Crytek's Light Propagation Volumes algorithm in WebGL
Stars: ✭ 47 (-44.05%)
Mutual labels:  webgl2
Graphql Rover
🚀 GraphQL + Vue.js + D3.js schema viewer, powered by introspection.
Stars: ✭ 239 (+184.52%)
Mutual labels:  viewer
resimulated
1st place at Revision 2020 (PC 64K Intro)
Stars: ✭ 18 (-78.57%)
Mutual labels:  webgl2
Bootstrap Listr
Beautiful, responsive directory listings built upon Bootstrap
Stars: ✭ 231 (+175%)
Mutual labels:  viewer
ts3admin.class
The ts3admin.class is a powerful api for communication with Teamspeak 3 Servers from your website! Your creativity knows no bounds!
Stars: ✭ 107 (+27.38%)
Mutual labels:  viewer
react-viewer
Online EPUB/Comics viewer
Stars: ✭ 52 (-38.1%)
Mutual labels:  viewer
glNoise
A collection of GLSL noise functions for use with WebGL with an easy to use API.
Stars: ✭ 185 (+120.24%)
Mutual labels:  webgl2
goobi-viewer-core
Goobi viewer - Presentation software for digital libraries, museums, archives and galleries. Open Source.
Stars: ✭ 18 (-78.57%)
Mutual labels:  viewer

NiiVue

NiiVue is a WebGL 2.0 medical image viewer. This repository contains the core NiiVue package. We have additional projects under development that will demonstrate a web-based user interface implementation, and a desktop application built using web technologies.

NiiVue allows developers to create interactive web pages for visualizing nifti and other formats popular in neuroimaging. NiiVue includes many mouse and keyboard interactions that enable browsing and manipulating images displayed in the canvas. This core package does not include a comprehensive user interface outside of the canvas (e.g. buttons, and other widgets). However, developers who wish to build custom user interfaces around the NiiVue canvas can manipulate the rendered images and change settings via the API. Our UI wrapper demonstrates how the modular core NiiVue can be embedded into a rich user interface.

Getting started Docs and References

click here to go to the docs web page

Install NiiVue using npm

Installs without the bloat of the development dependencies or testing frameworks

npm install --only=prod @niivue/niivue

Overview/Mission

NiiVue brings the features of the widely used native desktop applications (AFNI, FSLeyes, MRIcroGL, Surfice, SUMA) to the web. The developers of these tools developed NiiVue in collaboration, allowing us to benefit from collective wisdom. This will enable other researchers and developers to build cloud-based medical imaging tools with a powerful viewer that can operate on any device (desktop, tablet, mobile).

Projects and People using NiiVue

Live View

We host many NiiVue examples via github pages. These are updated and deployed automatically. All live views reflect the capabilities of the NiiVue version in the main branch.

See the examples here

Requirements for NiiVue to work

Usage

Pure HTML

While NiiVue can be wrapped with frameworks (VueJS, React, Angular), you can also embed it directly into HTML web pages. Here is a minimal example:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>NiiVue</title>
  </head>
  <body>
    <canvas id="gl"></canvas>
  </body>
<script src="https://unpkg.com/@niivue/[email protected]/dist/niivue.umd.js"></script>
<script>
 var volumeList = [{url: "https://niivue.github.io/niivue-demo-images/mni152.nii.gz"}]
 var nv = new niivue.Niivue()
 nv.attachTo('gl') 
 nv.loadVolumes(volumeList)
</script>
</html>

VueJS example

install: npm i @niivue/niivue

<script>
import {Niivue} from '@niivue/niivue'
const nv = new Niivue()


export default {
  name: 'App',
  props: {

  },
  data(){
    return {
      volumeList: [
        {
          url: "./mni152.nii.gz",
        }
      ]

    }
  },

  mounted() {

    nv.attachTo('gl')
    nv.loadVolumes(this.volumeList) 
  }
}

</script>

<template>
<canvas id="gl" height="480" width="640">

</canvas>
</template>

React example

install: npm i @niivue/niivue

import { useRef, useEffect } from 'react'
import { Niivue } from '@niivue/niivue'

const NiiVue = ({ imageUrl }) => {
  const canvas = useRef()
  useEffect(() => {
    const volumeList = [
      {
        url: imageUrl,
      },
    ]
    const nv = new Niivue()
    nv.attachToCanvas(canvas.current)
    nv.loadVolumes(volumeList)
  }, [imageUrl])

  return (
    <canvas ref={canvas} height={480} width={640} />
  )
}

// use as: <NiiVue imageUrl={someUrl}> </NiiVue>

Angular example

Check our Angular TypeScript development notes for instructions on building an Angular App with Niivue.

install: npm i @niivue/niivue

import { Component, OnInit,  ViewChild} from '@angular/core';

import {Niivue} from '@niivue/niivue';

@Component({
  selector: 'app-niivue-view',
  templateUrl: './niivue-view.component.html',
  styleUrls: ['./niivue-view.component.sass']
})
export class NiivueViewComponent implements OnInit {
  @ViewChild('gl') canvas:HTMLCanvasElement|undefined;

  constructor() { }

  ngOnInit(): void {
    const url = '/assets/mni152.nii.gz';
    const volumeList = [
    {
      url,
    },
  ]
    const niivue = new Niivue();
    niivue.attachTo('gl');
    niivue.loadVolumes(volumeList);
  }
  
}

Core Libraries

Funding

  • 2021-2022
    • P50 DC014664/DC/NIDCD NIH HHS/United States

Supported Formats

NiiVue can open several formats popular with brain imaging:

Alternatives

There are several open source JavaScript NIfTI viewers. What makes NiiVue unique is how it leverages the shaders functions and 3D textures introduced with WebGL 2.0. The minimal design makes it easy to integrate with existing web pages quickly in order to build powerful web-based viewers and support cloud-based analysis pipelines. Unlike many alternatives, NiiVue does not use three.js. This means the screen is only refreshed when needed (preserving battery life and helping your computer do other tasks). On the other hand, NiiVue does not have access to the three.js user interface widgets, requiring developers to create their own custom widgets (e.g. using VueJS, React, Angular or pure HTML). Since there are numerous free alternatives, you can choose the optimal tool for your task. Francesco Giorlando describes some of the differences between different tools.

Tool Live Demos
AMI live demo
BioImage Suite Web Project live demo
BrainBrowser live demo
nifti-drop live demo
Papaya live demo
VTK.js live demo
slicedrop live demo

Development

All NiiVue development is public on GitHub. The main branch represents the most current state of NiiVue.

NiiVue is currently in a state of rapid development until we get to version 1.0.0. Therefore, it may be a good idea to check back frequently if you are developing software that relies on NiiVue. NiiVue releases starting with 0 should be considered beta software.

Note: All PRs from a fork or feature branch to main will require the automated github actions test suite to pass.

Install NiiVue into your project via NPM

Each version of NiiVue is published to NPM

https://www.npmjs.com/package/@niivue/niivue

Do the following to install NiiVue as a dependency in your project

npm install --save-dev @niivue/niivue

Local Development

Make sure you have nodejs and npm installed.

git clone [email protected]:niivue/niivue.git
cd niivue
npm install
npm run dev

Launch included demos

Launching the demos will format, build, and serve niivue demo pages. Open the demo URL in your browser to view the demo web pages. You can find the demo URL in your terminal after running npm run demo. The demos are intentionally simple, and each canvas showcases different NiiVue features.

When viewing the demos during development, be sure to shift + click the refresh button in your browser in order to avoid using cached versions of files.

On macOS and Linux

npm run demo

On Windows

npm run demo-win

Build NiiVue

Building NiiVue will format, build, and copy the bundled niivue.js to the tests and demos folders.

on macOS and Linux

npm run build

on Windows

npm run build-win

Versioning

NiiVue uses semantic versioning.

To update the version run:

npm version patch # options are: major | minor | patch

Run unit tests

Running the tests will format, build, and copy the bundled niivue.js to the tests and demos folders, then automatically begin the test suite.

on macOS and Linux

If using macOS with Apple Silicon add this to your .zshrc (if zsh). Also ensure Chrome is installed at that location:

export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
export PUPPETEER_EXECUTABLE_PATH=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
npm install
npm run test

on Windows

npm run test-win

Running a specific test

npm run test -- -t 'test string'
# on windows use npm run test-win

Creating fonts

{ echo "data:image/png;base64,"; openssl enc -base64 -in fnt.png; } > fnt.txt

# then copy the contents of fnt.txt to the font string in src/fnt.js

Contributing

Contributions to NiiVue are encouraged and welcomed. Feel free to update documentation, add features, fix bugs, or just ask questions on the issue board.

Using Issues

All contributions should start as a new issue on the NiiVue issue board.

By starting a new issue for everything we ping everyone watching the project at the same time, and therefore alerting them to the feature, bug, or question. It also gives everyone a change to comment on new posts.

Things to consider

When adding features please keep in mind that we want NiiVue to work on all devices that support WebGL 2.0 (laptops, desktops, tablets, and phones). Therefore, please do your best to test features on as many devices as you have access to.

When testing locally from other devices you can navigate to your development computer's local IP address (assuming your phone and computer are on the same local network) at the port specified in the URL you see when running npm run demo.

Adding tests

NiiVue relies on Jest

If you add a feature, or fix a bug please try to add a test for it. You can find tests in the tests folder within the niivue project. There are numerous existing tests, so you can probably use one of those as a template. Generally, a test is contained with an it('test name') block in the tests/test.niivue.js file.

Some tests generate screenshots of the WebGL canvas in order to compare renderings to previous snapshots. Please have a look at the current tests in order to see how you can add this to your new tests if needed.

Automated CI/CD

We rely heavily on GitHub's actions to automate testing and checks.

These automated tests only test in a Linux desktop environment. So do please try to visually check that things work on other devices like tablets and phones when needed.

Each PR to the main branch must pass the automated checks, and must be reviewed and signed off by at least one other person.

If all checks and tests pass then PRs will be merged into main.

You can edit a feature branch as many times as needed to fix broken tests in order to get them passing and merged into main.

Protected branches

The main branch is protected. This means that no one can commit to main directly. All edits must be merged in from forks or feature branches.

Making colormap loader

cd src/cmaps

for f in ls *.json; do echo "export { default as `basename $f .json` } from './$f';" >> index.js; done;

macOS kill test server if kept alive because of failing tests

sudo lsof -iTCP -sTCP:LISTEN -n -P | grep 8888 # 8888 is the test server used by jest

# the process id is the second column in the result

kill <pid> # kill the node process running the server if needed (when tests fail locally)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].