diff --git a/setup.py b/setup.py index f7ac314..d18135e 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="stackview", - version="0.8.0", + version="0.8.1", author="Robert Haase", author_email="robert.haase@uni-leipzig.de", description="Interactive image stack viewing in jupyter notebooks", diff --git a/stackview/__init__.py b/stackview/__init__.py index 2228465..8bed0a0 100644 --- a/stackview/__init__.py +++ b/stackview/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.8.0" +__version__ = "0.8.1" from ._static_view import jupyter_displayable_output, insight from ._utilities import merge_rgb diff --git a/stackview/_animate.py b/stackview/_animate.py index 538bdfd..9dddb1a 100644 --- a/stackview/_animate.py +++ b/stackview/_animate.py @@ -35,6 +35,9 @@ def animate(timelapse, filename:str=None, overwrite_file:bool=True, frame_delay_ from stackview._image_widget import _img_to_rgb from ._utilities import numpy_to_gif_bytestream, _gif_to_html + if isinstance(timelapse, list): + timelapse = np.asarray(timelapse) + if 0 <= timelapse.min() <= 1 and 0 <= timelapse.max() <= 1: warnings.warn("The timelapse has a small intensity range between 0 and 1. Consider normalizing it to the range between 0 and 255.") if timelapse.min() < 0 or timelapse.max() > 255: @@ -115,6 +118,13 @@ def animate_curtain(timelapse, timelapse_curtain, import numpy as np from ._image_widget import _img_to_rgb + + if isinstance(timelapse, list): + timelapse = np.asarray(timelapse) + + if isinstance(timelapse_curtain, list): + timelapse_curtain = np.asarray(timelapse_curtain) + max_size = timelapse.shape[1] images = [] diff --git a/stackview/_image_widget.py b/stackview/_image_widget.py index a65f05c..5d911fd 100644 --- a/stackview/_image_widget.py +++ b/stackview/_image_widget.py @@ -72,7 +72,7 @@ def _img_to_rgb(image, display_max=None): from ._colormaps import _labels_lut, create_colormap - if len(image.shape) > 2 and image.shape[-1] == 3: + if len(image.shape) > 2 and (image.shape[-1] == 3 or image.shape[-1] == 4): return image if image.dtype == bool: