National Alliance for Medical Image Computing User Desktop Slicer 3.0 Architecure AlgorithmsITKVTK 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
MRML Base Logic Links to: ITK MRML VTK (except Rendering) GUI Links to: VTK Rendering KWWidgets Observe Modified Events Edit Mrml Scene/Nodes Mediators Interactive Module Logic Links to: Base Logic ITK MRML VTK (except Rendering) GUI Links to: VTK Rendering KWWidgets Mediators Observe Modified Events on Application State Edit Mrml Scene/Nodes Registers GUI Event Observers Observe Modified Events Provides Frames for Widgets, Routing of User Events Execution Model Manager Logic Links to: Base Logic GUI Links to: KWWidgets Mediators External Processes (Grid/Pipeline) Speak MRML (link to libmrml or have data staged by slicer) Uses the JSON interface (Managed by Base and communicats like other Modules) Describe Input options Formulates Command Line and possibly stages data MRML Aware Processes Can Edit Mrml Scene/Nodes and Observe Modified Events Slicer 3 Architecture Diagram ( ) 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
data layerdata mediatorlogic layergui mediatorgui layer Main program; Bootstrap application logic, Create application gui MRML data model 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
National Alliance for Medical Image Computing Slicer Daemon Slicerd listens on local socket slicerget –gets volume and writes to stdout in nrrd slicerput [name] –reads nrrd on stdin and puts in slicer % slicerget 0 | unu 1op exp - | slicerput
National Alliance for Medical Image Computing ITK IO and Slicer Daemon AntiAliasBinaryImageFilter.exe bunny.z.nrrd "| sh slicerput.tcl"
National Alliance for Medical Image Computing 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
National Alliance for Medical Image Computing Undo Example Initial Scene Application Logic N1 N2 N3 Delta1 Scene R N4 R Delta2 Scene R R N5 Saved Scene N1 N4 N5 Undo Stack