I wish to create a custom Slicer. Something like http://salt.slicer.org/
I have build Slicer v4.11.20210226 on my machine (ubuntu 20.04) before.
Now, I wish to customize the application. Change the name, logo, looks, modules, etc.
I have been able to change logos quiet easily. Just change the logos and build Slicer, I got it to work. But, I’m still unclear on how to make other changes.
In order to make sure that my logos are not the cause of the problem, I have not changed anything. Just let the default logos be. In fact, the only change I made is the Slicer tag to v4.11.20210226 in the CMakeLists.txt file and started the build process.
I don’t understand what caused this error. Please help me decode this. It will be very helpful for my build.
Creating a custom app is a pretty advanced topic, meaning that you do it when you need total control of the build process, dependency libraries, and app behavior. With this much control it means there are a million options to consider and these need to be kept up to date with changes at various levels, so only the latest code versions are maintained and most likely to work so you should always start there before trying to customize.
So, I have tried to build it again. This time, I didn’t want to change anything. Hence, I used the default git tag in the top level CMakeLists.txt which was the latest commit in Slicer git repository. I have made no other changes to the file. In fact, I just did ‘cookiecutter gh:KitwareMedical/SlicerCustomAppTemplate’ with the name as SSLIP. Then, I created another directory named SSLIP-rel. I performed cmake. Then, make.
However, even without making any changes to the SlicerCustomAppTemplate, I am still unable to complete the build.
This is the latest error that I got.
I wanted to build custom Slicer based on v4.11.20210226 because it is currently the stable version. v4.13 is in preview release. It is not essential that I build using this version only.
After reading your comments, I have tried to build the latest one, but still got some build errors. I posted a photo of those in this forum.
I am writing in detail the steps that I followed to build custom Slicer. Please correct me if I am wrong.
Step1: cookiecutter gh:KitwareMedical/SlicerCustomAppTemplate. Then I get prompt in terminal to fill in application name, project name etc. which I have filled in accordingly. The name of the directory that is created is called SSLIP.
At this step I would normally make changes to CMakeLists.txt, logos, etc. But to make sure that I am not changing anything important, I have not touched any file and proceeded to the next step.
Step2: created another directory at the same level of SSLIP called SSLIP-rel.
Step3: Inside SSLIP-rel, I opened a terminal and entered the following command. cmake -DCMAKE_BUILD_TYPE:STRING=Release …/SSLIP
Step4: Then I did make.
The exact command I used is make 2>&1 >attempt11_output.log. This is to redirect the output to the log file.
The build runs for a couple of hours and then crashes with errors.
Thank you for the advice. I ran git init and added a commit. I was successfully able to build Slicer.
However, I came into some problems. Problem1: I turned Slicer_BUILD_EXTENSIONMANAGER_SUPPORT ON in the top level CMakeLists.txt in the SlicerCustomAppTemplate as I wanted to download some extensions.
The built Slicer has the Extension Manager. But no matter which extension I try to install, it doesn’t work.
For example, I have tried to install the SlicerVMTK extension. I even get a pop-up at the top right of the screen saying ‘Installed Extension SlicerVMTK’. But, the restart button at the bottom right corner of the screen doesn’t get activated. When I close and reopen Slicer, I cannot find the extension anywhere.
This is what I see in terminal when I try to install the SlicerVMTK extension.
libpng warning: iCCP: known incorrect sRGB profile
Retrieving extension metadata [ extensionId: 61cc101f342a877cb3f28a6a]
Retrieving extension files [ extensionId: 61cc101f342a877cb3f28a6a ]
Downloading extension [ item_id: 61cc101f342a877cb3f28a6a, file_id: 61ceb486342a877cb3f3dc34]
Installed extension SlicerVMTK (61cc101f342a877cb3f28a6a) revision 8e3fdf6
QPixmap::scaled: Pixmap is a null pixmap
“” 1 “JQuery not loaded - Failed to trigger webkitvisibilitychange”
But, the files are downloaded to the extensions folder. The same thing is happening with all the extensions.
Problem2: I have written some Effects in Segment Editor which also don’t seem to be working in the customized Slicer, but were working for me before. Note: I have written and used the effects in Slicer v4.11.20210226 but the custom built Slicer is the latest commit (v4.13). Could this be the reason?
Problem3: In my laptop (where the custom Slicer was built), I am able to launch the application successfully. It leads to the Slicer application home screen.
Then, I packaged the application (using make package). I am still able to launch the application. However, when I share the custom built Slicer application with someone else, they are unable to launch the application.
Errors related to ‘libqt5’ are showing up.
Thinking that there might have been some problem with the build, I tried building Slicer again. This time I got the following error.
In the directory where I have built Slicer, I searched for these shared object libraries, but I could not find them. However, the application still launches on my computer.
Is there anything wrong with my build process?
What changes do I need to make to solve this problem?
I figured out that the new laptop on which Slicer is expected to run on also needs to have the support libraries installed as it does not come as part of superbuild as explained in GNU/Linux systems — 3D Slicer documentation.
Once I installed these using the following commands, Slicer successfully launched.
However, is it possible to get rid of these requirements and get them with the superbuild itself? When I download Slicer from the website, I don’t need these support libraries to run the application. Everything comes neatly packaged. Is it possible for me to do the same for custom Slicer build?
Solution: I now understand that if I build Slicer, then I have to build the extensions myself. I cannot install them through the extension manager due to ABI compatibility issues. Using the instructions from Extensions — 3D Slicer documentation, I was able to successfully build a custom Slicer application with vmtk extension as shown in the figure below.