Skip to content
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
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,6 @@ method and `assign_coords`, equivalent to `xr.Dataset` `assign_coords` method.
Store as an Open Microscopy Environment-Next Generation File Format ([OME-NGFF])
/ [netCDF] [Zarr] store.

It is highly recommended to use `dimension_separator='/'` in the construction of
the Zarr stores.

```python
store = zarr.storage.DirectoryStore('multiscale.zarr', dimension_separator='/')
multiscale.to_zarr(store)
```

**Note**: The API is under development, and it may change until 1.0.0 is
released. We mean it :-).

Expand Down
12 changes: 9 additions & 3 deletions multiscale_spatial_image/multiscale_spatial_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
import numpy as np
from collections.abc import MutableMapping, Hashable
from pathlib import Path
from zarr.storage import BaseStore
import zarr.storage
from multiscale_spatial_image.operations import (
transpose,
reindex_data_arrays,
assign_coords,
)

# Zarr Python 3
if hasattr(zarr.storage, "StoreLike"):
StoreLike = zarr.storage.StoreLike
else:
StoreLike = Union[MutableMapping, str, Path, zarr.storage.BaseStore]


@register_datatree_accessor("msi")
class MultiscaleSpatialImage:
Expand All @@ -33,7 +39,7 @@ def __init__(self, xarray_obj: DataTree):

def to_zarr(
self,
store: Union[MutableMapping, str, Path, BaseStore],
store: StoreLike,
mode: str = "w",
encoding=None,
**kwargs,
Expand All @@ -43,7 +49,7 @@ def to_zarr(

Metadata is added according the OME-NGFF standard.

store : MutableMapping, str or Path, or zarr.storage.BaseStore
store : StoreLike
Store or path to directory in file system
mode : {{"w", "w-", "a", "r+", None}, default: "w"
Persistence mode: “w” means create (overwrite if exists); “w-” means create (fail if exists);
Expand Down
Loading