Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py
index e53235f5..2380f15d 100644
--- a/invesalius/data/slice_.py
+++ b/invesalius/data/slice_.py
@@ -1381,7 +1381,7 @@ class Slice(with_metaclass(utils.Singleton, object)):
colorer.SetInputData(image)
colorer.SetWindow(self.window_width)
colorer.SetLevel(self.window_level)
- colorer.SetOutputFormatToRGB()
+ colorer.SetOutputFormatToLuminance()
colorer.Update()
return colorer.GetOutput()
@@ -1454,7 +1454,7 @@ class Slice(with_metaclass(utils.Singleton, object)):
else:
# map scalar values into colors
lut_bg = vtk.vtkLookupTable()
- lut_bg.SetTableRange(imagedata.GetScalarRange())
+ lut_bg.SetTableRange((0, 255))
lut_bg.SetSaturationRange(self.saturation_range)
lut_bg.SetHueRange(self.hue_range)
lut_bg.SetValueRange(self.value_range)
diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py
index e53235f5..2380f15d 100644
--- a/invesalius/data/slice_.py
+++ b/invesalius/data/slice_.py
@@ -1381,7 +1381,7 @@ class Slice(with_metaclass(utils.Singleton, object)):
colorer.SetInputData(image)
colorer.SetWindow(self.window_width)
colorer.SetLevel(self.window_level)
- colorer.SetOutputFormatToRGB()
+ colorer.SetOutputFormatToLuminance()
colorer.Update()
return colorer.GetOutput()
@@ -1454,7 +1454,7 @@ class Slice(with_metaclass(utils.Singleton, object)):
else:
# map scalar values into colors
lut_bg = vtk.vtkLookupTable()
- lut_bg.SetTableRange(imagedata.GetScalarRange())
+ lut_bg.SetTableRange((0, 255))
lut_bg.SetSaturationRange(self.saturation_range)
lut_bg.SetHueRange(self.hue_range)
lut_bg.SetValueRange(self.value_range)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment