Sim ITK and Sim VTK ITK and VTK

  • Slides: 18
Download presentation
Sim. ITK and Sim. VTK: ITK and VTK in Simulink DG Gobbi, P Mousavi,

Sim. ITK and Sim. VTK: ITK and VTK in Simulink DG Gobbi, P Mousavi, KM Li, J Xiang, A Campigotto, A La. Pointe, G Fichtinger, P Abolmaesumi Medical Image Analysis Laboratory (Med. IA) http: //www. media. queensu. ca School of Computing Queen’s University

Motivation n Visual programming for ITK and VTK n n Drag & drop approach

Motivation n Visual programming for ITK and VTK n n Drag & drop approach to application development Increase understandability & maintainability Instructional value MATLAB is our friend n n n Use MATLAB’s Simulink visual environment Hence, avoid reinventing the wheel Allow mix of MATLAB code and ITK / VTK

Related Work n Visual Programming of VTK and ITK n n n ITK and

Related Work n Visual Programming of VTK and ITK n n n ITK and VTK in MATLAB (without Simulink) n n n ITKBoard (CSIRO) Sci. Run (Utah) Me. Vis. Lab (Me. Vis Research Gmb. H) ca. BIG XIP (ca. BIG, Siemens, Washington U. in St Louis) MATITK (Chu and Hamarneh) VTK plus MATLAB – various Us: Visual ITK/VTK Programming in MATLAB

MATLAB’s Simulink Environment Library Model

MATLAB’s Simulink Environment Library Model

Our Own Simulink Libraries

Our Own Simulink Libraries

3 D Processing with ITK

3 D Processing with ITK

Combine ITK Processing and VTK Rendering Output: VTK Window Input: cthead 1. png

Combine ITK Processing and VTK Rendering Output: VTK Window Input: cthead 1. png

Method: Wrapping Process n Simulink wrappers for ITK, VTK n n n Each Simulink

Method: Wrapping Process n Simulink wrappers for ITK, VTK n n n Each Simulink block is an “S-Function” with callbacks S-Function callbacks are C++ code, calls ITK or VTK CMake build process n n n Start with an XML description of each filter (ITK) or Start with class header files (VTK) CMake calls perl script to generate C++ code CMake then calls perl to generate. mdl library file Finally, build libraries with VC++ or gcc

Method: Data Flow for Sim. ITK n Sim. ITK, Sim. VTK use different architecture

Method: Data Flow for Sim. ITK n Sim. ITK, Sim. VTK use different architecture n n n ITK is primarily image based VTK handles many data set types Sim. ITK Data Flow n ITK images -> MATLAB arrays (“info” and “data”) n Use shared memory for efficiency n Conversion of ITK parameter data types n ITK uses several specialized types e. g. versor

Sim. ITK Helper Class Input Spacing & Origin Input. Port Conversion itk. Image Data

Sim. ITK Helper Class Input Spacing & Origin Input. Port Conversion itk. Image Data Conversion Parameters Parameter Variables itk. Image Run ITK Image Filter Conversion Output. Port Spacing & Orig Data

Method: Data Flow for Sim. VTK n Sim. VTK Data Flow n Use MATLAB

Method: Data Flow for Sim. VTK n Sim. VTK Data Flow n Use MATLAB arrays to pass vtk. Object pointers n n Define “VTKOBJECT” MATLAB type for safety When run starts, Simulink builds VTK pipeline on-the-fly Then, Simulink calls Update or Render at each time step Sim. VTK filter parameters n n VTK parameter types need no conversion VTK and MATLAB both use basic C data types

Registration Examples n Registration in ITK Immediate, interactive feedback n Great way to tune

Registration Examples n Registration in ITK Immediate, interactive feedback n Great way to tune parameters n Easy to swap out components n

Intervention Examples n Computer Assisted Intervention in VTK Incorporate real-time data input n Use

Intervention Examples n Computer Assisted Intervention in VTK Incorporate real-time data input n Use “Subsystems” to manage complexity n

Discussion n “Diagrams” that actually run as code Easy to verify that code matches

Discussion n “Diagrams” that actually run as code Easy to verify that code matches design n Great teaching tool n Understandability improves maintainability n n Utility Simulink models can run as stand-alone exec n Nearly all VTK, ITK classes can be wrapped n

Future Work n Wrap. ITK n n To automate ITK build (VTK is already

Future Work n Wrap. ITK n n To automate ITK build (VTK is already done!) GUI integration Slicer module interface in Simulink n KWWidgets (later Qt, maybe FLTK) n n Community Building n n Mailing list, website We want to hear from you!