Running a loadable module as a slicelet

(question posted by Samira on slicer-devel) I am looking into slicelet now and I want to run my loadable extension as a slicelet. What do I need to add to the extension code? And is there any guide on how to do that?

This page should get you started:
https://www.slicer.org/wiki/Documentation/Nightly/Developers/Slicelets

Let us know if you have any specific questions or problems.

I used the 4.10 version. If I custom the slicer which way would be the best now?

I would recommend to use latest master version. There are a few unresolved issues due to a recent ITK upgrade, but they should be fixed within a few weeks (SimpleITK does not work on Mac and there are some DICOM loading issues when you use Add data dialog instead of DICOM module). If you are impacted by these then you might want to use a master version from a few weeks ago.

1 Like

I used ‘Slicer.exe --python-code “slicer.util.selectModule(‘QuickSegment’)”’ and get error:

Traceback (most recent call last):


  File "C:/Users/Desktop/QuickSegment/QuickSegment.py", line 65, in setup
    self.showSingleModule(True)
  File "C:/Users/Desktop/QuickSegment/QuickSegment.py", line 137, in showSingleModule
    slicer.util.setToolbarsVisible(not singleModule, keepToolbars)
AttributeError: module 'slicer.util' has no attribute 'setToolbarsVisible'

You need to use a recent master version of Slicer.

Ok, Thanks.
I will update my slicer.