Skip to content

Commit ff67671

Browse files
authored
Added instructions for enabling notebook extension
1 parent 56dc86d commit ff67671

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,8 @@ When you click on the link, Binder launches 3D Slicer with SlicerJupyter extensi
1919

2020
### Setup
2121

22-
* Install Python and Jupyter notebook
23-
* Install [Anaconda](https://www.anaconda.com/products/individual) (recommended) or any other Python distribution (see installation instructions [here](http://jupyter.org/install))
24-
* You can choose any Python version and any bitness (Python 3, 64-bit is recommended)
25-
* Adding Python to your PATH environment variable or registering as default Python is not required
2622
* Install [3D Slicer](https://download.slicer.org/), start it, and install SlicerJupyter extension in its Extension Manager, restart 3D Slicer
27-
* Install Python packages in 3D Slicer's Python console by copy-pasting these lines:
23+
* Install Python packages **in 3D Slicer's Python console** by copy-pasting these lines:
2824
```
2925
import os
3026
if os.name=='nt':
@@ -35,18 +31,29 @@ else:
3531
pip_install('--upgrade pillow --force-reinstall')
3632
pip_install("ipywidgets pandas ipyevents ipycanvas")
3733
```
38-
* Install Slicer jupyter kernel
39-
* Switch to JupyterKernel module in 3D Slicer
40-
* Click "Copy command to clipboard" to copy the kernel installation command to the clipboard
41-
* Start a command prompt in the Python environment where Jupyter is installed, and paste and run the kernel installation command
42-
* Install Python packages for dynamic Slicer views display by running these command in the installed Python environment: `python -m pip install jupyter ipywidgets pandas ipycanvas ipyevents`. For Jupyter lab, run these additional commands:
34+
* Install a Python distribution and Jupyter
35+
* Install [Anaconda](https://www.anaconda.com/products/individual) (recommended) or any other Python distribution (see installation instructions [here](http://jupyter.org/install))
36+
* You can choose any Python version and any bitness (Python 3, 64-bit is recommended)
37+
* Adding Python to your PATH environment variable or registering as default Python is not required
38+
* Start a command prompt in the Python environment
39+
* Install widget support by running these commands in the Python command prompt:
40+
```
41+
python -m pip install jupyter ipywidgets pandas ipycanvas ipyevents
42+
jupyter nbextension enable --py widgetsnbextension
43+
jupyter nbextension enable --py ipyevents
44+
```
45+
* For Jupyter lab, run these additional commands:
4346
```
4447
conda install -c conda-forge nodejs
4548
pip install ipywidgets ipyevents ipycanvas
4649
jupyter labextension install @jupyter-widgets/jupyterlab-manager
4750
jupyter labextension install @jupyter-widgets/jupyterlab-manager ipycanvas
4851
jupyter labextension install @jupyter-widgets/jupyterlab-manager ipyevents
4952
```
53+
* Install Slicer kernel in the Python command prompt:
54+
* Switch to JupyterKernel module in 3D Slicer
55+
* Click "Copy command to clipboard" to copy the kernel installation command to the clipboard
56+
* Paste the command in the Python command prompt (not in Slicer's Python console)
5057
* Start Jupyter notebook. For example, by runnning _jupyter-notebook_ executable.
5158

5259
See video of installation steps using Anaconda here:

0 commit comments

Comments
 (0)