Login  Register

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

Posted by Rasband, Wayne (NIH/NIMH) [E] on Apr 01, 2015; 3:30pm
URL: http://imagej.273.s1.nabble.com/Get-the-number-of-frames-from-a-multiple-tiff-header-tp5012283p5012303.html

On Apr 1, 2015, at 2:12 AM, mailfert <[hidden email]> wrote:

>
> Dear ImageJ users,
>
> I'm a little bit disapointed.
> I would like to read from my plugin the number of frames of my multiple tiff
> files.
> I know how to read the image size and other useful parameters but I don't
> know how to know the number of frames of my stack of images without opening
> all frames.
> As I work with lots of 2Go files, it takes times for me to open the files
> just to know the number of frames.
> Could you help me please?

Open the file as a virtual stack, which will only load the first frame. Here is a JavaScript example:

   img = IJ.openVirtual("");
   stack = img.getStack();
   frames = stack.getSize();
   print("frames="+frames);

-wayne

> --
> View this message in context: http://imagej.1557.x6.nabble.com/Get-the-number-of-frames-from-a-multiple-tiff-header-tp5012283.html
> Sent from the ImageJ mailing list archive at Nabble.com.

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