3dslicer extension deployment options
-
Main links
-
slicerrc.py is a thing! sample: 3D-Slicer-Scripts/.slicerrc.py at master · jzeyl/3D-Slicer-Scripts · GitHub
-
Slicer custom application deployment to many computers - Development - 3D Slicer Community
SlicerQReads.exe --python-code "folder='S:\SlicerQREADS\TestImages'; import os; slicer.util.loadVolume(folder + '/' + os.listdir(folder)[0], {'singleFile': False})"
- alternatively:
Slicer.exe --python-script "/full/path/to/myscript.py" --no-splash --no-main-window
3
-
Slicer can run in Docker4
-
Slicer can run in webbrowser5
-
Slicer can run in jupyter5, including partially (e.g. only a single view etc!)
Slicer --help
:
--testing Activate testing mode. It implies --disable-settings and --ignore-slicerrc. (default: false)
--disable-python Disable python support. This is equivalent to build the application with Slicer_USE_PYTHONQT=OFF.
--python-script Python script to execute after slicer loads.
--python-code Python code to execute after slicer loads.
-c Python code to execute after slicer loads. By default, no modules are loaded and Slicer exits afterward.
--ignore-slicerrc Do not load the Slicer resource file (~/.slicerrc.py).
--additional-module-path Additional module path to consider when searching for modules to load.
--additional-module-paths List of additional module path to consider when searching for modules to load.
-
Slicer modules — todo, CLI things with easy arguments
-
Slicer extensions/modules creation
- Developing extension in 3D Slicer - Google Slides presentation
- Sharing extensions there: TL;DR use slicer publishing thing to publish to own repo, then PR to slicer main extensions index repo (GitHub - Slicer/ExtensionsIndex: Slicer extensions index)
- Sample JSON: ExtensionsIndex/SurfaceWrapSolidify.json at main · Slicer/ExtensionsIndex · GitHub
- Pull requests · Slicer/ExtensionsIndex has code for existing recent extensions that may be useful
- Developing extension in 3D Slicer - Google Slides presentation
-
Extension manager
- Extensions Manager — 3D Slicer documentation 2
- Can have different extension server URI!
- Updating:
- Extensions Manager — 3D Slicer documentation
- TL;D/R extension manager can do that incl. automatically
-
CI/CD exists for extensions published officially
-
Misc:
- Script repository — 3D Slicer documentation has sample uses of slicer CLI!
- 3D-Slicer-Scripts/.slicerrc.py at master · jzeyl/3D-Slicer-Scripts · GitHub
-
Script repository — 3D Slicer documentation has this:
-
This code snippet can be useful for sharing code in development without requiring a restart of Slicer.
- gist.githubusercontent.com/pieper/a9c0ba57de3833c9f5aea68247bda597/raw/82d73d85340ffd205b01fc339b096a8607cfe02b/InstallSlicerModuleFromGit.py
- TODO, does this mean updating extensions without restart?
- EDIT: I can reload the code of the extension as-is
-
-
Fazit:
- extensions can be built (C++) or not (python)
- enabling:
- add to CLI path to “additional module paths” path to place where .py extension is locally
- git pull etc.?
- get a .zip from the repo and use the python code to get it from there and update
- make our own extension manager repo thing and use automatic updating functionality
- add to CLI path to “additional module paths” path to place where .py extension is locally
-
Other bits
- Making Slicer simpler by hiding many things: Simple 3D Slicer based image viewer
- And hiding a module UI: Slicer/Modules/Scripted/DICOMPlugins/DICOMScalarVolumePlugin.py at 022a4f1a347ebb24509a50f6c8928ae26d3c5955 · Slicer/Slicer
-
Run Slicer in your web browser - as a Jupyter notebook or as a full application - Announcements - 3D Slicer Community ↩︎
-
GitHub - Slicer/SlicerDocker: Build, package, test, and run 3D Slicer and Slicer Extensions in Docker. ↩︎
-
Run Slicer in your web browser - as a Jupyter notebook or as a full application - Announcements - 3D Slicer Community ↩︎ ↩︎