Commit c3bcac3d73ad0a30c19cb3baa632cf9a59f1f37b
1 parent
79d131b2
Exists in
master
and in
67 other branches
FIX: Show slice planes in the 3D
Showing
2 changed files
with
17 additions
and
6 deletions
Show diff stats
invesalius/control.py
| ... | ... | @@ -355,7 +355,8 @@ class Controller(): |
| 355 | 355 | ps.Publisher().sendMessage('Load slice to viewer', |
| 356 | 356 | (proj.imagedata, |
| 357 | 357 | proj.mask_dict)) |
| 358 | - | |
| 358 | + | |
| 359 | + ps.Publisher().sendMessage('Load slice plane') | |
| 359 | 360 | |
| 360 | 361 | ps.Publisher().sendMessage('Bright and contrast adjustment image',\ |
| 361 | 362 | (proj.window, proj.level)) | ... | ... |
invesalius/data/volume.py
| ... | ... | @@ -30,6 +30,8 @@ import slice_ |
| 30 | 30 | import imagedata_utils |
| 31 | 31 | from data import vtk_utils |
| 32 | 32 | from vtk.util import numpy_support |
| 33 | +import session as ses | |
| 34 | + | |
| 33 | 35 | |
| 34 | 36 | Kernels = { |
| 35 | 37 | "Basic Smooth 5x5" : [1.0, 1.0, 1.0, 1.0, 1.0, |
| ... | ... | @@ -429,7 +431,9 @@ class Volume(): |
| 429 | 431 | else: |
| 430 | 432 | raycasting_function = vtk.vtkVolumeRayCastCompositeFunction() |
| 431 | 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 | 438 | def ApplyConvolution(self, imagedata, update_progress = None): |
| 435 | 439 | number_filters = len(self.config['convolutionFilters']) |
| ... | ... | @@ -512,10 +516,16 @@ class Volume(): |
| 512 | 516 | volume_mapper.IntermixIntersectingGeometryOn() |
| 513 | 517 | self.volume_mapper = volume_mapper |
| 514 | 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 | 530 | self.SetTypeRaycasting() |
| 521 | 531 | volume_mapper.SetInput(image2) | ... | ... |