Skip to content

Commit

Permalink
bug in cropping function
Browse files Browse the repository at this point in the history
  • Loading branch information
mjo22 committed Nov 17, 2024
1 parent 35a666f commit cbea7a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cryojax/image/_edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def crop_to_shape_with_center(
h, w = shape
x0, y0 = max(xc - w // 2, 0), max(yc - h // 2, 0)
xn, yn = (
min(yc + h // 2 + h % 2, image.shape[1] - 1),
min(xc + w // 2 + w % 2, image.shape[0] - 1),
min(xc + w // 2 + w % 2, image.shape[1] - 1),
min(yc + h // 2 + h % 2, image.shape[0] - 1),
)
cropped = image[y0:yn, x0:xn]
else:
Expand Down

0 comments on commit cbea7a0

Please sign in to comment.