I’m trying to launch Slicer with just a single module on Mac. Would the steps here work with Mac as well? Has anybody tried this? I tried a few things, but couldn’t get it to work.
My aim is to let my user click on ‘ModulName.app’ and show the module with ModuleName with only necessary GUI components of Slicer. I’ve been able to do this on Windows, but we would like to have a version for Mac as well.
I’ve never tried the settings approach, but it should work the same on mac as anywhere else. Another option is to remove the files related to modules you don’t want to load. There’s also the CustomSlicerGenerator although I haven’t used it in a while. Of course, building your own SlicerCAT is the most powerful approach.
Thanks Steve! I think SlicerCAT is too much work for the simple single module that I’m trying to create.
These are the steps that I followed for my scripted module
Copy the ModuleName.py and ModuelName.ui in Slicer.app/Contents/lib/Slicer-4.13/qt-scripted-modules and Slicer.app/Contents/lib/Slicer-4.13/qt-scripted-modules/Resources/UI respectively
Make a copy of bin/SlicerLauncherSettings.ini and rename it to ModuleNameLauncherSettings.ini
Rename Contents/MacOS/Slicer to Contents/MacOS/ModuleName
I’m confused about the path in the [Application] section of the .ini file, since there’s no bin/Slicer (which is what the original SlicerLauncherSettings.ini file was pointing to), and hence no bin/ModuleName as well.
MacOS packaging works differently, and I’m afraid I need help understanding how things are connected to make this work.
Slicer accepts the option --modules-to-ignore, from the command line, specifying the list of modules to ignore as ModuleNameA,ModuleNameB,... should allow you to achieve this.
This command line parameter has its equivalent in the revision specific settings file shipped along side the application, on macOS it would be Slicer.app/Contents/www.na-mic.org/Slicer-NNNNN.ini here NNNNN is the slicer revision.