[Insight-users] Re: [Insight-developers] Hint: Tapping into ITK pipelines to visualize intermediate result s with VTK

Joshua Cates cates@sci.utah.edu
Thu, 17 Oct 2002 14:27:10 -0600 (MDT)


Very cool.  I'll be anxious to see the code.  Luis and I have talked about
modifying finite difference base classes to better support this type of
interactivity.  One idea was to allow a user to pause/resume (perhaps even
with modified parameters) the solver through the iteration event callback
mechanism.  Coupled with real-time rendering, this would allow true 
interactive control of the solution, i.e. you would see the surface evolve 
and could stop it at any point to change curvature terms, add more 
iterations, modify the speed function, etc.

Josh.

______________________________
 Josh Cates			
 School of Computer Science	
 University of Utah
 Email: cates@sci.utah.edu
 Phone: (801) 587-7697
 URL:   www.cs.utk.edu/~cates


On Thu, 17 Oct 2002, Miller, James V (Research) wrote:

> Several of ITK's filters are designed so at the end of each iteration in the algorithm, the output of
> the filter contains the "results so far".  For example, the finite difference filters (level sets,
> etc.) trigger an IterationEvent as well as a ProgressEvent() so that you can tap into the output of
> the current iteration as the filter is executing.
>  
> I put together a little application that shows a levelset expanded over an image.  To do this, I
> originally tied the output of the levelset filter to a VTK pipeline to run MarchingSquares to extract
> the zero level set and display the original image. This used the standard Exporter/Importer
> facilities of VTK and ITK and wired the pipeline methods together so Update() would propagate between
> VTK and ITK filters.
>  
> I tied a callback to the IterationEvent that told my VTK viewer to render.  
>  
> Unfortunately, telling a VTK viewer to render causes an Update() to propagate up the pipeline.  But
> since the pipeline is already updating (since the level set code was running), the update mechanism
> aborted and not data was drawn.
>  
> To address this, I separated the two pipelines.  The ITK pipeline read the data, preprocessed the
> data, and ran the level set algorithm.  A separate pipeline was used to export data from ITK to VTK
> and to visualize the data.  To separate the pipelines, I created an itk::Image and essentially
> "grafted" the output of the levelset filter into this image.  (This copied the regions, spacing,
> origin, and passed a reference to the pixel container from the output of the level to this separate
> image).  I then passed this extra image through the standard ITK exporters and VTK importers. This
> extra image did not have to copy the bulk pixel data (since I just passed a reference to the pixel
> container) but it also did not have a "source" so the VTK pipeline could run asynchronously with the
> ITK pipeline.
>  
> Now in my iteration callback, I reconfigured this extra image (copying regions, spacing, origin, and
> reference to the pixel container), and told VTK to render.
> 
> When the examples/applications reconfiguration is complete, I'll put this application in as an
> example.    
> 
> Jim Miller 
> _____________________________________
> Visualization & Computer Vision
> GE Research
> Bldg. KW, Room C218B
> P.O. Box 8, Schenectady NY 12301
> 
> millerjv@research.ge.com <mailto:millerjv@research.ge.com> 
> 
> james.miller@research.ge.com
> (518) 387-4005, Dial Comm: 8*833-4005, 
> Cell: (518) 505-7065, Fax: (518) 387-6981 
> 
>  <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
> 
>  
>