-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Unexpected behavior in skimage.transforms.rescale() with image shape (x, y, 1) #5553
Comments
I see that the "multichannel" parameter (and upcoming "channel_axis" parameter) can fix this issue, which works for now. I understand this is a challenge when dealing with image structure intent, and each package has to define which axes are spatial, which are channels, which are hyper-spatial (for image stacks or sequences). Is the intent of scikit-image image structures written in the docs somewhere? Is the term "N-dimensional image" explicitly defined to mean "all axes are spatial unless otherwise indicated"? I ask because my intuition coming from other image-related packages is that the last axis is assumed to be channels (unless there are only 2 axes), but here it wasn't, to my surprise. |
We are in the process of deprecating the multichannel boolean and replacing it with a channel_axis integer (or channel_axis=None for no channels dimension). The 0.19 release will support both multichannel and the new channel_axis argument, but eventually multichannel will be dropped. |
Volumetric (3D) medical images or other forms of non-2D data are supported. Given this we don't want to try to guess what a user is providing and prefer to move to an API where it is made explicit. We do need to make sure we document this prominently. Thank you for bringing this up as I see that I failed to update this page when adding the |
Hi @grlee77, I appreciate your time and comments. Your N-D generalized approach makes sense. I appreciate the link to the page, that helped me better understand how skimage works.. Thank you! My specific issue is resolved. I'll leave it to your discretion whether to keep this issue open or closed in case it's a helpful bookmark for what you wanted to change about the overall user/developer experience. |
Description
When using
skimage.transforms.rescale()
with 2D images with a single explicit channel, i.e. shape (x, y, 1), there is an error message I found unhelpful. I expected the function to "just work" with that shape, or at the very least warn that shape is not allowed/expected. Instead I received an OverflowError in the internalgaussian_filter1d()
function.I searched issues for "rescale overflow" and found nothing relating to this behavior.
Way to reproduce
Actual output
Version information
The text was updated successfully, but these errors were encountered: