Skip to content

Commit

Permalink
FIX min_xs, min_ys should never be negative
Browse files Browse the repository at this point in the history
  • Loading branch information
xgrg committed Oct 9, 2020
1 parent 07c0f8f commit 90b4998
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nisnap/utils/slices.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def __get_abs_minmax(data, axis, slices, margin=5):
for a, bba in bb.items():
res[a] = []
for each in bba:
i = [int(min_xs - margin), int(max_xs + margin)],\
[int(min_ys - margin), int(max_ys + margin)]
i = [max(int(min_xs - margin), 0) , int(max_xs + margin)],\
[max(int(min_ys - margin), 0), int(max_ys + margin)]
res[a].append(i)
return res

Expand Down

0 comments on commit 90b4998

Please sign in to comment.