ISQ files not loading in headless mode

Hi!

I am trying to pre-process some microCT data in .ISQ format. After installing the BoneJ plugin, I can drag &drop or open ISQ files with the GUI as expected. However, when I try to do the same thing from the command line using openImage in --headless mode, I get the following output/error:

[INFO] null = filename.ISQ

Here’s the mini script that produces the issue:

from ij import IJ
import ij.IJ
import ij.io.Opener
imp = IJ.openImage('/filepath/filename.ISQ');

When I replace the .ISQ file with a TIF or CZI, everything works smoothly. The script is taking its time at the openImage step, so it seems as if it is unable to associate the data with imp.
Any suggestions or comments would be much appreciated.

ISQ reading was upstreamed to SCIFIO and is no longer part of BoneJ.

Flagging this report for @imagejan, @gab1one & @ctrueden who were the last to touch that code.

I don’t know about the ISQ format, but to test whether it’s an issue with SCIFIO, I would first try to leave any ImageJ1 component (i.e. ij.IJ) out of the game.

Instead of:

… can you try:

#@ DatasetIOService io

dataset = io.open('/filepath/filename.ISQ')

… to see if that works?

Thank you both. Jan’s suggested command produces an error (again, it works with CZI and TIFF, but not ISQ):

[ERROR] Traceback (most recent call last):
  File "script.py", line 3, in <module>
    dataset = io.open('/filepath/filename.ISQ')
	at io.scif.services.DefaultInitializeService.initializeReader(DefaultInitializeService.java:87)
	at io.scif.img.ImgOpener.createReader(ImgOpener.java:483)
	at io.scif.img.ImgOpener.openImgs(ImgOpener.java:242)
	at io.scif.services.DefaultDatasetIOService.open(DefaultDatasetIOService.java:152)
	at io.scif.services.DefaultDatasetIOService.open(DefaultDatasetIOService.java:133)
	at io.scif.services.DefaultDatasetIOService.open(DefaultDatasetIOService.java:138)
	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)
java.lang.NullPointerException: java.lang.NullPointerException

	at org.python.core.Py.JavaError(Py.java:547)
	at org.python.core.Py.JavaError(Py.java:538)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:192)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:208)
	at org.python.core.PyObject.__call__(PyObject.java:477)
	at org.python.core.PyObject.__call__(PyObject.java:481)
	at org.python.core.PyMethod.__call__(PyMethod.java:141)
	at org.python.pycode._pyx0.f$0(editCT2.py:3)
	at org.python.pycode._pyx0.call_function(editCT2.py)
	at org.python.core.PyTableCode.call(PyTableCode.java:173)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1687)
	at org.python.core.__builtin__.eval(__builtin__.java:497)
	at org.python.core.__builtin__.eval(__builtin__.java:501)
	at org.python.util.PythonInterpreter.eval(PythonInterpreter.java:255)
	at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:57)
	at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:31)
	at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
	at org.scijava.script.ScriptModule.run(ScriptModule.java:157)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63)
	at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at io.scif.services.DefaultInitializeService.initializeReader(DefaultInitializeService.java:87)
	at io.scif.img.ImgOpener.createReader(ImgOpener.java:483)
	at io.scif.img.ImgOpener.openImgs(ImgOpener.java:242)
	at io.scif.services.DefaultDatasetIOService.open(DefaultDatasetIOService.java:152)
	at io.scif.services.DefaultDatasetIOService.open(DefaultDatasetIOService.java:133)
	at io.scif.services.DefaultDatasetIOService.open(DefaultDatasetIOService.java:138)
	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:190)
	... 24 more

Make sure you have installed BoneJ from the updater and not the old version from anywhere else. That could cause IJ a lot of confusion. As mentioned, BoneJ doesn’t provide the ISQ reader any more but you may find it useful for your analysis once the ISQ images are read in.

It turnes out that I had to include the following line to activate SCIFIO, in order to open the files:

IJ.run("ImageJ2...", "scijavaio=true loglevel=INFO");

However, now I am getting “negative seek offset” errors for many of the ISQ files I am trying to open. Not sure if this has anything to do with file size, or something else SCIFIO cannot deal with. Anyway, thank you all for the helpful comments.

1 Like