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'):
Returns:
"""
norm = np.max([np.max(abs(arr)), 1e-15])
objecthsv = np.zeros((3,) + arr.shape)
objecthsv[0] = np.angle(-arr) / 2 / np.pi + 0.5
if background == 'dark':
objecthsv[1] = np.ones(arr.shape)
objecthsv[2] = abs(arr) / np.max(abs(arr))
objecthsv[2] = abs(arr) / norm
else:
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))
......
......@@ -89,7 +89,7 @@ class XYZStackViewer:
self.minval, self.maxval = clim
elif cmap == 'seismic':
self.maxval = max(abs(volume))
self.minval = -self.maxval
self.minval = -1*self.maxval
else:
self.maxval = max(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