Skip to content

Commit be23b40

Browse files
Merge pull request #13 from haesleinhuepf/dev
insight update: colors and < 100 pixels
2 parents 7b2a827 + b2f613f commit be23b40

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
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.4.0",
8+
version="0.5.0",
99
author="Robert Haase",
1010
author_email="[email protected]",
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.4.0"
1+
__version__ = "0.5.0"
22

33
import warnings
44
from ._static_view import jupyter_displayable_output, insight

stackview/_image_widget.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ def _labels_lut():
9797
lut = rs.rand(65537, 3)
9898
lut[0, :] = 0
9999
# these are the first four colours from matplotlib's default
100-
lut[1] = [1.0, 0.4980392156862745, 0.054901960784313725]
101-
lut[2] = [0.12156862745098039, 0.4666666666666667, 0.7058823529411765]
100+
lut[1] = [0.12156862745098039, 0.4666666666666667, 0.7058823529411765]
101+
lut[2] = [1.0, 0.4980392156862745, 0.054901960784313725]
102102
lut[3] = [0.17254901960784313, 0.6274509803921569, 0.17254901960784313]
103103
lut[4] = [0.8392156862745098, 0.15294117647058825, 0.1568627450980392]
104-
return lut
104+
return lut

stackview/_static_view.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,12 @@ def _repr_html_(self):
5959
from ._image_widget import _is_label_image
6060
labels = _is_label_image(self)
6161

62-
# In case the image is 2D, 3D and larger than 100 pixels, turn on fancy view
63-
if len(self.shape) in (2, 3) and size_in_pixels >= 100:
64-
import matplotlib.pyplot as plt
65-
_imshow(self,
66-
labels=labels,
67-
continue_drawing=True,
68-
colorbar=not labels)
69-
image = _png_to_html(_plt_to_png())
70-
else:
71-
return "<pre>numpy.ndarray(" + str(np.asarray(self)) + ", dtype=" + str(self.dtype) + ")</pre>"
62+
import matplotlib.pyplot as plt
63+
_imshow(self,
64+
labels=labels,
65+
continue_drawing=True,
66+
colorbar=not labels)
67+
image = _png_to_html(_plt_to_png())
7268

7369
if size_in_bytes > 1024:
7470
size_in_bytes = size_in_bytes / 1024

0 commit comments

Comments
 (0)