Search code examples
dicomvtkrenderer

Unable to clear a vtkRenderWindow


I am using a QVTKWidget with a bunch of vtkImageMapper, vtkActor2D and two vtkRenderers.

I load all these objects into the QVTKWidget with a DICOM image.

There are two renderers because the user can open two images at the same time.

However, he might want to close an image um order to replace it. The problem is i cant get the old image out of the window.

The method Clear() from the render Windows apparently doesn't work. The same with RemoveAllProps().

So, how can i clear the Windows?


Solution

  • RemoveAllViewProps() should work in this case. Perhaps you still see the image because the window isn't updated yet. Can you make sure that the renderwindow is refreshed by calling Render() to the renderer after removing all props?