NGFF v06 transformations - #1182
Tomaz-Vieira wants to merge 30 commits into
Conversation
0dfccb5 to
f57dc1d
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## transformation_manager #1182 +/- ##
=========================================================
Coverage ? 92.22%
=========================================================
Files ? 55
Lines ? 8654
Branches ? 0
=========================================================
Hits ? 7981
Misses ? 673
Partials ? 0
🚀 New features to boost your workflow:
|
| def __repr__(self) -> str: | ||
| s = super().__repr__() + "\n" | ||
| s += "\n".join(f" {out} <- {inp}\n" for out, inp in self.output_to_input.items()) | ||
| return s |
There was a problem hiding this comment.
Rough edge: MapAxis is basically an affine (made of zeros and a few ones to permute the data). When we do repr on the affine we print the matrix and not the axes (which will be handled by the coordinate systems). Here we do the opposite, we print the axes and don't care about the affine.
It's not incorrect, but I see that this goes more towards the philosophy of spatialdata transformations, while the affine stays "true" to the NGFF transformations.
For clarify we could actually always print both: the "index-based/matrix representation" (in this case index 0 goes to 1, index 3 goes to 4 etc; in the affine case the matrix); and then the axes annotation (x -> y, y -> z here; in the case of affine the input and output axes, as we do when we print spatialdata Affine transformations).
There was a problem hiding this comment.
I think I'd rather avoid the indexed output since we have everything labeled (axes have names, arrays have dims), and hopefully we eventually completely hide the fact that indices have any meaning for us
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
84e3669 to
3a42bef
Compare
Mirrors Ngff* classes in the
graphmodule, parses ome-zarr-models-py classes.CoordSystem(based onNgffCoordinateSystem)__hash__(needed for usage in graph, but we might still have the identity issue when searching for verts)*Edge(based onNgffTransformation)omz-models-pyclasses__init__and nowhere elseio_raster.py
RangeIndexto the resulting xarraysNext steps
Roundtripping
This PR only does input dfor now; The full roundtrip is showing some issues that would delay this further, so I've removed all output for now and will submit it in another PR
Using unorderd axes in coordinate systems
Since our arrays are labeled, we probably shouldn't be using a
Sequenceof axes in our coordinate systems. This will probably simplify runtime quit a lot, but might create some more work during IO