Can I save the scene as a html?

I tend to share some “dicom” files as the “html” file. So it could be opened in Chrome.
Can I save the scene as a html file(not include the 3d view)? Or, is there any python lib could deal with it?

There are many options. You can export contact sheets (lightbox views), videos, and image sequences of views that you can view in a web browser using Screen Capture module.

You could put together a simple html+Javascript page to browse slices and rotate 3D view with sliders - it would be a fun project! If you come up with a solution then we would integrate it into the Screen Capture module.

You can also run full Slicer in a docker container and access it via a web browser. You can try it yourself in your browser now:

@pieper what do you think about a html export feature in Screen Capture module that would use cornerstone.js?

If you could point me an example that displays a series of pngs (zstack browsing with zoom) then I could easily add it as an export option to Screen Capture.

1 Like

Thanks.
I used to create the web files through the manu of Mango, another free and open source software. But I donot how to call it in slicer’s python.
http://ric.uthscsa.edu/mango/index.html

I think the html file could be more convenient than png especially in mobile phone.

Mango/Papaya web viewer looks nice, has BSD-type license, and seems to be very easy to export data to it from Slicer. However, it seems like a one-man-project, which is not developed anymore (there are barely any commits made over the last year), and did not work on a mobile browser that I tried.

Cornerstone viewer is a larger community effort, with lots of ties to the Slicer ecosystem, so it would be better to use that. But it seems a bit more complicated to set it up. I would need at least a fully configured demo deployment. @pieper could you help with this (or it would not be that simple to set this up with Cornerstone/OHIF)?

I’d suggest trying https://slicedrop.com, the original Slicer-in-a-browser project by Daniel Haehn, for simple viewing. It handles most file formats used by Slicer (including DICOM if they form a volume stack) and does orthogonal reslice and window/level natively. It’s a few years old now but still very slick.

3 Likes

Thanks for the suggestion @pieper, I’ve tried slicedrop and it works nicely.

I’ve just realized that you can also use Kheops for this, which has a built-in OHIF viewer and takes care of storage and authentication, too.

1 Like

Thank you very much!
Really cool !

How can I change my code to open my volume just giving a path of nrrd file in the index.html?
I tend to share a volume with my team by slicedrop, and I hope they can access the data just click the index file, which means that each one do not need to click the file button to reselect the path in the index.html?
However, I am not good at java. Could you help me?
And my path is “D:/slicerdrop”
Thank you very much!

I forked the index in my github:

I haven’t tried myself, but you should be able to do something like Daniel’s examples. If you host the slicedrop web app code and the data on the same server (to avoid CORS issues) then you can configure a json file like ones in the examples and embed the path to it as a URL parameter like in this example.

http://x.babymri.org/example4/?scene=http://x.babymri.org/example4/scene.json

In addition to volumes, you should be able to share segmentations, models, and even tractography this way.

@timeanddoctor Slicer How do you use this viewer? Copy it to a USB stick and then view it on a computer? Or do you upload it to a web server and access from a tablet/phone? Is there a preference for the data to remain on a remote server (not downloaded to the user’s computer)? Or, is the data already on the user’s computer (and you prefer not to upload it to a remote server)?

Slicer is already a fully portable, zero-install viewer (soon it will be distributable with any extensions, Python packages, and settings), which can be launched with a shortcut to load a set of images. Could this be useful? We could also customize the appearance to only show features and module that you would like your users to see.

Slicer can also be used in a web browser, without the need to download any images to the user’s computer/tablet/phone (by running it in a docker container, as shown in the SlicerJupyter example).

Thanks.
Slicer is powerfull and we use it for preoperation plan regularly.
I tend share a dicom image by chrome for my friends who can read it in mobile phone. We used to do this by the png file.
I still do not deal with the dropslice problem for the index code is difficult for me. And I dont want to apply a host server as well. I think it is a tremedous task for me to do.

You wouldn’t need to run your own server. I believe it would work fine with a cloud storage hosting service, like dropbox, AWS S3 or similar. That way you could also selectively share access with strong security.

@lassoan we could probably set up the glTF exporter to also create a simple web app wrapper that could be easily shared out of dropbox.