06-08-2010 08:50 AM
Hi all,
I am trying to change the color table of an intensity graph to some standard color tables, such as "rainbow", "gray-scale", "seismic", "lava waves", "hot metal", "purple haze" , etc. I can find "rainbow" and "gray-scale" somewhere from the examples, but not the others. I tried to generate those color tables myself using the example "...examples\general\graphs\intgraph.llb\Create IntGraph Color Table.vi, but the result was far from good.
Anyone can teach me how to generate those color tables? Thank you in advance.
Regards,
Julianti
Solved! Go to Solution.
06-08-2010 09:16 AM - edited 06-08-2010 09:16 AM
Hi Julianti,
those color tables can be provided in two ways:
- define an array of 256 colors and wire it to the "colortable" property of the IntGraph. The first and the last color will be used for under- and overrange, respectively.
- define an array of marker values (value, color) and wire it to the "Marker Values[]" property of the graph. Here you can define less than 256 values, and you can make nice color ramps easily by enabling "Interpolate Colors"...
And be warned: there used to be an error/bug in older LV versions when both methods were used in a mixed way...
06-08-2010 09:58 AM
Hi GerdW,
Thanks for your ideas. I tried your second idea, it works for simple color tables such as the "seismic" and "hot metal". However, for those complex one such as "lava waves", it will be really headache. Is there a simpler method such as import from a picture?
Regards,
Julianti
06-08-2010 01:28 PM
Hi Julianti,
I used to import my colortables from other programs I was using (like visualization progs of REM or SAM devices). Other sources are older paint-like programs which often worked with just a 256 color table...
But well, what's the problem to load a picture using the LV picture file functions to get the colortable from such a picture? Have you ever tried to?
06-09-2010 01:32 AM
Hi Julianti,
here's the context help for "Read PNG File". Read the part on the "image data" contents! (And I would suggest to use 8 bit images for your purpose...)
06-09-2010 07:04 AM
Hi GerdW,
I am not sure the exact way of doing it, but I made a simple vi based on your idea. The vi can extract the color table I want in array format, provided that I load the bitmap file containing only the color scale. Some color table array constants are included in the VI for those who need them. Please see the attachments and give me your comment.
Regards,
Julianti
06-11-2010 12:57 AM
Hi all,
As I am using those color table array constants generated using the vi attached in the previous post, and seems there will be no more discussion about it, I will accept the vi as the solution. Hope that those color tables are useful to you too.
regards,
Julianti