Running Slicer without GUI?

I’ve installed Slicer on an Ubuntu cloud instance (AWS/GCP) and I want to run it with a self-made extension and no GUI… Is there documentation on the slicer site that I’m missing to be able to do this? I’ve found info about using Python to do things, but I want to essentially go: Slicer, do this task, using this folder, and put the output in this location.

Is docker an option for you? Here’s an example of a command line tool based on Slicer and this is another one. If you don’t use docker you would need a different way of having a desktop to access all of Slicer. If you don’t need graphics you might be able to get by with PythonSlicer and access just logic classes.

Maybe you can describe your processing task in more detail if you need more explicit suggestions.

I have dicom images I want to turn into OBJ models using an extension that’s already made. My idea was to use a form to upload the images to AWS/GCP and there have Slicer take them as input with the extension and then output the obj. The extension segments the file to create a 3D render.

I’ve never worked with docker, but I can check it out as well as PythonSlicer.

If you don’t want to learn Javascript to create a frontend, then it is also an option to create a web application using Slicer Jupyter notebook and Voila.

You can use standard IPython widgets for file upload/download/display. Voila takes care of selectively locking down the notebook, so users can still interact with widgets but they will not see or able to modify code in the notebook.

See a number of example web applications here:

They are all hosted on the free binder service and a new container is created for each user from scratch, so initial loading of the page may take a minute, but of if you set up your own server then page loading should be instantaneous.

From my recent experience on headless Slicer on Ubuntu, I think something like the following on the command line could be one way to go:

xvfb-run -a /slicer_path/Slicer --no-splash --python-script

here “xvfb” is a package you need to install on your Ubuntu instance. Running “xvfb-run program” will start “program” with a dummy graphical interface, otherwise it complains that it can’t connect to X server.

If it works for you, you can put everything you want in


Hi Lenny, this isn’t directly related to your question, but I am working on a similar project (DICOM -> OBJ). Is the extension that you are using something that is custom to your project or an open source extension. If its open source, would you mind sharing a link to it?


thanks! it works like magic

1 Like

Hi, I have been working on developing a web app as suggested by @lassoan following this link:

. I successfully created a Slicer Jupyter notebook. However, on integrating with Voila I have some issues.

The application fails to launch, even after several tries.

This happens as soon as I add “docker” and “start” file in my repository.

Am I missing some thing? Can you provide any example repository which works with slicer jupyter notebook and voila.

For your reference, my repository link is:

Does everything work well (Slicer kernel starts without problems) if you don’t use Voila?

Thank you for your reply @lassoan. Yes, slicer works well. I just need to integrate it with Viola. I think I am missing something in the Docker file.
I have tried slicer in my other repository. It works well. I am following your repository. Just the integration with viola is a bit difficult.

hi @lassoan . This is the example I have been following to generate my own repository and notebook. It works fine. The problem arises only when I try to run the app through Voila.

Can you help me with this?
Thanks alot

For reference, this has been discussed at the weekly developer meeting: 2021.04.06 Hangout - #3 by jcfr