-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d04f7e
commit 383baaa
Showing
8 changed files
with
178 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"multiscales": [ | ||
{ | ||
"axes": [ | ||
{"name": "c", "type": "channel"}, | ||
{"name": "z", "type": "space", "unit": "micrometer"}, | ||
{"name": "y", "type": "space", "unit": "micrometer"}, | ||
{"name": "x", "type": "space", "unit": "micrometer"} | ||
], | ||
"datasets": [ | ||
{ | ||
"coordinateTransformations": [ | ||
{"scale": [1.0, 1.0, 0.1625, 0.1625], "type": "scale"} | ||
], | ||
"path": "0" | ||
}, | ||
{ | ||
"coordinateTransformations": [ | ||
{"scale": [1.0, 1.0, 0.325, 0.325], "type": "scale"} | ||
], | ||
"path": "1" | ||
}, | ||
{ | ||
"coordinateTransformations": [ | ||
{"scale": [1.0, 1.0, 0.65, 0.65], "type": "scale"} | ||
], | ||
"path": "2" | ||
}, | ||
{ | ||
"coordinateTransformations": [ | ||
{"scale": [1.0, 1.0, 1.3, 1.3], "type": "scale"} | ||
], | ||
"path": "3" | ||
}, | ||
{ | ||
"coordinateTransformations": [ | ||
{"scale": [1.0, 1.0, 2.6, 2.6], "type": "scale"} | ||
], | ||
"path": "4" | ||
} | ||
], | ||
"version": "0.4" | ||
} | ||
], | ||
"omero": { | ||
"channels": [ | ||
{ | ||
"color": "00FFFF", | ||
"label": "DAPI", | ||
"wavelength_id": "A01_C01", | ||
"window": {"end": 700, "max": 65535, "min": 0, "start": 0} | ||
}, | ||
{ | ||
"color": "FF00FF", | ||
"label": "nanog", | ||
"wavelength_id": "A01_C02", | ||
"window": {"end": 180, "max": 65535, "min": 0, "start": 0} | ||
}, | ||
{ | ||
"color": "FFFF00", | ||
"label": "Lamin B1", | ||
"wavelength_id": "A02_C03", | ||
"window": {"end": 1500, "max": 65535, "min": 0, "start": 0} | ||
} | ||
], | ||
"id": 1, | ||
"name": "TBD", | ||
"version": "0.4" | ||
} | ||
} |
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,20 @@ | ||
import json | ||
from pathlib import Path | ||
|
||
import zarr | ||
import zarr.store | ||
from pytest import fixture | ||
|
||
|
||
@fixture | ||
def ome_zarr_image_v04_path(tmpdir): | ||
zarr_path = Path(tmpdir) / "test_ome_ngff_v04.zarr" | ||
|
||
group = zarr.open_group(store=zarr_path, mode="w", zarr_format=2) | ||
|
||
with open("tests/data/meta_v04/base_ome_zarr_image_meta.json") as f: | ||
base_ome_zarr_meta = json.load(f) | ||
|
||
base_ome_zarr_meta = base_ome_zarr_meta | ||
group.attrs.update(base_ome_zarr_meta) | ||
return zarr_path |
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,37 @@ | ||
import json | ||
|
||
|
||
class TestOMEZarrHandlerV04: | ||
def test_basic_workflow(self, ome_zarr_image_v04_path): | ||
from ngio.io import read_group_attrs | ||
from ngio.ngff_meta import get_ngff_image_meta_handler | ||
|
||
handler = get_ngff_image_meta_handler( | ||
zarr_path=ome_zarr_image_v04_path, meta_mode="image" | ||
) | ||
|
||
meta = handler.load_meta() | ||
handler.write_meta(meta) | ||
|
||
with open("tests/data/meta_v04/base_ome_zarr_image_meta.json") as f: | ||
base_ome_zarr_meta = json.load(f) | ||
|
||
saved_meta = read_group_attrs(store=ome_zarr_image_v04_path, zarr_format=2) | ||
assert saved_meta == base_ome_zarr_meta | ||
|
||
def test_basic_workflow_with_cache(self, ome_zarr_image_v04_path): | ||
from ngio.io import read_group_attrs | ||
from ngio.ngff_meta import get_ngff_image_meta_handler | ||
|
||
handler = get_ngff_image_meta_handler( | ||
zarr_path=ome_zarr_image_v04_path, meta_mode="image", cache=True | ||
) | ||
|
||
meta = handler.load_meta() | ||
handler.write_meta(meta) | ||
|
||
with open("tests/data/meta_v04/base_ome_zarr_image_meta.json") as f: | ||
base_ome_zarr_meta = json.load(f) | ||
|
||
saved_meta = read_group_attrs(store=ome_zarr_image_v04_path, zarr_format=2) | ||
assert saved_meta == base_ome_zarr_meta |
This file was deleted.
Oops, something went wrong.