Skip to content

Commit

Permalink
Update README and masks.py to use ID.ome.zarr
Browse files Browse the repository at this point in the history
  • Loading branch information
will-moore committed Aug 23, 2023
1 parent 36e66c4 commit 3ca2c58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,25 @@ Masks and Polygons

To export Masks or Polygons for an Image or Plate, use the `masks` or `polygons` command::

# Saved under 1.zarr/labels/0 - 1.zarr/ must already exist
# Saved under 1.ome.zarr/labels/0
# 1.ome.zarr/ should already exist or specify path with --source-image
$ omero zarr masks Image:1

# Labels saved under each image. e.g 2.zarr/A/1/0/labels/0
# Plate should already be exported
# Labels saved under each image. e.g 2.ome.zarr/A/1/0/labels/0
# 2.ome.zarr should already be exported or specify path with --source-image
$ omero zarr masks Plate:2

# Saved under zarr_files/1.zarr/labels/0
# Saved under zarr_files/1.ome.zarr/labels/0
$ omero zarr --output /home/user/zarr_files masks Image:1

# Specify the label-name. (default is '0')
# e.g. Export to 1.zarr/labels/A
# e.g. Export to 1.ome.zarr/labels/A
$ omero zarr masks Image:1 --label-name=A

# Allow overlapping masks or polygons (overlap will be maximum value of the dtype)
$ omero zarr polygons Image:1 --overlaps=dtype_max

The default behaviour is to export all masks or polygons on the Image to a single 5D
The default behaviour is to export all masks or polygons on the Image to a single nD
"labeled" zarr array, with a different value for each Shape.
An exception will be thrown if any of the masks overlap, unless the `--overlaps`
option is used as above.
Expand Down
4 changes: 2 additions & 2 deletions src/omero_zarr/masks.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ def save(self, masks: List[omero.model.Shape], name: str) -> None:
ignored_dimensions.add(d)

if self.plate:
filename = f"{self.plate.id}.zarr"
filename = f"{self.plate.id}.ome.zarr"
else:
filename = f"{self.image.id}.zarr"
filename = f"{self.image.id}.ome.zarr"

# Verify that we are linking this mask to a real ome-zarr
source_image = self.source_image
Expand Down

0 comments on commit 3ca2c58

Please sign in to comment.