glencoesoftware / bioformats2raw

Bio-Formats image file format to raw format converter
GNU General Public License v2.0
77 stars 35 forks source link

Color metadata & single-channel use case #170

Closed sbesson closed 1 year ago

sbesson commented 1 year ago

https://github.com/glencoesoftware/bioformats2raw/pull/160 introduced the population of the omero metadata specification by this conversion tool.

The new logic populates the mininum/maximum values per channel but also stores some channel metadata like the color. The relevant portion of the code is largely inherited from omero-blitz ChannelProcessor to try to set a meaningful value based on various metadata fields and invoked in

https://github.com/glencoesoftware/bioformats2raw/blob/17910912043ce812a37f006f20ffc971ade7c694/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java#L1788

While testing different conversion workflows, I noticed one particular deviation in the case of single-channel image. This can be tested by

% bioformats2raw test.fake test.zarr
% grep color test.zarr/0/.zattrs 
      "color" : "FF0000",

In the case of single-channel data, the OMERO importer calls a separate setSingleChannel method which sets the color to grey instead.

https://github.com/ome/omero-blitz/blob/5d27e4771af5c4c457464090edb5b450d1c11e1d/src/main/java/ome/formats/model/ChannelProcessor.java#L106-L119

Should bioformats2raw be updated to adopt the same behavior?