LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TIFF Saving in Labview using open-source libraries

Hi, 

My requirement is to read and write a stack of images into TIFF format (multiple pages, directories , with customised metadata). I would like to do this using open-source libraries (C, C++ or preferably .NET) and build a code in LabVIEW.

I had explored an old post on the same using LibTiff dlls in LabVIEW (https://forums.ni.com/t5/LabVIEW/Labview-libtiff-implementation/td-p/929843) and tried utilising the same. However, all dlls and llbs / VIs attached in the post don't seem to work,  in that , I get an error message ' Library not found or failed to load' (attached image) for all Call library function nodes despite configuring it to point to the correct dll location in my local system. I have ensured that the right version of the dll is utilised as mentioned in the post. 

I am working on 32-bit LV (version 14.0.1, LabVIEW2014 Service Pack) on Windows 10 , 64-bit OS. The downloaded dll from the webpage said it was compatiblie with both 32- and 64-bit systems.

In this respect I would like some help in figuring out why this issue occurs. Alternatively I would also welcome your suggestions on various other TIFF utility libraries which can be used for my specifications (mentioned above) in LabVIEW.

Thanks in advance !

 

0 Kudos
Message 1 of 12
(4,180 Views)

Although the library might work on 32 and 64 bit LabVIEW, you do need the correct dll. The 64 bit dll won't work on 32 bit LabVIEW. Make sure you've downloaded he correct dll.

0 Kudos
Message 2 of 12
(4,144 Views)

 


I have ensured the dll is compatible with both 64 and 32 bit LabVIEW... The libtiff link write-up for the same says so.

0 Kudos
Message 3 of 12
(4,117 Views)

I'm pretty sure a dll is either 64 bit or 32 bit, unless it's a .net dll. And it's not a .net dll, they don't expose functions like a  normal dl. When they say it's 32 and 64 bit, it might be implied that you do need to download different versions.

0 Kudos
Message 4 of 12
(4,097 Views)

wiebe@CARYA wrote:

I'm pretty sure a dll is either 64 bit or 32 bit, unless it's a .net dll. And it's not a .net dll, they don't expose functions like a  normal dl. When they say it's 32 and 64 bit, it might be implied that you do need to download different versions.


I think AishaRaj is refferring to

"The library, along with associated tool programs, should handle most of your needs for reading and writing TIFF images on 32- and 64-bit machines."

from http://www.libtiff.org/

 

but I agree, if there was a dll for 32 and 64, you had to use the proper dll

 

and if I remember correctly, we wanted to use those dlls a few years ago, and it was quite an effort  trouble to make them run on a windows 7 x64 pc.

0 Kudos
Message 5 of 12
(4,091 Views)

yep, in the end, we completly dismissed the libtiff library and focused on the approach presented in message 64 of the thread you quoted in your first post

https://forums.ni.com/t5/LabVIEW/Labview-libtiff-implementation/m-p/3078644#M879535 from pbuerki

 

"In my search for a fast Tiff Reader that does not require IMAQ, I came across a discussion on LAVA.org (https://lavag.org/topic/7170-tiff-reader/) that provided a link to a little know LAVA Code Repository (http://code.google.com/p/lavacr/source/browse/#svn/trunk/8.5.x/Machine%20Vision%20and%20Imaging/TIFF...).

This repository includes a TIFF reader written by Gavin Burnell and Herbert Looser that apparently does not use the libtiff or any of its successors.

After some minor modifications to their Load Flattened Image from Tiff.vi (see TIFF File Reader (LAVA.org).vi), I can now read my dropbox Tiff file in 74 ms. (My application loads up to several hundred large Tiff files for interactive viewing.)"

 

 

Works in LabView 2017 x32 on Windows 10 x64

 

I quickly tested it with a 2 page tif created with ifranview:

http://www.nightprogrammer.org/development/multipage-tiff-example-download-test-image-file/

 

looks like I can't attach a .tiff to this post ...

 

 

 

 

 

 

0 Kudos
Message 6 of 12
(4,083 Views)

Going down the .Net route I do have some code for reading and displaying a TIF file posted here.  To display it, it will read it, then save it to a PNG file stream, which LabVIEW then reads into the native LabVIEW image format.  You could look into invoking the Save to a TIF file format and see if that works.

0 Kudos
Message 7 of 12
(4,077 Views)

Yeah, I have an old Tiff library, that covers almost the entire standard in pure LabVIEW. Works with and without IMAQ. Jpg compression is the only part missing. It's on my list for cleanup and release, but it's not on top of it. If only I did it in OO to start with. Can't release it giving my current view of what "quality" is...

Message 8 of 12
(4,071 Views)

Is there a reason you have to do this with LabVIEW?

 

There are plenty of programs out there that will batch convert image files from one format to another.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 12
(4,062 Views)

@wiebe@CARYA  Sorry for the ambiguous wording ... I did mean that I had tried using different dlls : 64- and 32-bit versions of LibTiff ... but to no avail ... Thank you for pointing this out though !!

0 Kudos
Message 10 of 12
(4,046 Views)