# Disable automatic scene view generation on save

**URL:** https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888
**Category:** Development
**Created:** [August 24, 2018, 6:03pm UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888 "2018-08-24T18:03:36Z")
**Posts on this page:** 15
**Page:** 1

<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 24, 2018, 6:03pm UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/1 "2018-08-24T18:03:36Z")

</div>

Currently, a scene view is added on each scene save, which approximately doubles the scene file size, which may be significant when the scene has hundreds of nodes.

Also, each time when the scene file is loaded and the re-saved one more scene view is added.

**Can I go ahead and remove automatic scene view generation on scene save?**

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [August 24, 2018, 8:58pm UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/2 "2018-08-24T20:58:06Z")

</div>

Sounds good to me.

Could you add an option like `includeSceneView` (or similar name) ?

Such option could be passed as a property to

> <https://github.com/Slicer/Slicer/blob/cac6db684d0310ec4376c61ab5019183a3525d3c/Base/Python/slicer/util.py#L476-L496>

Also function `saveDefaultSceneView` would be a no-op with such property is set to `1`

> <https://github.com/Slicer/Slicer/blob/cac6db684d0310ec4376c61ab5019183a3525d3c/Modules/Loadable/Data/qSlicerSceneWriter.cxx#L117>

Ideally, the option would also show up in the data dialog

---

<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 24, 2018, 9:22pm UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/3 "2018-08-24T21:22:53Z")

</div>

Yes, adding the sceneview automatically hasn’t turned out to have a lot of utility. It also make it difficult if you have to inspect the mrml file for any reason. +1 for turning that feature off by default (and while I agree with Jc that a gui option to reenable it would be ideal, I’d be okay with turning it off even if the gui weren’t added).

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [August 24, 2018, 9:39pm UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/4 "2018-08-24T21:39:25Z")

</div>

> I’d be okay with turning it off even if the gui weren’t added

Sounds good. Availability from python is sufficient

Should the MRB always be done including scene view then ?

---

<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 24, 2018, 10:01pm UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/5 "2018-08-24T22:01:51Z")

</div>

> [@jcfr](#):
>
> Should the MRB always be done including scene view then ?

I don’t think the sceneviews add anything extra in the mrb case compared to the mrml case, so no, I wouldn’t.

The sceneview does create a screen capture and that could be useful to have if one wanted to have a thumbnail for browsing scenes, like in an open dialog (but we’ve never done that so I’m not sure it’s a valid use case).

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [August 24, 2018, 10:20pm UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/6 "2018-08-24T22:20:48Z")

</div>

Does this mean that it will not be possible to save MRB like this one: [http://slicer.kitware.com/midas3/slicerdatastore/view?itemId=121588&layout=layout](http://slicer.kitware.com/midas3/slicerdatastore/view?itemId=121588&layout=layout)

---

<div class="post-metadata">

### Author: ![rkikinis](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rkikinis/32/791_2.png) [@rkikinis](https://discourse.slicer.org/u/rkikinis)
#### Post date: [August 24, 2018, 10:36pm UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/7 "2018-08-24T22:36:14Z")

</div>

That would be a pity

---

<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 24, 2018, 10:38pm UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/8 "2018-08-24T22:38:10Z")

</div>

The only difference would be that you would not get the master scene view at the end of that list. The ones you make explicitly would still be there.

But it’s true that if you didn’t make scene views explicitly there wouldn’t be any in the data store.

---

<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 24, 2018, 11:24pm UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/9 "2018-08-24T23:24:36Z")

</div>

The only difference would be that if you needed a scene view then you would need to click on the “Create scene view” button + click OK (two extra clicks) before you save the scene.

I find that these automatically created scene views are more distracting for me than helpful, as they clutter the scene view list.

We can save a screenshot independently of scene views when the scene is saved to enable quick preview without loading the scene.

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [August 24, 2018, 11:36pm UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/10 "2018-08-24T23:36:33Z")

</div>

Thanks for your patience and for the clarification. The propose change make complete sense. 👍

> automatically created scene views are more distracting for me than helpful,

agreed. Explicit is better than implicit in that case

> We can save a screenshot independently of scene views when the scene is saved to enable quick preview without loading the scene.

👍

---

<div class="post-metadata">

### Author: ![rkikinis](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rkikinis/32/791_2.png) [@rkikinis](https://discourse.slicer.org/u/rkikinis)
#### Post date: [August 24, 2018, 11:51pm UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/11 "2018-08-24T23:51:13Z")

</div>

If I load an mrb, do I get the same look/ configuration like when I saved the mrb?

---

<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 25, 2018, 3:46am UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/12 "2018-08-25T03:46:59Z")

</div>

> [@rkikinis](#):
>
> If I load an mrb, do I get the same look/ configuration like when I saved the mrb?

Yes. The loaded scene will look exactly like the scene looked at the time of saving.

Automatic sceneview creation might have been implemented just because of the screenshot. Storing state of all nodes in scene view is redundant, because that information is already stored in the main scene.

---

<div class="post-metadata">

### Author: ![rkikinis](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rkikinis/32/791_2.png) [@rkikinis](https://discourse.slicer.org/u/rkikinis)
#### Post date: [August 25, 2018, 10:55am UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/13 "2018-08-25T10:55:14Z")

</div>

Hi,  
thanks for the explanation. Preserving the ability to restore the state was the functionality I was concerned about.  
Best  
Ron

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [August 25, 2018, 5:07pm UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/14 "2018-08-25T17:07:48Z")

</div>

> [@lassoan](#):
>
> We can save a screenshot independently of scene views when the scene is saved to enable quick preview without loading the scene

Yes I think if this small feature is added to scene saving instead of the scene view capture, then we won’t lose anything by removing the automatic scene views.

---

<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 26, 2018, 2:09pm UTC](https://discourse.slicer.org/t/disable-automatic-scene-view-generation-on-save/3888/15 "2018-08-26T14:09:25Z")

</div>

I’ve implemented replaced automatic scene view saving by automatic screenshot saving. I wanted to send a pull request but accidently pushed it directly - [see changes here](https://github.com/Slicer/Slicer/commit/2dd13d78f9a1b8678593e4f3cd06a127133602ab). Let me know if you have any comments, I’ll address them in follow-up commits.
