# Can I save the scene as a html?

**URL:** https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906
**Category:** Support
**Created:** [August 8, 2020, 7:24am UTC](https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906 "2020-08-08T07:24:26Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)
#### Post date: [August 8, 2020, 7:24am UTC](https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906/1 "2020-08-08T07:24:26Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [August 8, 2020, 1:16pm UTC](https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906/2 "2020-08-08T13:16:16Z")

</div>

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:

> **[GitHub: Slicer/SlicerNotebooks/master](https://mybinder.org/v2/gh/Slicer/SlicerNotebooks/master?filepath=SlicerWeb.ipynb)**
>
> Click to run this interactive environment. From the Binder Project: Reproducible, sharable, interactive computing environments.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [August 8, 2020, 3:31pm UTC](https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906/3 "2020-08-08T15:31:22Z")

</div>

@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.

---

<div class="post-metadata">

### Author: ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)
#### Post date: [August 9, 2020, 2:19pm UTC](https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906/4 "2020-08-09T14:19:41Z")

</div>

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](http://ric.uthscsa.edu/mango/index.html)

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

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [August 9, 2020, 3:31pm UTC](https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906/5 "2020-08-09T15:31:31Z")

</div>

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)?

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [August 10, 2020, 2:16pm UTC](https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906/6 "2020-08-10T14:16:31Z")

</div>

I’d suggest trying [https://slicedrop.com](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.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [August 10, 2020, 2:58pm UTC](https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906/7 "2020-08-10T14:58:15Z")

</div>

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

I’ve just realized that you can also use [Kheops](http://kheops.online/) for this, which has a built-in OHIF viewer and takes care of storage and authentication, too.

---

<div class="post-metadata">

### Author: ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)
#### Post date: [August 10, 2020, 4:02pm UTC](https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906/8 "2020-08-10T16:02:15Z")

</div>

Thank you very much!  
Really cool !

---

<div class="post-metadata">

### Author: ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)
#### Post date: [August 12, 2020, 5:41am UTC](https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906/9 "2020-08-12T05:41:05Z")

</div>

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:

> <https://github.com/neurosurgerydoctor/slicedrop.github.com/blob/aee20fc73d6855f9c64610f6b8de397c6fc94714/index.html#L159>

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [August 12, 2020, 2:16pm UTC](https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906/10 "2020-08-12T14:16:16Z")

</div>

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](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.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [August 12, 2020, 3:02pm UTC](https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906/11 "2020-08-12T15:02:23Z")

</div>

@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](https://github.com/Slicer/Slicer/pull/5029) 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](https://mybinder.org/v2/gh/Slicer/SlicerNotebooks/master?filepath=SlicerWeb.ipynb)).

---

<div class="post-metadata">

### Author: ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)
#### Post date: [August 12, 2020, 4:24pm UTC](https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906/12 "2020-08-12T16:24:12Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [August 12, 2020, 4:36pm UTC](https://discourse.slicer.org/t/can-i-save-the-scene-as-a-html/12906/13 "2020-08-12T16:36:41Z")

</div>

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.
