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
1 change: 0 additions & 1 deletion src/lavlab/imsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import bisect

# import logging
import io
import os
from enum import Enum
Expand Down
17 changes: 10 additions & 7 deletions src/lavlab/omero/rois.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ def get_shapes_as_points( # pylint: disable=R0914

if isinstance(shape, EllipseI):
points = draw.ellipse_perimeter(
float(shape.getY().getValue() / img_downsample),
float(shape.getX().getValue() / img_downsample),
float(shape.getRadiusY().getValue() / img_downsample),
float(shape.getRadiusX().getValue() / img_downsample),
int(shape.getY().getValue() // img_downsample),
int(shape.getX().getValue() // img_downsample),
int(shape.getRadiusY().getValue() // img_downsample),
int(shape.getRadiusX().getValue() // img_downsample),
shape=yx_shape,
)
points = [(points[1][i], points[0][i]) for i in range(len(points[0]))]
Expand All @@ -108,11 +108,14 @@ def get_shapes_as_points( # pylint: disable=R0914

r, g, b, _ = uint_to_rgba(color_val)

if (len(points) / point_downsample) <= 2:
point_downsample = 1
print('Point downsampling too high, leading to destroyed polygon. Setting downsampling = 1.')

points = [
(float(x), float(y))
for x, y in zip(
points[0][::point_downsample], points[1][::point_downsample]
)
for x, y in
points[::point_downsample]
]

# Ensure shape ID is an integer
Expand Down
Loading