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

greyscale images have channel color grey 808080 #156

Open
will-moore opened this issue Mar 10, 2025 · 5 comments
Open

greyscale images have channel color grey 808080 #156

will-moore opened this issue Mar 10, 2025 · 5 comments

Comments

@will-moore
Copy link
Member

will-moore commented Mar 10, 2025

There are several examples of images that have rendering settings info generated, possibly by Bio-Formats (I could be wrong) where the images are "greyscale" but the single channel has also been given a colour of grey "color": "808080".

This can be seen in a number of images in IDR, e.g. https://idr.openmicroscopy.org/webclient/img_detail/15159990/?dataset=18501
although it is not usually obvious as the single-channel images are also greyscale by default.

It is more noticeable in OME-Zarr images. E.g.
https://ome.github.io/ome-ngff-validator/?source=https://uk1s3.embassy.ebi.ac.uk/bia-integrator-data/S-BIAD1520/88bddf0e-84c1-4502-9c5c-5fc96c26a06a/3709c79d-38d1-40fc-84d5-ead5684ddd8a.ome.zarr/0

Vizarr reads the omero rendering settings but doesn't take into account the greyscale flag.

This was also an issue in OMERO.figure for a while. Reading images from OMERO with grey channels (before it was updated to read the greyscale flag).

Is there an reason for setting the channel color to grey instead of white?

@melissalinkert
Copy link
Member

This color does not come from Bio-Formats. showinf -nopix -omexml 'B2-Strobl2014A-DS0001TP(TS)DR0004CH0001PL(ZM).TIF' can confirm that a Color is not set on Channel at all.

I would expect this specific grey color is coming from:

https://github.com/ome/omero-blitz/blob/master/src/main/java/ome/formats/model/ChannelProcessor.java#L114
https://github.com/ome/omero-blitz/blob/master/src/main/java/ome/formats/model/ColorsFactory.java#L373

As far as I know, this has been the behavior for single-channel images with no color assigned by Bio-Formats for a very long time.

@melissalinkert melissalinkert transferred this issue from ome/bioformats Mar 10, 2025
@sbesson
Copy link
Member

sbesson commented Mar 10, 2025

Seconding @melissalinkert's explanation, the code history reveals this behaviour was introduced in ome/openmicroscopy#3140 and relased in OMERO 5.1.0.

@will-moore
Copy link
Member Author

Ah, OK. So the OME-Zarr image above must have come from OMERO originally.
I'll open a fix for vizarr, but can we also change grey default to white?
I can't think of any time when it's better to have the colour as grey instead of white?
cc @jburel

@jburel
Copy link
Member

jburel commented Mar 11, 2025

I cannot remember the reason for selecting grey instead of white but we will need to check with existing image like DICOM

@will-moore
Copy link
Member Author

@jburel What do you need to check? Anything I can help with?

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

No branches or pull requests

4 participants