Bug with binary TIFF images (imagej 1)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug with binary TIFF images (imagej 1)

Antoine Vandecreme
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
Reply | Threaded
Open this post in threaded view
|

Re: Bug with binary TIFF images (imagej 1)

Rasband, Wayne (NIH/NIMH) [E]
On Jun 18, 2014, at 3:09 PM, Antoine Vandecreme wrote:

> 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

This bug fix is in the latest ImageJ daily build (1.49c15).

-wayne

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