Skip to content
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

OME metadata support #355

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .array_config import ArrayConfig

from funlib.geometry import Coordinate
from funlib.persistence import open_ds
from funlib.persistence import open_ds, open_ome_ds

from upath import UPath as Path

Expand Down Expand Up @@ -56,9 +56,15 @@ class ZarrArrayConfig(ArrayConfig):
mode: Optional[str] = attr.ib(
default="a", metadata={"help_text": "The access mode!"}
)
ome_metadata: bool = attr.ib(
default=False, metadata={"help_text": "Whether to expect OME metadata"}
)

def array(self, mode="r"):
return open_ds(f"{self.file_name}/{self.dataset}", mode=mode)
if self.ome_metadata:
return open_ome_ds(f"{self.file_name}/{self.dataset}", mode=mode)
else:
return open_ds(f"{self.file_name}/{self.dataset}", mode=mode)

def verify(self) -> Tuple[bool, str]:
"""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ dependencies = [
"funlib.geometry>=0.2",
"mwatershed>=0.5.2",
"cellmap-models",
"funlib.persistence>=0.5.3",
"gunpowder>=1.4",
"lsds",
"xarray",
Expand All @@ -59,6 +58,7 @@ dependencies = [
"upath",
"boto3",
"matplotlib",
"funlib.persistence @ git+https://github.com/funkelab/funlib.persistence.git@ome-ngff"
"xarray-multiscale",
]

Expand Down
Loading