Re: Open every nth image in a stack?
Posted by Wayne Rasband on Nov 22, 2005; 4:44pm
URL: http://imagej.273.s1.nabble.com/Open-every-nth-image-in-a-stack-tp3704402p3704405.html
> I am generating very large stacks and it would often be useful
> when importing a stack of images to only open a subset of
> the stack. Such as the first 100 slices or every third slice.
> Is there a way to do this?
You may be able to do this using the File>Import>Raw command if the
images are uncompressed TIFFs, you know the offset to the first image,
and the images are stored consecutively. For example, you can import
the first 10 slices of a 100 slice stack of 512x512 16-bit images using
the macro
run("Raw...", "width=512 height=512 offset=768 number=10 gap=0")
You can import every third slice using the macro
run("Raw...", "width=512 height=512 offset=768 number=33 gap=1048576")
These macros assumes the TIFF stack was created by ImageJ, where the
offset to the start of the image data is always 768. To import every
third slice the gap must be set to 512*512*2*2 (1048576).
-wayne