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

Ordering of axes & dimensions #173

Open
tbenst opened this issue Sep 28, 2020 · 3 comments
Open

Ordering of axes & dimensions #173

tbenst opened this issue Sep 28, 2020 · 3 comments
Labels
question Questions that might worth living in the FAQ page

Comments

@tbenst
Copy link

tbenst commented Sep 28, 2020

Really enjoying the API of this package.

A bit confused by https://juliaimages.org/latest/pkgs/axes/#Names-and-locations. By convention, x is horizontal and y is vertical. But this does not seem to be the case:

A = rand(10,20,5);
axisA = AxisArray(A, (:x, :y, :z), (1μm, 2μm, 3μm))
Gray.(axisA[:,:,1])
# a horizontal rectangle appears

Perhaps documentation should use (:y, :x, :z)?

@dehann
Copy link

dehann commented Dec 8, 2020

@johnnychen94
Copy link
Member

johnnychen94 commented Dec 8, 2020

This is how we usually reason about the axis when processing an image; so it's consistent that x defines the height. Imagine that the last pixel is placed at the bottom-right place instead of the top-right place and you'll find this convention justified.

image

@johnnychen94 johnnychen94 transferred this issue from JuliaImages/Images.jl Dec 8, 2020
@ashwanirathee
Copy link
Member

This was a rather interesting one for me too because if you look at the cartesian Index and indexing of images of the two images like
It did got me quite confused and I had to do dry runs of algorithm with actual graph 😄
img[2nd dim,1st dim]
2nd dim looks like it represents y-axis,and 1st dim looks it represents x-axis but the thing that looks like the y-axis here is actually supposed to represent x-axis in Cartesian Indexes and similiarly for 1st dim
I am used to thinking in cartesianindexes but the image are usually thought about in terms of rows and columns
It's the way the data is handled between Cartesian indexes and img[y,x] that had me confused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions that might worth living in the FAQ page
Projects
None yet
Development

No branches or pull requests

4 participants