LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview libtiff implementation

writeScanLine writes one row of data at a time to a file previously open for writing using the function TIFFWriteScanLine (see here). WriteStripedPage writes many lines at time (a "strip" of data) using the function TIFFWriteEncodedStrip (see here). The number of lines depends on the image width: the VI "libtiff2_CalcStrip.vi" takes care of calculating it by taking into account the bit per sample (8, 16, or 32) and trying to output strips that are around 8 kB each. Note that 8 kB is somewhat arbitrary, although "suggested" by libtiff. To experiment and change this value, you should change the constant named "Suggested strip size in bits (8 kB)" found in "libtiff2_CalcStrip.vi" from 65535 (default, corresponding to ~ 8 kB) to something else.

I got slightly faster execution times by using writeScanLine, but you should try which one performs better for your specific case, maybe playing around with the strip size. Note that both writeScanLine and writeStripedPage use "high level" functions, i.e. most probably it is possible to get the whole writing routine faster by calling other functions, such as TIFFWriteRawStrip. Maybe I will implement it in the next "release"! 😉

 

hope this helps and enjoy!

 

Nico

Message 21 of 106
(4,750 Views)

I am almost ready to upload several new VIs: now also RGB images will be supported (single or multipage), as well as some basic metadata writing/reading (plus several bug fixes!).

 

I was wondering what people out there might be interested in: special bit per pixel values (e. g. strange 12 or 14 bit images)? More than three colours (RGB+???)? Or what else?! I could try and include some of these features if there is enough interest!

 

let me know,

 

Nico

0 Kudos
Message 22 of 106
(4,679 Views)

Hi Nico, 

 

Thanks for your hard work! I'm working on an application which requires saving of 32bit TIFFs and came across your library. Smiley Happy Do you think you can include a function to write in custom tags?

 

Best regards,

Victor

0 Kudos
Message 23 of 106
(4,652 Views)

Hi Victor,

 

I'll try to create some VI to write/read custom tags: it would definitely add more flexibility to the whole thing.

 

Thanks for the suggestion!

 

Nico

0 Kudos
Message 24 of 106
(4,649 Views)

Hi Nico,

 

Thanks! Do you have any experience with writing tiled TIFF? 

 

Best regards,

Victor

0 Kudos
Message 25 of 106
(4,628 Views)

Hi Victor,

 

no, I didn't try to write tiled TIFFs. However, before starting with libtiff I had no idea about how to write TIFF files at all! Smiley Happy

I started with striped- or scanline-oriented files because I needed some VIs to write images from a scanning microscope, therefore these structures are closer to the original data format (sequential acquisition of pixels, line by line).

 

Anyway tiled TIFF are on my "to do" list, as soon as I will be less busy with my work!

 

Nico

 

 

0 Kudos
Message 26 of 106
(4,631 Views)

Hi Nico,

 

No problem, I'll work with striped and scanline TIFFs first then. Its great that you have created this library, looking forward to your new edition soon. 🙂 

 

Best regards,

Victor

0 Kudos
Message 27 of 106
(4,610 Views)

Hi!

 

as promised, here is the latest version of libtiff for labview!

 

Currently, the library supports writing/reading single or multipaged TIFF files in U8, U16, SGL, or RGB format. The files can be either scanline-oriented (i. e. a single line is written or read at a time) or striped (accessing a stripe made of multiple lines at a time). For RGB images, both separate color planes (i. e. first the plane containing the red values, then the gree and finally the blue) or contig color planes are allowed (i. e. for every pixel the red, green and blue one after the other).

 

What's new:

- RGB support

- I eliminated small error that incorrectly displayed SGL values in the previous version.

- Metadata: the metadata entry is limited to few fields (ImageDescription, Software, Date, Time, and Artist).

- A VI named libtiff3_tif2Images converts TIFF files into an array of images.

 

Still to do:

-Custom tags

-Tile-oriented TIFFs

-(your comment here!)

 

Enjoy!

 

Nico

Message 28 of 106
(4,602 Views)

Could you sombody please upload the libtiff3.llb for Labview 8.5? 

 

THank you very much. 

0 Kudos
Message 29 of 106
(4,512 Views)

Hi,

 

sorry for the delay.

 

I compiled a version of libtiff that *SHOULD* work on LV 8.5, but I didnt test it.

Let me know if there are any problems with it.

 

Enjoy!

 

Nico

0 Kudos
Message 30 of 106
(4,470 Views)