-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ome metadata support Needs some testing. OME zarr support is not very robust and I couldn't find a library that covered all our needs. There is the official ome-zarr-py package: https://github.com/ome/ome-zarr-py. I had difficulty extracting the metadata from arrays and it seems like you end up having to write your own internal models for the metadata or simply operate on the json level. See this example Davis has a metadata package that has a lot of what I want on the metadata side, but it doesn't seem to come with much actual data support for reading and writing arrays with the given metadata. Davis seems to also have a new package that looks very promising but seems very early in development. Ziwen has put a lot of effort into this library which is what I ended up going for since it seems to be the closest to fully covering both the metadata model side and tying it to actual data with something like an open_ome_zarr convenience function. There was only a small piece missing that I felt I needed so I opened a pull request here which is currently in progress. There seem to be more implementations, but these are the ones I looked into
- Loading branch information
Showing
7 changed files
with
116 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import os | ||
from ..fixtures import * | ||
|
||
import pytest | ||
from pytest_lazy_fixtures import lf | ||
|
||
import logging | ||
|
||
logging.basicConfig(level=logging.INFO) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"array_config", | ||
[ | ||
lf("zarr_array"), | ||
lf("multiscale_zarr"), | ||
], | ||
) | ||
def test_array(array_config): | ||
array = array_config.array() | ||
|
||
assert array.offset == (12, 12, 12), f"offset is not correct, expected (12, 12, 12), got {array.offset}" | ||
assert array.voxel_size == (1, 2, 4), f"resolution is not correct, expected (1, 2, 4), got {array.voxel_size}" | ||
assert array.axis_names == ["z", "y", "x"], f"axis names are not correct, expected ['z', 'y', 'x'], got {array.axis_names}" | ||
|
||
# offset = array.attrs["offset"] | ||
# resolution = array.attrs["resolution"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters