Editing Layout through Python script

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.


You might be looking for the ScriptRepository wiki page. There is also the 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.

@brynpitt you may also want to look at the info on Slicelets.

For the viewer layouts specifically, the CompareVolumesLogic is an example of dynamically configuring the mrml layout nodes for various scenarios.