Speeding up TIFF stack loading
Posted by aweitz on Jun 25, 2009; 8:11pm
URL: http://imagej.273.s1.nabble.com/Speeding-up-TIFF-stack-loading-tp3691996.html
Hi,
I have a bunch of TIFF stacks that I want to open with ImageJ. Each stack has 6000 slices. When I try to open a TIFF stack, it takes about 40 seconds for ImageJ to count how many slices are in the stack.
I noticed that if I open a stack with ImageJ, save it, and re-open it, it immediately knows how many slices are in the stack and doesn't have to spend those 40 seconds trying to figure it out. Looking in TiffDecoder.java, I see this is because it reads the number of images/slices from the TIFF description tag and then sets FileInfo nImages to 6000.
I tried modifying the code to automatically set nImages to 6000. When I do this, my TIFF stacks open without the 40-second delay. However, the stacks don't open correctly. Only the first slice appears OK, and the subsequent 5999 slices look bad.
Does anyone know how I can modify the source to have ImageJ assume there are 6000 slices in every TIFF stack so that I don't have to waste 40 seconds having ImageJ count the slices?
Thanks!
Andrew