[Insight-users] Visual Studio debugger visualizers for ITK

Dženan Zukić dzenanz at gmail.com
Wed Aug 10 11:35:17 EDT 2011


Hi guys and Luis,

Visual studio has support for custom visualization of user types in
debugger (watch window and mouse hover)
File C:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\Packages\Debugger\autoexp.dat controls how different
datatypes are displayed. The file itself contains instructions on how
to modify it.

With VS2008 SP1 and newer you don't even have to modify that file, you
can add environment variable _vcee_autoexp which points to your own
file which will then be combined with the system one on the fly.

Example visualizer for ImageRegion:
itk::ImageRegion<*>{
  children
   (
     #(
         size: $c.m_Size,
         index: $c.m_Index
      )
   )
   preview
   (
     #(
         "R", $c.m_Size
      )
   )
}

Two example screenshots are attached:
image: watch window displaying itk::Image using enhanced view
buffer: itk::Image with underlying buffer expanded (limited to first
million elements)

I have started building this file (attached), but it only contains
support for image and the classes it contains. With distributed
effort, everyone can contribute a visualizer for a class or two for
everyone's benefit.

Also in the file are included my attempt at visualizing iterators by
previewing their current offset and the element pointed to, but I got
the math wrong because I am not familiar with iterator internals. I
would appreciate is someone could tell me the formula to get the
current element, to replace my attempt:

currentElement: m_Buffer[m_BeginOffset+m_SpanBeginOffset+m_Offset]

Some of this could probably be automated by changing the source code
of the library, but that might even be more effort than doing this by
hand for the most important classes.

Also, we should probably put this file into the wiki. Is
http://www.itk.org/Wiki/ITK the right place to put the link?

Regards,
Dženan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itk_debug_visualizers.dat
Type: application/octet-stream
Size: 7571 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110810/b3c1df1d/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: buffer.png
Type: image/png
Size: 24230 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110810/b3c1df1d/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 24188 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110810/b3c1df1d/attachment-0003.png>


More information about the Insight-users mailing list