Download presentation
Presentation is loading. Please wait.
Published byMalcolm Andrews Modified over 8 years ago
1
National Alliance for Medical Image Computing http://na-mic.org Integrating with Slicer3
2
National Alliance for Medical Image Computing http://na-mic.org NA-MIC Kit Goals Software and Methodologies for Medical Image Computing –Facilitate Research –Promote Interoperability Stable, Cross-Platform Run Time Environment –Full Set of Core Features –Avoid Duplicated Effort Flexible Module Architecture –Plug-ins should be As Simple As Possible
3
National Alliance for Medical Image Computing http://na-mic.org Provided by D. Gering Slicer3 data model
4
National Alliance for Medical Image Computing http://na-mic.org Slicer3 “Observer MVC” Pattern MRML (Model) –For Scene Description and Application State –MRML Nodes are Persistent and Undoable –Scene and Nodes are Observable Logic Encapsulate VTK and ITK Pipelines (Controller) –Observe MRML to Configure Pipelines –Help Create/Manage Nodes –No UI Components (no Widgets, Actors, Mappers, Renderers or RenderWindows) GUI (View) –Observe and Edit MRML –Interact with User and Display Hardware Modules Should Follow Same Conventions Logic MRML Nodes GUI WidgetsRenderers Edit Observe Edit “Observe” means generic event mechanisms are used to pass information. “Edit” means code can directly call methods. Example: GUI can call methods in Logic classes, but Logic cannot call GUI methods. MRML cannot call Logic or GUI methods. There can be many observers for any event.
5
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 RegistrationRestricted access to Slicer internals Daemon OpenIGTLink Stochastic Tractography Access to MRML
6
National Alliance for Medical Image Computing http://na-mic.org Base Features vs. Modules FeaturesBaseModules VisualizationMRML: Models, Volumes, Volume Rendering, Fiducials, Continuum Meshes, Labeled Data Can create custom MRML Nodes and behavior FilteringNoneImplemented as Modules using ITK or other Libraries RegistrationTransform Display and Edit, Save/RestoreCalculate Transforms, Resample Data SegmentationLabel Maps, Parcellated SurfacesSegmentation Algorithms in ITK or other Libraries QuantificationLabel, Image, Volume Statistics; Numpy access to MRML Applications in Python or MATLAB Real-time IntegrationVTK Rendering, KWWidgets framework, Tracker Support (as Transforms) Direct Manipulation of the MRML Scene; 2D/3D Widgets; Device Interfaces, OpenIGTLink Module Diffusion ImagingDWI, DTI, Fiber BundlesTractography, Clustering, Atlases Applications“Bundles” of Modules in Distribution: Registration, Editor, some Filters, Customized Extensions, Domain- specific code, Optimized Interfaces…
7
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
8
National Alliance for Medical Image Computing http://na-mic.org Built in module vtkMRMLNode.hvtkSlicerModuleGUI.h vtkSlicerModuleLogic.h vtkMRMLYourModuleNode.h GetNodeTagName() Copy() ReadXMLAttributes() WriteXML() vtkSlicerYourModuleGUI.h BuildGUI() ProcessGUIEvents() ProcessLogicEvents() ProcessMRMLEvents() vtkSlicerYourModuleLogic.h ProcessMRMLEvents() ProcessLogicEvents() Slicer provided Module writer provided
9
National Alliance for Medical Image Computing http://na-mic.org Loadable module vtkMRMLNode.hvtkSlicerModuleGUI.h vtkSlicerModuleLogic.h vtkMRMLYourModuleNode.h GetNodeTagName() Copy() ReadXMLAttributes() WriteXML() vtkSlicerYourModuleGUI.h BuildGUI() ProcessGUIEvents() ProcessLogicEvents() ProcessMRMLEvents() vtkSlicerYourModuleLogic.h ProcessMRMLEvents() ProcessLogicEvents() YourModule.so GetLoadableModuleDescription() GetLoadableModuleLogic() GetLoadableModuleGUI() Slicer provided Module writer provided
10
National Alliance for Medical Image Computing http://na-mic.org Tcl scripted module vtkMRMLScriptedModule Node.h vtkSlicerScriptedModule GUI.h vtkSlicerScriptedModule Logic.h YourModuleNode.tcl YourModuleGUI.tcl proc YourModuleBuildGUI proc YourModuleProcessGUIEvents proc YourModuleProcessLogicEvents YourModuleLogic.tcl YourModule.tcl package provide YourModule x.y Slicer provided Module writer provided
11
National Alliance for Medical Image Computing http://na-mic.org Python scripted module vtkMRMLScriptedModule Node.h vtkSlicerScriptedModule GUI.h vtkSlicerScriptedModule Logic.h YourModuleGUI.py def BuildGUI() def ProcessGUIEvents() def ProcessLogicEvents() Slicer provided Module writer provided
12
National Alliance for Medical Image Computing http://na-mic.org Command line module vtkMRMLCommandLine ModuleNode.h vtkCommandLine ModuleGUI.h vtkCommandLine ModuleLogic.h YourModule.xml YourModule.so XMLModuleDescription GetXMLModuleDescription() ModelEntryPoint() Slicer provided Module writer provided YourModule (exe) YourModule –xml YourModule.py XML def toXML() def Execute() or
13
National Alliance for Medical Image Computing http://na-mic.org All modules are created equal… … an entry in the module menu … a panel of user interface controls
14
National Alliance for Medical Image Computing http://na-mic.org Modularity Goals Keep the base package “lean and mean” Modules have individual identity –Per-module web site, svn, downloads, mailing lists, wiki… Allow users to assemble their own set of tools –Customized ‘Bundles’ by task or application Easy to download compatible extensions –Analogous to Firefox extensions –Integrate extension builds into developer/nightly/release processs NITRC Supplement to NA-MIC helping to pay for needed infrastructure (Neuroimaging Informatics Tools and Resources Clearinghouse) –NITRC can host neuroimaging projects (gforge implementation)
15
National Alliance for Medical Image Computing http://na-mic.org Module distribution* * Under development
16
National Alliance for Medical Image Computing http://na-mic.org NITRC
17
National Alliance for Medical Image Computing http://na-mic.org Daemon slicerget.tcl name > image.nrrd cat image.nrrd | slicerput.tcl name YourTool
18
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 RegistrationRestricted access to Slicer internals Daemon OpenIGTLink Stochastic Tractography Access to MRML
19
National Alliance for Medical Image Computing http://na-mic.org Module Terminology Built-In Modules –Few Core Features Linked to Slicer3.cxx –Non-Core Modules becoming Loadable Loadable Modules –Dynamically Discovered and Loaded –Can Access Application’s MRML Scene Instance and Call SlicerBaseGUI and Related APIs (vtkRendering, KWWidgets…) Scripted Modules –Like Loadable, but Written in Tcl or Python Command Line Modules –Can Run as Stand Alone Executables –Provide Standard Command Line Parsing, which Allows Slicer to Generate GUI Automatically –Can be Compiled as Shared Library for Dynamic Link to Slicer
20
National Alliance for Medical Image Computing http://na-mic.org Loadable Modules http://www.slicer.org/slicerWiki/index.php/Slicer3:How_to_i mplement_an_Interactive_Module_GUIhttp://www.slicer.org/slicerWiki/index.php/Slicer3:How_to_i mplement_an_Interactive_Module_GUI http://www.slicer.org/slicerWiki/index.php/Slicer3:Loadable_ Modules:HOWTOhttp://www.slicer.org/slicerWiki/index.php/Slicer3:Loadable_ Modules:HOWTO Create vtkSlicerModuleGUI Subclass –Override Virtual Methods for CreateGUI, ProcessMRMLEvents, etc. Provide Custom vtkMRMLNode Subclass(es) to Represent, Save and Restore state Create Logic Classes to Implement Module Functionality Create CMake Configuration Files to Build and Install Shared Libraries for Runtime Discovery and Packaging
21
National Alliance for Medical Image Computing http://na-mic.org Scripted Modules A Generic ScriptedModule Module Provides Mapping of C++ Method Entry Points to a Corresponding Naming Convention for Scripts –vtkMRMLScriptedModuleNode, vtkSlicerScriptedModuleLogic, vtkSlicerScriptedModuleGUI Scripts are Dynamically Discovered at Runtime A Generic ScriptedModuleNode Allows Save/Restore of Keyword / Value Pairs to Represent Module State Full API of Slicer, MRML, KWWidgets, VTK, available (except where not wrappable; these APIs have been designed for scriptability) Editor is extensive Tcl-based Module Several Python examples are included in current svn trunk –Python modules can also access Numpy routines for Numerical processing (Volumes and other DataArrays are directly mapped to Numpy arrays for easy manipulation)
22
National Alliance for Medical Image Computing http://na-mic.org Command Line Modules Use the GenerateCLP command (provided with Slicer) to convert XML description of program arguments into a C++.h file Main program of module uses PARSE_ARGS macro provided by.h file to instance variables corresponding to parameters defined in XML file PARSE_ARGS also defines a --xml argument that returns original XML string on stdout Slicer parses the XML to create GUI for each module Are Covered Extensively in the HelloWorld Tutorial Note: Command Line Modules can be written in any language. C++ utilities are provided, but can be emulated / recreated as needed.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.