LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot read this wierd tif image

I have this tif image recorded from my lab camera, the format is *.tif. Firstly, none of commercialized software I had on my computer can read it, such as windows photo reader, photoshop etc.

This file contains multiple frames in one file, I tried to read it in labview. I referred to this thread:

http://forums.ni.com/t5/LabVIEW/Opening-tif-file/m-p/315068/highlight/false#M163019

The code cannot read either. I enclosed the code that I used.

 

Then I check out this thread:

http://forums.ni.com/t5/LabVIEW/Labview-libtiff-implementation/m-p/929843/highlight/false#M417600

I don't know how to turn that integer type handle into a real image display in labaview. Still I consider it is failed in read this image in labview.

 

I attached the failed reading, and the correct one as it should be. Anyone could help me with some idea about how to open this tif image and display it in labview? Some testing codes are truly helpful.

 

Thanks

Arnold
0 Kudos
Message 1 of 9
(4,495 Views)

TIF (or TIFF) is not a weird format, it's quite popular.  I just Googled TIF to JPG converter and there were pages of links.  I'm sure you can find a free file format converter to download.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 2 of 9
(4,487 Views)

I have looked at your file with two graphics programs and a hex editor.  It appears to be a TIFF file. It seems to have 10 300x300 images all of which are blank.  Depending on the settings of the graphics program the images may be white or black.  There is no indication that it looks like your desired image.

 

Lynn

0 Kudos
Message 3 of 9
(4,482 Views)

Thanks, you are right, it is quite standard. A nice guy under this thread introduced me a 3rd-party software: 

http://forums.ni.com/t5/LabVIEW/Opening-tif-file/m-p/314531#M162769

 

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

I checked out his results, it is pretty good, but how can I make a convertion in labview environment? 

Arnold
0 Kudos
Message 4 of 9
(4,476 Views)

Yes, all your observations are correct, but I'm looking for a solution to read the tif image correctly only in labview environment, it is much better if someone could help me get the image into a IMAQ type. So far, I can't get to this point and I'm kind of lost due to this format issue. 

 

According to other's help, IrfanView (  http://www.irfanview.com/  ) has no trouble opening/displaying/converting it. But I need a good converter in labview. Do you have any idea? 

Arnold
0 Kudos
Message 5 of 9
(4,475 Views)

Some more updates:

 

The TIF data I am saving is either 16 bit integer or (if you do live flat field) 32 bit float.  Most retail software will only read 8 bit TIF. Although some, like MetaMorph will read it correctly.  The example VI in Labview IMAQ is for 8 bit TIF. Any idea on how to deal with 16 bit TIF?

Arnold
0 Kudos
Message 6 of 9
(4,462 Views)

Well, TIFF is a format that was designed for scanners and desktop publishing Apps.  

TIFF is currently owned by Adobe and since they may change it at any time it's hard for NI to truly support it. 

Since it's not really appropriate for the things most LabVIEW users do so you may have to deal with one of the following.

 

1) Use a second party software package to bulk convert all your files before sending them to LabVIEW.

2) Learn the details of 16-bit TIFF and write your own converter in LabVIEW (or another language with a DLL connection to LabVIEW).

3) Wait and see if someone has already done #2.

4) If possible, don't collect your raw data as TIFF in the first place, use something LabVIEW can deal with directly.

 

Also, you may want to create a new post in the Vision forums and see if anyone there can help more.  (Please put in a link to this thread so everyone can keep track of your current situation and they don't waste their time.)

 

Good Luck!

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 7 of 9
(4,445 Views)

I've run into this problem before.  LabVIEW doesn't support multi-image TIF files much the less 16-bit multi-image TIF files.  In my case I used ImageJ to covert the multi-image TIF into a set of individual TIFs.

 

 

 

Randall Pursley
0 Kudos
Message 8 of 9
(4,440 Views)

Thanks everybody, problem is solved by this man. 

http://forums.ni.com/t5/LabVIEW/Labview-libtiff-implementation/m-p/1533764#M569550

Arnold
0 Kudos
Message 9 of 9
(4,429 Views)