Hide main window - Show only external view

Hi everybody,

Im running my module from the terminal using --no-main-window, and I wondering if its possible to show just an external view like that.

The idea is run the module from the terminal with 3dS in the back, in some moment the external view appears (necessary to put a point), then close it and continue with the rest of the process.

Thanks for your help, Lucas.

I would recommend to use the main window, as it makes everything much simpler (and allows you to switch back to the full Slicer GUI for testing and troubleshooting very easily).

You can hide unnecessary decoration of the window using slicer.util.set...Visible functions:

showFull = False  # set it to True to show the full Slicer GUI
slicer.util.findChild(None, "PanelDockWidget").setVisible(showFull)

See more information on the Slicelet page.

HI Andras, the idea is start the module from the console and open the 3dS GU just to take some points and close it.

I wonder if its possible run the process like that:

  • Run my module from my terminal with 3dS --no-main-window.
  • In some moment of the process the module opens 3dS GUI.
  • The user take some points, and then the module closes 3dS GUI.
  • The module continues with the rest.

I dont know if its possible (and how) to open and close the GUI when I started with --no-main-window.

Thanks, Lucas.

I don’t think you can create a main window later, but what you can do is to hide the main window right after it is created. It will just pop up for a fraction of a second. If you don’t want the main window to appear even for a very short time then I think you need to implement a custom application and change the main window initialization.

You can also keep a running Slicer in the background and just send commands to execute using web requests (executed by the WebServer module). This has the advantage that Slicer has to be started only once when the computer starts (or the first time it is needed) and it can stay hidden in the background until it is needed to display something.