Commit d43fdfb9a725ebc2fc9851b0452b0475ee383475

Authored by Thiago Franco de Moraes
1 parent 991ffa8b

More cleaning

invesalius/control.py
@@ -373,8 +373,7 @@ class Controller(): @@ -373,8 +373,7 @@ class Controller():
373 self.Slice.spacing = proj.spacing 373 self.Slice.spacing = proj.spacing
374 374
375 Publisher.sendMessage('Load slice to viewer', 375 Publisher.sendMessage('Load slice to viewer',
376 - (proj.imagedata,  
377 - proj.mask_dict)) 376 + (proj.mask_dict))
378 377
379 378
380 Publisher.sendMessage('Load slice plane') 379 Publisher.sendMessage('Load slice plane')
invesalius/data/viewer_slice.py
@@ -845,8 +845,8 @@ class Viewer(wx.Panel): @@ -845,8 +845,8 @@ class Viewer(wx.Panel):
845 self.interactor.Bind(wx.EVT_SIZE, self.OnSize) 845 self.interactor.Bind(wx.EVT_SIZE, self.OnSize)
846 846
847 def LoadImagedata(self, pubsub_evt): 847 def LoadImagedata(self, pubsub_evt):
848 - imagedata, mask_dict = pubsub_evt.data  
849 - self.SetInput(imagedata, mask_dict) 848 + mask_dict = pubsub_evt.data
  849 + self.SetInput(mask_dict)
850 850
851 def LoadRenderers(self, imagedata): 851 def LoadRenderers(self, imagedata):
852 number_renderers = self.layout[0] * self.layout[1] 852 number_renderers = self.layout[0] * self.layout[1]
@@ -911,7 +911,7 @@ class Viewer(wx.Panel): @@ -911,7 +911,7 @@ class Viewer(wx.Panel):
911 self.cursor_ = cursor 911 self.cursor_ = cursor
912 return cursor 912 return cursor
913 913
914 - def SetInput(self, imagedata, mask_dict): 914 + def SetInput(self, mask_dict):
915 self.slice_ = sl.Slice() 915 self.slice_ = sl.Slice()
916 916
917 max_slice_number = sl.Slice().GetNumberOfSlices(self.orientation) 917 max_slice_number = sl.Slice().GetNumberOfSlices(self.orientation)
@@ -921,7 +921,7 @@ class Viewer(wx.Panel): @@ -921,7 +921,7 @@ class Viewer(wx.Panel):
921 self.slice_data = self.create_slice_window() 921 self.slice_data = self.create_slice_window()
922 self.slice_data.SetCursor(self.__create_cursor()) 922 self.slice_data.SetCursor(self.__create_cursor())
923 self.cam = self.slice_data.renderer.GetActiveCamera() 923 self.cam = self.slice_data.renderer.GetActiveCamera()
924 - self.__build_cross_lines(imagedata) 924 + self.__build_cross_lines()
925 925
926 # Set the slice number to the last slice to ensure the camera if far 926 # Set the slice number to the last slice to ensure the camera if far
927 # enough to show all slices. 927 # enough to show all slices.
@@ -936,7 +936,7 @@ class Viewer(wx.Panel): @@ -936,7 +936,7 @@ class Viewer(wx.Panel):
936 ## Insert cursor 936 ## Insert cursor
937 self.SetInteractorStyle(const.STATE_DEFAULT) 937 self.SetInteractorStyle(const.STATE_DEFAULT)
938 938
939 - def __build_cross_lines(self, imagedata): 939 + def __build_cross_lines(self):
940 renderer = self.slice_data.overlay_renderer 940 renderer = self.slice_data.overlay_renderer
941 941
942 cross = vtk.vtkCursor3D() 942 cross = vtk.vtkCursor3D()
invesalius/project.py
@@ -22,7 +22,6 @@ import glob @@ -22,7 +22,6 @@ import glob
22 import os 22 import os
23 import plistlib 23 import plistlib
24 import shutil 24 import shutil
25 -import stat  
26 import tarfile 25 import tarfile
27 import tempfile 26 import tempfile
28 27
@@ -35,7 +34,6 @@ import data.mask as msk @@ -35,7 +34,6 @@ import data.mask as msk
35 import data.polydata_utils as pu 34 import data.polydata_utils as pu
36 import data.surface as srf 35 import data.surface as srf
37 from presets import Presets 36 from presets import Presets
38 -from reader import dicom  
39 from utils import Singleton, debug 37 from utils import Singleton, debug
40 import version 38 import version
41 39
@@ -47,18 +45,13 @@ class Project(object): @@ -47,18 +45,13 @@ class Project(object):
47 def __init__(self): 45 def __init__(self):
48 # Patient/ acquistion information 46 # Patient/ acquistion information
49 self.name = '' 47 self.name = ''
50 - self.dicom_sample = ''  
51 self.modality = '' 48 self.modality = ''
52 self.original_orientation = '' 49 self.original_orientation = ''
53 self.window = '' 50 self.window = ''
54 self.level = '' 51 self.level = ''
55 52
56 - # Original imagedata (shouldn't be changed)  
57 - self.imagedata = ''  
58 -  
59 # Masks (vtkImageData) 53 # Masks (vtkImageData)
60 self.mask_dict = {} 54 self.mask_dict = {}
61 - self.last_mask_index = 0  
62 55
63 # Surfaces are (vtkPolyData) 56 # Surfaces are (vtkPolyData)
64 self.surface_dict = {} 57 self.surface_dict = {}
@@ -107,7 +100,6 @@ class Project(object): @@ -107,7 +100,6 @@ class Project(object):
107 output 100 output
108 @ index: index of item that was inserted 101 @ index: index of item that was inserted
109 """ 102 """
110 - #self.last_mask_index = mask.index  
111 index = len(self.mask_dict) 103 index = len(self.mask_dict)
112 self.mask_dict[index] = mask 104 self.mask_dict[index] = mask
113 return index 105 return index