Skip to content

Commit

Permalink
merge master -Dorg -Ssuccess-only: PR 157 (Pixel type fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
snoopycrimecop committed Jan 1, 2024
2 parents b04a9c0 + d1bb6e2 commit e7d08d5
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/omero_zarr/raw_pixels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -116,7 +126,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()
Expand Down

0 comments on commit e7d08d5

Please sign in to comment.