Upload
shakira-lindsley
View
217
Download
2
Embed Size (px)
Citation preview
National Alliance for Medical Image Computing http://na-mic.org
Anatomy of a plugin
Common architecture for interactive and batch processing
National Alliance for Medical Image Computing http://na-mic.org
Objectives
• Provide a simple mechanism for integrating user code with the rich user experience of Slicer3
• Support GUI application processing• Support batch processing
National Alliance for Medical Image Computing http://na-mic.org
Grand vision
UserDesktopAlgorithms ITK VTK Slicer
Modules
VTK AppsUsing ITK
Scripts ofSlicer Mods
BatchPrograms
Non-NAMICCmd tools BatchMake
BIRN GridWizard
Slicer 3.0
National Alliance for Medical Image Computing http://na-mic.org
Design
• Specification of parameters to control a plugin– Command line style parameter specification
– XML description
• Automatic discovery process for plugins– Searchpath for plugins
– Queries for XML description of parameters
• Automatic construction of GUI for plugins– Each parameter/attribute type maps to a specific style of GUI
element
Plugin writer focuses on algorithm, not GUI nor integration
National Alliance for Medical Image Computing http://na-mic.org
Each module has …
… an entry in the module menu
… a panel of user interface controls
National Alliance for Medical Image Computing http://na-mic.org
Plugin overview
National Alliance for Medical Image Computing http://na-mic.org
Parameters
<integer> | <float> | <double> | <boolean> | <string> | <integer-vector> | <float-vector> | <double-vector> | <string-vector> | <integer-enumeration> | <float-enumeration> | <double-enumeration> | <string-enumeration> | <file> | <directory> | <image>[type="scalar|label|tensor|diffusion-weighted|vector|model"] | <geometry> [type="fiberbundle|model"] | <point>[multiple="true|false"] [coordinateSystem="lps|ras|ijk"] | <region>[multiple="true|false"] [coordinateSystem="lps|ras|ijk"]
National Alliance for Medical Image Computing http://na-mic.org
Parameter description
<name> * C++ variable name of the parameter
<description> * Help message for parameter
<label> * GUI label for the parameter
<default> Default value
<flag> * Single character flag, e.g. –f
<longflag> * Single word flag, e.g. --outputImage
<constraints> Block around minimum/maximum/step. Trigger a slider to be used.
<minimum> Minimum parameter value
<maximum> Maximum parameter value
<step> Step size
<channel> * Input or output parameter (image, geometry, file, directory)
<index> * Position of a parameter without a flag. Starts at 0
<enumeration> * Block around element
<element> * Choice value for an enumeration
* Required tags
* Required under certain conditions
National Alliance for Medical Image Computing http://na-mic.org
Behind the scenes
• Tasks queued for processing thread• Three types of modules:
– executable,
– shared object, and
– Python modules
• Scalar images sent via files for executables and memory* for shared objects and python
• Vector images, tensor images, geometry, tables, transforms sent via files
• Scalars, file names, directories, fiducials, regions sent via command line
* VTK-based modules using scalar images are only supported as executable (command line) modules.
National Alliance for Medical Image Computing http://na-mic.org
(Current) Limitations
• Limited/restricted access to Slicer3 internals• Supported parameter types are prescribed by Slicer3
– Request new parameter types
• Some parameter types can only (currently) be sent to plugins, not returned from plugins
• Some parameters types are (currently) sent via files not mapped through memory
• Conditional parameter specification tricky• Non-interactive• Intermediate results not (currently) supported
National Alliance for Medical Image Computing http://na-mic.org
The next level
Full Slicer3 modules are also supported as plugins• Model-view-controller design: Node, GUI, Logic• Access to all Slicer3 services
o Exposed to Slicer3 architectureo Batch processing requires running all of Slicer3
National Alliance for Medical Image Computing http://na-mic.org
Slicer3 Plugins
Common architecture for interactive and batch processing