national alliance for medical image computing user desktop slicer 3.0 architecure algorithmsitkvtk...

10
National Alliance for Medical Image Computing http://na-mic.org User Desktop Slicer 3.0 Architecure Algorithms ITK VTK Slicer Modules VTK Apps Using ITK Scripts of Slicer Mods Batch Programs Non-NAMIC Cmd tools LONI Pipeline Birn Grid Data/Compute Slicer 3.0

Upload: chase-ramos

Post on 27-Mar-2015

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: National Alliance for Medical Image Computing  User Desktop Slicer 3.0 Architecure AlgorithmsITKVTK Slicer Modules VTK Apps Using ITK

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

UserDesktop

Slicer 3.0 Architecure

Algorithms ITK VTK SlicerModules

VTK AppsUsing ITK

Scripts ofSlicer Mods

BatchPrograms

Non-NAMICCmd tools

LONIPipeline

Birn GridData/Compute

Slicer 3.0

Page 2: National Alliance for Medical Image Computing  User Desktop Slicer 3.0 Architecure AlgorithmsITKVTK Slicer Modules VTK Apps Using ITK

MRML

BaseLogic

Links to: ITK

MRMLVTK (except Rendering)

GUILinks to:

VTK RenderingKWWidgets

Observe ModifiedEvents

Edit Mrml Scene/Nodes

Mediators

Interactive ModuleLogic

Links to: Base Logic

ITKMRML

VTK (except Rendering)

GUILinks to:

VTK RenderingKWWidgets

Mediators

Observe ModifiedEvents on ApplicationState

Edit Mrml Scene/Nodes

•Registers GUI Event Observers

Observe ModifiedEvents

Provides •Frames for Widgets,•Routing of User Events

Execution Model Manager

LogicLinks to:

Base Logic

GUILinks to:

KWWidgets Mediators

ExternalProcesses (Grid/Pipeline)

• Speak MRML(link to libmrml

or have data staged by slicer)•Uses the JSON interface

(Managed by Base and communicatslike other Modules)

Describe Input options

Formulates Command Lineand possiblystages data

MRMLAware ProcessesCan Edit Mrml Scene/Nodesand Observe Modified Events

Slicer 3 Architecture Diagram (2006-01-26)

Auto-Generated GUIs from JSON Descriptions

Notes:•All classes in the Logic directory should be able to run ‘headless’ without OpenGL or window system for scripting and testing•Base/Logic contains transient application state (cursor location, focus, mrml scene connection…)•Interactive Modules are ones which interact with the VTK scene and/or User events•Interactive Modules interact with 3D scene by creating objects in MRML scene (not by direct manipulation of the Renderer)•Logic classes encapsulate and manage internal vtk/itk pipelines•GUI classes are implemented as KWWidget subclasses•Each Logic class defines a set of Get/Set methods for internal state and Modified Events that GUI classes can Observe

Page 3: National Alliance for Medical Image Computing  User Desktop Slicer 3.0 Architecure AlgorithmsITKVTK Slicer Modules VTK Apps Using ITK

data layer data mediator logic layer gui mediator gui layer

Main program; Bootstrap application logic, Create application gui

MRML data model

VTK pipeline VTK pipeline

Logic code adds modified event observers to MRML scene and MRML nodes.

Logic methods apply changes to the MRML scene.

(VTK, ITK, no KWWidgets, no VTKRendering)

vtkObject

vtkSlicerLogic

- Undo manager,

- tracing

vtkSlicerApplicationLogic

- MRML slice #

- “transient state”

- open views, slices,

modules (and active)

- cursor location

- version

- focus, event routing

vtkSlicerViewLogic

vtkSlicerLinkedSliceLogic

vtkSliceLogic

- vtkImageReslice

- vtkImageComposite

vtkSlicerSliceLayerLogic

- MRML node

- Opacity

- Compositing

- Window/level

vtkSlicerViewLogic

vtkSlicerModuleLogic

- Undo/tracing helpers

vtkSlicerEditorLogic

vtkSlicerMRMLLogic

vtkSlicerCustomModuleLogic

GUI code adds observers to modified events generated by/to logic

Apply methods from GUI classes call set method in logic to change state

vtkKWWidget

vtkSlicerGUI

- look & feel?

- set command helpers?

vtkSlicerApplicationGUI

- connect to window system

- vtkKWApplication

- vtkKWWindow

vtkSlicerViewGUI

- Render windows

- mappers, actors

vtkSlicerSliceGUI

- vtkImageMapper

- vtkKWRenderWindow

vtkSlicerSliceLogicGUI

vtkSlicerModuleGUI

vtkSlicerCustomModuleGUI

Page 4: National Alliance for Medical Image Computing  User Desktop Slicer 3.0 Architecure AlgorithmsITKVTK Slicer Modules VTK Apps Using ITK

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

Slicer Daemon

• Slicerd listens on local socket• slicerget <id>

– gets volume and writes to stdout in nrrd

• slicerput [name]– reads nrrd on stdin and puts in slicer

% slicerget 0 | unu 1op exp - | slicerput

Page 5: National Alliance for Medical Image Computing  User Desktop Slicer 3.0 Architecure AlgorithmsITKVTK Slicer Modules VTK Apps Using ITK

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

ITK IO and Slicer Daemon

AntiAliasBinaryImageFilter.exe bunny.z.nrrd "| sh slicerput.tcl"

Page 6: National Alliance for Medical Image Computing  User Desktop Slicer 3.0 Architecure AlgorithmsITKVTK Slicer Modules VTK Apps Using ITK

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

Undo Architecture for Slicer3

• Versioning “Commit Aside” Strategy Encapsulated within MRML

• Store “Initial Scene” (from file) and “Delta Scenes” (scenes containing undoable changes)

• Delta Scenes ‘are’ MRML Scenes • Some Nodes are Reference Nodes• Setting the MRML scene in the Application Logic

causes the cascade of observer callbacks • => All Undoable operations must store their data

as MRML nodes

Page 7: National Alliance for Medical Image Computing  User Desktop Slicer 3.0 Architecure AlgorithmsITKVTK Slicer Modules VTK Apps Using ITK

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

Undo 1st Pass

Initial Scene

Application Logic

N1

N2

N3

Delta1 Scene

R

N4

R

Delta2 Scene

R

R

N5

Saved Scene

N1

N4

N5

Undo Stack

Page 8: National Alliance for Medical Image Computing  User Desktop Slicer 3.0 Architecure AlgorithmsITKVTK Slicer Modules VTK Apps Using ITK

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

Undo Current

Initial Scene

MRML Scene

N1

N2

N3

Delta1 Scene

N4

Delta2 Scene

N5

Saved Scene

N1

N4

N5

Undo Stack

Page 9: National Alliance for Medical Image Computing  User Desktop Slicer 3.0 Architecure AlgorithmsITKVTK Slicer Modules VTK Apps Using ITK

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

Slice Management

ForegroundSlice Layer Logic

Slice Node

Slice Composite Node

BackgroundSlice Layer Logic

Slice Logic

Volume Display NodeVolume Node

Volume Display NodeVolume Node

Slice GUI

MRML Nodes: Persistent, Undoable State

Logic: Encapsulate VTK Pipelines, Observe MRML Nodes

GUI: Manage Widgets and Rendering; Manipulated Nodes and Logic; Observe Nodes and Logic

Page 10: National Alliance for Medical Image Computing  User Desktop Slicer 3.0 Architecure AlgorithmsITKVTK Slicer Modules VTK Apps Using ITK

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

Slice Coordinates

XY Image Space Coordinates

Slice Coordinates

RAS to RAS Coordinates

IJK Volume Coordinates

XYToSlice Matrix

SliceToRAS Matrix

RASToRAS Transforms

RASToIJK Matrix

IJK = RASToIJK * RASToRAS * SliceToRAS * XYToSlice * XY

SliceNode

XYToIJK Matrix Calculated by SliceLayerLogic

From GUI