Skip to content
Closed
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
15 changes: 14 additions & 1 deletion iohub/ngff.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import math
import os
from copy import deepcopy
from pathlib import Path
from typing import TYPE_CHECKING, Generator, Literal, Sequence, Union

import numpy as np
Expand Down Expand Up @@ -340,7 +341,19 @@ def downscale(self):
raise NotImplementedError

def tensorstore(self):
raise NotImplementedError
import tensorstore as ts

assert self.path != "", "Zarr array must be stored on a file system."
Copy link
Contributor

@ziw-liu ziw-liu Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory an iohub NGFF store is always on a local mounted FS, so this might be redundant.


ts_spec = {
"driver": "zarr",
"kvstore": {
"driver": "file",
"path": str(Path(self.path).resolve()),
},
}

return ts.open(ts_spec, create=False, open=True).result()


class TiledImageArray(ImageArray):
Expand Down