Commit ecc617cf authored by Matthijs's avatar Matthijs
Browse files

default colormaps

parent c7d75528
......@@ -51,7 +51,7 @@ class SingleStackViewer:
class XYZStackViewer:
def __init__(self, volume, limit_sliders=(0, 0, 0), cmap: str = 'seismic', clim: tuple = (None, None),
def __init__(self, volume, limit_sliders=(0, 0, 0), cmap: str = None, clim: tuple = (None, None),
data_transform: callable = None, name: str = None):
"""
Dynamic matplotlib plot showing slices out of a 3d dataset
......@@ -70,14 +70,11 @@ class XYZStackViewer:
if volume.ndim == 4 and volume.shape[-1] in [3, 4]:
rgb_plot = True
show_colorbar = False
else:
# assert volume.ndim == 3, 'Functionality is designed for 3D arrays'
rgb_plot = False
if cmap is not None:
show_colorbar = True
else:
show_colorbar = False
radio_start = 0
if data_transform is not None:
......@@ -87,12 +84,18 @@ class XYZStackViewer:
show_colorbar = True # False
rgb_plot = False # True
radio_start = 0 # 1
if cmap is None:
cmap = 'viridis'
else:
def dummy(array):
return array
self.cast_fn = dummy
if cmap is None:
cmap = 'seismic'
show_colorbar = True
self.volume = volume
self.indices = [s // 2 for s in volume.shape]
self.shape = self.volume.shape
......
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