Skip to content

Commit

Permalink
Use np.where instead of np.place
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Mar 8, 2024
1 parent cd0c715 commit 41ea6b5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sources/zarr/large_image_source_zarr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,13 +578,10 @@ def addTile(self, tile, x=0, y=0, mask=None, axes=None, **kwargs):
else:
root = current_arrays['root']
root.resize(*tuple(new_dims.values()))
data = root[mask_placement_slices]
if mask is not None:
np.place(data, mask, tile)
if mask:
root[mask_placement_slices] = np.where(mask, tile, root[mask_placement_slices])
else:
data = tile
np.place(data, full_mask, tile)
root[mask_placement_slices] = data
root[mask_placement_slices] = tile

# Edit OME metadata
self._zarr.attrs.update({
Expand Down

0 comments on commit 41ea6b5

Please sign in to comment.