niivue / niivue-vscode

NiiVue extension for vscode + standalone web app
https://niivue.github.io/niivue-vscode/
MIT License
24 stars 7 forks source link

NiiVue VSCode README

WebGL 2.0 medical image viewer
This extension uses NiiVue to display images selected in VSCode.

VS Code version

The VS Code extension is published on the VS Code marketplace and can be installed via the extension tab in VS Code, searching for niivue

Browser version

The web version can be installed as a local app with file associations (only supported in Chrome)

Development

Currently my time that I can spend on this project is quite limited. I'm very happy for contributions in the form of pull requests.
Otherwise, if you would like to see a certain feature implemented, please let me know so I can prioritize the development. Either create a new issue or comment/react on an existing issue.

VS Code screenshots

Default View when opening an image Comparing multiple images

List of Hotkeys

Features

Supported Formats

NiiVue can open several formats popular with brain imaging:

If niivue-vscode fails to open any of these files, please create an issue.

Developing this extension in VSCode

Installing

    npm install --global yarn
    yarn install:all

It might be required to update node first before running 'yarn install'. This can be done with the following:

    npm install --global n
    n latest

Hot Reload Development in browser

    yarn start:webview

Debugging the extension in vscode

This requires a full compilation and is slow

    yarn watch:webview

Playwright Tests

The playwright tests are for the niivue webview. Install the vscode extension Playwright Test for VSCode. Open the command line and execute

    yarn start:webview

Open the vscode test interface and run the tests. New tests can be added under niivue/tests

Test in the web version of vscode

    yarn esbuild
    yarn open-in-browser

Publishing

First publish to vscode marketplace, this automatically increments the version number and creates a git commit

    vsce publish patch|minor|major [--pre-release]    

Then publish to openVSX marketplace

    npx ovsx publish --pat <openVSX access key>