Skip to content

Commit

Permalink
OME metadata support
Browse files Browse the repository at this point in the history
  • Loading branch information
pattonw committed Dec 10, 2024
1 parent e9697ad commit 31aa842
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
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"
]

# extras
Expand Down

0 comments on commit 31aa842

Please sign in to comment.