Skip to content

Commit

Permalink
fix: Update zarr group opening to use read mode and adjust tolerance …
Browse files Browse the repository at this point in the history
…scaling factor in CellMapImage when opening with reindexing
  • Loading branch information
rhoadesScholar committed Jan 22, 2025
1 parent 624d7f2 commit 3f7ef68
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/cellmap_data/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,11 @@ def group(self) -> zarr.Group:
return self._group
except AttributeError:
if self.path[:5] == "s3://":
self._group = zarr.open_group(zarr.N5FSStore(self.path, anon=True))
self._group = zarr.open_group(
zarr.N5FSStore(self.path, anon=True), mode="r"
)
else:
self._group = zarr.open_group(self.path)
self._group = zarr.open_group(self.path, mode="r")
return self._group

@property
Expand Down Expand Up @@ -514,7 +516,8 @@ def return_data(
**coords,
method="nearest",
tolerance=np.ones(coords[self.axes[0]].shape)
* np.max(list(self.scale.values())),
* np.max(list(self.scale.values()))
* 2,
fill_value=self.pad_value,
)
else:
Expand Down

0 comments on commit 3f7ef68

Please sign in to comment.