From 3ca2c58fca5c6a4fb90a26d5a0e51df041890033 Mon Sep 17 00:00:00 2001 From: William Moore Date: Wed, 23 Aug 2023 12:41:57 +0100 Subject: [PATCH] Update README and masks.py to use ID.ome.zarr --- README.rst | 13 +++++++------ src/omero_zarr/masks.py | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index 8972c62..50c66b8 100644 --- a/README.rst +++ b/README.rst @@ -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. diff --git a/src/omero_zarr/masks.py b/src/omero_zarr/masks.py index d54a07d..bf8e668 100644 --- a/src/omero_zarr/masks.py +++ b/src/omero_zarr/masks.py @@ -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