<div dir="ltr"><div>Hi All,</div><div>I am trying to make vtkRectilinearWipeWidget to work with PyQt so the wipe window can appear inside a Qt application. However, I am have a hard time to do it. I found this example: <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/BorderWidget">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/BorderWidget</a>. And my code is as following:</div><div><br></div><div><pre style="color:rgb(0,0,0);font-family:menlo;font-size:9pt"><span style="color:rgb(148,85,141)">self</span>.vtkWidget = QVTKRenderWindowInteractor()<br>wipe = vtk.vtkImageRectilinearWipe()<br>wipe.SetInputConnection(<span style="color:rgb(0,0,255)">0</span>, img_reader1.GetOutputPort())<br>wipe.SetInputConnection(<span style="color:rgb(0,0,255)">1</span>, img_reader2.GetOutputPort())<br><br>img_center = get_image_center(img_reader1)<br><br>wipe.SetPosition((<span style="color:rgb(0,0,128)">int</span>)(img_center[<span style="color:rgb(0,0,255)">0</span>]), (<span style="color:rgb(0,0,128)">int</span>)(img_center[<span style="color:rgb(0,0,255)">1</span>]))<br>wipe.SetWipeToQuad()<br><br>ren1 = vtk.vtkRenderer()<br><br>style = vtk.vtkInteractorStyleImage()<br><br><span style="color:rgb(148,85,141)">self</span>.vtkWidget.SetInteractorStyle(style)<br><span style="color:rgb(148,85,141)">self</span>.vtkWidget.GetRenderWindow().AddRenderer(ren1)<br><br>wipeActor = vtk.vtkImageActor()<br>wipeActor.GetMapper().SetInputConnection(wipe.GetOutputPort())<br><br>wipeWidget = vtk.vtkRectilinearWipeWidget()<br>wipeWidget.SetInteractor(<span style="color:rgb(148,85,141)">self</span>.vtkWidget)<br><br>wipeWidgetRep = wipeWidget.GetRepresentation()<br><br>wipeWidgetRep.SetImageActor(wipeActor)<br>wipeWidgetRep.SetRectilinearWipe(wipe)<br>wipeWidgetRep.GetProperty().SetLineWidth(<span style="color:rgb(0,0,255)">1.0</span>)<br>wipeWidgetRep.GetProperty().SetOpacity(<span style="color:rgb(0,0,255)">0.75</span>)<br><br>ren1.AddActor(wipeActor)<br>ren1.SetBackground(<span style="color:rgb(0,0,255)">0.1</span>, <span style="color:rgb(0,0,255)">0.2</span>, <span style="color:rgb(0,0,255)">0.4</span>)<br><br><span style="color:rgb(148,85,141)">self</span>.vtkWidget.Initialize()<br>wipeWidget.On()<br><span style="color:rgb(148,85,141)">self</span>.vtkWidget.Start()</pre><pre style="color:rgb(0,0,0);font-family:menlo;font-size:9pt"><br></pre></div><div><div class="gmail_signature"><div>But the result is incorrect. Only image from img_reader1 showed up in the Qt application and the the wipe line didn't show up either.</div><div><br></div><div>Can somebody offer any advices? </div><div><br></div><div dir="ltr"><br></div><div dir="ltr"><div>Many thanks.<br><br><br></div>Bill<br></div></div></div>
</div>