slicer4 cli

12
NA-MIC National Alliance for Medical Image Computing http://na-mic.org Slicer4 CLI Slicer Execution Model

Upload: sitara

Post on 23-Jan-2016

48 views

Category:

Documents


0 download

DESCRIPTION

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) - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Slicer4 CLI

NA-MICNational Alliance for Medical Image Computing http://na-mic.org

Slicer4 CLI

Slicer Execution Model

Page 2: Slicer4 CLI

National Alliance for Medical Image Computing http://na-mic.org

Variety of levels of integration

Slicer Libs

• ModuleDescriptionParser• GenerateCLP• vtkITK• MRML

Non-slicer specific support libraries

Slicer Base• Application logic• Widgets

Common infrastructure for Slicer applications

Built in modules

• Slice viewers• Models• Fiducials• Transforms

Full access to Slicer internals

Loadable modules

• Query Atlas• QDEC• Volume rendering• ChangeTracker• EMSegment

Full access to Slicer internals

Scripted modules• Editor• Teem Two Tensor Tractography• VMTK

Limited access to Slicer internals

Command line modules • Registration Restricted access to Slicer internals

Daemon• OpenIGTLink• Stochastic Tractography

Access to MRML

Page 3: Slicer4 CLI

National Alliance for Medical Image Computing http://na-mic.org

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

Page 4: Slicer4 CLI

National Alliance for Medical Image Computing http://na-mic.org

XML description of a module…

Page 5: Slicer4 CLI

National Alliance for Medical Image Computing http://na-mic.org

… produces a user interface

Page 6: Slicer4 CLI

National Alliance for Medical Image Computing http://na-mic.org

… produces command line parsing code

Page 7: Slicer4 CLI

National Alliance for Medical Image Computing http://na-mic.org

MRML magic

If built as a shared library, these calls will pull data directly from the MRML scene!

Page 8: Slicer4 CLI

National Alliance for Medical Image Computing http://na-mic.org

Inside Slicer…

vtkMRMLCommandLineModuleNode

qSlicerCLIModuleWidget

vtkSlicerCLIModuleLogic

YourModule.xml•<image>•<geometry>•<integer>•<double>•<file>

YourModule.so•XMLModuleDescription•GetXMLModuleDescription()•ModelEntryPoint()

Slicer provided

Module writer provided

YourModule (exe)•YourModule –xml

YourModule.py•XML•def toXML()•def Execute()

or or

qSlicerCLIModuleUIHelper

Page 9: Slicer4 CLI

National Alliance for Medical Image Computing http://na-mic.org

CLI Build System (within Slicer tree)

One CLI, one directory CMakeList.txt

Page 10: Slicer4 CLI

National Alliance for Medical Image Computing http://na-mic.org

CLI Build System (as Slicer Extension)

Page 11: Slicer4 CLI

National Alliance for Medical Image Computing http://na-mic.org

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++

Page 12: Slicer4 CLI

National Alliance for Medical Image Computing http://na-mic.org

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