Custom application does not open module at startup

I’ve compiled a custom application using the most recent Slicer commit on MacOS. In my superbuild CMakeList.txt file, I specify a default home module, currently set to Welcome:

set(Slicer_DEFAULT_HOME_MODULE “Welcome”)

When I run the application, both from the command line and after packaging, no module is opened at startup. Is this the expected behaviour? Is there somewhere else I need to set the module that should be opened at startup?

Based on what I know it should work as you expect it to work. However, usually we don’t specify this in a CMakeLists.txt file, but we use this at the time of CMake configuration. So this would be a cmake argument like this

-DSlicer_DEFAULT_HOME_MODULE:STRING="Welcome"

I can confirm, too, that set(Slicer_DEFAULT_HOME_MODULE “Welcome”) works. You would include it in the top-level CMakeLists.txt file if you use the custom application template. Note that the in the custom application template, “Welcome” module is disabled, so you either need to remove it from the disabled list or choose another home module.

Thanks, I tested setting it in the GUI instead. Though I guess that won’t do much good if my CMakeLists sets the module to be disabled!

Thank you. I’m trying a clean build now, with Data as the default module.

Another thing to note is that I’m hiding all of the toolbars in my custom application qAppMainWindow.cxx setupUi method:

// Hide the toolbars
this->MainToolBar->setVisible(false);
this->ModuleSelectorToolBar->setVisible(false);
this->ModuleToolBar->setVisible(false);
this->ViewToolBar->setVisible(false);
this->MouseModeToolBar->setVisible(false);
this->CaptureToolBar->setVisible(false);
this->ViewersToolBar->setVisible(false);
this->DialogToolBar->setVisible(false);

Does this interfere with the creation of the qSlicerModuleManager?

Right, I missed the part that this is for a custom application. My bad…

1 Like

No problem! I’ll see how this build goes once it’s done.

No

The default for custom application is expected to be “Home”. See https://github.com/KitwareMedical/SlicerCustomAppTemplate/blob/e8afb986dd07f47e6dfea2437723ec2b3b8ded43/{{cookiecutter.project_name}}/CMakeLists.txt#L42

Changing the value in the CMakeLists.txt and re-configuring and re-building the project from the top-level will have the expected effect.
Configuring the project passing Slicer_DEFAULT_HOME_MODULE option is also expected to change the value.

Ultimately the value is configured into the header Slicer/CMake/vtkSlicerConfigure.h.in

Thank you - I can see where it should be set on line 14 of vtkSlicerConfigure.h.in, and the correct value appears in Slicer-build/vtkSlicerConfigure.h:

#define Slicer_DEFAULT_HOME_MODULE “Data”

However, I’ve tried building the full Superbuild again, and when I run the executable, it starts with a blank module panel.

The error log doesn’t have much in it:

Debug, Python
Scripted subject hierarchy plugin registered: Annotations
Scripted subject hierarchy plugin registered: SegmentEditor
Scripted subject hierarchy plugin registered: SegmentStatistics

Warning, Qt
libpng warning: iCCP: known incorrect sRGB profile

Debug, Qt
Session start time …: 2018-11-30 13:49:09
Slicer version …: 4.11.0-2018-11-14 (revision 60adeea) macosx-amd64 - not installed release
PADPlanner2 version …: 1.2.0-2018-11-29 (revision 25c786a)
Operating system …: Mac OS X / 10.12.6 / 16G1618 - 64-bit
Memory …: 16384 MB physical, 1024 MB virtual
CPU …: GenuineIntel Intel® Core™ i7-6567U CPU @ 3.30GHz, 2 cores, 4 logical processors
VTK configuration …: OpenGL2 rendering, Sequential threading
Developer mode enabled …: no
Prefer executable CLI …: yes
Additional module paths …: (none)

What could be causing this?

In CMakeLists.txt files you only modify the default .ini file content. Delete the current .ini file if you want the application to start from default settings.

Ok. Which .ini file?

customapplicationname.ini

Rebuilding anything will not have any effect. Application setting .ini is stored in the user’s profile:
https://www.slicer.org/wiki/Documentation/Nightly/SlicerApplication/ApplicationSettings#Settings_file_location

Ok, sorry, I didn’t know. I’ll delete those and try again.
Thanks!

Excellent! Thank you. That solved it.

1 Like