Slicer has evolved a lot since the concepts of no-main-window-slicelets. Initialization of the main window has become more complicated (due to hi-DPI screens, OpenGL context initialization overrides, interaction widgets, etc.) and it is expected to get even more complex in the future (with multi-monitor support, multi-touch, pen, and Mac trackpad support, etc.). It should be still possible to mimic initialization steps of the Slicer main window in a generic widget in a Python script, but it would be significant effort to maintain consistency.
Instead, I would recommend to use Slicer’s main window but customize it (hide all those parts that you don’t need). This has the advantage that you can flip between “slicelet” and “full Slicer” experience very easily, which helps a lot in development and support.
I’ve added a number of helper functions to show/hide user interface elements that you can use to show a single module and a view layout, with any additional user interface elements you need (these functions will be included in Preview releases you download tomorrow or later). You can add these functions in the module widget setup method and then launch Slicer using Slicer.exe --python-code "slicer.util.selectModule('MyModuleName')"
. It would not be too difficult to generate application shortcut with an icon (at least on Windows), which would make it very easy for users to start Slicer with the simple GUI.
Here is an example module (not functional yet, but maybe we’ll make it work, if there is enough interest) that uses the newly added functions: SlicerSimpleWorkflows/QuickSegment at master · lassoan/SlicerSimpleWorkflows · GitHub
By hitting Ctrl+Shift+b you can switch to the full Slicer GUI: