LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read multi-image tiff

Solved!
Go to solution

No not yet. I'll do that. The image is in the link.

https://drive.google.com/open?id=0B71N93kVyonTQ1JlbWdGRjVGX1E

0 Kudos
Message 21 of 29
(4,716 Views)

Uhhhh....I'm downloading it now but Google just complained that the file is greater than 1GB...Is there a reason this single image is larger than than a 2 hour movie? (which has 24 images/second and audio)  It likely is at a higher resolution than your monitor can display anyway.  It needs to be converted into an image that is more reasonable.

0 Kudos
Message 22 of 29
(4,715 Views)

Okay well I see this is because the file contains 820 images.  In this case I'd look into extracting each image into it's own file, then you can load that one file into the UI at a time.

 

Edit, here is one method of extracting images using the commandline and another tool.

 

http://superuser.com/questions/44600/how-to-split-a-multipage-tiff-file-on-windows

 

Double Edit: Also interestingly enough on my system it will load the first image, but then out of memory on any other, maybe there is a bug in my code that is leaking memory.

Message 23 of 29
(4,711 Views)
Solution
Accepted by topic author john1626

Okay found a bug and fixed it.  I wasn't releasing the previous image before loading the next, which normally wouldn't be a problem, except you are loading the same file each time and the file is quite large.  This might look like a memory leak since old images aren't disposed before loading the next.  Let me know if this works for you.

Message 24 of 29
(4,704 Views)

Thank you so much. This one works very well.

0 Kudos
Message 25 of 29
(4,685 Views)

Dear all,

 

thanks for the code.

It works on 8 bit MultiTiff files but not on 16bit files.

Does anyone tried to load a 16bit image?

 

Best regards.

0 Kudos
Message 26 of 29
(3,603 Views)

I have not, do you have a 16bit tiff file you are willing to share to see what is happening?  I suspect there is something wrong with the .net functions for image selection but am unsure what it could be.

0 Kudos
Message 27 of 29
(3,582 Views)

Here is an example of my 16bit image.

 

In the meantime, I successfully opened a 16 bit Multi-Tiff stack of thousand of images and I post here the result if someone is interested in this thread.To run it, you need to:

1- install 'tiff-3.8.2-1.exe'

2- run 'Read_Images_From_TIFFStack_Example.vi' located inside the 'MultiTiff.llb' Library where other vi's coming from the 'Libtiff3' post in this forum.

 

I hope this will help people.

Download All
Message 28 of 29
(3,571 Views)

Many thanks for sharing the code, it worked perfectly with my multi-page 16-bit .tiff files. I had so far been unsuccessful in loading up these files as the only code snippets I found using libtiff were assuming 8-bit files, so yours was indeed a godsend - many thanks!

0 Kudos
Message 29 of 29
(2,284 Views)