You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use plane, row, col dimensions ordering as specified in the skimage conventions page #2276
@soupault what are P0... Pn? We don't really have a concept of time in scikit-image, but in general yes, it should be the leading dimension, so that each frame (whether 2D, 3D, or 3D+c) is contiguous in memory, when using the "standard" C-ordering in NumPy arrays. Some specialised applications might want time-contiguous voxels, but I would say they are in the minority.
nD-planes they are. It is clear that for 3 spatial dims the order should be P, M, N. I'm wondering if there is already a convention on how to order 4 or them: should it be P_3, P_4, M, N or P_4, P_3, M, N?
Personally, I have no idea how to interpret P_4 in image processing case (well, obviously, it is a basis vector for 4th spatial dimension, as well as P_inf is an INFth vector in Hilbert space), but you (as The Guardian of Dimensions) are probably aware.
@soupault that's exactly it, I don't think there is such a case as 4-spatial dimension data. There's T, and T should come first as discussed (in general). There might also be some other array dimension, for example, sample ID, and that should probably come before T still.
I guess what I'm saying is, T comes first, and for anything else, it should probably be evaluated on a case-by-case basis.
We will use alphabetically ordered letters M, N, P, Q, ... to document the shape of array-like objects in our API. This ordering holds true for optional dimensions, e.g. [M, ..., ]N[, P, ...][, C]
C may be used as an exception to the rule above to identify a channel axis.
These letters, except for C, hold no special meaning or convention other than how a shape or dimensionality is transformed by our API.
Activity
soupault commentedon Aug 30, 2016
@jni btw, what is the recommended ordering for nD images? Is it
T, P0, P1, ..., M, N, Cor something different (e.g.T, Pn, ..., P1, P0, M, N, C)?jni commentedon Sep 9, 2016
@soupault what are
P0...Pn? We don't really have a concept of time in scikit-image, but in general yes, it should be the leading dimension, so that each frame (whether 2D, 3D, or 3D+c) is contiguous in memory, when using the "standard" C-ordering in NumPy arrays. Some specialised applications might want time-contiguous voxels, but I would say they are in the minority.soupault commentedon Sep 9, 2016
nD-planes they are. It is clear that for 3 spatial dims the order should be
P, M, N. I'm wondering if there is already a convention on how to order 4 or them: should it beP_3, P_4, M, NorP_4, P_3, M, N?Personally, I have no idea how to interpret P_4 in image processing case (well, obviously, it is a basis vector for 4th spatial dimension, as well as P_inf is an INFth vector in Hilbert space), but you (as The Guardian of Dimensions) are probably aware.
jni commentedon Sep 9, 2016
@soupault that's exactly it, I don't think there is such a case as 4-spatial dimension data. There's T, and T should come first as discussed (in general). There might also be some other array dimension, for example, sample ID, and that should probably come before T still.
I guess what I'm saying is, T comes first, and for anything else, it should probably be evaluated on a case-by-case basis.
lagru commentedon Aug 18, 2022
To keep track: we've reached a decision in #3031 (comment)
My perceived summary of the decision:
M, N, P, Q, ...to document the shape of array-like objects in our API. This ordering holds true for optional dimensions, e.g.[M, ..., ]N[, P, ...][, C]Cmay be used as an exception to the rule above to identify a channel axis.C, hold no special meaning or convention other than how a shape or dimensionality is transformed by our API.Use consistent notation for array dimensions in the docstrings (#3031)