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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
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
Next Next commit
OME metadata support
pattonw committed Dec 10, 2024
commit 31aa8420b4e50e48208cb57c4e0263dde5caddb0
Original file line number Diff line number Diff line change
@@ -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

@@ -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]:
"""
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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",
@@ -59,6 +58,7 @@ dependencies = [
"upath",
"boto3",
"matplotlib",
"funlib.persistence @ git+https://github.com/funkelab/funlib.persistence.git@ome-ngff"
]

# extras