Error when using ChannelSeparator to read dimensions of an image from the file header

I’m running a simple program to find out the dimensions of an image from the header of the file:

from loci.formats import ChannelSeparator

fr = ChannelSeparator()
fr.setGroupFiles(False)
fr.setId("/home/albert/Desktop/t2/bridge.tif")

print fr.getSizeX(), fr.getSizeY()

And I am getting this error, which I don’t understand. It’s as if the bioformats library is missing file readers? My Fiji is updated to today.

Caused by: java.lang.NoSuchMethodError: loci.common.RandomAccessInputStream.readUnsignedInt()J
	at loci.formats.tiff.TiffParser.getNextOffset(TiffParser.java:1365)
	at loci.formats.tiff.TiffParser.getFirstOffset(TiffParser.java:418)
	at loci.formats.tiff.TiffParser.getFirstIFD(TiffParser.java:372)
	at loci.formats.in.SEQReader.isThisType(SEQReader.java:87)
	at loci.formats.FormatReader.isThisType(FormatReader.java:612)
	at loci.formats.in.SEQReader.isThisType(SEQReader.java:79)
	at loci.formats.ImageReader.isThisType(ImageReader.java:858)
	at loci.formats.ImageReader.getReader(ImageReader.java:189)
	at loci.formats.ImageReader.setId(ImageReader.java:840)
	at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:650)
	at loci.formats.ChannelSeparator.setId(ChannelSeparator.java:293)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188)
	... 24 more

Any ideas on what could be going wrong, @ctrueden @melissa ?

Thank you.

Including the bio-formats update site and restarting fiji solved the issue–meaning, the issue is solved in the newest bio-formats jars.

@albertcardona this looks similar to the issue reported here. I am pretty certain we had identified the source of this issue to be a conflict between incompatible JARs with @ctrueden

Can you check whether you have both formats-common and ome-common JARs installed in your Fiji distribution? If so, the first one is causing the issue you are seeing.

2 Likes