# Editing Layout through Python script

**URL:** <https://discourse.slicer.org/t/editing-layout-through-python-script/3519>\
**Category:** Development\
**Created:** [July 19, 2018, 3:11am UTC](https://discourse.slicer.org/t/editing-layout-through-python-script/3519 "2018-07-19T03:11:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brynpitt](https://avatars.discourse-cdn.com/v4/letter/b/e99b99/32.png) [@brynpitt](https://discourse.slicer.org/u/brynpitt)\
**Post date:** [July 19, 2018, 3:11am UTC](https://discourse.slicer.org/t/editing-layout-through-python-script/3519/1 "2018-07-19T03:11:53Z")

</div>

Hello all,

I have a very simple problem: I am looking for reference information on changing Slicer’s layout using Python scripts. I know I found such a page in the past (for an older version of Slicer), but I cannot seem to find it again in the Wiki.

Ultimately, I would like to use a script so that I can launch Slicer with a customized layout (3D Only view, toolbars disabled, etc). For now, I am just trying to find the documentation for existing classes and functions.

Thanks,  
BP

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [July 19, 2018, 3:32am UTC](https://discourse.slicer.org/t/editing-layout-through-python-script/3519/2 "2018-07-19T03:32:34Z")

</div>

You might be looking for the [ScriptRepository](https://www.slicer.org/wiki/Documentation/4.8/ScriptRepository) wiki page. There is also the [Python scripting](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Python_scripting) wiki page which has some good information.

Slicer does have a 3D Only view (View-\>Layout-\>3D Only) and the last view is saved and used when relaunching Slicer.

---

<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:** [July 19, 2018, 1:35pm UTC](https://discourse.slicer.org/t/editing-layout-through-python-script/3519/3 "2018-07-19T13:35:03Z")

</div>

@brynpitt you may also want to look at the info on [Slicelets](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Slicelets).

For the viewer layouts specifically, the [CompareVolumesLogic](https://github.com/pieper/CompareVolumes/blob/master/CompareVolumes.py#L296) is an example of dynamically configuring the mrml layout nodes for various scenarios.
