3D Slicer + Cloud computing (again)

Hello Slicers,

I would like information on how to use 3D Slicer for visualization on a cloud platform such as Amazon AWS or Google Cloud. This is for an educational course on medical image processing, using a cloud provider for deep learning. If I understand correctly, one possibility is to give each student a virtual machine with OpenGL [1]. Is there any other option?

[1] Want to use , slicer which is installed on cloud virtual machine

1 Like

We use vnc + virtualgl.

Hi @gcsharp - the dit4c folks in Australia set up some nice docker infrastructure for this.

I use their approach as the basis for my SlicerDockers which give you a full Slicer environment running in any container service. You can even install new versions of Slicer and extensions inside the VM and all is accessible via a browser (using noVNC). I find the performance very acceptable.

I now have some more information. The class will use Google colab.

Could it be possible to upload the 3D Slicer jupyter kernel into Google colab? If not, what method could you suggest for 3D visualization? Installing local 3D Slicer is not an option.

1 Like

I haven’t tried, but it looks like you could set up each user with a virtual machine running the slicer as described here under “Connecting to a runtime on a Google Compute Engine instance” at this page https://research.google.com/colaboratory/local-runtimes.html

I’m just curious, why it is not an option? Will participates use their phones and tablets? Or 32-bit Windows XP computers?

Thanks Steve, I will take a look. That might work.

There are multiple instructors, each using different toolsets. So the decision was made to use cloud resources with needed toolsets pre-installed.

Could Slicer be a pre-installed tool?

If you cannot install it then you you can run it using docker using this command docker run -d -p 8080:8080 --name slicer stevepieper/slicer. You can then access Slicer in your web browser by opening localhost:8080 page clicking on the “X11 Session” button.

If absolutely any installation (even docker) is impossible then you can run Slicer using binder. For example, by opening this notebook: https://mybinder.org/v2/gh/slicer/SlicerNotebooks/master?filepath=01_Data_Loading_and_Visualization.ipynb (there are some more here)

@pieper Would you be able to update this Slicer binder dockerfile to include similar VNC access as your Slicer docker images?

Yes, I think a VM with Slicer pre-installed would be acceptable.

Docker could potentially be an option. But there would also need to be a way to get local access the output data, which is stored in Google colab/Google drive.

Same thing for mybinder. How would you access the files on Google?

The docker images would need to be downloaded, and can be very very large. Often times, even downloading Slicer binary is a hassle to plan for an event with unknown network quality, docker will be much worse. Installing docker can also be tricky.

@gcsharp - whatever you end up doing, would be really great if you could share the instructions and your experience after the event! Instructions on setting up Google Cloud VM + Colab and Slicer would be a great resource to have!

If the network quality is unknown then of course you cannot even consider using any cloud-based resources and you need to have all software and data locally.

Yes, that should be doable. But I looked around a little bit and I don’t think it can be used with google colab unless you also do an ssh tunnel on your localhost and doesn’t sound like Greg will be allowed to do that. I didn’t see anyway to connect colab to anything but your local machine.

I was able to install SlicerJupyter within the dockerized Slicer for testing. By default jupyter servers are only available on localhost, but it looks like it’s possible to configure them to be public. So basically @gcsharp if you wanted to take that approach we could set up a dockerfile that starts up a jupyter notebook server which could run on any container service (e.g. it’s just a few clicks on Google). Then you would just start as many as you need and hand out IP addresses and passwords to the students. Of course you could also let them connect to the Slicer desktop via noVNC if you want to let them use Slicer directly.


Not necessarily. If both your compute resources and data are on the cloud, I would actually think your network demands become a lot less stringent. I don’t think you need a high-end network to interact with a cloud-based notebook and visualize view image slices, and some summary data. Depends on what exactly the tutorial will aim to do, I guess.

Agree. But I anticipate the network access will be stable.

FYI, this is for AAPM summer school. Students will be doing interactive programming for deep learning, image registration, image segmentation, CAD, etc. It’s a very ambitious program for AAPM; they have never tried something like this before. (https://w3.aapm.org/meetings/2019SS/)


Google has all kinds of APIs, including python libraries for accessing data in their storage buckets, DICOMweb, etc. I have close to zero experience, but I know they exist, and I can look up few pointers if you cannot find. But it will be another learning curve. Maybe it is most practical to have a public shared folder on Google Drive? Wouldn’t this work?

For binder: the GitHub repository can contain all notebooks and data in the same repository and will be downloaded to the computer that runs Jupyter.

A downside of binder (and other free services, such as google colab) is that there is no quality of service guarantee: you cannot control how long does it take for an instance to start and your instance can be stopped anytime for any reason (the notebook will be still available in your browser, so you don’t lose your work, but you need to start a new instance, copy the saved notebook content, etc.). Usually it is not a problem, but it is a risk.

It seems that participants will bring their own laptop and will need to install up to 8GB of software anyway, so they may just as well install Slicer locally. Things will be faster and much lower chance of things not working. You can always set up a few cloud Slicer instances (e.g., a couple of docker instances running on a few machines) just in case some people have problems on their computer.

Yes, at this point we have held probably hundreds of trainings this way and by now incompatible laptops are very rare. But conference wifi issues are still pretty common.