Repository navigation
Fix: return object-typed properties as NumPy arrays in skimage.measure.regionprops_table - #272
Conversation
|
Can one of the admins verify this patch? |
@quasiben, could you please look at this one? |
|
add to allowlist |
|
I fixed a small formatting issue that was making tests fail, now it's all green besides label checker, but I can't assign those. |
|
@grlee77, could you please review this? π |
grlee77
left a comment
There was a problem hiding this comment.
Thanks, @alxndrkalinin, the main fix here looks good to me!
I have one request to revert changes to the non-object code path in _regionprops.py as I think it will be slower. If you measured an improvement, though, please let me know.
Co-authored-by: Gregory Lee <grlee77@gmail.com>
alxndrkalinin
left a comment
There was a problem hiding this comment.
Thanks for the feedback @grlee77!
Please see 2 small suggestions I have β if you think they're unnecessary, I'll be happy to just revert back to the list for non-object props.
grlee77
left a comment
There was a problem hiding this comment.
Thanks @alxndrkalinin, this looks good now.
This PR fixes adding properties whose results are objects to the dictionary that is returned by
skimage.measure.regionprops_table.Minimal example reproducing the issue:
raises
TypeError: Implicit conversion to a NumPy array is not allowed., while returning correct values is expected (also see modified unit tests).For some reason, only
sliceproperty was checked for, although the list of such properties already exists inOBJECT_COLUMNS.