120 likes | 304 Views
Slicer4 CLI. Slicer Execution Model. Variety of levels of integration. What is a CLI Module?. Simplest mechanism to contribute an algorithm to Slicer Plugin mechanism Command line paradigm Plugins are called with (argc, argv)
E N D
Slicer4 CLI Slicer Execution Model
What is a CLI Module? • Simplest mechanism to contribute an algorithm to Slicer • Plugin mechanism • Command line paradigm • Plugins are called with (argc, argv) • Arguments are flags, flags with values, or just indexed on the command line • CLI modules are self describing • ./myplugin –xml • Produces an XML description of the parameters for the plugin • CLI modules can be executables, shared libraries, or scripts • CLI modules can be used within Slicer or in batch
MRML magic If built as a shared library, these calls will pull data directly from the MRML scene!
Inside Slicer… Slicer provided Module writer provided vtkMRMLCommandLineModuleNode qSlicerCLIModuleWidget vtkSlicerCLIModuleLogic • YourModule.xml • <image> • <geometry> • <integer> • <double> • <file> qSlicerCLIModuleUIHelper • YourModule.py • XML • def toXML() • def Execute() • YourModule (exe) • YourModule –xml • YourModule.so • XMLModuleDescription • GetXMLModuleDescription() • ModelEntryPoint() or or
CLI Build System (within Slicer tree) One CLI, one directory CMakeList.txt
What can SEM/CLI do today? • Modules can be executables, shared libraries, scripts • Module “interface” defined through parameters • Parameters include “simple” and “bulk” types • Parameters passed through command line and files • Modules can be run inside and outside of 3D Slicer • Modules can report progress • Modules can be aborted • Modules are run in a separate processing thread • User interface built automatically from the parameter descriptions • Modules can be re-used easily from Python, harder to re-use in C++
What CAN’T SEM/CLI do today • Pass back intermediate results • Update the 3D Visualization/Slice Viewers while executing • Accept input while running to steer the module • Request input while running • Automatically execute with changes in MRML • Orchestrate a change in layout or visualization content • Easily use collections of Modules in a workflow or wizard • Call a SEM/CLI from a SEM/CLI