Commit 33bf2ba1 authored by Matthijs's avatar Matthijs
Browse files

minor bugfixes

parent db494d45
...@@ -12,14 +12,15 @@ def complex_to_hsv(arr, background='dark'): ...@@ -12,14 +12,15 @@ def complex_to_hsv(arr, background='dark'):
Returns: Returns:
""" """
norm = np.max([np.max(abs(arr)), 1e-15])
objecthsv = np.zeros((3,) + arr.shape) objecthsv = np.zeros((3,) + arr.shape)
objecthsv[0] = np.angle(-arr) / 2 / np.pi + 0.5 objecthsv[0] = np.angle(-arr) / 2 / np.pi + 0.5
if background == 'dark': if background == 'dark':
objecthsv[1] = np.ones(arr.shape) objecthsv[1] = np.ones(arr.shape)
objecthsv[2] = abs(arr) / np.max(abs(arr)) objecthsv[2] = abs(arr) / norm
else: else:
objecthsv[2] = np.ones(arr.shape) objecthsv[2] = np.ones(arr.shape)
objecthsv[1] = abs(arr) / np.max(abs(arr)) objecthsv[1] = abs(arr) / norm
return np.transpose(objecthsv, (1, 2, 0)) return np.transpose(objecthsv, (1, 2, 0))
......
...@@ -89,7 +89,7 @@ class XYZStackViewer: ...@@ -89,7 +89,7 @@ class XYZStackViewer:
self.minval, self.maxval = clim self.minval, self.maxval = clim
elif cmap == 'seismic': elif cmap == 'seismic':
self.maxval = max(abs(volume)) self.maxval = max(abs(volume))
self.minval = -self.maxval self.minval = -1*self.maxval
else: else:
self.maxval = max(volume) self.maxval = max(volume)
self.minval = min([0, min(volume)]) self.minval = min([0, min(volume)])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment