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"><<a href="mailto:luisrpp@gmail.com">luisrpp@gmail.com</a>></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'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"><<a href="mailto:clinton@elemtech.com" target="_blank">clinton@elemtech.com</a>></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>
ImageType2D::Pointer img =<br>
myImage->getImage2DFrom3D(horizontalScrollBar->value());<br>
<br>
vtkImageViewer* image_view = vtkImageViewer::New();<br>
image_view->SetInput(myImage->convertITKtoVTK(img));<br>
<br>
vtkWidget->SetRenderWindow(image_view->GetRenderWindow());<br>
<br>
image_view->SetColorLevel(138.5);<br>
image_view->SetColorWindow(233);<br>
<br>
vtkWidget->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't you use the same vtkImageViewer instance at all times, and just call SetInput when you change the image?<br>
And don't bother calling vtkWidget->SetRenderWindow() and vtkWidget->show() each time the slider moves.<br>
<br>
Clint<br>
<br>
<br>
</blockquote></div><br>
</div></div></blockquote></div><br>