Opening a single image from a tiff stack
Posted by Mike Downey on Jan 21, 2011; 1:51pm
URL: http://imagej.273.s1.nabble.com/Opening-a-single-image-from-a-tiff-stack-tp3685932.html
Hi,
I am trying to write a plugin which needs to read in single frames from
a TIFF stack. It appears that a virtual stack is the way to go so I tried:
TiffDecoder td = new TiffDecoder(directory, filename);
FileInfo[] fi = td.getTiffInfo();
FileInfoVirtualStack vs = new FileInfoVirtualStack(fi[0]);
ImageProcessor ip = vs.getProcessor(frame);
This works but has the unwanted side effect of displaying the stack too.
I had a look at the source code and the open() method in
FileInfoVirtualStack ends with imp2.show();
Is there another way of obtaining single images from a stack (without
having to load in the entire stack or display anything unwanted on
screen)? In the meantime I have subclassed FileInfoVirtualStack and
replaced the open() method with an identical copy, apart from the
unwanted imp2.show(); command.
Thanks,
Mike.