Slicer / ITK / VTK Development Tools - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Slicer / ITK / VTK Development Tools

Description:

NA-MIC. National Alliance for Medical Image Computing. http://na-mic.org. Slicer / ITK / VTK ... This version comes with cygwin and most linux distributions ... – PowerPoint PPT presentation

Number of Views:83
Avg rating:3.0/5.0
Slides: 15
Provided by: NAM7
Category:

less

Transcript and Presenter's Notes

Title: Slicer / ITK / VTK Development Tools


1
Slicer / ITK / VTK Development Tools
  • Steve Pieper, PhD

2
Overall Goals
  • Understanding the Big Picture
  • Code browsing with ctags
  • Source Navigator
  • Debugging
  • tkcon
  • Using the native debuggers
  • itkFilterWatcher

3
Ctags
  • Exuberant CTAGS
  • Ctags.sf.net
  • This version comes with cygwin and most linux
    distributions
  • Provides detailed tag files for emacs and vi
  • Run in top level directory with
  • ctags R .

4
Using the tags file from vim
  • Put cursor on identifier of interest
  • Type Control- to jump to the tag
  • If there is more than one tag for this
    identifier, type tselect and select desired tag
    from list
  • Type Control-t to jump back to original spot
  • You can nest tags on a stack to trace through a
    control flow

5
Source Navigator
  • http//sourcenav.sourceforge.net/
  • Linux source code to compile
  • Windows binaries

6
Source Navigator
  • Multi-directory class browser (see whole project)
  • Hierarchy Display
  • View all code
  • Jump to definitions and declarations
  • See comments and code
  • Grep UI

7
Native Tools
  • CMake creates makefiles and .SLN files that can
    be used outside of CMake for debugging
  • Resolve linker or option issues
  • Can attach to running process with gdb or visual
    studio
  • Debug the C code

8
Visual Studio Slicer Debugging
  • Start Slicer
  • Tools-gtDebug Processes
  • Attach to wish84.exe, Slicer 2.4
  • Run program until it crashes
  • Browse to Source directory and set breakpoints

9
gdb Debugging
  • Start slicer (built in debug mode)
  • Use ps to find process id of parent vtk thread
  • Use gdb command attach ltpidgt
  • For debugging startup
  • slicer2-linux-x86 Base/tcl/tkcon.tcl
  • Attach gdb
  • In tkcon
  • source Base/tcl/Go.tcl

10
Tkcon
  • Very smart console written in Tk
  • Identifier completion
  • Files
  • Variables
  • Class instances
  • UI Windows
  • Command line editing like readline
  • Create VTK class instances and experiment
  • Write and test tcl code interactively

11
Interactive VTK Commands
  • ltinstancegt ListMethods
  • Tells all instances currently known to the
    interpreter
  • ltinstancegt Print
  • Calls the PrintSelf method
  • ltinstancegt ListMethods
  • Tell what methods are available in the interpreter

12
itkFilterWatcher
  • Uses itk Observer mechanism to register callbacks
    for common events
  • StartEvent
  • ProgressEvent
  • EndEvent
  • Prints total running time

13
Worlds oldest debugging tool
  • Print statements in the code!
  • Just remember to disable them when you are done
    debugging
  • In C
  • vtkDebugMacro()
  • Call GlobalWarningDisplayOn method for any
    instance of a vtkObject subclass
  • In Tcl
  • if Module(verbose) 1
  • puts "INIT mInit"
  • Use the -verbose option in slicer to set the
    Module(verbose) flag

14
Resources
  • www.slicer.org
  • www.na-mic.org/Wiki
  • www.na-mic.org/Bug
  • www.na-mic.org/Testing
  • slicer-devel_at_bwh.harvard.edu
  • slicer-users_at_bwh.harvard.edu
Write a Comment
User Comments (0)
About PowerShow.com