Login  Register

Re: Reading Tiff files saved by ImageJ

Posted by Rasband, Wayne (NIH/NIMH) [E] on Nov 30, 2010; 10:11pm
URL: http://imagej.273.s1.nabble.com/Reading-Tiff-files-saved-by-ImageJ-tp3686341p3686342.html

On Nov 30, 2010, at 10:12 AM, Laurent Holtzer wrote:

> Dear all,
>
> I have some very large TIFF-files (for example 8 Gb) which I save with ImageJ. However, after this I would like to read them with Matlab and this does not seem to work. Both imread (built-in function of Matlab) or tiffread seem to have problems because of the large size of the TIFF-file. The first image is read normally, but then these Matlab-functions seem to be unable to find the next IFD entry.
>
> I found out that ImageJ places all IFD entries (except the ones from the first image) at the end of the TIFF file. Normally the position of the IFD entries for the next image are stored as a 32-bit value in an IFD entry for the current image. In my case a 64-bit value is needed and it doesn't work. However, imageJ seems to be able to open these TIFF-files without any problem. Can anyone explain me how it does this?

ImageJ only writes the first IFD for TIFF files larger than 4GB. It is able to read such files because it sees "images=n" in the ImageDescription tag and realizes it needs to open n images. You should be able to open such files in Matlab as raw data. Open the file in ImageJ in debugging mode to get the offset to the first image.

-wayne