czbiohub-sf / iohub

Pythonic and parallelizable I/O for N-dimensional imaging data with OME metadata
https://czbiohub-sf.github.io/iohub/
BSD 3-Clause "New" or "Revised" License
26 stars 6 forks source link

Automatically generate display metadata for fluorescence channels #83

Closed ziw-liu closed 1 year ago

ziw-liu commented 1 year ago

Currently iohub detects label-free channels and writes OME-NGFF metadata fields to display colors and contrast limits properly. This can be done with common fluorescence channels too. For example GFP is green and DAPI is blue etc.

ziw-liu commented 1 year ago

Another possibility is trying to get those from TIFF metadata during conversion. But the metadata (display setting) reading can be quite unstable.

AhmetCanSolak commented 1 year ago

this is a great first issue, @ziw-liu could you write a detailed task(not more than a paragraph probably) on what needs to be done step-by-step and we can try to recruit a new first-time contributor.

ziw-liu commented 1 year ago

this is a great first issue, @ziw-liu could you write a detailed task(not more than a paragraph probably) on what needs to be done step-by-step and we can try to recruit a new first-time contributor.

The detection function is called here. For now the module is called lf_utils which stands for 'label-free utilities'. This can be renamed to something more generic like display_utils. And the the hard-coded color (FFFFFF, RGB hex for white) can become part of the settings dictionary to match channel names. Finally tests can be written to assert that (for example) a channel called 'GFP' has the hex for green in the omero color metadata field when it has been written to the OME-Zarr store.

edyoshikun commented 1 year ago

@ziw-liu , @ieivanov mentioned that Manu's team tends to use GFP with grayscale colormap. This is a problem for other datasets where we have multimodal label-free channels (i.e Retardance, States0-4, Phase) and fluorescence in the same store. This could be handled by writing different channel names or knowing in advance if the store is just fluorescence channels.

ziw-liu commented 1 year ago

This could be handled by writing different channel names or knowing in advance if the store is just fluorescence channels.

I think iohub should adopt a simple and generic logic. The user can modify the color if necessary. Another possibility is that we implement a convenience method to overwrite all the colormap field in a dataset.

mattersoflight commented 1 year ago

Another possibility is that we implement a convenience method to overwrite all the colormap field in a dataset.

👍🏼 a plugin like phenosight/recOrder can set the use-case-specific colormap for channels that are frequently visualized together. I also think iohub should apply widely used defaults.

ieivanov commented 1 year ago

I think iohub should adopt a simple and generic logic.

Agreed. We can encode writing GFP in gray colormap as part of the OpenCell data converter

ziw-liu commented 1 year ago

Closed by #101