diff --git a/src/omero_zarr/raw_pixels.py b/src/omero_zarr/raw_pixels.py index c49d987..4054609 100644 --- a/src/omero_zarr/raw_pixels.py +++ b/src/omero_zarr/raw_pixels.py @@ -33,6 +33,16 @@ write_well_metadata, ) from omero.model import Channel +from omero.model.enums import ( + PixelsTypedouble, + PixelsTypefloat, + PixelsTypeint8, + PixelsTypeint16, + PixelsTypeint32, + PixelsTypeuint8, + PixelsTypeuint16, + PixelsTypeuint32, +) from omero.rtypes import unwrap from zarr.hierarchy import Group, open_group @@ -99,7 +109,18 @@ def add_raw_image( tile_height: Optional[int] = None, ) -> List[str]: pixels = image.getPrimaryPixels() - d_type = image.getPixelsType() + omero_dtype = image.getPixelsType() + pixelTypes = { + PixelsTypeint8: ["b", np.int8], + PixelsTypeuint8: ["B", np.uint8], + PixelsTypeint16: ["h", np.int16], + PixelsTypeuint16: ["H", np.uint16], + PixelsTypeint32: ["i", np.int32], + PixelsTypeuint32: ["I", np.uint32], + PixelsTypefloat: ["f", np.float32], + PixelsTypedouble: ["d", np.float64], + } + d_type = pixelTypes[omero_dtype][1] size_c = image.getSizeC() size_z = image.getSizeZ() size_x = image.getSizeX()