Commit c799d5d1b99e2409886b9df695b8a803bef271f8

Authored by Paulo Henrique Junqueira Amorim
1 parent a5e04a63

FIX: fixed bug initial threshold from editor pencil

Showing 1 changed file with 7 additions and 0 deletions   Show diff stats
invesalius/control.py
@@ -18,6 +18,7 @@ class Controller(): @@ -18,6 +18,7 @@ class Controller():
18 self.volume = volume.Volume() 18 self.volume = volume.Volume()
19 self.__bind_events() 19 self.__bind_events()
20 20
  21 +
21 def __bind_events(self): 22 def __bind_events(self):
22 ps.Publisher().subscribe(self.ImportDirectory, 'Import directory') 23 ps.Publisher().subscribe(self.ImportDirectory, 'Import directory')
23 ps.Publisher().subscribe(self.StartImportPanel, "Load data to import panel") 24 ps.Publisher().subscribe(self.StartImportPanel, "Load data to import panel")
@@ -63,6 +64,10 @@ class Controller(): @@ -63,6 +64,10 @@ class Controller():
63 proj.SetAcquisitionModality(acquisition_modality) 64 proj.SetAcquisitionModality(acquisition_modality)
64 proj.imagedata = imagedata 65 proj.imagedata = imagedata
65 66
  67 + threshold_range = proj.imagedata.GetScalarRange()
  68 + const.THRESHOLD_OUTVALUE = threshold_range[0]
  69 + const.THRESHOLD_INVALUE = threshold_range[1]
  70 +
66 # Based on imagedata, load data to GUI 71 # Based on imagedata, load data to GUI
67 ps.Publisher().sendMessage('Load slice to viewer', (imagedata)) 72 ps.Publisher().sendMessage('Load slice to viewer', (imagedata))
68 73
@@ -85,3 +90,5 @@ class Controller(): @@ -85,3 +90,5 @@ class Controller():
85 (min_thresh, max_thresh) = proj.threshold_modes.get_value(key) 90 (min_thresh, max_thresh) = proj.threshold_modes.get_value(key)
86 91
87 92
  93 +
  94 +