Commit 41a8eeff0c67cffaaf9a183badbce6db8a9d7270

Authored by tfmoraes
1 parent 5eff9593

ADD: Added a constant to set the raycasting mapper

invesalius/constants.py
... ... @@ -92,5 +92,7 @@ WINDOW_LEVEL = {"Abdomen":(350,50),
92 92 "Vasculature - Hard":(240,80),
93 93 "Vasculature - Soft":(650,160)}
94 94  
95   -REDUCE_IMAGEDATA_QUALITY = 1
  95 +REDUCE_IMAGEDATA_QUALITY = 0
96 96  
  97 +# if 1, use vtkVolumeRaycastMapper, if 0, use vtkFixedPointVolumeRayCastMapper
  98 +TYPE_RAYCASTING_MAPPER = 0
... ...
invesalius/data/volume.py
... ... @@ -23,6 +23,7 @@ import vtk
23 23 import wx
24 24 import wx.lib.pubsub as ps
25 25  
  26 +import constants
26 27 from project import Project
27 28  
28 29 Kernels = {
... ... @@ -351,12 +352,18 @@ class Volume():
351 352 # Changed the vtkVolumeRayCast to vtkFixedPointVolumeRayCastMapper
352 353 # because it's faster and the image is better
353 354 # TODO: To test if it's true.
354   - volume_mapper = vtk.vtkFixedPointVolumeRayCastMapper()
355   - #volume_mapper.AutoAdjustSampleDistancesOff()
356   - volume_mapper.SetInput(image2.GetOutput())
357   - #volume_mapper.SetVolumeRayCastFunction(composite_function)
358   - #volume_mapper.SetGradientEstimator(gradientEstimator)
359   - #volume_mapper.IntermixIntersectingGeometryOn()
  355 + if constants.TYPE_RAYCASTING_MAPPER:
  356 + volume_mapper = vtk.vtkVolumeRayCastMapper()
  357 + #volume_mapper.AutoAdjustSampleDistancesOff()
  358 + volume_mapper.SetInput(image2.GetOutput())
  359 + volume_mapper.SetVolumeRayCastFunction(composite_function)
  360 + #volume_mapper.SetGradientEstimator(gradientEstimator)
  361 + volume_mapper.IntermixIntersectingGeometryOn()
  362 + else:
  363 + volume_mapper = vtk.vtkFixedPointVolumeRayCastMapper()
  364 + #volume_mapper.AutoAdjustSampleDistancesOff()
  365 + volume_mapper.SetInput(image2.GetOutput())
  366 + volume_mapper.IntermixIntersectingGeometryOn()
360 367  
361 368 #Cut Plane
362 369 CutPlane(image2.GetOutput(), volume_mapper)
... ...