I am having an issue using ImageJ to open compressed tifs - specifically, tif stacks that have been saved using “deflate”. From the UserGuide, it is my understanding that ImageJ supports opening this format.
When I attempt to open a stack of this format, ImageJ will open a stack of the correct dimensions, but will have the first slice duplicated into every other slice of the stack.
Here are the tif tags that imageJ reads from the file when opening:
test.tif: opening 254, "NewSubfileType", value=0 256, "ImageWidth", value=256 257, "ImageLength", value=256 258, "BitsPerSample", value=16 259, "Compression", value=8 262, "PhotoInterp", value=1 270, "ImageDescription", value=182, count=65 273, "StripOffsets", value=312, count=2 277, "SamplesPerPixel", value=1 278, "RowsPerStrip", value=128 279, "StripByteCount", value=320, count=2 305, "Software", value=328, count=12 306, "DateTime", value=340, count=20 339, "SampleFormat", value=1 nextIFD=131492 number of IFDs: 1 offset to first image: 368 gap between images: 0 little-endian byte order: true```
This does not happen when I use another program to open the tif or use Bio-Formats to import the tif into ImageJ (which has been a suitable work around for now).
Is this the expected behavior and ImageJ does not support opening tif stacks that have been saved with this compression?
I have attached an example test.tif (256.6 KB) or one can be created with the following python snippet (requires the tifffile and numpy packages):
#!/bin/python import tifffile import numpy as np test_shape = (2, 256, 256) dtype = np.uint16 test_stack = np.random.randint( low=0, high=(2**16)-1, size=test_shape, dtype=dtype) tifffile.imsave( data=test_stack, file='test.tif', imagej=True, compress=1)