Skip to content

Commit 3b7aa31

Browse files
Merge pull request #66 from haesleinhuepf/bugfix_rgba_animations
Bugfix RGBA animations didn't work
2 parents c92c1c5 + 627504b commit 3b7aa31

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="stackview",
8-
version="0.8.0",
8+
version="0.8.1",
99
author="Robert Haase",
1010
author_email="robert.haase@uni-leipzig.de",
1111
description="Interactive image stack viewing in jupyter notebooks",

stackview/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.8.0"
1+
__version__ = "0.8.1"
22

33
from ._static_view import jupyter_displayable_output, insight
44
from ._utilities import merge_rgb

stackview/_animate.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ def animate(timelapse, filename:str=None, overwrite_file:bool=True, frame_delay_
3535
from stackview._image_widget import _img_to_rgb
3636
from ._utilities import numpy_to_gif_bytestream, _gif_to_html
3737

38+
if isinstance(timelapse, list):
39+
timelapse = np.asarray(timelapse)
40+
3841
if 0 <= timelapse.min() <= 1 and 0 <= timelapse.max() <= 1:
3942
warnings.warn("The timelapse has a small intensity range between 0 and 1. Consider normalizing it to the range between 0 and 255.")
4043
if timelapse.min() < 0 or timelapse.max() > 255:
@@ -115,6 +118,13 @@ def animate_curtain(timelapse, timelapse_curtain,
115118
import numpy as np
116119
from ._image_widget import _img_to_rgb
117120

121+
122+
if isinstance(timelapse, list):
123+
timelapse = np.asarray(timelapse)
124+
125+
if isinstance(timelapse_curtain, list):
126+
timelapse_curtain = np.asarray(timelapse_curtain)
127+
118128
max_size = timelapse.shape[1]
119129

120130
images = []

stackview/_image_widget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def _img_to_rgb(image,
7272
display_max=None):
7373
from ._colormaps import _labels_lut, create_colormap
7474

75-
if len(image.shape) > 2 and image.shape[-1] == 3:
75+
if len(image.shape) > 2 and (image.shape[-1] == 3 or image.shape[-1] == 4):
7676
return image
7777

7878
if image.dtype == bool:

0 commit comments

Comments
 (0)