Commit c3bcac3d73ad0a30c19cb3baa632cf9a59f1f37b

Authored by Paulo Henrique Junqueira Amorim
1 parent 79d131b2

FIX: Show slice planes in the 3D

invesalius/control.py
@@ -355,7 +355,8 @@ class Controller(): @@ -355,7 +355,8 @@ class Controller():
355 ps.Publisher().sendMessage('Load slice to viewer', 355 ps.Publisher().sendMessage('Load slice to viewer',
356 (proj.imagedata, 356 (proj.imagedata,
357 proj.mask_dict)) 357 proj.mask_dict))
358 - 358 +
  359 + ps.Publisher().sendMessage('Load slice plane')
359 360
360 ps.Publisher().sendMessage('Bright and contrast adjustment image',\ 361 ps.Publisher().sendMessage('Bright and contrast adjustment image',\
361 (proj.window, proj.level)) 362 (proj.window, proj.level))
invesalius/data/volume.py
@@ -30,6 +30,8 @@ import slice_ @@ -30,6 +30,8 @@ import slice_
30 import imagedata_utils 30 import imagedata_utils
31 from data import vtk_utils 31 from data import vtk_utils
32 from vtk.util import numpy_support 32 from vtk.util import numpy_support
  33 +import session as ses
  34 +
33 35
34 Kernels = { 36 Kernels = {
35 "Basic Smooth 5x5" : [1.0, 1.0, 1.0, 1.0, 1.0, 37 "Basic Smooth 5x5" : [1.0, 1.0, 1.0, 1.0, 1.0,
@@ -429,7 +431,9 @@ class Volume(): @@ -429,7 +431,9 @@ class Volume():
429 else: 431 else:
430 raycasting_function = vtk.vtkVolumeRayCastCompositeFunction() 432 raycasting_function = vtk.vtkVolumeRayCastCompositeFunction()
431 raycasting_function.SetCompositeMethodToInterpolateFirst() 433 raycasting_function.SetCompositeMethodToInterpolateFirst()
432 - self.volume_mapper.SetVolumeRayCastFunction(raycasting_function) 434 +
  435 + if ses.Session().rendering == 0:
  436 + self.volume_mapper.SetVolumeRayCastFunction(raycasting_function)
433 437
434 def ApplyConvolution(self, imagedata, update_progress = None): 438 def ApplyConvolution(self, imagedata, update_progress = None):
435 number_filters = len(self.config['convolutionFilters']) 439 number_filters = len(self.config['convolutionFilters'])
@@ -512,10 +516,16 @@ class Volume(): @@ -512,10 +516,16 @@ class Volume():
512 volume_mapper.IntermixIntersectingGeometryOn() 516 volume_mapper.IntermixIntersectingGeometryOn()
513 self.volume_mapper = volume_mapper 517 self.volume_mapper = volume_mapper
514 else: 518 else:
515 - volume_mapper = vtk.vtkFixedPointVolumeRayCastMapper()  
516 - #volume_mapper.AutoAdjustSampleDistancesOff()  
517 - self.volume_mapper = volume_mapper  
518 - volume_mapper.IntermixIntersectingGeometryOn() 519 +
  520 + if ses.Session().rendering == 0:
  521 + volume_mapper = vtk.vtkFixedPointVolumeRayCastMapper()
  522 + #volume_mapper.AutoAdjustSampleDistancesOff()
  523 + self.volume_mapper = volume_mapper
  524 + volume_mapper.IntermixIntersectingGeometryOn()
  525 +
  526 + else:
  527 + volume_mapper = vtk.vtkGPUVolumeRayCastMapper()
  528 + self.volume_mapper = volume_mapper
519 529
520 self.SetTypeRaycasting() 530 self.SetTypeRaycasting()
521 volume_mapper.SetInput(image2) 531 volume_mapper.SetInput(image2)