# itkwidgets & jupyterlab

**URL:** https://discourse.itk.org/t/itkwidgets-jupyterlab/5384
**Category:** Uncategorized
**Tags:** itkwidgets
**Created:** [September 30, 2022, 8:58am UTC](https://discourse.itk.org/t/itkwidgets-jupyterlab/5384 "2022-09-30T08:58:48Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![martin.genet](https://discourse.itk.org/user_avatar/discourse.itk.org/martin.genet/32/2960_2.png) [@martin.genet](https://discourse.itk.org/u/martin.genet)
#### Post date: [September 30, 2022, 8:58am UTC](https://discourse.itk.org/t/itkwidgets-jupyterlab/5384/1 "2022-09-30T08:58:48Z")

</div>

Hello,

Trying to get itkwidgets to run within Jupyter Lab. I am running JupyterLab 3.4.7, itk 5.3rc04.post3, itkwidgets 1.0a12, everything installed smoothly, but when I try running the example notebooks, I am only getting `<itkwidgets.viewer.Viewer at 0x7f94c314b5e0>` result to the `view` commands, but no actual visualization window:

 ![Screenshot 2022-09-30 at 10.54.35](https://discourse.itk.org/uploads/default/original/2X/6/64f8f17d905ba239263a2200a40a048677ee0939.png)  
I don’t see the ImJoy button so I am guessing something went wrong. Any idea?

I also tried to run them in Jupyter Notebook. Basic examples work fine, though the `vtkPointSetData` example gives me similar problems:

 ![Screenshot 2022-09-30 at 10.51.31](https://discourse.itk.org/uploads/default/original/2X/0/0df63d22b3eafe404fc6024637f385882247f5d5.png)

And on my own examples, sometimes I get an error:

 ![Screenshot 2022-09-30 at 10.48.47](https://discourse.itk.org/uploads/default/original/2X/3/330d70018d1fdc439a0ff6509c1c92a4e5a31fcb.jpeg)

Or a gray window:

 ![Screenshot 2022-09-30 at 10.50.38](https://discourse.itk.org/uploads/default/original/2X/d/dee2f5399cfbb03686c8e9b163cbc831f511e0c0.png)

I hope I can solve this issue quickly, as I use this in a class starting very soon! Thanks in advance for any help.

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [September 30, 2022, 6:59pm UTC](https://discourse.itk.org/t/itkwidgets-jupyterlab/5384/2 "2022-09-30T18:59:33Z")

</div>

> [@martin.genet](#):
>
> I don’t see the ImJoy button so I am guessing something went wrong. Any idea?

Hi @martin.genet , when installing, was the `lab` extra option added, i.e.

```auto
pip install --upgrade --pre 'itkwidgets[lab]'

```

?

---

<div class="post-metadata">

### Author: ![martin.genet](https://discourse.itk.org/user_avatar/discourse.itk.org/martin.genet/32/2960_2.png) [@martin.genet](https://discourse.itk.org/u/martin.genet)
#### Post date: [October 3, 2022, 7:42am UTC](https://discourse.itk.org/t/itkwidgets-jupyterlab/5384/3 "2022-10-03T07:42:55Z")

</div>

I though so but now I am in doubt, as I uninstalled + reinstalled and it works. Thank you!

For the second point, I guess it is due to geometries being not yet supported, cf. [Unable to visualize unstructured grid · Issue #520 · InsightSoftwareConsortium/itkwidgets · GitHub](https://github.com/InsightSoftwareConsortium/itkwidgets/issues/520#issuecomment-1241979144). Any idea when it might come? I would need it for a class in three weeks.

Thanks again!

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [October 7, 2022, 6:37pm UTC](https://discourse.itk.org/t/itkwidgets-jupyterlab/5384/4 "2022-10-07T18:37:03Z")

</div>

Hi @martin.genet ,

Great to hear about your success!

The geometries support is expected very roughly in 2 months.

- Matt

---

<div class="post-metadata">

### Author: ![constantine](https://discourse.itk.org/user_avatar/discourse.itk.org/constantine/32/3915_2.png) [@constantine](https://discourse.itk.org/u/constantine)
#### Post date: [February 19, 2024, 1:56am UTC](https://discourse.itk.org/t/itkwidgets-jupyterlab/5384/5 "2024-02-19T01:56:18Z")

</div>

Hello clever people!

I have just installed itkwidgets as per instructions ([https://itkwidgets.readthedocs.io/en/latest/quick\_start\_guide.html](https://itkwidgets.readthedocs.io/en/latest/quick_start_guide.html)) on Windows and there’s a similar issue, where upon the call to display an image like this:

```auto
import itk
from itkwidgets import view
image = itk.imread('Lat_Bisection.nrrd', itk.ctype('float'))
view(image)

```

I get “The connection was reset” error:

 ![image](https://discourse.itk.org/uploads/default/original/2X/4/410aeb45cf90f73f0cf2f41d6a73a766460996db.png)

with the following errors coming up in the dev tools console:

 ![image](https://discourse.itk.org/uploads/default/original/2X/0/02d72898d22be253fd7512ce3fcd3d921e275428.png)

while other cells in this notebook work fine.

Any suggestions how to go about it?

The same sort of setup works on Ubuntu, although quite sloooooooow to respond, which is another matter all together.

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [February 19, 2024, 2:50pm UTC](https://discourse.itk.org/t/itkwidgets-jupyterlab/5384/6 "2024-02-19T14:50:38Z")

</div>

Hi @constantine ,

Is this with the latest version, `1.0a48`?

---

<div class="post-metadata">

### Author: ![constantine](https://discourse.itk.org/user_avatar/discourse.itk.org/constantine/32/3915_2.png) [@constantine](https://discourse.itk.org/u/constantine)
#### Post date: [February 19, 2024, 11:14pm UTC](https://discourse.itk.org/t/itkwidgets-jupyterlab/5384/7 "2024-02-19T23:14:29Z")

</div>

Affirmative.

![image](https://discourse.itk.org/uploads/default/original/2X/5/5de51f34fd33dc3db8e228342d3ab86f16117ee1.png)

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [February 20, 2024, 3:20am UTC](https://discourse.itk.org/t/itkwidgets-jupyterlab/5384/8 "2024-02-20T03:20:56Z")

</div>

Do all the checks pass in the [itkwidgets EnvironmentChecks](https://github.com/InsightSoftwareConsortium/itkwidgets/blob/main/examples/EnvironmentCheck.ipynb) notebook?

---

<div class="post-metadata">

### Author: ![constantine](https://discourse.itk.org/user_avatar/discourse.itk.org/constantine/32/3915_2.png) [@constantine](https://discourse.itk.org/u/constantine)
#### Post date: [February 22, 2024, 12:43am UTC](https://discourse.itk.org/t/itkwidgets-jupyterlab/5384/9 "2024-02-22T00:43:30Z")

</div>

Thank you for keeping up with this, @matt.mccormick!

There are a lot of requirements listed in that itkwidgets EnvironmentChecks notebook:

```auto
    "itkwidgets[all]>=1.0a24",
    "imjoy-elfinder",
    "imjoy-jupyter-extension",
    "imjoy-jupyterlab-extension",
    "itk",
    "monai[nibabel, matplotlib, tqdm]",
    "imageio",
    "pyvista",
    "dask[diagnostics]",
    "toolz",
    "scikit-image",
    "pooch",
    "matplotlib",
    "tqdm",
    "vtk",
    "netCDF4",
    "xarray",
    "zarr",
    "fsspec[http]"

```

I’m reluctant to just go ahead an install all those — I don’t like clogging up my python environments with superfluous packages.

Would you be able to suggest which ones are actually required to run itkwidgets?

Kind regards,  
Constantine

---

<div class="post-metadata">

### Author: ![constantine](https://discourse.itk.org/user_avatar/discourse.itk.org/constantine/32/3915_2.png) [@constantine](https://discourse.itk.org/u/constantine)
#### Post date: [February 25, 2024, 5:07am UTC](https://discourse.itk.org/t/itkwidgets-jupyterlab/5384/10 "2024-02-25T05:07:05Z")

</div>

@matt.mccormick — to answer your question: yes, all the checks in the `itkwedgets` Environment Checks notebook (the one you linked to) pass. I created a fresh environment and ran everything in the notebbook, to have it install everything that’s listed.

Nonetheless, the error’s the same: “The connection was reset.” 😭

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [April 24, 2024, 7:45pm UTC](https://discourse.itk.org/t/itkwidgets-jupyterlab/5384/11 "2024-04-24T19:45:32Z")

</div>

@constantine those requirements are for the example notebooks, demonstrating interoperability with various other tools. The actual requirements for itkwidgets are extremely light and universal:

> <https://github.com/InsightSoftwareConsortium/itkwidgets/blob/3b172a49c89a909fc8220f49e8e96c0dacb7a6e7/pyproject.toml#L39-L46>

Thanks for the feedback regarding Windows terminal rendering. I am working on alternatives. Stay tuned!
