Detecting and loading Loadable modules


#1

Hello, I have written a custom C++ loadable module in Slicer, and it works fine when I run it on my built version of Slicer. However, when I try to run it on a standard version of Slicer, it does not load my module, it appears greyed out in the Module list in Application Settings. Does this guide still apply for Slicer4:

https://www.slicer.org/wiki/Slicer3:Loadable_Modules:HOWTO

If so, would it be possible to link a module that has implemented the required changes. I do not see these changes in the CropVolume module for example.


(Csaba Pinter) #2

The page you linked belongs to Slicer version 3, which is a completely different architecture. Please confirm you’re using Slicer 4.

However in general if you build something locally, it is basically impossible to expect that the configuration of your build environment (Qt version, etc.) will be exactly the same as in the factory machine.

The best way to use your module with factory-built Slicer is to publish it as an extension and install it from Extension Manager after the factory machine built it against the factory Slicer.


#3

Yes I am using Slicer 4. I posted that link to see if there was a newer version I could follow. I think I understand what you’re saying. I bundled my module into an extension, built the extension, but I do not have a PACKAGE target. Did I do something wrong?


(Csaba Pinter) #4

This is the main developer wiki page that points to all the how-tos:
https://www.slicer.org/wiki/Documentation/Nightly/Developers

A few of them that are related to the one you linked before:
https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build_Module
https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/Module
https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/Extension

As for the missing package target, I’m not sure. If your extension is not a superbuild extension, then it should be in the Extension.sln solution, or available for make if you use Mac (which in this case will be “make package” - lower case).


#5

Thank you, I had accidentally selected superbuild when I initially made the extension. I fixed that, built the PACKAGE target, installed the zip from the Extension Manager, but my module is still greyed out. Any advice?


(Csaba Pinter) #6

Please see what I wrote above:


#7

Thank you for your patience. I understand what you mean now. When I try to publish using the following command from my slicer-build directory:

bin/slicerExtensionWizard --publish ~/MyExtension

I receive the following output:

bin/slicerExtensionWizard: line 4: declare: `APPLAUNCHER_0_CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files': not a valid identifier
bin/slicerExtensionWizard: line 4: declare: `APPLAUNCHER_0_ProgramFiles(x86)=C:\Program Files (x86)': not a valid identifier
bin/slicerExtensionWizard: line 4: declare: `APPLAUNCHER_0_asl.log=Destination=file': not a valid identifier
Creating initial commit containing the following files:

And then it lists all the right files, but Git Bash seems to hang forever. Are those errors preventing the publishing?


(Csaba Pinter) #8

Publishing an extension consists of submtting the s4ext file to the ExtensionIndex repository. That way when the factory build machine parses the extensions it will find yours and build that one as well.

Here’s the guide:
https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/BuildTestPackageDistributeExtensions

Let us know if something is not straightforward or if some parts of the wiki page are outdated. Thanks!