LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save intensity graph as BMP

I try to save the data of an intensity graph as a bitmap. I flatten the 2D-array and combine it with "write BMP file". For the color table I am using the Property Node/"Color Table" of the intensity graph. It works very well for values between 0...max.
After few calculations the values are also in negative range (e.g. -128...0...+128) and the saved image shows only the range beginning at 0...+128.

How can I save the data without loss of information ?
I am using LV6.0

Guido
0 Kudos
Message 1 of 6
(3,437 Views)
Hi,
you can shift your data in 2D array to the proper range. I mean the following:
1. Use "Array Max & Min" to find out the minimal value in your 2D array.
2. Then subtract this value from 2D 2D array. This will shift your data range from (min; max) to (0; max-min). In your case (-128; 128)->(0; 256).
3. Then show this data in intensity graph, and save it as you did it before. May be it will be convenient to set "Autoscale Z" to true for your graph.

Example is attached.

Good luck.

Oleg Chutko.
Message 2 of 6
(3,437 Views)
> I try to save the data of an intensity graph as a bitmap. I flatten
> the 2D-array and combine it with "write BMP file". For the color table
> I am using the Property Node/"Color Table" of the intensity graph. It
> works very well for values between 0...max.
> After few calculations the values are also in negative range (e.g.
> -128...0...+128) and the saved image shows only the range beginning at
> 0...+128.
>

It sounds like you are saving the raw 2D data and the color table. This
will be enough information to build a bitmap, but you will have to redo
what the intensity graph does. The intensity graph maps the raw data
into the range 1 to 254, with 0 being below color and 255 being above
color. It also decimates or stretches the data to fit the disp
lay size.
These are the steps for making the bitmap.

An alternative is to use the method to get the control image. This will
return an image, which can be saved as a bitmap. By default it will
have the border and scales on it. If you don't want those, hide them
using properties first, then execute the method.

Greg McKaskle
0 Kudos
Message 3 of 6
(3,437 Views)
Hi Greg !

Thank you for information !
But if I use the alternative method, I just get the
data which is shown in the graph. For example: A 1024X1024 array which is shown in a 256X256 intensity graph will give me a saved picture with the resolution of 256X256.
Am I right ?
0 Kudos
Message 4 of 6
(3,437 Views)
Yes,
in this case you save the image of control. So you will get the picture similar to the control on the front panel with the same sizes and resolution.

Oleg Chutko.
0 Kudos
Message 5 of 6
(3,437 Views)
> Thank you for information !
> But if I use the alternative method, I just get the
> data which is shown in the graph. For example: A 1024X1024 array which
> is shown in a 256X256 intensity graph will give me a saved picture
> with the resolution of 256X256.
> Am I right ?

Yes. If you want the control to be the same size as the data, make it
larger before getting the control image.

Greg McKaskle
0 Kudos
Message 6 of 6
(3,437 Views)