Skip to content

Commit b4a0c14

Browse files
authored
fixed zip zarr for cells
1 parent 03a7aff commit b4a0c14

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/segger/validation/xenium_explorer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
from tqdm import tqdm
1111
from typing import Dict, Any, Optional, List, Tuple
1212
from segger.prediction.boundary import generate_boundary
13-
13+
from zarr.storage import ZipStore
14+
import zarr
1415

1516

1617
def get_flatten_version(polygon_vertices: List[List[Tuple[float, float]]], max_value: int = 21) -> np.ndarray:
@@ -146,7 +147,8 @@ def seg2explorer(
146147
"seg_mask_value": np.array(seg_mask_value, dtype=np.int32),
147148
}
148149

149-
existing_store = zarr.open(source_path / "cells.zarr.zip", mode="r")
150+
source_zarr_store = ZipStore(source_path / "cells.zarr.zip", mode="r") # added this line
151+
existing_store = zarr.open(source_zarr_store, mode="r")
150152
new_store = zarr.open(storage / f"{cells_filename}.zarr.zip", mode="w")
151153
new_store["cell_id"] = cells["cell_id"]
152154
new_store["polygon_num_vertices"] = cells["polygon_num_vertices"]

0 commit comments

Comments
 (0)