# Get Module Panel on Jupyter Notebook

**URL:** <https://discourse.slicer.org/t/get-module-panel-on-jupyter-notebook/23287>\
**Category:** Development\
**Tags:** segmentation, python\
**Created:** [May 5, 2022, 1:27pm UTC](https://discourse.slicer.org/t/get-module-panel-on-jupyter-notebook/23287 "2022-05-05T13:27:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiago\_Guiomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tiago_guiomar/32/14736_2.png) [@Tiago\_Guiomar](https://discourse.slicer.org/u/Tiago_Guiomar)\
**Post date:** [May 5, 2022, 1:27pm UTC](https://discourse.slicer.org/t/get-module-panel-on-jupyter-notebook/23287/1 "2022-05-05T13:27:37Z")

</div>

I’m doing a small project using 3DSlicer and jupyter notebook and I needed some help with the GUI. I’m using some script I got and it ain’t work. I was wondering if there’s any way I get all the GUI on jupyter notebook so I can segment inside the notebook and not having to go to 3DSlicer to do the segmentation.

I have this code:

```auto
# Only available if jupyter desktop server is configured.
# "404 : Not Found" error is displayed if Jupyter desktop server is not configured,
# in that case, switch to the application window if Slicer is running locally.
app = slicernb.AppWindow(contents="full", windowScale=1)

slicer.util.selectModule("SegmentEditor")
segmentEditorWidget = slicer.modules.segmenteditor.widgetRepresentation().self().editor
segmentEditorNode = segmentEditorWidget.mrmlSegmentEditorNode()
segmentationNode=slicer.mrmlScene.AddNewNodeByClass("vtkMRMLSegmentationNode")
segmentEditorWidget.setSegmentationNode(segmentationNode)
segmentEditorWidget.setMasterVolumeNode(volumeNode)

display(app)

```

---

<div class="post-metadata">

**Author:** ![Tiago\_Guiomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tiago_guiomar/32/14736_2.png) [@Tiago\_Guiomar](https://discourse.slicer.org/u/Tiago_Guiomar)\
**Post date:** [May 5, 2022, 1:30pm UTC](https://discourse.slicer.org/t/get-module-panel-on-jupyter-notebook/23287/2 "2022-05-05T13:30:10Z")

</div>

I was assuming (contents=“full”) would solve it but it just opens a new slicer tab and won’t run on my notebook.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 6, 2022, 1:06am UTC](https://discourse.slicer.org/t/get-module-panel-on-jupyter-notebook/23287/3 "2022-05-06T01:06:40Z")

</div>

Do you use the [slicer-notebook docker image](https://github.com/Slicer/SlicerDocker/blob/master/README.rst#usage-of-slicer-notebook-image) or you just run Slicer directly on your computer?

---

<div class="post-metadata">

**Author:** ![Tiago\_Guiomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tiago_guiomar/32/14736_2.png) [@Tiago\_Guiomar](https://discourse.slicer.org/u/Tiago_Guiomar)\
**Post date:** [May 10, 2022, 1:37pm UTC](https://discourse.slicer.org/t/get-module-panel-on-jupyter-notebook/23287/4 "2022-05-10T13:37:28Z")

</div>

I just use it on my computer

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 10, 2022, 11:16pm UTC](https://discourse.slicer.org/t/get-module-panel-on-jupyter-notebook/23287/5 "2022-05-10T23:16:28Z")

</div>

`slicernb.AppWindow` offers GUI access to the Slicer application when Slicer runs on a remote server or within a docker container. If you run Slicer locally then remote desktop access is not necessary but you can just split your screen between the notebook and Slicer. You can still include views into your notebook various ways - see all the other examples above `AppWindow` examples.

---

<div class="post-metadata">

**Author:** ![Tiago\_Guiomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tiago_guiomar/32/14736_2.png) [@Tiago\_Guiomar](https://discourse.slicer.org/u/Tiago_Guiomar)\
**Post date:** [May 11, 2022, 12:00pm UTC](https://discourse.slicer.org/t/get-module-panel-on-jupyter-notebook/23287/6 "2022-05-11T12:00:42Z")

</div>

I would like to do the segmentation inside the notebook and not having to go to slicer, just to make it faster and all in one place,  
I’ll check slicernb.AppWindow.  
Thank you.

---

<div class="post-metadata">

**Author:** ![Tiago\_Guiomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tiago_guiomar/32/14736_2.png) [@Tiago\_Guiomar](https://discourse.slicer.org/u/Tiago_Guiomar)\
**Post date:** [May 11, 2022, 3:54pm UTC](https://discourse.slicer.org/t/get-module-panel-on-jupyter-notebook/23287/7 "2022-05-11T15:54:04Z")

</div>

I’ve been searching all around and I can’t find any documentation on `slicernb.AppWindow`. Where can I find it?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 11, 2022, 8:03pm UTC](https://discourse.slicer.org/t/get-module-panel-on-jupyter-notebook/23287/8 "2022-05-11T20:03:14Z")

</div>

`JupyterNotebooksLib` is a tiny set of convenience classes. We haven’t set up a readthedocs site for it,. You can type the classname and press Shift-Tab for documentation:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/d/bd5303ad683db7a94dab15e521096945ecfdb839.png)

You can also browse the documented source code here: [SlicerJupyter/JupyterNotebooks/JupyterNotebooksLib/widgets.py at master · Slicer/SlicerJupyter · GitHub](https://github.com/Slicer/SlicerJupyter/blob/master/JupyterNotebooks/JupyterNotebooksLib/widgets.py#L145)

If anything is not clear or incomplete then feel free to ask here. If you figure out something or your questions are answered then it would be great if you could send pull requests with your suggested changes to the documentation.

---

<div class="post-metadata">

**Author:** ![Tiago\_Guiomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tiago_guiomar/32/14736_2.png) [@Tiago\_Guiomar](https://discourse.slicer.org/u/Tiago_Guiomar)\
**Post date:** [May 12, 2022, 2:20pm UTC](https://discourse.slicer.org/t/get-module-panel-on-jupyter-notebook/23287/9 "2022-05-12T14:20:32Z")

</div>

Thank you for the information, really helped me out. I just have one more question, how can I setup my jupyter desktop server? I’m doing this project with a professor, he never heard about this and we can’t seem to find a solution.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 13, 2022, 2:14pm UTC](https://discourse.slicer.org/t/get-module-panel-on-jupyter-notebook/23287/10 "2022-06-13T14:14:43Z")

</div>

The simplest way to get `slicernb.AppWindow` command to work is to run Slicer in a docker container.
