Login  Register

Bug with binary TIFF images (imagej 1)

Posted by Antoine Vandecreme on Jun 18, 2014; 7:09pm
URL: http://imagej.273.s1.nabble.com/Bug-with-binary-TIFF-images-imagej-1-tp5008300.html

Hello all,

According to the TIFF specification, the default value for BitsPerSample is 1.
See http://www.awaresystems.be/imaging/tiff/tifftags/bitspersample.html
However, ImageJ has the default FileInfo.fileType=GRAY8 causing either an
incorrect interpretation of the data (small images) or an error when opening a
big image (see attached screenshot) if the tag is not explicitly set in the
image (see attached test.tif, the image should be entirely white).

The fix is to modify TiffDecoder.OpenIFD by adding
fi.fileType = FileInfo.BITMAP;
right before the for loop.

Regards,
Antoine Vandecreme

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

tiff.png (17K) Download Attachment
test.tif (6K) Download Attachment