[vtkusers] updating vtkImageData ?

Anders Wallin anders.e.e.wallin at gmail.com
Fri Feb 10 15:52:01 EST 2012


>> But this does not seem to update my image. If I move these two lines
>> to before the "ren.addActor(ia)"  then I do see that my image-updating
>> function works, and I get the second frame of my animation. However it
>> seems after  "ren.addActor(ia)"  the image data is locked, and
>> scalars.SetValue( id , new_color  ) has no effect?
>>
>> any ideas?
>> thanks,
>> Anders
> After you call Update(), does it work if you wiggle the scene (i.e. just
> click and drag once)? If so, just add a renderWindow->Render() call.

It turns out there is some subtle difference between
vtkRenderer.Render() and vtkRenderWindow.Render()

This example shows the behavior:
http://pastebin.com/KPFpkCKU
On my machine I see an unmodified image with "renWin.Render()" and a
modified image with "ren.Render()"
I had previously used renWin.Render() in all my vtk code, but I have
always worked with polydata only.

Anders



More information about the vtkusers mailing list