ome / ngff

Next-generation file format (NGFF) specifications for storing bioimaging data in the cloud.
https://ngff.openmicroscopy.org
Other
115 stars 38 forks source link

Affine transformations specification are not decoupled from their input and output spaces #146

Open LucaMarconato opened 2 years ago

LucaMarconato commented 2 years ago

I want to point out that affine transformations like

{ "type": "affine", "affine": [1, 2, 3, 4, 5, 6] }

require "input" and "output" to be specified to be parsed, otherwise it's not clear if it is for instance the affine transformation

1 2 3
4 5 6
0 0 1

or

1 2
3 4
5 6
0 1

This has two undesiderable implications:

My proposal it to be explicit about the shape of the affine transformation by adding inner parentheses. In the case above this could be solved by having [[1, 2, 3], [4, 5, 6]] and [[1, 2], [3, 4], [5, 6]] as value for affine.

Tagging @bogovicj

LucaMarconato commented 2 years ago

I have just noticed that the matrix MAY be specified as 2D array, so a solution is already supported, very good. I wonder if the 2D specification shouldn't instead be required.

bogovicj commented 2 years ago

Thanks @LucaMarconato Good point and nice argument to use 2D arrays rather than the flattened representation. I'll think about it a little more but will probably change the spec to move away from the flat arrays.