LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help using flatten pixmap

I want to save the display on my intensity graph as an image file.  The problem is when I wire the data to the Flatten Pixmap function and then save the file, the color changes.  How do I fix this?  I have attached the vi.  Thanks.
0 Kudos
Message 1 of 7
(4,544 Views)
You are not graphing any specific colors, just numbers 0...256. The Z scale determines the color assignment.
 
You have several possibilities:
  1. Create a color palette from the Z axis color ramp, then draw it as 8 bit paletted image. Wire the palette to the "colors" input of flatten pixmap.
  2. You could aslo get the image of the graph directly using an invoke node as follows. Then save the image to a file.
  3. ...

Message Edited by altenbach on 02-19-2007 03:59 PM

0 Kudos
Message 2 of 7
(4,537 Views)
Your first suggestion was giving me an error so I tried your second method.  The images are saving appropriately, but there is a gray border around it.  Any ideas?

Message Edited by AntLee29 on 02-19-2007 06:50 PM

Download All
0 Kudos
Message 3 of 7
(4,533 Views)

Well, the first method should work OK. Can you tell us what you did and what kind of error you were getting?

If you get the image, it will include everything from the graph. You simply need to get the image subset based on the position and size of the plot area. Here is one possibility that should get you started (you might still need to tweak it a bit).

 

Message Edited by altenbach on 02-19-2007 10:43 PM

0 Kudos
Message 4 of 7
(4,519 Views)
Your solution got me even closer, but there is still a faint gray line outlining the image, meaning there is still some shrinkage of the original intensity graph during the creation of the 256x256 png file.
As for the first method, I wired the color table of the intensity image to the "colors" input of the Flatten Pixmap and wired the intensity data to the 8-bit input.  The problem is that the intensity data can be as high as 2^16, so the 8-bit input would cause me to lose data.  Was there something wrong with the way I did it?

Message Edited by AntLee29 on 02-20-2007 05:06 PM

Message Edited by AntLee29 on 02-20-2007 05:08 PM

Download All
0 Kudos
Message 5 of 7
(4,496 Views)


@AntLee29 wrote:
Your solution got me even closer, but there is still a faint gray line outlining the image, meaning ...

As I said, you still need to tweak it a little bit. 😄
  1. Make your plot area on the front panel 3 pixels larger (259x259)\
  2. Plot bounds property: add 1 to "left" and add 2 to "top"
  3. Plot area size: subtract 3 from each.
  4. Please verify all the above corrections!

Also make sure you are using the right input cluster for the "bundle by name". Easiest wold be to right-click in the input terminal to the image subset VI and "create constant". Wire this constant to the "bundle by name" and the output of "bundle by name" to the subVI. Now all elements have the correct name and wiring errors are minimized.



@AntLee29 wrote:
The problem is that the intensity data can be as high as 2^16, so the 8-bit input would cause me to lose data.  Was there something wrong with the way I did it?

Don't overestimate your eyes. 😉 with 24 bit colors, each color (R, G, B) can only have 8 bits worth of information and a ramp from e.g. black to red can only have 256 levels no matter how hard you try. Your image is has two ramps, so you're already stepping over every other color anyway. Right? 🙂

Message Edited by altenbach on 02-20-2007 04:03 PM

Message Edited by altenbach on 02-20-2007 04:05 PM

0 Kudos
Message 6 of 7
(4,485 Views)
Your solution worked.  Thanks!
 
And thanks for the little lesson with colors. Smiley Happy
0 Kudos
Message 7 of 7
(4,475 Views)