LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Opening .tif file

Is it possible to open a .tif image file with labview...if so...how?

Thanks,

Azazal
Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 1 of 11
(10,880 Views)
I'm pretty sure IMAQ has functions to deal with TIF files. Or you can try this: Image Toolbox.
0 Kudos
Message 2 of 11
(10,862 Views)
The easiest way (from a programming standpoint) is to get the NI Vision Development Module.
 
You can write your own as well.   See here and here and here
 
You have to keep in mind that the TIFF image format is VERY flexible and a piece of code that understands all the possible permutations of that format is a quite impressive piece of work. If you need code that'll understand many of the formats, bite the bullet and spend the money for the NI add-on. If you only need to read one particular format then you can code up something like in this example (which understand just one format).
 
There's an example of this found here
(I've attached a LV v7.1.1 LLB which I have used in the past that is based on that example).
 
Keep in mind that after you do get an array of bytes from the file, you cannot convert that array to display in the "picture" indicator that ships with LabVIEW without the Vision add-on. You can use the intensity graph however.
 
Good Luck!
 
 
Message 3 of 11
(10,863 Views)
Thanks for the responses, I couldn't use the toolkit as it only had a couple of the functions listed on the webpage as it was only a demo.  Warren I also tried to use your example you posted, but when I tried to display with the intensity graph, I noticed an odd thing.  The original .tif is 458x338 pixels, but in the image data that corresponds to the loaded .tif file there were only 1222 points.  I have attached my original .tif file for you to see if you get the same thing.  I guess I should give you a little more of the application.  I have these images which are masks of thresholded images and I need to know the number of pixels represented by the purple part of the image...any help would be great and I wanted to say thanks again for your quick responses.

Azazal

ps(I attached the original .tif file, I had to zip it as you can't post .tif in the forums)
Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 4 of 11
(10,847 Views)

I suspect the image you have uses one of the compression options available for TIF images where multiple identical byte/pixel values are represented by one intensity value and a repeat count. The VIs I provided are relatively "dumb" in that they assume no compression - there is one byte in the file for every byte in the image. You can look at the TIF specs and see how this is built into the image files and modify the VIs accordingly but this effort is not going to be a quick fix I'm afraid.

FWIW, the Vision toolkit does open and display the file properly.

0 Kudos
Message 5 of 11
(10,836 Views)
Hello Warren,

It turns out that I have IMAQ vision and I can load my .tif file pretty easily.  Now I have come to a point where I need to do some image analysis.  I have image masks where I need to count the number of pixels based on a threshold value.  I  wrote a vi based off of an example I found but I can not get the program to actually count the pixels.  I have attached my program and an image I drew in paint that has only black and white pixels.  Thanks in advance.

Azazal

Message Edited by Azazel on 01-24-2006 09:51 AM

Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
Download All
0 Kudos
Message 6 of 11
(10,824 Views)


It turns out that I have IMAQ vision and I can load my .tif file pretty easily. 

Well that certainly makes it easy...


I have image masks where I need to count the number of pixels based on a threshold value.  I  wrote a vi based off of an example I found but I can not get the program to actually count the pixels. 

If you really want to count pixels and not blobs then why don't you try something like this:


 

Message Edited by Warren Massey on 01-24-2006 08:25 AM

Download All
0 Kudos
Message 7 of 11
(10,818 Views)

I have this tif image, I cannot read it with Windows photo reader, Photoshop, IMAQ vi, or the one you enclosed here. Can you help?

Arnold
0 Kudos
Message 8 of 11
(10,013 Views)

IrfanView (  http://www.irfanview.com/  ) has no trouble opening/displaying/converting it.

 

It's not much to look at...

test.png

0 Kudos
Message 9 of 11
(10,001 Views)

Thanks, it helps 50%, but do u know how to do it in Labview? Any subVI could help convert to the image you just showed? I really want to implement this function in labview to adapt with other of my image processing VIs. It is not convenient to use a 3rd-party software for convertion.

Arnold
0 Kudos
Message 10 of 11
(9,996 Views)