From 2f14ff94cf172bae229952d7bbd9782e090b45ca Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Thu, 7 Apr 2016 16:25:04 -0300 Subject: [PATCH] Saving screenshots with vtk6 --- invesalius/data/viewer_slice.py | 5 +++-- invesalius/data/viewer_volume.py | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/invesalius/data/viewer_slice.py b/invesalius/data/viewer_slice.py index 9453256..3423ef1 100755 --- a/invesalius/data/viewer_slice.py +++ b/invesalius/data/viewer_slice.py @@ -753,6 +753,7 @@ class Viewer(wx.Panel): image = vtk.vtkRenderLargeImage() image.SetInput(ren) image.SetMagnification(1) + image.Update() image = image.GetOutput() @@ -769,8 +770,8 @@ class Viewer(wx.Panel): elif (filetype == const.FILETYPE_TIF): writer = vtk.vtkTIFFWriter() filename = "%s.tif"%filename.strip(".tif") - - writer.SetInput(image) + + writer.SetInputData(image) writer.SetFileName(filename) writer.Write() diff --git a/invesalius/data/viewer_volume.py b/invesalius/data/viewer_volume.py index 0fec3e8..cee8553 100755 --- a/invesalius/data/viewer_volume.py +++ b/invesalius/data/viewer_volume.py @@ -318,6 +318,7 @@ class Viewer(wx.Panel): image = vtk.vtkRenderLargeImage() image.SetInput(self.ren) image.SetMagnification(1) + image.Update() image = image.GetOutput() @@ -333,12 +334,12 @@ class Viewer(wx.Panel): elif (filetype == const.FILETYPE_TIF): writer = vtk.vtkTIFFWriter() filename = "%s.tif"%filename.strip(".tif") - - writer.SetInput(image) + + writer.SetInputData(image) writer.SetFileName(filename) writer.Write() Publisher.sendMessage('End busy cursor') - + def OnCloseProject(self, pubsub_evt): if self.raycasting_volume: self.raycasting_volume = False -- libgit2 0.21.2