nvkvc
(Nikola Novakovic)
July 2, 2024, 7:52am
1
I have jupyterlab installed on docker image and I’ve also installed some additional libraries to the image like PyImageJ with ITKWidgets.
However, when i try to visualise something using itk library I only got object printed, here’s the image:
These are the version of a software installed on jupyter:
Selected Jupyter core packages...
IPython : 8.19.0
ipykernel : 6.28.0
ipywidgets : 8.1.3
jupyter_client : 8.6.0
jupyter_core : 5.7.0
jupyter_server : 2.12.2
jupyterlab : 4.0.10
nbclient : 0.8.0
nbconvert : 7.14.0
nbformat : 5.9.2
notebook : 7.0.6
qtconsole : not installed
traitlets : 5.14.1
And this is the content of my Dockerfile:
FROM quay.io/jupyter/minimal-notebook:2024-01-05@sha256:6943c4333439ea8f8db769b5a4bd862f2351477c878b40fb533aa4f89c896d5f
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN mamba install --yes \
'pyimagej' \
'openjdk=8' \
'ipywidgets' && \
mamba clean --all -f -y
RUN pip install --no-cache-dir 'itkwidgets[all]>=1.0a49'
RUN jupyter labextension enable imjoy-jupyterlab-extension
RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager itk-jupyter-widgets
USER ${NB_UID}
WORKDIR "${HOME}"
Does anyone knows what might be the issue here?
Thanks in advance!
dzenanz
(Dženan Zukić)
July 2, 2024, 1:19pm
2
@matt.mccormick and/or @PaulHax might be able to help.
PaulHax
(Paul Elliott)
July 2, 2024, 2:28pm
3
Please ensure itkwidgets[all]>=1.0a53
. Version 1.0a50
is is needed for JuperterLab 4. More info:
opened 07:54AM - 17 Apr 24 UTC
**Describe the bug**
Kernel hangs after itkwidgets visualization in jupyter not… ebook
https://github.com/Project-MONAI/tutorials/blob/main/model_zoo/TCIA_PROSTATEx_Prostate_MRI_Anatomy_Model.ipynb
**To Reproduce**
1. docker pull projectmonai/monai:latest
2. create a new container
3. run into container
4. `pip install 'itkwidgets[notebook]>=1.0a49'`
```
from monai.transforms import LoadImage
root_dir = "/opt/monai/workspace/Data"
data_dir = os.path.join(root_dir, "Task09_Spleen")
train_images = sorted(glob.glob(os.path.join(data_dir, "imagesTr", "*.nii.gz")))
out = LoadImage(ensure_channel_first=True)(train_images[0])
view(image=out)
```
**Expected behavior**
Kernal will not hangs after using view.
**Screenshots**
<img width="594" alt="Screen Shot 2024-04-17 at 15 46 44" src="https://github.com/Project-MONAI/tutorials/assets/55491388/7f0a0638-786b-4c8d-bfd4-ddabb94c6ed7">
**Additional context**
- Look similar to this one:
https://github.com/InsightSoftwareConsortium/itkwidgets/issues/688
- After install `itkwidgets[notebook]>=1.0a49`, look like there will be a requirement compatibility issues for pandas, not sure whether it's related the issue.
```
Collecting pandas>=2.0.0 (from dask-image->ngff-zarr[dask-image]>=0.4.3->itkwidgets>=1.0a49->itkwidgets[notebook]>=1.0a49)
Downloading pandas-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB)
```
```
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
cudf 24.2.0 requires pandas<1.6.0dev0,>=1.3, but you have pandas 2.2.2 which is incompatible.
dask-cuda 24.2.0 requires pandas<1.6.0.dev0,>=1.3, but you have pandas 2.2.2 which is incompatible.
dask-cudf 24.2.0 requires pandas<1.6.0dev0,>=1.3, but you have pandas 2.2.2 which is incompatible.
```
- After install the itkwidgets and exiting the Jupyter notebook, trying to launch the notebook again leads to a configuration error. It appears that the installation of itkwidgets is causing a disruption in the configuration settings.
<img width="1490" alt="Screen Shot 2024-04-17 at 15 51 33" src="https://github.com/Project-MONAI/tutorials/assets/55491388/c4d909d4-f6de-4ff5-8e3c-66b9fd4c94ff">
(Thanks for the ping dzenanz)
2 Likes
nvkvc
(Nikola Novakovic)
July 2, 2024, 4:22pm
4
PaulHax:
1.0a53
Thanks Paul and Dzenan for your quick response. However bumping itkwidgets to 1.0a53 version didn’t fix the issue. This is what I got printed on console when I run test from my first comment:
Jul 02, 2024 4:18:44 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
ImageJ2 version: 2.15.0/1.54f
[INFO] Populating metadata
WARNING:imagej:Operating in headless mode - the original ImageJ will have limited functionality.
<itkwidgets.viewer.Viewer at 0x7f2ecad20350>
Do you maybe have any other idea what might cause this issue? Should I provide some more information to you?
PaulHax
(Paul Elliott)
July 3, 2024, 2:01pm
5
Shucks. Upgrading the version was my one good idea =/
You could check the browser’s Javascript console (F12) to see if there is anything suspicioius.
@matt.mccormick may have a better idea.
PaulHax
(Paul Elliott)
July 3, 2024, 2:29pm
6
I ran the itkwidgets Hello3DWorld.ipynb with your docker file and it worked. Hmmm.
These lines should probably be removed, which likely bring in old, incompatible dependencies.