# Launching Slicer with only Slicelet displayed on mac

**URL:** <https://discourse.slicer.org/t/launching-slicer-with-only-slicelet-displayed-on-mac/19472>\
**Category:** Development\
**Created:** [September 1, 2021, 8:18pm UTC](https://discourse.slicer.org/t/launching-slicer-with-only-slicelet-displayed-on-mac/19472 "2021-09-01T20:18:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hina-shah](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hina-shah/32/695_2.png) [@hina-shah](https://discourse.slicer.org/u/hina-shah)\
**Post date:** [September 1, 2021, 8:18pm UTC](https://discourse.slicer.org/t/launching-slicer-with-only-slicelet-displayed-on-mac/19472/1 "2021-09-01T20:18:26Z")

</div>

Hi All,

I’m trying to launch Slicer with just a single module on Mac. Would the [steps here](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Slicelets) 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.

Thank you!  
HIna

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [September 1, 2021, 8:32pm UTC](https://discourse.slicer.org/t/launching-slicer-with-only-slicelet-displayed-on-mac/19472/2 "2021-09-01T20:32:17Z")

</div>

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](https://github.com/pieper/CustomSlicerGenerator) although I haven’t used it in a while. Of course, building your own [SlicerCAT](https://blog.kitware.com/slicercat-creating-custom-applications-based-on-3d-slicer/) is the most powerful approach.

---

<div class="post-metadata">

**Author:** ![hina-shah](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hina-shah/32/695_2.png) [@hina-shah](https://discourse.slicer.org/u/hina-shah)\
**Post date:** [September 2, 2021, 3:33am UTC](https://discourse.slicer.org/t/launching-slicer-with-only-slicelet-displayed-on-mac/19472/3 "2021-09-02T03:33:27Z")

</div>

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`
- Make edits in `ModuleNameLauncherSettings.ini` as:

> [General]  
> additionalSettingsFilePath=\<APPLAUNCHER\_SETTINGS\_DIR\>/SlicerLauncherSettings.ini  
> additionalSettingsExcludeGroups=General,Application,ExtraApplicationToLaunch  
> launcherNoSplashScreen=false  
> launcherSplashImagePath=\<APPLAUNCHER\_DIR\>/bin/Slicer-SplashScreen.png  
> launcherSplashScreenHideDelayMs=3000  
> additionalLauncherHelpShortArgument=-h  
> additionalLauncherHelpLongArgument=–help  
> additionalLauncherNoSplashArguments=–no-splash,–help,–version,–home,–program-path,–no-main-window,–settings-path,–temporary-path
> 
> [Application]
> 
> path=\<APPLAUNCHER\_DIR\>/bin/ModuleName  
> arguments=–python-code “slicer.util.selectModule(‘ModuleName’)”  
> name=ModuleName  
> revision=29738  
> [organizationDomain=www.na-mic.org](http://organizationDomain=www.na-mic.org)  
> organizationName=NA-MIC
> 
> [ExtraApplicationToLaunch]

- 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.

Thank you!  
Hina

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [September 2, 2021, 5:32am UTC](https://discourse.slicer.org/t/launching-slicer-with-only-slicelet-displayed-on-mac/19472/4 "2021-09-02T05:32:11Z")

</div>

> [@hina-shah](#):
>
> I’m trying to launch Slicer with just a single module on Mac.

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.

> [@hina-shah](#):
>
> 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.

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.

In this file, there is the following:

```auto
[Extensions]
....

[Modules]
AdditionalPaths=@Invalid()
IgnoreModules=@Invalid()

```

Setting `IgnoreModules` to the list of modules should allow to achieve the desired effect on all platforms.

### Updating default settings (e.g home module)

- Create an empty the file `Slicer.app/Contents/www.na-mic.org/Slicer.ini` (or equivalent on Linux and Windows)
- Configure Module settings or any other settings of your choice

The setting found in the install tree will now be used and should allow you to create a zip file on all platform.

### Notes about renaming

- On macOS, you should be able to rename `Slicer.app` to `AnyName.app`

- Since the main application name is hard-coded in the executable at build time, you should not rename the settings files bundled in the package.

> <https://github.com/Slicer/Slicer/blob/7e8515f85efc44674c021336746b4c6d8a3363e4/Base/QTCore/qSlicerCoreApplication.cxx#L1567-L1570>
