niivue / niivue-vscode

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

Feature request: add overlays #4

Closed vincenzoml closed 1 year ago

vincenzoml commented 1 year ago

Would be great to be able to add overlays, that's it.

korbinian90 commented 1 year ago

I like to implement it, but it might be a bit tricky. At the moment the extension works as a "readonly editor" for a file. So currently, it gets only the input of one file.

I think I can create a custom command: "Open NiiVue Panel" and make it persistent. Clicked files could be forwarded to this panel, when it is selected. The first image would be greyscale and the second image added in opaque colormap.

Currently, the data is read from disk by vscode and sent to niivue as a buffer. This is what happens in the rendered niivue html document:

let image = new niivue.NVImage(data, uri);
nv.addVolume(image);

Is there a way to use addVolume and set a colormap?

vincenzoml commented 1 year ago

I have worked extensively with niivue a couple of years ago, so I am not totally sure to give the best answer here, but for setting the colour I'd look at the source code of https://niivue.github.io/niivue/features/colormaps.html

korbinian90 commented 1 year ago

update v0.2.0