06-19-2008 03:03 PM
06-19-2008 03:13 PM
06-19-2008 03:20 PM
Hi Mike,
I have array of float values. Max value in array is 7.68.
I am converting that in to grayscale(SGL) image using IMAQ arraytoimage.
Thanks,
06-19-2008 03:40 PM
It depends on what you want to do with the file after you've saved it. If you want to maintain the "pixel values" from your float array, you can write out a binary file that contains the single- or double-precision float data. There is a write binary file function that will work for this.
If you want to be able to open the image in a graphics program then you will need to convert the image to either 8-bit or 16-bit integer data. Then decide whether you can live with a lossy compression (such as JPEG). If you can not live with any alteration of the image data, and you want to keep 16-bits per pixel, TIFF is a format that can support that. There is a IMAQ Write File 2 vi for that. (Select the TIFF format from the polymorphic VI).
Here in our lab we use a binary file format (of our own design) with an ASCII header and multiple images after the header. The header describes the image width, height, type (e.g. uint8, uint16, float32), big or little endian, grayscale or color, and so on. Anyone can open the file (with notepad for example) to figure out what is in the file. We have a reader VI that parses the header and knows how to read the pixel data.
We also have a plugin for ImageJ (freeware) that can parse the file and read in the image sequence.
06-19-2008 04:42 PM
Ok, I got it by converting them into 8-bit interger.
Thank you very much 🙂
06-19-2008 04:42 PM
Hi,
You can use IMAQ Write File from vi.lib\vision\Files1.llb instead of IMAQ Write File 2. This vi supported AIPD format (proprietary NI image file format), which is able to save float image. You can read this image after that with IMAQ Read File. This is easiest way to save float point image:
best regards,
Andrey