Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixel type fix #157

Merged
merged 2 commits into from
Jan 3, 2024
Merged

Pixel type fix #157

merged 2 commits into from
Jan 3, 2024

Conversation

will-moore
Copy link
Member

@will-moore will-moore commented Dec 13, 2023

Images in OMERO with float pixelType are float-32 (f4: 4 bytes per pixel) but are currently exported as f8.
E.g. https://idr.openmicroscopy.org/webclient/?show=image-10648046 was exported as
https://ome.github.io/ome-ngff-validator/?source=https://uk1s3.embassy.ebi.ac.uk/bia-integrator-data/S-BIAD852/971f2809-c748-4259-8044-81ba6c774fdd/971f2809-c748-4259-8044-81ba6c774fdd.zarr

This is because we have previously used np.dtype(omeroDtype) which gives the float64 dtype by default:

>>> from omero.model.enums import PixelsTypefloat
>>> PixelsTypefloat
'float'
>>> np.dtype(PixelsTypefloat)
dtype('float64')

To test:

omero zarr export Image:10648046
ome_zarr view 10648046.zarr

Should see Type: <f4

@will-moore
Copy link
Member Author

Testing on idr-ftp

NB: we need #147 for name_option AND #156, so I've merged them together with this PR in a new branch to allow installing together (https://github.com/snoopycrimecop/omero-cli-zarr/ doesn't exist yet):

conda activate omero_zarr_export
pip install 'omero-cli-zarr @ git+https://github.com/will-moore/omero-cli-zarr@merge_prs'
...
Successfully installed omero-cli-zarr-0+untagged.486.g0b26417

@joshmoore
Copy link
Member

https://github.com/snoopycrimecop/omero-cli-zarr/ doesn't exist yet

That just requires adding the submodule to https://github.com/ome/omero-plugins if you'd like to do that.

@dominikl
Copy link
Member

Looks good to me. Tested it with the same image 10648046 "dtype": "<f4" 👍

cat 0/.zarray
{
    "chunks": [
        1,
        1,
        1024,
        1024
    ],
    "compressor": {
        "blocksize": 0,
        "clevel": 5,
        "cname": "lz4",
        "id": "blosc",
        "shuffle": 1
    },
    "dimension_separator": "/",
    "dtype": "<f4",
    "fill_value": 0.0,
    "filters": null,
    "order": "C",
    "shape": [
        600,
        3,
        432,
        101
    ],
    "zarr_format": 2
}%

@joshmoore
Copy link
Member

Anyone up for another release in 2023?

@will-moore will-moore merged commit 80b8a0e into ome:master Jan 3, 2024
2 checks passed
@will-moore
Copy link
Member Author

Merged, but can't release without fixing the versioning issue: see #156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants