Image writer issue

I’ve noticed an issue when reading and writing tifs in KNIME using the either the table reader or image writer nodes. While everything works perfectly within KNIME the issue comes when reading a Fiji saved tif in KNIME or writing a tif in KNIME and then reading it in Fiji.

Here is a link to small workflow that highlights these issues.

In the top row, I read in two images (xyz) and merge them into xyzt. Then I write this to tif. If I open this image in Fiji then I get an xyt image with the z and t dimensions merged. However, if I open this in KNIME, I get the correct xyzt image.

The reverse case also occurs. If I start with an xyzt tif image saved from Fiji 4D.tif (158.8 KB) and read this in KNIME then I only get an xyt image. So I suspect that there is a disconnect between SCIFIO in KNIME and Fiji somewhere.

Of course it is relatively trivial to solve this in KNIME or Fiji by rearranging the dimensions. However, it would be great if the images could be read correctly in the first place. If anyone has an idea of what is happening here, that would be awesome.

Some basic troubleshooting:
This is not resolved by using the “Bioformats importer” in Fiji.
Moving the dimensions around or adding new dimensions in KNIME doesn’t help either.
This does not occur with the ICS image format.

Thanks @aseeber for putting together an example workflow illustrating the issue!

I’m afraid you just (re-)discovered a couple of long-standing SCIFIO issues, in particular:

The reason for these inconsistencies is the TIFF format, while defining multi-page tiff files, leaves some freedom for storing metadata and dimensions, and ImageJ1 (what you get by default for reading and saving tiffs in Fiji) uses its own flavor of the TIFF format.

Did you try opening via File > Import > Image…? This will use SCIFIO instead of the ImageJ1 TiffReader.

Similarly, you can try saving using SCIFIO by running File > Export > Image…


Indeed, reading and writing ICS (we recommend the same format for users of Huygens Remote Manager, btw) has also been my workaround for the last couple of years, because in addition to the dimensionality issues, there’s also still an important performance problem:


Unfortunately, it’s been like that for more than five years now, and I wasn’t able to improve the situation myself by contributing to SCIFIO, because I didn’t understand the details of how readers and writers work in that library.

But there’s hope that the situation on the SCIFIO side will improve soon, as Mark Hiner (hinerm on GitHub) joined the ImageJ/SciJava/Scifio team again thanks to new funding. :slight_smile:

1 Like

Thanks @imagejan, once again, you are a fount of image processing knowledge.

I suspected that this was an already known issue but wanted to clearly document it anyway. Thanks for putting all those links together as well.

Did you try opening via File > Import > Image… ? This will use SCIFIO instead of the ImageJ1 TiffReader .

Similarly, you can try saving using SCIFIO by running File > Export > Image…

Both of these approaches work, I didn’t know you could do it that way :grinning:

This issue is not really problem for me but rather for collaborators who get confused when their tifs don’t open as expected (either in KNIME or Fiji). ICS is okay as a work around but ICS2 would be nicer since there it only needs a single file.

1 Like