Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] region_props handling of NumPy array #789

Open
JHancox opened this issue Oct 9, 2024 · 0 comments
Open

[BUG] region_props handling of NumPy array #789

JHancox opened this issue Oct 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@JHancox
Copy link

JHancox commented Oct 9, 2024

Describe the bug
In cucim.skimage.measure, region_props allows you to pass in a numpy object and some properties work okay (e.g. bbox) whereas others produce an error when evaluated (e.g. centroid). This inconsistency is somewhat confusing. It seems that ndarray is only partially supported internally.

Steps/Code to reproduce bug

import cupy as cp
from cucim.skimage import measure

a = np.array([[0,0,0,0,0,0,0],
              [0,1,1,1,0,0,0],
              [0,1,1,1,0,0,0],
              [0,1,1,1,0,0,0],
              [0,0,0,2,2,2,0],
              [0,0,0,2,2,0,0],
              [0,0,0,3,3,0,0]])

# Uncomment and it works. Omit this and some properties work 
# a = cp.array(a)

res = measure.regionprops(a)

for r in res:
    print(r.bbox, r.centroid)

Expected behavior
All properties should either work without error or should fail consistently

Environment details (please complete the following information):
Running Vista2D container, which includes cucim v23.12.1

Additional context

@JHancox JHancox added the bug Something isn't working label Oct 9, 2024
@jakirkham jakirkham changed the title [BUG] [BUG] region_props handling of NumPy array Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant