Commit da74828263b2fbca975ccf3e88db5ffdafbcfe89
1 parent
8fa8e038
Exists in
master
and in
67 other branches
FIX: Turned volume raycast
Showing
1 changed file
with
11 additions
and
4 deletions
Show diff stats
invesalius/data/volume.py
... | ... | @@ -26,7 +26,8 @@ import wx.lib.pubsub as ps |
26 | 26 | |
27 | 27 | import constants as const |
28 | 28 | import project as prj |
29 | - | |
29 | +import slice_ | |
30 | +import imagedata_utils | |
30 | 31 | from data import vtk_utils |
31 | 32 | from vtk.util import numpy_support |
32 | 33 | |
... | ... | @@ -447,7 +448,14 @@ class Volume(): |
447 | 448 | |
448 | 449 | def LoadVolume(self): |
449 | 450 | proj = prj.Project() |
450 | - image = proj.imagedata | |
451 | + slice_data = slice_.Slice() | |
452 | + n_array = slice_data.matrix | |
453 | + spacing = slice_data.spacing | |
454 | + slice_number = 0 | |
455 | + orientation = 'AXIAL' | |
456 | + | |
457 | + image = imagedata_utils.to_vtk(n_array, spacing, slice_number, orientation) | |
458 | + self.image = image | |
451 | 459 | |
452 | 460 | number_filters = len(self.config['convolutionFilters']) |
453 | 461 | |
... | ... | @@ -571,8 +579,7 @@ class Volume(): |
571 | 579 | self.volume_mapper) |
572 | 580 | |
573 | 581 | def CalculateHistogram(self): |
574 | - proj = prj.Project() | |
575 | - image = proj.imagedata | |
582 | + image = self.image | |
576 | 583 | r = int(image.GetScalarRange()[1] - image.GetScalarRange()[0]) |
577 | 584 | accumulate = vtk.vtkImageAccumulate() |
578 | 585 | accumulate.SetInput(image) | ... | ... |