Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="stackview",
version="0.14.2",
version="0.14.3",
author="Robert Haase",
author_email="robert.haase@uni-leipzig.de",
description="Interactive image stack viewing in jupyter notebooks",
Expand Down
2 changes: 1 addition & 1 deletion stackview/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.14.2"
__version__ = "0.14.3"

from ._static_view import jupyter_displayable_output, insight
from ._utilities import merge_rgb
Expand Down
13 changes: 11 additions & 2 deletions stackview/_add_bounding_boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,19 @@ def add_bounding_boxes(image, bounding_boxes, line_width=2):
for bbox in bounding_boxes:
x = bbox['x']
y = bbox['y']
width = bbox['width']
height = bbox['height']
width = bbox['width'] if 'width' in bbox else 1
height = bbox['height'] if 'height' in bbox else 1
color_name = bbox['color'] if 'color' in bbox else "red"

if isinstance(x, float):
x = int(x * img_with_boxes.shape[1])
if isinstance(y, float):
y = int(y * img_with_boxes.shape[0])
if isinstance(width, float):
width = int(width * img_with_boxes.shape[1])
if isinstance(height, float):
height = int(height * img_with_boxes.shape[0])

# Convert color name to RGB
color = color_name_to_rgb(color_name)

Expand Down