Skip to content

Use plane, row, col dimensions ordering as specified in the skimage conventions page #2276

Closed

Description

@soupault

Description

I've discovered that the declared recommended order of 3D image dimensions is plane, row, col (see the table in http://scikit-image.org/docs/dev/user_guide/numpy_images.html#coordinate-conventions).
In skimage there are couple of places, where this order is violated (at least, in docstrings). One of the cases I can remember is https://github.com/scikit-image/scikit-image/blob/master/skimage/restoration/inpaint.py#L82 . Probably, there are more.

Those mistakes have to be fixed so to not confuse users.

Activity

  1. added
    📄 type: Documentation
    🔧 type: Maintenance
    on Aug 30, 2016
  2. soupault commented on Aug 30, 2016

    @soupault
    MemberAuthor

    @jni btw, what is the recommended ordering for nD images? Is it T, P0, P1, ..., M, N, C or something different (e.g. T, Pn, ..., P1, P0, M, N, C)?

  3. jni commented on Sep 9, 2016

    @jni
    Member

    @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.

  4. soupault commented on Sep 9, 2016

    @soupault
    MemberAuthor

    what are P0... Pn?

    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.

  5. jni commented on Sep 9, 2016

    @jni
    Member

    @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.

  6. added this to the 1.0 milestone on May 5, 2020
  7. locked and limited conversation to collaborators on Oct 18, 2021
  8. unlocked this conversation on Apr 5, 2022
  9. modified the milestones: 1.0, skimage2 on Apr 5, 2022
  10. reopened this on Apr 5, 2022
  11. lagru commented on Aug 18, 2022

    @lagru
    Member

    To keep track: we've reached a decision in #3031 (comment)

    My perceived summary of the decision:

    • 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.
  12. modified the milestones: 2.0, 0.25 on Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

📄 type: Documentation💬 Discussion🔧 type: Maintenance

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions