From c3bcac3d73ad0a30c19cb3baa632cf9a59f1f37b Mon Sep 17 00:00:00 2001 From: paulojamorim Date: Wed, 18 May 2011 13:39:48 +0000 Subject: [PATCH] FIX: Show slice planes in the 3D --- invesalius/control.py | 3 ++- invesalius/data/volume.py | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/invesalius/control.py b/invesalius/control.py index e1cde04..5aaf02c 100755 --- a/invesalius/control.py +++ b/invesalius/control.py @@ -355,7 +355,8 @@ class Controller(): ps.Publisher().sendMessage('Load slice to viewer', (proj.imagedata, proj.mask_dict)) - + + ps.Publisher().sendMessage('Load slice plane') ps.Publisher().sendMessage('Bright and contrast adjustment image',\ (proj.window, proj.level)) diff --git a/invesalius/data/volume.py b/invesalius/data/volume.py index 3ced07e..871deab 100755 --- a/invesalius/data/volume.py +++ b/invesalius/data/volume.py @@ -30,6 +30,8 @@ import slice_ import imagedata_utils from data import vtk_utils from vtk.util import numpy_support +import session as ses + Kernels = { "Basic Smooth 5x5" : [1.0, 1.0, 1.0, 1.0, 1.0, @@ -429,7 +431,9 @@ class Volume(): else: raycasting_function = vtk.vtkVolumeRayCastCompositeFunction() raycasting_function.SetCompositeMethodToInterpolateFirst() - self.volume_mapper.SetVolumeRayCastFunction(raycasting_function) + + if ses.Session().rendering == 0: + self.volume_mapper.SetVolumeRayCastFunction(raycasting_function) def ApplyConvolution(self, imagedata, update_progress = None): number_filters = len(self.config['convolutionFilters']) @@ -512,10 +516,16 @@ class Volume(): volume_mapper.IntermixIntersectingGeometryOn() self.volume_mapper = volume_mapper else: - volume_mapper = vtk.vtkFixedPointVolumeRayCastMapper() - #volume_mapper.AutoAdjustSampleDistancesOff() - self.volume_mapper = volume_mapper - volume_mapper.IntermixIntersectingGeometryOn() + + if ses.Session().rendering == 0: + volume_mapper = vtk.vtkFixedPointVolumeRayCastMapper() + #volume_mapper.AutoAdjustSampleDistancesOff() + self.volume_mapper = volume_mapper + volume_mapper.IntermixIntersectingGeometryOn() + + else: + volume_mapper = vtk.vtkGPUVolumeRayCastMapper() + self.volume_mapper = volume_mapper self.SetTypeRaycasting() volume_mapper.SetInput(image2) -- libgit2 0.21.2