Skip to content

Commit

Permalink
fixed shape check
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-gould committed Jul 12, 2024
1 parent 62b5870 commit 09aabef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dask_image/ndmeasure/_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ def _norm_input_labels_index(image, label_image=None, index=None):
"Having index with dimensionality greater than 1 is undefined.",
FutureWarning
)
if image.shape[:2] != label_image.shape: # allow trailing channel

image_shape = image.shape if image.ndim == label_image.ndim else image.shape[:-1]
if image_shape != label_image.shape: # allow trailing channel
raise ValueError(
"The image and label_image arrays must be the same shape."
f"The image and label_image arrays must be the same shape. {image_shape} != {label_image.shape}"
)

return (image, label_image, index)
Expand Down

0 comments on commit 09aabef

Please sign in to comment.