Skip to content

Replace arrayCoordinateSystem with explanation on how to express dimensionless transforms in pixel coordinates#118

Open
jo-mueller wants to merge 11 commits intoome:mainfrom
jo-mueller:no-array-cs
Open

Replace arrayCoordinateSystem with explanation on how to express dimensionless transforms in pixel coordinates#118
jo-mueller wants to merge 11 commits intoome:mainfrom
jo-mueller:no-array-cs

Conversation

@jo-mueller
Copy link
Copy Markdown
Contributor

Fixes ome/ngff#438
Addresses comment 4 on RFC5.

Title. This PR replaces the definition of implicit arrayCoordinateSystems with examples and explanatory text on how to properly express transforms that are done in pixel space, not unit space.

Follow up PR to #103 and #90

cc @bogovicj @btbest @will-moore @clbarnes @dstansby

@jo-mueller jo-mueller added the enhancement New feature or request label Mar 26, 2026
@github-actions
Copy link
Copy Markdown

Automated Review URLs

@btbest
Copy link
Copy Markdown
Contributor

btbest commented Mar 27, 2026

Perfect from my point of view! 🚀

@jo-mueller jo-mueller marked this pull request as ready for review March 27, 2026 07:44
Comment on lines +301 to +306
- A "pixel"/"voxel" is the continuous region (rectangle/box) that corresponds to a single sample in the discrete array,
i.e., the area corresponding to nearest-neighbor (NN) interpolation of that sample.
- The center of a 2d pixel corresponding to the origin (0,0) in the discrete array
is the origin of the continuous coordinate system (0.0, 0.0) (when the transformation is the identity).
- The continuous rectangle of the pixel is given
by the half-open interval [-0.5, 0.5) x [-0.5, 0.5) (i.e., -0.5 is included, +0.5 is excluded).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why this section needs to talk about interpolation? I also would not say "pixel/voxel" -- just say "pixel" here, and make it clear that this term denotes an N-dimensional geometrical element.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think the phrasing of a hyper-rectangle as the area that would correspond to the sample at location (i, j) is quite illuminating. I would simply consider it a rephrasing of the same concept.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the issue with defining a pixel as a unit hyperrectangle is that it stops being a hyperrectangle when you apply any transform that doesn't preserve angles, like shearing.

So if the 4 coordinates

[
  [(0,0), (0, 1)], 
  [(1, 0), (1, 1)]
]

is "4 pixels" (because nearest-neighbor interpolation would render the intensities at these coordinates as squares), shearing those coordinates, e.g.:

[
  [(0, 0), (0, 1)], 
  [(1, 1), (1, 2)]
]

gives you 4 of something other than a pixel (because these would be rendered as 4 rhombuses by nearest neighbor interpolation)

Is that the intent of this definition? An image is made of pixels until you apply certain transforms to it, and after that its made of something with no name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So...clearer separation of when we speak about

  • Pixels: "Little hyper-boxes" in native coordinate systems directly attached to arrays
  • Coordinates: Points in space that describe locations in a given coordinate system and that can be transformed into other coordinate systems
    ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do we lose if we just talk about points? Will the lack of a definition of "pixel" impair anyone's ability to make sense of the transforms + coordinate systems framework?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's good clarification @mkitti. I should have said "all the transforms defined here work on coordinates".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do we lose if we just talk about points?

Nothing, but: I'm afraid we are inching into discussion points that are better placed in ome/ngff#492, tbh, because they exceed the scope of this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as this PR purports to be about "pixel coordinates", I think clarifying usage of the term "pixel" here is important. maybe adjust the title if "pixel coordinates" is not in fact a key part of this PR?

Copy link
Copy Markdown
Contributor Author

@jo-mueller jo-mueller Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as this PR purports to be about "pixel coordinates", I think clarifying usage of the term "pixel" here is important.

I'm not saying it isn't. My point is simply that the term "pixel" currently occurs 17 times throughout different sections and it is out of scope of this PR to fix termini in sections that are about labels, multiscales, etc.

I do think common language is important, I simply prefer doing it in incremental steps. Right now, this PR doesn't use the term "pixel" anymore (save for the title, ofc), except in a section that is concerned with the actual definition of the term itself, which I hope would agree it's an improvement?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i definitely agree that the particular discussion about what "pixel" means, and what it contributes to the spec, can be continued elsewhere; hopefully the outcome of that discussion would not require editing any of the text modified here.

This can be expressed in the metadata in multiple ways, including:
- One can embed a transformation defined in array units into a `sequence` transformation
that includes the appropriate scale transformation and its inverse to convert to physical units (see example below).
- One can define a unitless coordinate system and connect it to the "intrinsic" coordinate system
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a definition of "intrinsic coordinate system somewhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm...In #117, I added this further up under the coordinate systems section:

grafik

Could add that here as well?

Copy link
Copy Markdown
Contributor

@d-v-b d-v-b Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so "intrinsic coordinate system" means "native physical coordinate system"? IMO this is not terribly clear, since both "intrinsic coordinate system" and "native coordinate system" are terms invented in this spec, as far as I can tell.

I would encourage reducing the number of different "kinds" of coordinate systems, especially if their differences cannot be strictly defined (i.e., defined well enough for a program to do something useful with).

Putting aside the "coordinate system" language for a minute, there is something special about the coordinates an array "starts with" -- without defining these coordinates, you have not defined the input to any of the transforms. So there needs to be some way for an array to declare what coordinates it has, before any transforms are applied.

"Array declares its coordinates" is not in principle the same thing as an "intrinsic coordinate system" or "array coordinate system" because ome-zarr could in principle add a convention (like xarray) where the array's coordinates are data that you read from a coordinate array (and so they would not start at (0,0,0), and might have units, etc). I would not close the door on this possibility.

So I would not use language that implies that the coordinates an array declares (implicitly, for now, but possibly explicitly later) are somehow categorically different from the coordinates that pop out of transforms. So I don't think you need to talk about pixel units or array units or any of that. The minimal thing is to instruct viewers how to address the coordinates an array starts with.

@will-moore will-moore mentioned this pull request Apr 1, 2026
Copy link
Copy Markdown
Contributor

@bogovicj bogovicj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this PR's scope as being pretty small, it does what it says and is clear (modulo the discussion below). So I approve these changes.

There are comments here about definitions and terminology that deserve further discussion. @d-v-b opened this issue ome/ngff#492
and I suggest we move the discussion there.

It's true that the phrasing of the examples and text edited here will change as a result of those decisions we'll have about terminology, but they'll affect more than what is written here, so I'd suggest those larger changes be a separate PR.

@jo-mueller jo-mueller requested review from d-v-b and will-moore April 8, 2026 18:06
@jo-mueller jo-mueller requested a review from bogovicj April 8, 2026 18:06
Copy link
Copy Markdown
Member

@will-moore will-moore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never really felt the need for Array coordinate systems, so it almost feels a bit verbose to describe how to work without them. But no objections if it's useful, Thanks

@jo-mueller
Copy link
Copy Markdown
Contributor Author

so it almost feels a bit verbose to describe how to work without them. But no objections if it's useful

Yeah...maybe we'll need a section for "How to express this or that data structure" to be broken out of the spec at some point 🤔

@lubianat lubianat modified the milestone: 0.6 Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC5 - explain usage of arraycoordinatesystems arrayCoordinateSystem

8 participants