itkwidgets icon indicating copy to clipboard operation
itkwidgets copied to clipboard

itkwidgets on Google CoLab

Open vianamp opened this issue 5 years ago • 9 comments

Hi guys.

Have any of you tried to run itkwidgets on Google Colab?

I got the package installed with !pip, but the moment I try view(image), the thing keeps running forever. Could that be because the free server where I am running the notebook in is just not good enough for 3D view? It is a small image though 32x32x32.

Any thoughts?

vianamp avatar Nov 07 '18 17:11 vianamp

Just found this: https://stackoverflow.com/questions/47269168/ipywidgets-with-google-colaboratory

:(

vianamp avatar Nov 07 '18 18:11 vianamp

Hey @vianamp ,

Yes, please follow and thumbs up this issue:

https://github.com/googlecolab/colabtools/issues/60

thewtex avatar Nov 07 '18 18:11 thewtex

UPDATE: you will be able to use the itk-vtk-viewer directly inside Google Colab which will be similar to itkwidgets, see https://github.com/Kitware/itk-vtk-viewer/issues/336

oeway avatar Aug 20 '20 09:08 oeway

@oeway #brilliant!! :heart: :heart_eyes:

Awesome to know that we will have Google Colab support with the itkwidgets / imjoy refactor (WIP)!

This is superb for reproducibility and teaching with deep learning libraries.

@aylward

thewtex avatar Sep 29 '20 18:09 thewtex

@thewtex and @oeway This new function is so cool!!!!

I have a question about the using itkwidgets on colab.

Here is a working example I made for testing the viewer : https://github.com/AllenInstitute/aics-segmentation/blob/colab/lookup_table_demo/test_viewer.ipynb

It works well so far. But, i would like to extract the ROI from the ROI selection in the viewer. Previously, I can do this

viewer_bw =view(bw)
print( viewer_bw.roi_slice() )

I am not sure how to extract ROI with the new ImJoy layer

jxchen01 avatar Nov 06 '20 22:11 jxchen01

@jxchen01 Thanks!

We don't have ROI widget support in the itk-vtk-viewer yet, it would be nice to have this feature indeed. @thewtex what do you think?

Related to this, I am also interested in having the PaintWidget working in the viewer at some point( e.g. adding a new channel and use the paint widget to do annotation).

oeway avatar Nov 07 '20 00:11 oeway

@jxchen01 very nice! Yes, the ROI selection feature in itkwidgets will work in Colab as it works in Jupyter as we integrate more of the ImJoy communication backend.

@oeway :+1: Interactive widget support is being added, e.g. the PaintWidget. :paintbrush:

thewtex avatar Nov 10 '20 18:11 thewtex

Rebasing on ImJoy magic for CoLab support! :tada:

pip install --upgrade --pre itkwidgets

to test.

CSS issues in the output, currently using the createDialog over createWindow in Colab.

@bnmajor maybe the CSS here can be adjusted?

https://github.com/Kitware/itk-vtk-viewer/blob/0aec56c6dd8411e2d47ab98245242fe1db063e79/dist/index.html#L42

thewtex avatar May 21 '22 23:05 thewtex

CSS issues in the output, currently using the createDialog over createWindow in Colab.

Or, we should be using the w and h options for createWindow ?

thewtex avatar May 22 '22 14:05 thewtex

CoLab support in 1.0aNN :tada: thanks to ImJoy, @bnmajor and @oeway 's efforts.

thewtex avatar Dec 18 '23 21:12 thewtex