<div dir="ltr">If you add the actor after myimg.modify(), it shows the updated image.<br><br>You are earlier modifying the data, but not adding the updated actor to the renderer.<br><br>myim.modify()<br>ren.AddActor(ia)<br>
<br>Jothy<br><br><div class="gmail_quote">On Mon, Feb 13, 2012 at 12:12 PM, Anders Wallin <span dir="ltr"><<a href="mailto:anders.e.e.wallin@gmail.com">anders.e.e.wallin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm not sure exactly what modification you suggest.<br>
This slightly modified code shows exactly the same behavior as before:<br>
<a href="http://pastebin.com/8BVZViQ3" target="_blank">http://pastebin.com/8BVZViQ3</a><br>
<font color="#888888"><br>
Anders<br>
</font><div><div></div><div class="h5"><br>
> Can you remove<br>
> ren.AddActor( self.ia )<br>
> from the class and add it after adding the renderer?<br>
> Jothy<br>
><br>
><br>
> On Sat, Feb 11, 2012 at 9:07 AM, Anders Wallin <<a href="mailto:anders.e.e.wallin@gmail.com">anders.e.e.wallin@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Here is a more realistic example of what I want to do:<br>
>> <a href="http://pastebin.com/3Wz8C8yC" target="_blank">http://pastebin.com/3Wz8C8yC</a><br>
>><br>
>> Now I see different behavior between:<br>
>><br>
>> myim = MyImage(ren) # create vtkImageActor, add it to ren<br>
>> renWin.Render() # when Render() is called here, we don't see<br>
>> the results of modify()<br>
>> myim.modify() # this modifies the vtkCharArray of the image<br>
>> renWin.Render()<br>
>><br>
>> and<br>
>><br>
>> myim = MyImage(ren) # create vtkImageActor, add it to ren<br>
>> # without Render() here , the results of modify() are visible<br>
>> myim.modify() # this modifies the vtkCharArray of the image<br>
>> renWin.Render() # now we see a modified image!<br>
>><br>
>><br>
>> Confused.<br>
>> Anders<br>
>><br>
>> On Fri, Feb 10, 2012 at 11:01 PM, David Doria <<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>><br>
>> wrote:<br>
>> >><br>
>> >> It turns out there is some subtle difference between<br>
>> >> vtkRenderer.Render() and vtkRenderWindow.Render()<br>
>> >><br>
>> >> This example shows the behavior:<br>
>> >> <a href="http://pastebin.com/KPFpkCKU" target="_blank">http://pastebin.com/KPFpkCKU</a><br>
>> >> On my machine I see an unmodified image with "renWin.Render()" and a<br>
>> >> modified image with "ren.Render()"<br>
>> >> I had previously used renWin.Render() in all my vtk code, but I have<br>
>> >> always worked with polydata only.<br>
>> ><br>
>> ><br>
>> > Quoting David Gobbi from an old mailing list post that I've used ever<br>
>> > since:<br>
>> ><br>
>> > "You should never, ever call renderer->Render(). That method is only<br>
>> > meant to be called by the vtkRenderWindow. The documentation says<br>
>> > so quite clearly. By calling it you are probably causing some<br>
>> > timestamps<br>
>> > to be set (indicating that all actors in the renderer have rendered),<br>
>> > but<br>
>> > you<br>
>> > aren't actually doing any rendering. Then, when you call<br>
>> > renderWindow->Render() it sees that those timestamps have been updated<br>
>> > and thinks that there is nothing to be done."<br>
>> ><br>
>> > I'm not sure why renderWindow->Render() is not working for you in this<br>
>> > case.<br>
>> > Any Python VTK experts out there?<br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Please keep messages on-topic and check the VTK FAQ at:<br>
>> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Jothy<br>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothy<br></div><br>
</div>