Problem solved!!<br><br>It was missing to call the Render method of the vtkRenderWindow class.<br><br><div class="gmail_quote">On Sat, Oct 25, 2008 at 1:23 PM, Luis Roberto P. Paula <span dir="ltr">&lt;<a href="mailto:luisrpp@gmail.com">luisrpp@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Clint,<br><br>I tried this, but if a just call the SetInput method, the image doesn&#39;t change in the display when the slider moves.<br>
<br>How can I update the image using the same vtkRenderWindow?<div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">
On Sat, Oct 25, 2008 at 1:01 PM, Clinton Stimpson <span dir="ltr">&lt;<a href="mailto:clinton@elemtech.com" target="_blank">clinton@elemtech.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi All,<br>
<br>
I have developed a GUI with Qt and I am using the QVTKWidget to display a 2D<br>
image.<br>
<br>
This 2D image cames from a 3D image. I have a slider to control what is the<br>
slice to be displayed.<br>
<br>
The problem is that I am getting a flickering effect every time the image is<br>
changed.<br>
<br>
Here is a piece of code of what I am doing:<br>
<br>
void MyGui::moveBar() {<br>
 &nbsp; ImageType2D::Pointer img =<br>
myImage-&gt;getImage2DFrom3D(horizontalScrollBar-&gt;value());<br>
<br>
 &nbsp; vtkImageViewer* image_view = vtkImageViewer::New();<br>
 &nbsp; image_view-&gt;SetInput(myImage-&gt;convertITKtoVTK(img));<br>
<br>
 &nbsp; vtkWidget-&gt;SetRenderWindow(image_view-&gt;GetRenderWindow());<br>
<br>
 &nbsp; image_view-&gt;SetColorLevel(138.5);<br>
 &nbsp; image_view-&gt;SetColorWindow(233);<br>
<br>
 &nbsp; vtkWidget-&gt;show();<br>
}<br>
<br>
This method is called every time the slider is moved.<br>
<br>
Does anybody knows how to get rid of this flickering effect?<br>
</blockquote>
<br></div>
The flicker comes from re-creating the vtkRenderWindow each time you have an image.<br>
Can&#39;t you use the same vtkImageViewer instance at all times, and just call SetInput when you change the image?<br>
And don&#39;t bother calling vtkWidget-&gt;SetRenderWindow() and vtkWidget-&gt;show() each time the slider moves.<br>
<br>
Clint<br>
<br>
<br>
</blockquote></div><br>
</div></div></blockquote></div><br>