LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does Labview handle 16bit images with the VI "ImagetoArray"?

Hi...

The ImagetoArray function in labview 6.1 handles 16 bit images as an I16 data. This seems to cause memory overflow when I have intensities past 32k. How do I change this to an unsigned 16 bit array or is there a different function that I can use? Thanks much


0 Kudos
Message 1 of 8
(3,699 Views)

ivanlum,

What version to NI-IMAQ are you using?

Thanks,
Lorne Hengst
Application Engineer
National Instruments

0 Kudos
Message 2 of 8
(3,688 Views)
Hi ...

I was using Labview 6.1 and i realized that I was getting errors with it. So I recently upgraded to Labview 7.1.... I dont see anything new in Labview 7.1 that may solve this though. The "ImagetoArray" vi is still using an I16 designation. PLease advise. Thanks


0 Kudos
Message 3 of 8
(3,677 Views)

ivanlum,

Which version of NI-IMAQ are you using?  This will be a seperate version than the version of LabVIEW.

You can check your NI-IMAQ version number by going to Measurement Automation Explorer (MAX) via the Start menu...

Start->Programs->National Instruments->Measurement Automation Explorer

And going to the Software folder in MAX.  There should be an entry for NI-IMAQ.  Left click that entry and check the version number on the right side of your screen.

Lorne Hengst
Application Engineer
National Instruments

0 Kudos
Message 4 of 8
(3,667 Views)
Hi Lorne,

My version of IMAQ is 3.1.0

Ivan
0 Kudos
Message 5 of 8
(3,662 Views)
Ivan,
 
The LabVIEW function "IMAQ Image to Array"  encodes the output array into either 8 bits, 16 bits, or floating point, depending on the image that is used as an input.  You can change the type of the input image by using the "IMAQ Cast Image" function to cast the image from one representation (8 bit) to another (16 bit).  All of these functions should be available for you in the version of the IMAQ driver you have installed.
 
Thanks,
 
Scott Savage
National Instruments
Applications Engineering
0 Kudos
Message 6 of 8
(3,644 Views)
HI Scott,

Thanks for your reply. I am working with 16 bits images and my intensity counts go as high as 50,000 counts. However, apparently, the ImageToArray vi only handles -32k to 32k counts. How do I make the VI work with unsigned 16 bit images?

Ivan
0 Kudos
Message 7 of 8
(3,644 Views)

Ivan,

At first I wasn't sure what you were asking.  Now I think I understand.

If you have a 16 bit image, it doesn't matter if it is signed or unsigned.  Both the U16 and I16 have 65,000 different intensity values, the numbers are just represented differently.  In order to convert a 2-Dimensional I16 array to a 2-Dimensional U16 array, you will need to do some simple bit manipulation.

Basically you need to first cast the I16 into a U16 and then XOR each element in the I16 2D Array with a 0b1000000000000000.  I have attached an example VI which shows how to do this.  This basically changes the flips the left most bit.

I hope I answered your question,

Lorne Hengst
Application Engineer
National Instruments

0 Kudos
Message 8 of 8
(3,626 Views)