TIFF handling issues

Issue #47 resolved
Dimitry Tegunov created an issue

TIFF files created with IMOD (e. g. using mrc2tif) are read correctly. However, TIFF files created in Matlab 2017b or custom code using libtiff4 fail with the following message:

DEBUG readTIFF: Reading TIFF file. img_select -1 TIFF width 3838, length 3710, nDim 40, sample format 297, bits per sample 8

I. e. the sample format field has an illegal value. This illegal value also appears to be different in each TIFF directory of that file. The sample format field is the only one that isn't being read correctly. Meanwhile, IMOD can read that file without any issues.

Here are some example files: https://www.dropbox.com/sh/xx3z4k3dzrqbuin/AAD_jRocUBangrxKcNuT701Ja?dl=0

If it can't be fixed, perhaps a viable workaround would be to default to sample format = 1 in case of an illegal value, since integer numbers are the most likely to be used with compressed TIFFs.

Another minor issue I noticed: relion_image_handler --i my.tif --o my.mrc produces an MRC stack with the size of the full stack, but a header specifying Z = 1. Meanwhile, --o my.mrcs produces an MRC stack with the size of a single frame, but Z = 40 in the header (i. e. number of frames in TIFF).

Comments (4)

  1. Takanori Nakane

    Thanks for your feedback. The commit dfe4224 should allow you to read a TIFF from Matlab.

    For the MRC and MRCS issue, I will need more time.

  2. Takanori Nakane

    With the commit 51fc422, you can convert from TIFF to MRCS. TIFF to MRC does not work, though. This is due to idiosyncratic distinction between MRCS and MRC in RELION (or XMIPP) and not easy to fix without major refactoring of image_handler.

  3. Log in to comment