juliaimages.github.io icon indicating copy to clipboard operation
juliaimages.github.io copied to clipboard

Ordering of axes & dimensions

Open tbenst opened this issue 4 years ago • 3 comments

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)?

tbenst avatar Sep 28 '20 21:09 tbenst

Hi, also FYI https://evizero.github.io/Augmentor.jl/images/#Vertical-Major-vs-Horizontal-Major-1

dehann avatar Dec 08 '20 16:12 dehann

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 avatar Dec 08 '20 17:12 johnnychen94

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

ashwanirathee avatar Mar 28 '21 11:03 ashwanirathee