2010.03.08 17:36 "[Tiff] Reading STK Proprietary TIFF files", by Richard Nolde
1. Re: Problem with multipage .stk tiff file (Shafiq Abedin)
If you looked at the vendor site and the other sites that people referenced in their replies, you should now understand that the problem has nothing to do with Libtiff. It is a non-standard use of TIFF, in a very proprietary vendor specific format and you may have to write your own low level code to pull the individual scans out of the one "image" that is actually stored in the TIFF file. It isn't an image in any real sense of the word. It is simply an array of data values that the vendor's proprietary software knows how to deal with. Anyone can put anything they want in a TIFF "image", but that doesn't mean that anyone else in the world can make sense of it. I could put four dimensional MRI scan data into a single TIFF "image" but you would not be able to view it. If I wanted anybody else to be able to view all the samples as images, I would break out each plane into a series of images representing the values at the same time offset from the start of the scan. That means you have to take the data that you get back from Libtiff and extract multiple subsets, one at a time into a new file with multiple IFDs that represent a single plane or scan each. Only you or the vendor will know where each scan starts and stops in the bulk data dump that you are seeing as a single "image" and what the size and spacing of each element are. Reading the image into memory is already being handled for you by Libtiff. Making sense of it and writing it out as a series of indvidual scans is up to you.
Libtiff is able to see the data correctly as indicated by tiffinfo and tiffdump. The data do not automatically equate to a series of viewable images anymore than remote sensing or satellite data do. If you know the exact dimensions, format, etc for each slice, you might be able to extract them with tiffcrop which allows you to make multiple files from a single original image by breaking them up into a series of zones or sections. You will have to experiment to see if this works. Read the tiffcrop man page.