Commit 148e2aa4 authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[core][roi] Fix typo when computing 2D roi

parent 6143d2bf
......@@ -54,7 +54,8 @@ def apply_2D_ROI(img, origin=None, size=None, center=None):
and all(j < img.shape[i] for i, j in enumerate(origin)), "Origin must be a valid pixel"
origin = numpy.array(origin)
size = numpy.array(size)
points = numpy.array([origin, origin + size])
points = numpy.ceil([origin, origin + size]).astype(
points[1] = numpy.minimum(points[1], img.shape)
elif center is not None:
assert all(i >= 0 for i in center) \
and all(j < img.shape[i] for i, j in enumerate(center)), "Center must be a valid pixel"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment