Slicer 3.0 Architecure Algorithms ITK VTK Slicer Modules Slicer 3.0 Scripts of Slicer Mods VTK Apps Using ITK Batch Programs Non-NAMIC Cmd tools LONI Pipeline Birn Grid Data/Compute National Alliance for Medical Image Computing http://na-mic.org User Desktop.
Download ReportTranscript Slicer 3.0 Architecure Algorithms ITK VTK Slicer Modules Slicer 3.0 Scripts of Slicer Mods VTK Apps Using ITK Batch Programs Non-NAMIC Cmd tools LONI Pipeline Birn Grid Data/Compute National Alliance for Medical Image Computing http://na-mic.org User Desktop.
Slicer 3.0 Architecure Algorithms ITK VTK Slicer Modules Slicer 3.0 Scripts of Slicer Mods VTK Apps Using ITK Batch Programs Non-NAMIC Cmd tools LONI Pipeline Birn Grid Data/Compute National Alliance for Medical Image Computing http://na-mic.org User Desktop Slicer 3 Architecture Diagram (2006-01-26) Execution Model Manager Auto-Generated GUIs from JSON Descriptions Logic Links to: Base Logic Mediators Base (Managed by Base and communicats like other Modules) GUI Links to: KWWidgets Observe Modified Events Formulates Command Line and possibly stages data Logic Links to: ITK MRML VTK (except Rendering) Edit Mrml Scene/Nodes Mediators GUI Links to: VTK Rendering KWWidgets Provides •Frames for Widgets, •Routing of User Events Observe Modified Events on Application State •Registers GUI Event Observers MRML Describe Input options External Processes (Grid/Pipeline) • Speak MRML (link to libmrml or have data staged by slicer) •Uses the JSON interface Interactive Module Observe Modified Events MRML Aware Processes Can Edit Mrml Scene/Nodes and Observe Modified Events Edit Mrml Scene/Nodes Logic Links to: Base Logic ITK MRML VTK (except Rendering) Mediators GUI Links to: VTK Rendering KWWidgets 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 Main program; Bootstrap application logic, Create application gui data layer data mediator Logic code adds modified event observers to MRML scene and MRML nodes. MRML data model Logic methods apply changes to the MRML scene. VTK pipeline logic layer gui mediator gui layer (VTK, ITK, no KWWidgets, no VTKRendering) vtkKWWidget vtkObject vtkSlicerGUI - look & feel? 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 - set command helpers? vtkSlicerApplicationGUI - connect to window system - vtkKWApplication - vtkKWWindow vtkSlicerViewGUI - Render windows - mappers, actors vtkSlicerSliceGUI - vtkImageMapper - vtkKWRenderWindow vtkSlicerSliceLogicGUI VTK pipeline vtkSlicerModuleGUI vtkSlicerCustomModuleGUI 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 National Alliance for Medical Image Computing http://na-mic.org ITK IO and Slicer Daemon AntiAliasBinaryImageFilter.exe bunny.z.nrrd "| sh slicerput.tcl" 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 National Alliance for Medical Image Computing http://na-mic.org Undo 1st Pass Undo Stack Application Logic Initial Scene Delta1 Scene Delta2 Scene Saved Scene N1 R R N1 N2 N4 R N4 N3 R N5 N5 National Alliance for Medical Image Computing http://na-mic.org Undo Current Undo Stack Initial Scene Delta1 Scene MRML Scene Delta2 Scene N1 N2 Saved Scene N1 N4 N3 National Alliance for Medical Image Computing http://na-mic.org N4 N5 N5 Slice Management Volume Display Node Volume Node Foreground Slice Layer Logic Volume Display Node Volume Node Background Slice Layer Logic Slice Node Slice Logic Slice Composite Node 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 National Alliance for Medical Image Computing http://na-mic.org Slice GUI Slice Coordinates RASToRAS Transforms SliceToRAS Matrix XYToSlice Matrix RASToIJK Matrix RAS to RAS Coordinates Slice Coordinates XY Image Space Coordinates IJK Volume Coordinates IJK = RASToIJK * RASToRAS * SliceToRAS * XYToSlice * XY From GUI SliceNode XYToIJK Matrix Calculated by SliceLayerLogic National Alliance for Medical Image Computing http://na-mic.org