na-mic national alliance for medical image computing slicer4 guided tour steve pieper, ph.d
TRANSCRIPT
![Page 1: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/1.jpg)
NA-MICNational Alliance for Medical Image Computing http://na-mic.org
Slicer4Guided Tour
Steve Pieper, Ph.D.
![Page 2: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/2.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Goals
• Understanding the Lay of the Land• Developing our Common Language• Highlighting the Points of Interest
http://www.slicer.org/slicerWiki/index.php/Slicer4
![Page 3: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/3.jpg)
National Alliance for Medical Image Computing http://na-mic.org
The Big Picture
• Model / View / Controller Style– MRML / GUI / Logic
• Rules:– MRML: Things that get loaded with a
scene file.– GUI: Things that depend on a display.– Logic: Things that operate on MRML.
![Page 4: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/4.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Overview
![Page 5: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/5.jpg)
National Alliance for Medical Image Computing http://na-mic.org
MRML Concepts: Nodes
• Data Containers and Data Helpers– XML (De)Serializable– Issue Events when Changed– Have Pointers to Bulk Data
• E.g. vtkImageData, vtkPolyData…
• Have Unique IDs
• Exist in only one MRML Scene– One MRML Scene for the Application
![Page 6: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/6.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Coordinate Systems
http://www.slicer.org/slicerWiki/index.php/Coordinate_systems
• Interface Works in Millimeters, Patient Space
• Volume Nodes have IJKToRAS– IJK is Index Space of Image– RAS is Right/Anterior/Superior
• vtkImageData is pixel container with origin 0,0,0 and spacing 1,1,1
• Annotations, PolyData are RAS mm
![Page 7: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/7.jpg)
National Alliance for Medical Image Computing http://na-mic.org
MRML: Storable
• Storable Nodes Reference Storage Nodes
• Storage Nodes: Bulk Data I/O
• Storage Nodes allow RemoteIO (URL access to Bulk Data)– HTTP download supported now– Upload handlers still experimental– Scene files can contain URLs
![Page 8: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/8.jpg)
National Alliance for Medical Image Computing http://na-mic.org
MRML: Displayable
• Has List of Display Nodes– Tagged by ViewNode IDs: each display
node on/off in each view– E.g. FiberBundles with Lines + Glyphs
• DisplayNode has Parameters and Pipelines to Implement Visualization of Displayable
![Page 9: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/9.jpg)
National Alliance for Medical Image Computing http://na-mic.org
MRML Transformable
• Has Reference to TransformNode defining Transform To Parent
• Transforms are RAS to RAS
• Linear Transforms are Handled On-the-fly
• Non-Linear Transforms must be applied using modules
![Page 10: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/10.jpg)
National Alliance for Medical Image Computing http://na-mic.org
MRML: Hierarchies
• Grouping Concept Independent of Transform Hierarchy– E.g. Vascular Tree Levels of Detail
• In Slicer3, Parent Model Display Parameters Override when Collapsed
• In Slicer4, Plans to Use Hierarchies for Time Series, DICOM, etc.
![Page 11: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/11.jpg)
National Alliance for Medical Image Computing http://na-mic.org
• (Were SceneSnapShots in Slicer3)
• Retains State of MRML Nodes– Included in MRML Scene File– Optional Image and Text Description
• Bulk Data Not Copied– Load all Bulk Data Before Making
SceneViews– Use Visibility to Control what is Shown
MRML: SceneViews
![Page 12: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/12.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Module GUIs
• qSlicerAbstractModuleWidget subclasses (are QWidgets)
• setup()
• enter()
• exit()
• Are MRMLNode Editors– Synchronize MRML Events
to/from Widgets
![Page 13: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/13.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Modules
• Slicer Loadable Modules– Shared Libraries Discovered at Run-
Time– Can use Qt, MRML, VTK, ITK, Teem,
etc.– Best Choice for Full Control,
Interactivity, Optimized Computation
• Requires Familiarity with C++ APIs
![Page 14: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/14.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Command Line Interface (CLI) Modules
• Just Like Slicer3
• Any Executable that Works with –xml can be used (even via wrapper scripts)
• Shared Library CLI for Better Performance
• No Slicer API Knowledge Required
• Interface is Consistent, but Limited
![Page 15: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/15.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Scripted Modules
• Most of Qt, VTK, Slicer API Exposed– Only Python Supported– Tcl Legacy Mode to Ease Transition
• Very Rapid Development Iterations
• Requires Some Familiarity with APIs
• More about Slicer4 Python Later…
![Page 16: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/16.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Extensions
• Any Module Type can be an Extension
• Optional User Install– Built to Match Slicer Version– Network Download from within Slicer
• NA-MIC DBPs, Collaborations are Expected to Deliver Extensions
• Extension Writing Tutorial Later…
![Page 17: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/17.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Slicer4 Views
• LayoutNode Defines Interface
• Layout Manager Creates View Widget Instances to Match Layout
• ViewNodes Describe 3D Views
• SliceNodes + SliceCompositeNodes Describe 2D Slice Views
![Page 18: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/18.jpg)
National Alliance for Medical Image Computing http://na-mic.org
DisplayableManagers
• DisplaybleManagers Link DisplayableNodes to VTK Actors/Mappers/Props/Widgets– Must Synchronize Events from Either
Source (like Module GUIs)
• Modules Can Register DisplayableManagers with Factory– DisplayableManagers are Instanced as
Views are Created
![Page 19: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/19.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Overview Revisited
![Page 20: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/20.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Functional Decomposition
• Reusable Components with Only Needed Dependencies– CTK for Non-Slicer-Specific Qt+DICOM (+VTK)– Reusable MRML: MRMLLogic, qMRMLWidgets– Module Support: SlicerExecutionModel, QTCLI– Slicer: QTCore, QTGUI– Modules: QTCoreModules, QTModules,
QTScriptedModules
• Extensions
![Page 21: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/21.jpg)
National Alliance for Medical Image Computing http://na-mic.org
DICOM Interface
• Slicer3– File Based, Limited Write– Special Purpose Converters (e.g. DWI)
• Slicer4 (in Development)– Networking and Database (Q/R, Store)– Ron’s “Lollipop” Model (MRMLScene in
Private Tags)
• Community Input Needed
![Page 22: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/22.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Collaborating Groups
• CTK, DCMTK, ITKv4, VTK, CMake, Python, Qt…
• “SuperBuild Philosophy”– Slicer Organization on github.com
• patched versions as needed
– Edits “Belonging” in Package Go in git– Avoid Workarounds/Duplicates in Slicer
![Page 23: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/23.jpg)
National Alliance for Medical Image Computing http://na-mic.org
svn and git
• http://svn.slicer.org/Slicer4/trunk– For Nightly builds, releases,
collaboration
• http://www.slicer.org/slicerWiki/index.php/Slicer:git-svn– Developers can choose to use git for
topic branches
• Extensions can use git/svn/cvs
![Page 24: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/24.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Coding Conventions
• http://www.slicer.org/slicerWiki/index.php/Slicer:Style_and_Conventions– Use Style of Parent Class
• VTK Classes use VTK Style• Qt Classes use Qt Style• Python Code uses Python Style
– Comments and Testing– Communicate with your Colleagues
![Page 25: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/25.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Python in Slicer4
• Scripted Modules as Slicelets
• Python Console
• PythonQt
• Slicer in External Python
• .slicerrc.py
• Python testing
• Scripted Access to Modules
![Page 26: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/26.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Slicer4: What Works (mostly)
• Main GUI, Toolbars, Menus• Scene/Data Load/Save• Slice and 3D Visualization (pan/zoom, overlays, models…)• Command Line Modules• Python Wrapping, Python Scripted Modules• Loadable Modules• Editor• Annotations (Evolution of Fiducials and Measurements)• Nightly Builds• Volume Rendering• Many things…
![Page 27: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/27.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Slicer4: What’s Missing
• Some Core Modules Need Work• Hierarchies Need Elaboration• IGT Modules• Performance Optimization• Your Extensions!
Please help identify what is needed to support your work.
![Page 28: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/28.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Developer Decision Tree
• Working on the Slicer Core?– Focus on Qt Transition
• Working on a Module?– Build it as an Extension
• Command Line Module?– Develop and Test with Slicer3.6 or Slicer4
• GUI Project with Deadlines in early 2011?– Develop with KWWidgets for 3.6.X– Keep your Logic and MRML Distinct from the GUI– Ongoing Support will be Provided
• Longer-Term Project that Needs a Custom GUI?– Start working with developer builds of Slicer4– Talk with dev team about any key missing features– Consider doing some or all coding in Python
Just use Slicer4 for New Projects
![Page 29: NA-MIC National Alliance for Medical Image Computing Slicer4 Guided Tour Steve Pieper, Ph.D](https://reader035.vdocuments.site/reader035/viewer/2022062321/56649da95503460f94a95d80/html5/thumbnails/29.jpg)
National Alliance for Medical Image Computing http://na-mic.org
Implementation Strategies
• Non-Interactive Algorithm– Write ITK Class– Use Slicer Execution Model– Add as Extension
• Interactive Segmentation– Add Effect to Editor Module– Add as Extension (coming soon)
• Custom GUI?– Loadable Module