Skip to content
Snippets Groups Projects

Automatic objects colormap

+ 3
6
@@ -81,7 +81,8 @@ def slices(
img_height = img_size
img_width = img_size
# If we pass python None to the imshow function, we will get
# If we pass python None to the imshow function, it will set to
# default value 'antialiased'
if interpolation is None:
interpolation = 'none'
@@ -102,14 +103,10 @@ def slices(
raise ValueError(
f"Invalid value for 'axis'. It should be an integer between 0 and {vol.ndim - 1}."
)
if cmap == 'objects':
num_labels = len(np.unique(vol))
cmap = qim3d.viz.colormaps.objects(num_labels)
if type(cmap) == matplotlib.colors.LinearSegmentedColormap or cmap == 'objects':
num_labels = len(np.unique(vol))
if cmap == 'objects':
cmap = qim3d.viz.colormaps.objects(num_labels)
# If vmin and vmax are not set like this, then in case the
Loading