ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

arrays

Hii In labview, there are datatype U8, U16, Int16, Int32 etc... I want to creat an array where each element in array is 1bit or 2bit or 3 bit....

 

how do this... and how to dispay an image of 2bit or 3bit...

 

 

Please let me know

 

Thanks

Prashh

0 Kudos
Message 1 of 10
(4,459 Views)

Hi, Prashh,

 

Theoretically you can create array of clusters with booleans (one, or two or three for different bit depth.)

But for achieving best performance, I would like to recommend to use U8 type where only 1 or 2 or 3 bits are used.

For displaying the image you can use Binary Palette, for example, for 1 bit image - with black (zero) and red (1). For two bits you may have only 4 different colors, and so on.

 

Andrey.

 

0 Kudos
Message 2 of 10
(4,449 Views)

Hello andrey

 

     Thanks for ur reply. How can I create 2 or 3 bit image with boolean pallete...

Can u pls send an example for creating and displaying an image of  3 bit...

 

 

Thanks

Prashh

0 Kudos
Message 3 of 10
(4,433 Views)

Seems like the most direct way of displaying the array and getting the "bits" out of it would be a 2-D array of buttons....


Bit Array.gif
Message Edited by Broken Arrow on 10-09-2009 09:23 AM
Richard






0 Kudos
Message 4 of 10
(4,412 Views)

prashiit wrote:

Hello andrey

 

     Thanks for ur reply. How can I create 2 or 3 bit image with boolean pallete...

Can u pls send an example for creating and displaying an image of  3 bit...

 


 

 

 

Hi, Prashh,

 

I hope, the code given below will explain something:

 

snippet3.png

 

Not really Andy Warhol artwork, but something similar:

 

screenshot.png

 

best regards, 

 

Andrey.

Message Edited by Andrey Dmitriev on 10-10-2009 11:35 PM
Message 5 of 10
(4,371 Views)

Hello Andrey,

 

 

    I am using 8.6 version. Please send me 8.6 VI 

0 Kudos
Message 6 of 10
(4,351 Views)

The Block Diagram is so trivial, you can recreate it in 10 min by provided screenshot... 8.6 in attachment.

Message 7 of 10
(4,345 Views)

Hello Andrey

 

 

   Thanks for your VI. But, I want to use it for gray scale image.

 

for example: If I put 0 shift, Image should be displayed with 256 different gray levels.

                                -1-------------------------------------- 128------------------

                                -2---------------------------------------  64-------------------

-3---------------------------------------- 32-----------------

-4---------------------------------------   16-------------------

  

0 Kudos
Message 8 of 10
(4,324 Views)

 

 

As you can see in the example above - IT IS grayscale image, just displayed with pseudocolors. Just change 4 colors palette to 4 shades of gray and you will get what you wanted.

0 Kudos
Message 9 of 10
(4,314 Views)

Broken Arrow wrote:

Seems like the most direct way of displaying the array and getting the "bits" out of it would be a 2-D array of buttons....


Bit Array.gif

to Broken Arrow: please read this: WARNING: Don't clean out your image gallery!

Message 10 of 10
(4,306 Views)