-
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 transforms json-schema (request for feedback) #149
base: main
Are you sure you want to change the base?
Changes from 54 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
9406ce1
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,3 @@ | ||
{ | ||
"schema": "schemas/coordinate_transforms.schema" | ||
} |
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 |
---|---|---|
@@ -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 | ||
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. The spec still says: "Each dictionary in "datasets" MUST contain the field "coordinateTransformations", which contains a list of transformations that map the data coordinates to the physical coordinates (as specified by "axes") for this resolution level. 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. @bogovicj, assuming I should go with the spec over the example here? Out of interest, why does the pixel -> physical need to be replicated here? 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. I think the spec just needs updating or clarifying at that point. Maybe now it's "Each dictionary in "datasets" except the first MUST contain the field "coordinateTransformations"... |
||
}, | ||
{ | ||
"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.
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. |
||
}], | ||
"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" }] }, | ||||||
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. The axes list has a single dict with multiple "name" keys? Is is supposed to be 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.
Suggested change
@bogovicj, should changes to the examples happen here or in your PR? I haven't modified these from your branch, but also could add tests for the subspace directory. 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. good catch, I'll fix 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. |
||||||
{ "name " : "out", "axes" : [ {"name" : "x", "name" : "y", "name" : "z" }] } | ||||||
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. Same here? 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. good catch, I'll fix |
||||||
], | ||||||
"coordinateTransformations" : [ | ||||||
{ | ||||||
"type" : "sequence", | ||||||
"name" : "5D-to-3D", | ||||||
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 combination of |
||||||
"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" }] } | ||
], | ||
"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,3 @@ | ||
{ | ||
"schema": "schemas/coordinate_transforms.schema" | ||
} |
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" | ||
} | ||
] | ||
} |
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.
Is the top-level multiscales coordinateTransformations no-longer valid? If it is, then this is a useful example. If not then the spec wording needs to be changed.
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.
It will still be valid - I'll edit this example showing how.