itkwidgets & jupyterlab

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:


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:

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

Or a gray window:

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

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

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

?

1 Like

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. Any idea when it might come? I would need it for a class in three weeks.

Thanks again!

1 Like

Hi @martin.genet ,

Great to hear about your success!

The geometries support is expected very roughly in 2 months.

  • Matt

Hello clever people!

I have just installed itkwidgets as per instructions (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:

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

I get “The connection was reset” error:

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

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.

Hi @constantine ,

Is this with the latest version, 1.0a48?

Affirmative.

image

Do all the checks pass in the itkwidgets EnvironmentChecks notebook?

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

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

    "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

@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.” :sob:

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

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