Color coding in XML files

267 views
Skip to first unread message

Fernando Pérez-García

unread,
Oct 19, 2015, 9:19:03 AM10/19/15
to Icy imaging
Dear Icy experts,

We're using Icy to trace contours on histology slices. We then save the ROIs as an XML file and then we read them somewhere else. We'd like to keep the coherence between the colors used on Icy and the ones we'll show later. However, the "color" element of the ROI in the XML file looks like "-16711936". I expected some hex or rgb format, I don't know what that number means.

Can you help me?


Thanks in advance,

Fernando

Jerome Mutterer

unread,
Oct 19, 2015, 4:22:34 PM10/19/15
to icy-so...@googlegroups.com
Hi Fernando,
Colors in the XML file are saved as signed integers. You can recover R,G and B values from the color value using eg this IJ macro snippet:

c = (-16711936) & 0xFFFFFF;
r = (c>>16)&0xFF;
g = (c>>8)&0xFF;
b = c & 0xFF;
print (r,g,b);

Sincerely,

Jerome.


--
You received this message because you are subscribed to the Google Groups "Icy imaging" group.
To unsubscribe from this group and stop receiving emails from it, send an email to icy-software...@googlegroups.com.
To post to this group, send email to icy-so...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/icy-software/64405724-56b6-4b67-8fd3-ed8a42cd05eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jerome Mutterer
CNRS - Institut de biologie moléculaire des plantes
12, rue du Général Zimmer
67084 Strasbourg Cedex

Fernando Pérez-García

unread,
Oct 19, 2015, 5:02:21 PM10/19/15
to Icy imaging, jerome....@ibmp-cnrs.unistra.fr
Bonsoir Jerome,

Thanks for your quick response. Your answer solved my problem.


Best,

Fernando
Reply all
Reply to author
Forward
0 new messages