Commit 46111ecbdc7714b1671d775ae3405953b431322d

Authored by Thiago Franco de Moraes
1 parent 6102130b
Exists in watershed

micro-optimization

Showing 1 changed file with 2 additions and 7 deletions   Show diff stats
invesalius/data/styles.py
... ... @@ -42,7 +42,7 @@ ORIENTATIONS = {
42 42  
43 43 BRUSH_FOREGROUND=1
44 44 BRUSH_BACKGROUND=2
45   -BRUSH_ERASE=3
  45 +BRUSH_ERASE=0
46 46  
47 47 def get_LUT_value(data, window, level):
48 48 return np.piecewise(data,
... ... @@ -1009,12 +1009,7 @@ class WaterShedInteractorStyle(DefaultInteractorStyle):
1009 1009  
1010 1010 # Checking if roi_i has at least one element.
1011 1011 if roi_m.size:
1012   - if operation == BRUSH_FOREGROUND:
1013   - roi_m[index] = 1
1014   - elif operation == BRUSH_BACKGROUND:
1015   - roi_m[index] = 2
1016   - elif operation == BRUSH_ERASE:
1017   - roi_m[index] = 0
  1012 + roi_m[index] = operation
1018 1013  
1019 1014 def expand_watershed(self, pubsub_evt):
1020 1015 markers = self.matrix
... ...