Slicer as a python library / web based application?


I want to ask if there are any plans at any point to create Slicer as a full python package or a web based application, which would not require/reference a separate slicer executable application.

Currently to my knowledge the closest match is slicerio/slicer web server which allows to execute commands from python, howere it requires the slicer executable app.
Are there any plans to make Slicer as a web based app/viewer, similar to GitHub - niivue/niivue: a WebGL2 based medical image viewer. Supports over 30 formats of volumes and meshes. for example? Such functionality would allow to implement slicer UI window viewing in external UIs in which different windows would display different studies for multiple parallel users.

Basically to have multiple subsequent interactive windows like this in a single page.

Slicer is focused on being a workstation or server application. For web app use cases we tend to use OHIF, and some of us work on both projects so interoperability should be pretty good via dicom objects.

Separately we are thinking of factoring out some of Slicer into python packages that could be used in other ways, but it’s a complex process that will take time.

1 Like

Understood, that makes sense.
What I currently find lacking is a good web app for nifti file display/manipulation. There are some lightweight DICOM viewers such as OHIF, but they only load DICOMS, not nifti files.
Then there are some nifti file viewers (such as niivue and a few others), but as far as I’ve seen all are either no longer maintained or lack some important features or efficiency/optimization.
Slicer user interface for nifti file display/manipulation is the best that I know of and if it was available as a web app that would be optimal. However I fully understand that these are two very different use cases and tracks, so it makes sense to focus on server application.


I know nifti support comes up in the OHIF world from time to time and probably a solution is forthcoming. Right now I suppose anything is possible with enough coding effort but it’s not clear there’s something out of the box that does exactly what you have in mind.

Did you try the glance viewer from kitware?

1 Like

Also, VolView should work with non-DICOM (just tested)

CTChest from the Slicer sample data in VolView:

@Sam_Horvath I have tried VolView (as Osimis Orthanc plugin), it is quite nice, but still lacks some very relevant features (as far as I’ve managed to explore, let me know if there is something I have missed):

  1. Ability to display a study with overlayed 3D annotations. An equivalent in Slicer would be loading a study nifti file and a Segmentation-label.nii or Segmentation.seg.nrrd file which would contain 3d overlays/annotations and load the study with overlays. As far as I’ve seen VolView only supports 2D annotations.
  2. An available executive API endpoint which would allow other applications to send commands to VolView, for example to open and display a specific study. I’ve seen there is a way to general a URL which would open a specific study from URL, however I have not found if this allows to load multiple nifti files from disk. An equivalent in Slicer is the web server with EXEC endpoint which allows not only to send commands to load but also manipulate studies via requests.
1 Like

Hi @NaglisR, thanks for your feedback on VolView! I can address your two points.

  1. Rendering 3D annotations is in progress! I don’t have a timeline for it, since it’s not a priority right now.
  2. This is an interesting idea. The closest thing to a control endpoint in VolView is this PR that integrates a python server as a backend service: Python server demo by floryst · Pull Request #272 · Kitware/VolView · GitHub. Since it’s not possible to run an accessible webserver in the browser, you’d have to run a python server that acts as the control node for VolView.

@NaglisR Note that you actually don’t need a web client for image review. You can open Slicer directly from a website where you host your data, have very fast and sophisticated viewing and editing features, and then save the results to the remote database, when the user finished processing. You need to install a local application, which may be an extra step, but if your users spend significant time with image review and annotation then the inconvenience of installing a local application may be negligible.

For example, a group has set up a MONAILabel server in their hospital with some added features for authenticating users and adding more metadata (ability to flag segmentations for expert review, etc.) and they used locally installed 3D Slicer as frontend. They utilized MONAILabel to continuously retrain the model and select those images for manual segmentation that MONAILabel was the most uncertain about how to segment.

And if you really don’t want to install anything on the client machine, you can run Slicer itself on a cloud instance.

Either on AWS or GCP or really anywhere that rents VMs.

I’ve come to like this model because you don’t have the limitations imposed by the browser. It’s not a replacement for web applications, but it covers a lot of interesting cases (like being highly scalable) and means we don’t always need to reimplement everything in javascript if we don’t want to.

1 Like

To follow up on that specific topic, VolView has been officially integrated with Orthanc.

You may read more details here

Exciting to see progress on that front :rocket: