Login  Register

Re: Get the number of frames from a multiple tiff header

Posted by Michael Schmid on Apr 02, 2015; 1:38pm
URL: http://imagej.273.s1.nabble.com/Get-the-number-of-frames-from-a-multiple-tiff-header-tp5012283p5012327.html

Hi Sébastien,

the speed of reading large files depends mainly on
(1) whether the file was recently read and is still in the cache of the computer of the hard disk
(2) the speed of the disk and its interface to the computer.

To see whether there is a tag giving the number of frames in the header, you can switch debug mode on in ImageJ (in Edit>Options>Misc). The list will start e.g. like the following:
  myFileName.tif: opening
    254, "NewSubfileType", value=0
    256, "ImageWidth", value=186
    257, "ImageLength", value=226
If the file was written by ImageJ, you will also see something like the following:
FileInfo: name=myFileName.tif, dir=, width=186, height=226, nImages=27, offset=768, type=byte, byteOrder=big, format=2, url=, whiteIsZero=f, lutSize=0, comp=1, ranges=null, samples=1

If you have to open files repeatedly, you may consider reading them once in ImageJ and saving them again (keep the originals; they may contain some information, e.g. metadata, EXIF, etc. not written by ImageJ). ImageJ stores the number of frames in a private field; so opening ImageJ files as virtual stack should be faster.

Michael
________________________________________________________________
On Apr 2, 2015, at 14:14, mailfert wrote:

> Thanks your very much for your answers.
>
> For a tiff file containing 4086 slices (frames) which corresponds to a 2Go
> file, it takes:
>
> *2 minutes and 30 seconds *on a computer: Intel Xeon E5-1620 @3.6GHz + RAM
> 8Go
> and
> *22 secondes *on a second computer: Intel Xeon E5-2630 @2.3GHz + RAM 16Go
> *16 secondes *on a second computer: Intel Core I7-4770 @3.4GHz + RAM 16Go
>
> I don't understand why we should read all the headers just to know the
> number of slices.
> This should be in the ideal world instantaneous as it is to know the image
> size.
>
> Why theheader is not designed to contain the number of slices directly?!!!
>
> Thanks in advance for your precious comments.
>
> Best regards.
> Sébastien
>
>
>
>
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Get-the-number-of-frames-from-a-multiple-tiff-header-tp5012283p5012322.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html