Skip to content

niivue/jupyter-notebooks

Repository files navigation

niivue-binder

ipyniivue provides interactive visualization of medical volumes, meshes, streamlines, and connectomes in Jupyter. This repository includes recipes for ipyniivue that can be run on the cloud using binder or locally from a jupyter notebook. See the ipyniivue documentation for more features.

Usage: binder

Open the live demos with a web browser using binder. This is a zero-footprint solution: no files are downloaded to your computer. However, it does tend to be slow.

Binder

Usage: Colab

You can also paste notebook scripts into Google Colab. You will want to make sure to clone the repository and install the requirements. While this is less elegant than binder, the performance is typically better. Here is a basic example:

!git clone https://github.com/niivue/jupyter-notebooks
%cd niivue-binder
!pip install -q -r requirements.txt

#copy and paste a notebook, e.g. basic.ipynb

from ipyniivue import NiiVue

nv = NiiVue()
nv.load_volumes([{'path': './images/mni152.nii.gz'}])
nv

Usage: Local

You can work locally, and this typically provides optimal performance. However, this does require considerable disk space:

git clone https://github.com/niivue/jupyter-notebooks
cd jupyter-notebooks
pip install -r requirements.txt
jupyter lab ./notebooks/basic.ipynb
# press the 'run' button for the basic.ipynb notebook

Alternatively, you can install in a Python environment, to isolate it from other dependencies.

git clone https://github.com/niivue/jupyter-notebooks
cd jupyter-notebooks
conda env create -n ipyniivue -f environment.yml
conda activate ipyniivue
jupyter lab ./notebooks/basic.ipynb

Development

Setup

git clone https://github.com/niivue/jupyter-notebooks
cd jupyter-notebooks
pip install -r requirements-dev.txt
pre-commit install

Code Quality

Pre-commit hooks automate code style and strip notebook outputs and metadata for cleaner commits. They run upon committing changes or manually with:

pre-commit run --all-files

About

Neuroimaging visualizations using ipyniivue inside jupyter notebooks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published