Commit 4bcd447b2e3a87eaacfdb6047f2e8f8902421aa0

Authored by tatiana
1 parent 59567274

FIX: Colour used in erase imagedata during edition

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
invesalius/data/slice_.py
@@ -372,7 +372,7 @@ class Slice(object): @@ -372,7 +372,7 @@ class Slice(object):
372 """ 372 """
373 x, y, z = position 373 x, y, z = position
374 imagedata = self.current_mask.imagedata 374 imagedata = self.current_mask.imagedata
375 - colour = imagedata.GetScalarRange()[0]# - 1 # Important to effect erase 375 + colour = self.imagedata.GetScalarRange()[0]# - 1 # Important to effect erase
376 imagedata.SetScalarComponentFromDouble(x, y, z, 0, colour) 376 imagedata.SetScalarComponentFromDouble(x, y, z, 0, colour)
377 imagedata.Update() 377 imagedata.Update()
378 378
@@ -382,7 +382,7 @@ class Slice(object): @@ -382,7 +382,7 @@ class Slice(object):
382 """ 382 """
383 imagedata = self.current_mask.imagedata 383 imagedata = self.current_mask.imagedata
384 if colour is None: 384 if colour is None:
385 - colour = imagedata.GetScalarRange()[1] 385 + colour = self.imagedata.GetScalarRange()[1]
386 imagedata.SetScalarComponentFromDouble(x, y, z, 0, colour) 386 imagedata.SetScalarComponentFromDouble(x, y, z, 0, colour)
387 387
388 def EditPixelBasedOnThreshold(self, x, y, z): 388 def EditPixelBasedOnThreshold(self, x, y, z):