A Jupyter Widget for Niivue based on anywidget.
pip install ipyniivue_experimental
In a Jupyter environment:
from ipyniivue_experimental import AnyNiivue
nv = AnyNiivue()
nv.load_volumes([{"path": "images/mni152.nii.gz"}])
nv
See the basic demo to learn more.
This is an anywidget project. To get started create a virtual Python environment and install the necessary development dependencies.
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
Then, install JS dependencies with npm
and run the dev server.
npm install
npm run dev
You can now start VS Code or JupyterLab to develop the widget. When finished, stop the JS development server.
NOTE: In order to have anywidget automatically apply changes as you work, make sure to
export ANYWIDGET_HMR=1
environment variable.
Change to traitlet approach
Adding functions load_volumes, load_meshes, set_opacity, set_crosshair_width and set_crosshair_color.
Setting up the project