01-23-2015 01:08 PM
I suspect you can get this faster still. With a small bit of code, you could check that all the stripes are contiguous (normally they will be, but the TIFF spec doesn't require that). If so, you can read all the stripes at once. Read it as a 1-D array, reverse the array (to get the rotation), and reshape it to the 2-D.
Note that my code only works for a 16-bit grayscale TIFF since that's what you provided as an example. It will probably work for all such TIFFs generated by the same program, but may fail if your TIFF comes from a different source, since I didn't fully implement the TIFF spec.
01-23-2015 04:10 PM
Thank you, Nathand.
I tried, but was not successful. I do not really know what I am doing. I know that my stripes are contiguous. Simply reversing the array will not rotate the image by 90degrees clockwise. I first need to tranpose the array, then invert each line (or display the image in the intensity graph with the y-scale inverted, which is faster). I am also just using U16 tiff files in this application.
01-23-2015 04:57 PM - edited 01-23-2015 04:58 PM
Here's a quick change demonstrating what I meant about reading all the stripes at once. It doesn't do nearly the checks that it should do if you're processing a variety of TIFF files, but if the same source is always generating the images and you want it to process as fast as possible, it's not unreasonable to make some assumptions and report an error if the file doesn't match those expectations.
As an alternative to transposing the array, you can right-click the graph and choose "Transpose Array" (maybe that's what you're already doing).
Convert to Values is the same as the previous version so I'm not uploading that.
(edited for clarity)
01-27-2015 01:49 PM
Hello nathand,
This is working great and it is very fast. It takes about 114ms to load a new file, and about 10 ms to reload the same file. (Not sure why this is so, but I am ok with that.) Thank you so much for your patience and for putting in your time to help me with this application. I appreciate it. And I hope that many LabVIEW users in the future will also benefit from it.
Peter
02-19-2015 10:07 AM
Hey all,
First of all, cheers to Nico for creating this library! It's something i'm going to find very useful in the future.
Second thing, I'm trying to work out how create a TIFF file with multiple images (multipage?) from single images.
I have a camera streaming images which i can capture and convert single frames into simple IMAQ format, U16 array or TIFF. Can someone show me how to group the incoming single images into a multipage TIFF and then save them to a file location?
Thank you in advance,
Samuel
02-19-2015 11:10 AM
Hi Samuel,
if you are not overtly performance limited have a look at the code I posted in message 44. If Nico's library is quicker (it probably is) then writing multiple pages within one file basicly amounts to:
Hope this already helps you
stran
02-20-2015 02:51 AM - edited 02-20-2015 02:54 AM
Hi Stran,
Thanks for helping. Unfortunately I'm using LV2011, I can't open your VIs. So I think i will stay with Nico's library. Should the save image to tiff look something like this? (See attachement)
The VI is running in a For Loop. The For Loop runs until the specified number of images to capture have been reached. The Open File to Write is called once before the For Loop starts.
03-18-2015 03:35 AM
Hi, Dan
Thanks a lot for your sharing! This is just what I need for my work now. I am just trying to save single .tiff files into a stack. But I have met a problem when I tried your code and I don't know why. Can you help me with the error solving? Attached is the error message. I am using Labview 2014, 64bit.
Thanks a lot!
03-18-2015 06:50 AM - edited 03-18-2015 06:50 AM
Have you installed the right .Net component? You would most likely need the LibTiff.Net component installed on your system for LabVIEW to be able to use it.
03-18-2015 09:33 PM
Thanks a lot for this reply! I have downloaded the libtiff.net.dll file from http://bitmiracle.com/libtiff/, but it seems that I will need Visaul Studio to build the .net file in. But I don't have VS installed, so will there be another way to build the .net.dll file in? Thanks again for your help!