-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coordinate systems and new coordinate transformations proposal #138
base: main
Are you sure you want to change the base?
Changes from 37 commits
f0da62a
4331deb
8051e71
180568b
4f48364
98a40de
dd71953
1b26a8e
cd9c431
e210027
d873541
63ed4ce
a459492
9058b4b
38ac6ac
3a2aae1
ed12192
3ec8543
30cade5
df470d7
99f3a4e
de73c68
163c8f4
7b35c28
7baeed7
162a9e9
a90662d
32656e5
0245ca9
a3ff0b5
0df402d
f05d480
ed17ed5
b9f89e1
cd01ab7
86672e6
b34875d
35ea3e3
3fcba53
883ff1c
c2a18c4
027b55b
5bfe442
aab7469
9764451
098bfb8
f04ebef
ead1f7b
281df32
87d78e8
033d4bb
f78e441
55e35bd
0833395
85808cf
74466c5
9406ce1
ff2bc86
a68523f
3fe7aa2
f976a87
72b4f9c
be7d849
da94207
b92f540
383aa87
1849133
a2e7687
5ce238a
676aeba
be61476
578dd72
c33287d
6da38f7
1451a47
1602832
417c7cd
3c86a3b
9021ae0
841e0aa
704173c
03fe664
34e41d3
a24aefd
d22b663
7add879
e5b351c
9abfa1e
b7c28f9
5818a1f
3896ab4
2f7c413
67cb6d2
fb88485
85437f2
a9fadf3
a0cd017
150f1f8
61eb70a
0eb5040
aa0542d
bc4f395
802c94f
51417a6
cd92ec1
701867e
81cc4a5
7dec4fe
6ebcf5f
00b79f1
88b5f16
cc6ade0
11729de
8e9bdb6
d311848
b5ed81a
12a5338
5376db5
50e7759
e8bc1db
7d71127
3a7e76f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"arrayCoordinateSystem" : { | ||
"name" : "myDataArray", | ||
"axes" : [ | ||
{"name": "i", "type": "array"}, | ||
{"name": "j", "type": "array"}, | ||
{"name": "k", "type": "array"} | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,44 +3,50 @@ | |
{ | ||
"version": "0.5-dev", | ||
"name": "example", | ||
"axes": [ | ||
{"name": "t", "type": "time", "unit": "millisecond"}, | ||
{"name": "c", "type": "channel"}, | ||
{"name": "z", "type": "space", "unit": "micrometer"}, | ||
{"name": "y", "type": "space", "unit": "micrometer"}, | ||
{"name": "x", "type": "space", "unit": "micrometer"} | ||
"coordinateSystems" : [ | ||
{ | ||
"name" : "example", | ||
"axes": [ | ||
{"name": "t", "type": "time", "unit": "millisecond"}, | ||
{"name": "c", "type": "channel"}, | ||
{"name": "z", "type": "space", "unit": "micrometer"}, | ||
{"name": "y", "type": "space", "unit": "micrometer"}, | ||
{"name": "x", "type": "space", "unit": "micrometer"} | ||
] | ||
} | ||
], | ||
"datasets": [ | ||
{ | ||
"path": "0", | ||
"coordinateTransformations": [{ | ||
// the voxel size for the first scale level (0.5 micrometer) | ||
// the voxel size for the first scale level (0.5 micrometer), time unit (0.1 milliseconds) | ||
"type": "scale", | ||
"scale": [1.0, 1.0, 0.5, 0.5, 0.5] | ||
"scale": [0.1, 1.0, 0.5, 0.5, 0.5], | ||
"input" : "/0", | ||
"output" : "example" | ||
}] | ||
}, | ||
{ | ||
"path": "1", | ||
"coordinateTransformations": [{ | ||
// the voxel size for the second scale level (downscaled by a factor of 2 -> 1 micrometer) | ||
// the voxel size for the second scale level (downscaled by a factor of 2 -> 1 micrometer), time unit (0.1 milliseconds) | ||
"type": "scale", | ||
"scale": [1.0, 1.0, 1.0, 1.0, 1.0] | ||
"scale": [0.1, 1.0, 1.0, 1.0, 1.0], | ||
"input" : "/1`", | ||
"output" : "example" | ||
}] | ||
}, | ||
{ | ||
"path": "2", | ||
"coordinateTransformations": [{ | ||
// the voxel size for the third scale level (downscaled by a factor of 4 -> 2 micrometer) | ||
// the voxel size for the third scale level (downscaled by a factor of 4 -> 2 micrometer), time unit (0.1 milliseconds) | ||
"type": "scale", | ||
"scale": [1.0, 1.0, 2.0, 2.0, 2.0] | ||
"scale": [0.1, 1.0, 2.0, 2.0, 2.0], | ||
"input" : "/2", | ||
"output" : "example" | ||
}] | ||
} | ||
], | ||
"coordinateTransformations": [{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this proposal effectively remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not, I will add another example showing what |
||
// the time unit (0.1 milliseconds), which is the same for each scale level | ||
"type": "scale", | ||
"scale": [0.1, 1.0, 1.0, 1.0, 1.0] | ||
}], | ||
"type": "gaussian", | ||
"metadata": { | ||
"description": "the fields in metadata depend on the downscaling implementation. Here, the parameters passed to the skimage function are given", | ||
|
@@ -51,4 +57,4 @@ | |
} | ||
} | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"multiscales": [ | ||
{ | ||
"version": "0.5-dev", | ||
"name": "example", | ||
"coordinateSystems" : [ | ||
{ | ||
"name" : "exampleCoordinateSystem", | ||
"axes": [ | ||
{"name": "t", "type": "time", "unit": "millisecond"}, | ||
{"name": "c", "type": "channel"}, | ||
{"name": "z", "type": "space", "unit": "micrometer"}, | ||
{"name": "y", "type": "space", "unit": "micrometer"}, | ||
{"name": "x", "type": "space", "unit": "micrometer"} | ||
] | ||
} | ||
], | ||
"datasets": [ | ||
{ | ||
"path": "0" | ||
// the transformation of other arrays are defined relative to this, the highest resolution, array | ||
}, | ||
{ | ||
"path": "1", | ||
"coordinateTransformations": [{ | ||
// the second scale level (downscaled by a factor of 2 relative to "0" in zyx) | ||
"type": "scale", | ||
"scale": [1, 1, 2, 2, 2], | ||
"input" : "/1`", | ||
"output" : "/0" | ||
}] | ||
}, | ||
{ | ||
"path": "2", | ||
"coordinateTransformations": [{ | ||
// the third scale level (downscaled by a factor of 4 relative to "0" in zyx) | ||
"type": "scale", | ||
"scale": [1, 1, 4, 4, 4], | ||
"input" : "/2", | ||
"output" : "/0" | ||
}] | ||
} | ||
], | ||
"coordinateTransformations": [{ | ||
// the time unit (0.1 milliseconds), the voxel size for all spatial axes of "0" (0.5 micrometers) | ||
"type": "scale", | ||
"scale": [0.1, 1.0, 0.5, 0.5, 0.5], | ||
"input" : "/0", | ||
"output" : "xampleCoordinateSystem" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. xample -> example |
||
}], | ||
"type": "gaussian", | ||
"metadata": { | ||
"description": "the fields in metadata depend on the downscaling implementation. Here, the parameters passed to the skimage function are given", | ||
"method": "skimage.transform.pyramid_gaussian", | ||
"version": "0.16.1", | ||
"args": "[true]", | ||
"kwargs": {"multichannel": true} | ||
} | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"coordinateSystems" : [ | ||
{ "name " : "in", "axes" : [ {"name" : "0", "name" : "1", "name": "2", "name": "3", "name": "4" }] }, | ||
{ "name " : "out", "axes" : [ {"name" : "x", "name" : "y", "name" : "z" }] } | ||
], | ||
"coordinateTransformations" : [ | ||
{ | ||
"type" : "sequence", | ||
"name" : "5D-to-3D", | ||
"input" : "in", | ||
"output" : "out", | ||
"transformations" : [ | ||
{ | ||
"type": "mapIndex", | ||
"inputAxes" : ["0", "1"], | ||
"outputAxes" : ["x", "y"] | ||
}, | ||
{ | ||
"type": "scale", | ||
"scale" : [2], | ||
"inputAxes" : ["3"], | ||
"outputAxes" : ["z"] | ||
} | ||
] | ||
}, | ||
{ | ||
"type" : "sequence", | ||
"name" : "5D-to-3D-not-contiguous", | ||
"input" : "in", | ||
"output" : "out", | ||
"transformations" : [ | ||
{ | ||
"type": "mapIndex", | ||
"inputAxes" : ["0", "2"], | ||
"outputAxes" : ["x", "z"] | ||
}, | ||
{ | ||
"type": "scale", | ||
"scale" : [2], | ||
"inputAxes" : ["1"], | ||
"outputAxes" : ["y"] | ||
} | ||
] | ||
}, | ||
{ | ||
"type" : "sequence", | ||
"name" : "5D-to-3D-not-contiguous", | ||
"input" : "in", | ||
"output" : "out", | ||
"transformations" : [ | ||
{ | ||
"type": "mapAxes", | ||
"map" : {"0":"x", "2":"z"} | ||
}, | ||
{ | ||
"type": "scale", | ||
"scale" : [2], | ||
"inputAxes" : ["1"], | ||
"outputAxes" : ["y"] | ||
} | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"coordinateSystems" : [ | ||
{ "name " : "in", "axes" : [ {"name" : "i", "name" : "j" }] }, | ||
{ "name " : "out", "axes" : [ {"name" : "x", "name" : "y" }] } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. axes are both single-item lists containing a dict with multiple |
||
], | ||
"coordinateTransformations" : [ | ||
{ | ||
"type" : "sequence", | ||
"input" : "in", | ||
"output" : "out", | ||
"transformations" : [ | ||
{ | ||
"type": "identity", | ||
"inputAxes" : ["j"], | ||
"outputAxes" : ["x"] | ||
}, | ||
{ | ||
"type": "scale", | ||
"scale" : [2], | ||
"inputAxes" : ["i"], | ||
"outputAxes" : ["y"] | ||
} | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"coordinateSystems" : [ | ||
{ "name": "ij", "axes": [{"name": "i"}, {"name": "j"}] }, | ||
{ "name": "xy", "axes": [{"name": "x"}, {"name": "y"}] } | ||
], | ||
"coordinateTransformations" : [ | ||
{ | ||
"type": "affine", | ||
"affine": [1, 2, 3, 4, 5, 6], | ||
"input": "ij", | ||
"output": "xy" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"coordinateSystems": [ | ||
{ "name": "ij", "axes": [{"name": "i"}, {"name": "j"}] }, | ||
{ "name": "xyz", "axes": [{"name": "x"}, {"name": "y"}, {"name": "z"}] } | ||
], | ||
"coordinateTransformations": [ | ||
{ | ||
"type": "affine", | ||
"affine": [1, 2, 3, 4, 5, 6, 7, 8, 9], | ||
"input": "ij", | ||
"output": "xyz" | ||
} | ||
] | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the first example where I really don't know at first glance what's going on...? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related: #146 (comment) (please @bogovicj close the issue if the nested representation is adopted) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"coordinateSystems": [ | ||
{ "name": "in", "axes": [ {"name": "i"}, {"name": "j"} ] }, | ||
{ "name": "out", "axes": [ {"name": "x"}, {"name": "y"} ] } | ||
], | ||
"coordinateTransformations": [ | ||
{ | ||
"type": "byDimension", | ||
"input": "in", | ||
"output": "out", | ||
"transformations": [ | ||
{ "type": "translation", "translation": [-1.0], "input": ["i"], "output": ["x"]}, | ||
{ "type": "scale", "scale": [2.0], "input": ["j"], "output": ["y"]} | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"coordinateSystems": [ | ||
{ "name": "in", "axes": [ {"name": "i"}, {"name": "j"}, {"name": "k"}, {"name": "l"}] }, | ||
{ "name": "out", "axes": [ {"name": "x"}, {"name": "y"}, {"name": "z"} ] } | ||
], | ||
"coordinateTransformations": [ | ||
{ | ||
"type": "byDimension", | ||
"input": "in", | ||
"output": "out", | ||
"transformations" : [ | ||
{ "type": "translation", "translation": [1, 3], "input": ["i", "k" ], "output": ["y", "x"]}, | ||
{ "type": "scale", "scale": [2.0], "input": ["j"], "output": ["z"]} | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"coordinateSystems": [ | ||
{ "name": "in", "axes": [ {"name": "i"}, {"name": "j"} ] }, | ||
{ "name": "out", "axes": [ {"name": "x"}, {"name": "y"} ] } | ||
], | ||
"coordinateTransformations": [ | ||
{ | ||
"type": "byDimension", | ||
"input": "in", | ||
"output": "out", | ||
"transformations": [ | ||
{ "type": "translation", "translation": [-1.0], "input": ["i"], "output": ["z"]}, | ||
{ "type": "scale", "scale": [2.0], "input": ["0"], "output": ["y"]} | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"coordinateSystems": [ | ||
{ "name": "in", "axes": [ {"name": "i"}, {"name": "j"} ] }, | ||
{ "name": "out", "axes": [ {"name": "x"}, {"name": "y"} ] } | ||
], | ||
"coordinateTransformations": [ | ||
{ | ||
"type": "byDimension", | ||
"input": "in", | ||
"output": "out", | ||
"transformations": [ | ||
{ "type": "translation", "translation": [-1.0], "input": ["i"], "output": ["x"]}, | ||
{ "type": "scale", "scale": [2.0], "input": ["i"], "output": ["x"]} | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"coordinateSystems": [ | ||
{ "name": "i", "axes": [{"name": "i"}] }, | ||
{ "name": "x", "axes": [{"name": "x"}] } | ||
], | ||
"coordinateTransformations": [{ | ||
"name": "a coordinate field transform", | ||
"type": "coordinates", | ||
"path": "i2xCoordinates", | ||
"input": "i", | ||
"output": "x", | ||
"interpolation": "nearest" | ||
}] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"coordinateSystems": [ | ||
{ "name": "i", "axes": [{"name": "i"}] }, | ||
{ "name": "x", "axes": [{"name": "x"}] } | ||
], | ||
"coordinateTransformations": [{ | ||
"name": "a displacement field transform", | ||
"type": "displacements", | ||
"path": "i2xCoordinates", | ||
"input": "i", | ||
"output": "x", | ||
"interpolation": "nearest" | ||
}] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"coordinateSystems": [ | ||
{ "name": "in", "axes": [ {"name": "i"}, {"name": "j"} ]}, | ||
{ "name": "out", "axes": [ {"name": "x"}, {"name": "y"} ]} | ||
], | ||
"coordinateTransformations": [ | ||
{ "type": "identity", "input": "in", "output": "out" } | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to integrate the proposal from #114 which is orthognal to this proposal but is scheduled for discussion at the upcoming OME-NGFF call, how would this be modified?
Would the input still point at the relative path to the resolution group or should it point at the relative path to the resolution array i.e. `"/0/image"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A secondary concern is whether this nomenclature is redundant with the
multiscales.datasets.path
metadata which also defines the path to the array?