[vtkusers] Updating Filter Inputs and Outputs

Chris Hahn chahn at ucalgary.ca
Fri Mar 10 13:18:00 EST 2006


Hi There

I'm very new to vtk, so please bear with me if these questions seem 
trivial or obvious. Anyways, I'm currently using vtk to display image 
data which is being repeatedly updated over a network connection. 
Basically, this data is being streamed in C-array format, so I'm using 
vtkImageImport to import it and then I display the image using 
vtkImageViewer. Every time I receive new data, I call the render method 
for the image viewer and the image is updated on my screen. My problem 
occurs when I try to use any sort of image filter on the output of 
vtkImageImport. If I do this, the filter will only work on the first 
image. As soon as the incoming image data is changed, the filter output 
becomes a blank screen. The only way I've been able to get it to work is 
to delete and recreate the filter before I call the render method every 
time that the image data is changed. This seems inefficient and 
(hopefully) unnecessary. This has occurred for every filter that I've 
tried to play with, including vtkImageGaussianSmooth, vtkImageMagnify 
and vtkImageFlip.

So my questions are the following: how can I use filters in a case like 
this without deleting and recreating the filter every time the image is 
changed? Is that even possible? Also, is using the vtkImageViewer and 
constantly calling the render method the right way (i.e. the 
fastest/most effiicient way) to display a frequently updating image?

Any help would be greatly appreciated.
Thanks,
Chris



More information about the vtkusers mailing list