How to Run a Built Slicer Loadable Module on a Released Slicer Version

Hello,

I am currently developing a loadable module for 3D Slicer and have successfully built the module. I have also tested running the module within the built version of Slicer.

One thing I am curious about is how to run the built module on a released version of Slicer, such as the .exe or .dmg versions. Could you provide guidance on how to achieve this?

Thank you!

If you’ve added the module to the Slicer build system, you can just run make package (or build the Windows PACKAGE target).

Thank you for the response, Steve.

So, after creating the package, do we just place the .dll files in the Extensions-### folder? Our ultimate goal is to make our module easy to install, similar to how an extension manager works.

You can bundle loadable modules in the build tree just by adding them in cmake like the other built-in ones. This will automatically make them part of the packaging process so you don’t need to have them as extensions.

I apologize for the lack of clarity in my previous explanation.

What I’m looking for is a way to load a custom loadable module into the “Release” Slicer provided on the “Slicer website”.

Through this, we believe that only those developing loadable modules would need to build Slicer, while those using scripted modules could simply use the released version of Slicer. This would allow for more efficient management of the development environment.

In theory you can build Slicer modules using exactly the same compiler versions and flags so that your locally-built dlls will load in the release of Slicer from the download site, but in practice this is pretty difficult, so it’s better to make a build that has both the core Slicer and your C++ code.

Then, how do we install a loadable module from the Extension Manager?

Well, you could also build the extension, package it, and install from the file. This would allow you to update the extension without rebuilding the base Slicer. Or if you add your modules to Slicer’s modules/loadable directory and cmake files it would build and package up as one unit.

1 Like

Following your advice, I successfully loaded the module.
Thank you as always, Steve.