[ome-users] Preferred color mapping for channels in OME-TIFF
Roger Leigh
rleigh at dundee.ac.uk
Tue Apr 28 10:02:55 BST 2015
On 28/04/15 02:34, Dmitry Fedorov wrote:
> Dear Bioformatters,
>
> I wanted to store and also retrieve the preferred color mapping for
> image channels within OME-TIFF. Something like: channel0: 0,255,0;
> channel1: 255,0,0. I was looking over the schema and didn't find a
> specific field for this. Also looking at the OME-TIFF file produced by
> converting from a proprietary file this information seems not to be
> stored nor red by the viewer (bioformats or imagej). I'm not sure if I'm
> being unlucky with the format though.
It's certainly possible to do. If a proprietary file format does have
this metadata, the reader must transfer the setting to the OME data
model; depending upon how well a particular file format has been reverse
engineered, this may or may not be the case.
For all readers which do support this, you should see a call to
MetadataStore::setChannelColor(colour, image, channel)
to add the colour property to a particular channel of a particular image.
> My question would be if there's such a field somewhere, say in channel:
> <Channel ID="Channel:0:0" Name="FITC" SamplesPerPixel="1">
> <DetectorSettings ID="Detector:0:0"/>
> <ColorMapping Value="255,0,0"/>
> </Channel>
The channel colour is stored on Channel:
http://www.openmicroscopy.org/Schemas/Documentation/Generated/OME-2015-01/ome_xsd.html#Channel_Color
The encoding is a bit nonstandard; see
https://github.com/openmicroscopy/bioformats/blob/develop/components/ome-xml/src/ome/xml/model/primitives/Color.java#L46
https://github.com/openmicroscopy/bioformats/blob/develop/cpp/lib/ome/xml/model/primitives/Color.h#L127
https://github.com/openmicroscopy/bioformats/blob/develop/cpp/lib/ome/xml/model/primitives/Color.h#L297
for how it's composed as an RGBA tuple, then converted to a signed type.
> I guess I could use StructuredAnnotations but those would not be
> interpretable by other viewers. I could also reorder channels but that
> would only solve mapping to a single channel but not to multiple, like
> yellow for example.
If I understand your question properly, I think the Color attribute
should be sufficient. If it isn't, an alternative would be (for
OME-TIFF) to generate a lookup table for each channel, and then add the
appropriate channel-specific lookup table to each image plane using the
TIFF COLORMAP tag; and set the PHOTOMETRIC tag to PALETTE. These will
be exposed in the reader API using the get*LookupTable methods.
Adding more comprehensive support for lookup tables and more complex
rendering settings (gamma, log/exp transforms, etc.) is on our to do
list for the data model.
Kind regards,
Roger
--
Dr Roger Leigh -- Open Microscopy Environment
Wellcome Trust Centre for Gene Regulation and Expression,
College of Life Sciences, University of Dundee, Dow Street,
Dundee DD1 5EH Scotland UK Tel: (01382) 386364
The University of Dundee is a registered Scottish Charity, No: SC015096
More information about the ome-users
mailing list