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

VoxelsAccessor.shape is XYZ ordered, while getitem is ZYX ordered #27

Open
grisaitis opened this issue Oct 20, 2016 · 0 comments
Open

Comments

@grisaitis
Copy link

grisaitis commented Oct 20, 2016

I think VoxelsAccessor.shape needs to be reverse of what it is now.

For example:

>>> va = VoxelsAccessor("slowpoke3:32773", "e402c09ddd0f45e980d9be6e9fcb9bd0", "grayscale")
>>> va.shape
(1, 6446, 6643, 8090)

but

>>> va[0, 7888, 2668, 4176]
91

If you believe the shape, that last bit should return 0 (or whatever the fill value is), because the coordinate (7888, 2668, 4176) is outside the shape (6446, 6643, 8090).

Indeed,

>>> import requests
>>> import numpy as np
# this gets the voxel at XYZ location (4176, 2668, 7888)
>>> url = "http://slowpoke3:32773/api/node/e402c09ddd0f45e980d9be6e9fcb9bd0/grayscale/raw/0_1_2/1_1_1/4176_2668_7888/nD"
>>> response = requests.get(url)
>>> x = np.fromstring(response.content, dtype=np.uint8)
>>> print(x)
[91]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant