Open a slicer module with python

I want to open my custom scripted module every time I open Slicer.

I know that I have to edit the file, but I don’t know what lines of code to put in there.

As an example I add this to the command line when I start slicer:

--python-code "selectModule('WebServer')"

But you can put the same in, maybe using slicer.util.selectModule for style purposes.

1 Like

The Slicer script repository has many python examples that may be helpful for you. One includes setting the slicer module for startup.

1 Like

Using the GUI, you can go to Settings->Modules and set the Default startup module from the list of loaded modules. Here I have set “OpenIGTLinkIF” as my new default.