Hi All,<div><br></div><div>I&#39;m getting a strange behavior since I moved from QT 4.3 to QT 4.6 (Mac Snow Leopard and Ubuntu 64bit).</div><div><br></div><div>To display an image in the GUI, I&#39;m using QVTKWidget with vtkImageViewer2.</div>
<div><br></div><div>I need that every time the user clicks on the image with the mouse, a new image will be displayed.</div><div><br></div><div>To do that, I&#39;m doing this:</div><div><br></div><div>-----------------------------------------------------</div>
<div><div>   // Create Viewer</div><div>   viewer = vtkImageViewer2::New();</div><div>   viewer-&gt;SetInput(IMAGE);</div><div>   viewer-&gt;SetupInteractor(vtkWidget-&gt;GetRenderWindow()-&gt;GetInteractor());</div><div>
   </div><div>   vtkWidget-&gt;SetRenderWindow(viewer-&gt;GetRenderWindow());</div><div><br></div><div>   vtkInteractorStyleImage *imageStyle = vtkInteractorStyleImage::New();</div><div>   vtkPointPicker* picker = vtkPointPicker::New();</div>
<div>   vtkWidget-&gt;GetRenderWindow()-&gt;GetInteractor()-&gt;SetPicker(picker);</div><div><br></div><div>   // Create callback</div><div>   vtkImageInteractionCallback *callback = vtkImageInteractionCallback::New();</div>
<div>   callback-&gt;SetInteractor(vtkWidget-&gt;GetRenderWindow()-&gt;GetInteractor());</div><div>   callback-&gt;SetPicker(picker);</div><div>   callback-&gt;SetImageViewer(viewer); // Send a reference to callback</div>
<div>   imageStyle-&gt;AddObserver(vtkCommand::MouseMoveEvent, callback);</div><div>   imageStyle-&gt;AddObserver(vtkCommand::LeftButtonPressEvent, callback);</div><div>   imageStyle-&gt;AddObserver(vtkCommand::LeftButtonReleaseEvent, callback);</div>
<div>   </div><div>   vtkWidget-&gt;GetRenderWindow()-&gt;GetInteractor()-&gt;SetInteractorStyle(imageStyle);</div></div><div>   viewer-&gt;GetRenderer()-&gt;ResetCamera();</div><div><br></div><div>-----------------------------------------------------</div>
<div><br></div><div>The Execute method of the vtkImageInteractionCallback class basically performs this:</div><div><br></div><div>   viewer-&gt;SetInput(NEW_IMAGE);</div><div>   viewer-&gt;Render();</div><div><br></div><div>
In other words, this is what happens every time the user clicks on the image.</div><div><br></div><div>It is working fine, but the problem is that the first click performs a ZOOM OUT on the image. And it is always the first click!!</div>
<div><br></div><div>This is only happening in the first time the method Execute (vtkImageInteractionCallback : vtkCommand) call viewer-&gt;Render(). When I call Render() outside vtkImageInteractionCallback, the &quot;problem&quot; does NOT happen.</div>
<div><br></div><div>Does anyone have an idea on what is going on? How can I fix this?</div><div><br></div><div>Any help will be appreciated!</div><div><br></div><div>Thanks &amp; Regards,</div><div>Luis</div>